ml

package
v0.42.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 10

Documentation

Overview

These APIs allow you to manage Experiments, Model Registry, etc.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	// Type of activity. Valid values are: * `APPLIED_TRANSITION`: User applied
	// the corresponding stage transition.
	//
	// * `REQUESTED_TRANSITION`: User requested the corresponding stage
	// transition.
	//
	// * `CANCELLED_REQUEST`: User cancelled an existing transition request.
	//
	// * `APPROVED_REQUEST`: User approved the corresponding stage transition.
	//
	// * `REJECTED_REQUEST`: User rejected the coressponding stage transition.
	//
	// * `SYSTEM_TRANSITION`: For events performed as a side effect, such as
	// archiving existing model versions in a stage.
	ActivityType ActivityType `json:"activity_type,omitempty"`
	// User-provided comment associated with the activity.
	Comment string `json:"comment,omitempty"`
	// Creation time of the object, as a Unix timestamp in milliseconds.
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// Source stage of the transition (if the activity is stage transition
	// related). Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	FromStage Stage `json:"from_stage,omitempty"`
	// Unique identifier for the object.
	Id string `json:"id,omitempty"`
	// Time of the object at last update, as a Unix timestamp in milliseconds.
	LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
	// Comment made by system, for example explaining an activity of type
	// `SYSTEM_TRANSITION`. It usually describes a side effect, such as a
	// version being archived as part of another version's stage transition, and
	// may not be returned for some activity types.
	SystemComment string `json:"system_comment,omitempty"`
	// Target stage of the transition (if the activity is stage transition
	// related). Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	ToStage Stage `json:"to_stage,omitempty"`
	// The username of the user that created the object.
	UserId string `json:"user_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

Activity recorded for the action.

func (Activity) MarshalJSON added in v0.23.0

func (s Activity) MarshalJSON() ([]byte, error)

func (*Activity) UnmarshalJSON added in v0.23.0

func (s *Activity) UnmarshalJSON(b []byte) error

type ActivityAction

type ActivityAction string

An action that a user (with sufficient permissions) could take on an activity. Valid values are: * `APPROVE_TRANSITION_REQUEST`: Approve a transition request

* `REJECT_TRANSITION_REQUEST`: Reject a transition request

* `CANCEL_TRANSITION_REQUEST`: Cancel (delete) a transition request

const ActivityActionApproveTransitionRequest ActivityAction = `APPROVE_TRANSITION_REQUEST`

Approve a transition request

const ActivityActionCancelTransitionRequest ActivityAction = `CANCEL_TRANSITION_REQUEST`

Cancel (delete) a transition request

const ActivityActionRejectTransitionRequest ActivityAction = `REJECT_TRANSITION_REQUEST`

Reject a transition request

func (*ActivityAction) Set

func (f *ActivityAction) Set(v string) error

Set raw string value and validate it against allowed values

func (*ActivityAction) String

func (f *ActivityAction) String() string

String representation for fmt.Print

func (*ActivityAction) Type

func (f *ActivityAction) Type() string

Type always returns ActivityAction to satisfy [pflag.Value] interface

type ActivityType

type ActivityType string

Type of activity. Valid values are: * `APPLIED_TRANSITION`: User applied the corresponding stage transition.

* `REQUESTED_TRANSITION`: User requested the corresponding stage transition.

* `CANCELLED_REQUEST`: User cancelled an existing transition request.

* `APPROVED_REQUEST`: User approved the corresponding stage transition.

* `REJECTED_REQUEST`: User rejected the coressponding stage transition.

* `SYSTEM_TRANSITION`: For events performed as a side effect, such as archiving existing model versions in a stage.

const ActivityTypeAppliedTransition ActivityType = `APPLIED_TRANSITION`

User applied the corresponding stage transition.

const ActivityTypeApprovedRequest ActivityType = `APPROVED_REQUEST`

User approved the corresponding stage transition.

const ActivityTypeCancelledRequest ActivityType = `CANCELLED_REQUEST`

User cancelled an existing transition request.

const ActivityTypeNewComment ActivityType = `NEW_COMMENT`
const ActivityTypeRejectedRequest ActivityType = `REJECTED_REQUEST`

User rejected the coressponding stage transition.

const ActivityTypeRequestedTransition ActivityType = `REQUESTED_TRANSITION`

User requested the corresponding stage transition.

const ActivityTypeSystemTransition ActivityType = `SYSTEM_TRANSITION`

For events performed as a side effect, such as archiving existing model versions in a stage.

func (*ActivityType) Set

func (f *ActivityType) Set(v string) error

Set raw string value and validate it against allowed values

func (*ActivityType) String

func (f *ActivityType) String() string

String representation for fmt.Print

func (*ActivityType) Type

func (f *ActivityType) Type() string

Type always returns ActivityType to satisfy [pflag.Value] interface

type ApproveTransitionRequest

type ApproveTransitionRequest struct {
	// Specifies whether to archive all current model versions in the target
	// stage.
	ArchiveExistingVersions bool `json:"archive_existing_versions"`
	// User-provided comment on the action.
	Comment string `json:"comment,omitempty"`
	// Name of the model.
	Name string `json:"name"`
	// Target stage of the transition. Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	Stage Stage `json:"stage"`
	// Version of the model.
	Version string `json:"version"`

	ForceSendFields []string `json:"-"`
}

func (ApproveTransitionRequest) MarshalJSON added in v0.23.0

func (s ApproveTransitionRequest) MarshalJSON() ([]byte, error)

func (*ApproveTransitionRequest) UnmarshalJSON added in v0.23.0

func (s *ApproveTransitionRequest) UnmarshalJSON(b []byte) error

type ApproveTransitionRequestResponse

type ApproveTransitionRequestResponse struct {
	// Activity recorded for the action.
	Activity *Activity `json:"activity,omitempty"`
}

type CommentActivityAction

type CommentActivityAction string

An action that a user (with sufficient permissions) could take on a comment. Valid values are: * `EDIT_COMMENT`: Edit the comment

* `DELETE_COMMENT`: Delete the comment

const CommentActivityActionDeleteComment CommentActivityAction = `DELETE_COMMENT`

Delete the comment

const CommentActivityActionEditComment CommentActivityAction = `EDIT_COMMENT`

Edit the comment

func (*CommentActivityAction) Set

Set raw string value and validate it against allowed values

func (*CommentActivityAction) String

func (f *CommentActivityAction) String() string

String representation for fmt.Print

func (*CommentActivityAction) Type

func (f *CommentActivityAction) Type() string

Type always returns CommentActivityAction to satisfy [pflag.Value] interface

type CommentObject

type CommentObject struct {
	// Array of actions on the activity allowed for the current viewer.
	AvailableActions []CommentActivityAction `json:"available_actions,omitempty"`
	// User-provided comment on the action.
	Comment string `json:"comment,omitempty"`
	// Creation time of the object, as a Unix timestamp in milliseconds.
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// Comment ID
	Id string `json:"id,omitempty"`
	// Time of the object at last update, as a Unix timestamp in milliseconds.
	LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
	// The username of the user that created the object.
	UserId string `json:"user_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

Comment details.

func (CommentObject) MarshalJSON added in v0.23.0

func (s CommentObject) MarshalJSON() ([]byte, error)

func (*CommentObject) UnmarshalJSON added in v0.23.0

func (s *CommentObject) UnmarshalJSON(b []byte) error

type CreateComment

type CreateComment struct {
	// User-provided comment on the action.
	Comment string `json:"comment"`
	// Name of the model.
	Name string `json:"name"`
	// Version of the model.
	Version string `json:"version"`
}

type CreateCommentResponse

type CreateCommentResponse struct {
	// Comment details.
	Comment *CommentObject `json:"comment,omitempty"`
}

type CreateExperiment

type CreateExperiment struct {
	// Location where all artifacts for the experiment are stored. If not
	// provided, the remote server will select an appropriate default.
	ArtifactLocation string `json:"artifact_location,omitempty"`
	// Experiment name.
	Name string `json:"name"`
	// A collection of tags to set on the experiment. Maximum tag size and
	// number of tags per request depends on the storage backend. All storage
	// backends are guaranteed to support tag keys up to 250 bytes in size and
	// tag values up to 5000 bytes in size. All storage backends are also
	// guaranteed to support up to 20 tags per request.
	Tags []ExperimentTag `json:"tags,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CreateExperiment) MarshalJSON added in v0.23.0

func (s CreateExperiment) MarshalJSON() ([]byte, error)

func (*CreateExperiment) UnmarshalJSON added in v0.23.0

func (s *CreateExperiment) UnmarshalJSON(b []byte) error

type CreateExperimentResponse

type CreateExperimentResponse struct {
	// Unique identifier for the experiment.
	ExperimentId string `json:"experiment_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CreateExperimentResponse) MarshalJSON added in v0.23.0

func (s CreateExperimentResponse) MarshalJSON() ([]byte, error)

func (*CreateExperimentResponse) UnmarshalJSON added in v0.23.0

func (s *CreateExperimentResponse) UnmarshalJSON(b []byte) error

type CreateModelRequest

type CreateModelRequest struct {
	// Optional description for registered model.
	Description string `json:"description,omitempty"`
	// Register models under this name
	Name string `json:"name"`
	// Additional metadata for registered model.
	Tags []ModelTag `json:"tags,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CreateModelRequest) MarshalJSON added in v0.23.0

func (s CreateModelRequest) MarshalJSON() ([]byte, error)

func (*CreateModelRequest) UnmarshalJSON added in v0.23.0

func (s *CreateModelRequest) UnmarshalJSON(b []byte) error

type CreateModelResponse

type CreateModelResponse struct {
	RegisteredModel *Model `json:"registered_model,omitempty"`
}

type CreateModelVersionRequest

type CreateModelVersionRequest struct {
	// Optional description for model version.
	Description string `json:"description,omitempty"`
	// Register model under this name
	Name string `json:"name"`
	// MLflow run ID for correlation, if `source` was generated by an experiment
	// run in MLflow tracking server
	RunId string `json:"run_id,omitempty"`
	// MLflow run link - this is the exact link of the run that generated this
	// model version, potentially hosted at another instance of MLflow.
	RunLink string `json:"run_link,omitempty"`
	// URI indicating the location of the model artifacts.
	Source string `json:"source"`
	// Additional metadata for model version.
	Tags []ModelVersionTag `json:"tags,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CreateModelVersionRequest) MarshalJSON added in v0.23.0

func (s CreateModelVersionRequest) MarshalJSON() ([]byte, error)

func (*CreateModelVersionRequest) UnmarshalJSON added in v0.23.0

func (s *CreateModelVersionRequest) UnmarshalJSON(b []byte) error

type CreateModelVersionResponse

type CreateModelVersionResponse struct {
	// Return new version number generated for this model in registry.
	ModelVersion *ModelVersion `json:"model_version,omitempty"`
}

type CreateRegistryWebhook

type CreateRegistryWebhook struct {
	// User-specified description for the webhook.
	Description string `json:"description,omitempty"`
	// Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A
	// new model version was created for the associated model.
	//
	// * `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was
	// changed.
	//
	// * `TRANSITION_REQUEST_CREATED`: A user requested a model version’s
	// stage be transitioned.
	//
	// * `COMMENT_CREATED`: A user wrote a comment on a registered model.
	//
	// * `REGISTERED_MODEL_CREATED`: A new registered model was created. This
	// event type can only be specified for a registry-wide webhook, which can
	// be created by not specifying a model name in the create request.
	//
	// * `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was
	// transitioned to staging.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was
	// transitioned to production.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
	//
	// * `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model
	// version be transitioned to staging.
	//
	// * `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model
	// version be transitioned to production.
	//
	// * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model
	// version be archived.
	Events []RegistryWebhookEvent `json:"events"`

	HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"`

	JobSpec *JobSpec `json:"job_spec,omitempty"`
	// Name of the model whose events would trigger this webhook.
	ModelName string `json:"model_name,omitempty"`
	// Enable or disable triggering the webhook, or put the webhook into test
	// mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an
	// associated event happens.
	//
	// * `DISABLED`: Webhook is not triggered.
	//
	// * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is
	// not triggered on a real event.
	Status RegistryWebhookStatus `json:"status,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CreateRegistryWebhook) MarshalJSON added in v0.23.0

func (s CreateRegistryWebhook) MarshalJSON() ([]byte, error)

func (*CreateRegistryWebhook) UnmarshalJSON added in v0.23.0

func (s *CreateRegistryWebhook) UnmarshalJSON(b []byte) error

type CreateRun

type CreateRun struct {
	// ID of the associated experiment.
	ExperimentId string `json:"experiment_id,omitempty"`
	// Unix timestamp in milliseconds of when the run started.
	StartTime int64 `json:"start_time,omitempty"`
	// Additional metadata for run.
	Tags []RunTag `json:"tags,omitempty"`
	// ID of the user executing the run. This field is deprecated as of MLflow
	// 1.0, and will be removed in a future MLflow release. Use 'mlflow.user'
	// tag instead.
	UserId string `json:"user_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (CreateRun) MarshalJSON added in v0.23.0

func (s CreateRun) MarshalJSON() ([]byte, error)

func (*CreateRun) UnmarshalJSON added in v0.23.0

func (s *CreateRun) UnmarshalJSON(b []byte) error

type CreateRunResponse

type CreateRunResponse struct {
	// The newly created run.
	Run *Run `json:"run,omitempty"`
}

type CreateTransitionRequest

type CreateTransitionRequest struct {
	// User-provided comment on the action.
	Comment string `json:"comment,omitempty"`
	// Name of the model.
	Name string `json:"name"`
	// Target stage of the transition. Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	Stage Stage `json:"stage"`
	// Version of the model.
	Version string `json:"version"`

	ForceSendFields []string `json:"-"`
}

func (CreateTransitionRequest) MarshalJSON added in v0.23.0

func (s CreateTransitionRequest) MarshalJSON() ([]byte, error)

func (*CreateTransitionRequest) UnmarshalJSON added in v0.23.0

func (s *CreateTransitionRequest) UnmarshalJSON(b []byte) error

type CreateTransitionRequestResponse

type CreateTransitionRequestResponse struct {
	// Transition request details.
	Request *TransitionRequest `json:"request,omitempty"`
}

type CreateWebhookResponse

type CreateWebhookResponse struct {
	Webhook *RegistryWebhook `json:"webhook,omitempty"`
}

type Dataset added in v0.9.0

type Dataset struct {
	// Dataset digest, e.g. an md5 hash of the dataset that uniquely identifies
	// it within datasets of the same name.
	Digest string `json:"digest,omitempty"`
	// The name of the dataset. E.g. “my.uc.table@2” “nyc-taxi-dataset”,
	// “fantastic-elk-3”
	Name string `json:"name,omitempty"`
	// The profile of the dataset. Summary statistics for the dataset, such as
	// the number of rows in a table, the mean / std / mode of each column in a
	// table, or the number of elements in an array.
	Profile string `json:"profile,omitempty"`
	// The schema of the dataset. E.g., MLflow ColSpec JSON for a dataframe,
	// MLflow TensorSpec JSON for an ndarray, or another schema format.
	Schema string `json:"schema,omitempty"`
	// The type of the dataset source, e.g. ‘databricks-uc-table’,
	// ‘DBFS’, ‘S3’, ...
	Source string `json:"source,omitempty"`
	// Source information for the dataset. Note that the source may not exactly
	// reproduce the dataset if it was transformed / modified before use with
	// MLflow.
	SourceType string `json:"source_type,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (Dataset) MarshalJSON added in v0.23.0

func (s Dataset) MarshalJSON() ([]byte, error)

func (*Dataset) UnmarshalJSON added in v0.23.0

func (s *Dataset) UnmarshalJSON(b []byte) error

type DatasetInput added in v0.9.0

type DatasetInput struct {
	// The dataset being used as a Run input.
	Dataset *Dataset `json:"dataset,omitempty"`
	// A list of tags for the dataset input, e.g. a “context” tag with value
	// “training”
	Tags []InputTag `json:"tags,omitempty"`
}

type DeleteCommentRequest

type DeleteCommentRequest struct {
	Id string `json:"-" url:"id"`
}

Delete a comment

type DeleteCommentResponse added in v0.34.0

type DeleteCommentResponse struct {
}

type DeleteExperiment

type DeleteExperiment struct {
	// ID of the associated experiment.
	ExperimentId string `json:"experiment_id"`
}

type DeleteExperimentResponse added in v0.34.0

type DeleteExperimentResponse struct {
}

type DeleteModelRequest

type DeleteModelRequest struct {
	// Registered model unique name identifier.
	Name string `json:"-" url:"name"`
}

Delete a model

type DeleteModelResponse added in v0.34.0

type DeleteModelResponse struct {
}

type DeleteModelTagRequest

type DeleteModelTagRequest struct {
	// Name of the tag. The name must be an exact match; wild-card deletion is
	// not supported. Maximum size is 250 bytes.
	Key string `json:"-" url:"key"`
	// Name of the registered model that the tag was logged under.
	Name string `json:"-" url:"name"`
}

Delete a model tag

type DeleteModelTagResponse added in v0.34.0

type DeleteModelTagResponse struct {
}

type DeleteModelVersionRequest

type DeleteModelVersionRequest struct {
	// Name of the registered model
	Name string `json:"-" url:"name"`
	// Model version number
	Version string `json:"-" url:"version"`
}

Delete a model version.

type DeleteModelVersionResponse added in v0.34.0

type DeleteModelVersionResponse struct {
}

type DeleteModelVersionTagRequest

type DeleteModelVersionTagRequest struct {
	// Name of the tag. The name must be an exact match; wild-card deletion is
	// not supported. Maximum size is 250 bytes.
	Key string `json:"-" url:"key"`
	// Name of the registered model that the tag was logged under.
	Name string `json:"-" url:"name"`
	// Model version number that the tag was logged under.
	Version string `json:"-" url:"version"`
}

Delete a model version tag

type DeleteModelVersionTagResponse added in v0.34.0

type DeleteModelVersionTagResponse struct {
}

type DeleteRun

type DeleteRun struct {
	// ID of the run to delete.
	RunId string `json:"run_id"`
}

type DeleteRunResponse added in v0.34.0

type DeleteRunResponse struct {
}

type DeleteRuns added in v0.17.0

type DeleteRuns struct {
	// The ID of the experiment containing the runs to delete.
	ExperimentId string `json:"experiment_id"`
	// An optional positive integer indicating the maximum number of runs to
	// delete. The maximum allowed value for max_runs is 10000.
	MaxRuns int `json:"max_runs,omitempty"`
	// The maximum creation timestamp in milliseconds since the UNIX epoch for
	// deleting runs. Only runs created prior to or at this timestamp are
	// deleted.
	MaxTimestampMillis int64 `json:"max_timestamp_millis"`

	ForceSendFields []string `json:"-"`
}

func (DeleteRuns) MarshalJSON added in v0.23.0

func (s DeleteRuns) MarshalJSON() ([]byte, error)

func (*DeleteRuns) UnmarshalJSON added in v0.23.0

func (s *DeleteRuns) UnmarshalJSON(b []byte) error

type DeleteRunsResponse added in v0.17.0

type DeleteRunsResponse struct {
	// The number of runs deleted.
	RunsDeleted int `json:"runs_deleted,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (DeleteRunsResponse) MarshalJSON added in v0.23.0

func (s DeleteRunsResponse) MarshalJSON() ([]byte, error)

func (*DeleteRunsResponse) UnmarshalJSON added in v0.23.0

func (s *DeleteRunsResponse) UnmarshalJSON(b []byte) error

type DeleteTag

type DeleteTag struct {
	// Name of the tag. Maximum size is 255 bytes. Must be provided.
	Key string `json:"key"`
	// ID of the run that the tag was logged under. Must be provided.
	RunId string `json:"run_id"`
}

type DeleteTagResponse added in v0.34.0

type DeleteTagResponse struct {
}

type DeleteTransitionRequestRequest

type DeleteTransitionRequestRequest struct {
	// User-provided comment on the action.
	Comment string `json:"-" url:"comment,omitempty"`
	// Username of the user who created this request. Of the transition requests
	// matching the specified details, only the one transition created by this
	// user will be deleted.
	Creator string `json:"-" url:"creator"`
	// Name of the model.
	Name string `json:"-" url:"name"`
	// Target stage of the transition request. Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	Stage DeleteTransitionRequestStage `json:"-" url:"stage"`
	// Version of the model.
	Version string `json:"-" url:"version"`

	ForceSendFields []string `json:"-"`
}

Delete a transition request

func (DeleteTransitionRequestRequest) MarshalJSON added in v0.23.0

func (s DeleteTransitionRequestRequest) MarshalJSON() ([]byte, error)

func (*DeleteTransitionRequestRequest) UnmarshalJSON added in v0.23.0

func (s *DeleteTransitionRequestRequest) UnmarshalJSON(b []byte) error

type DeleteTransitionRequestResponse added in v0.34.0

type DeleteTransitionRequestResponse struct {
}

type DeleteTransitionRequestStage added in v0.9.0

type DeleteTransitionRequestStage string
const DeleteTransitionRequestStageArchived DeleteTransitionRequestStage = `Archived`
const DeleteTransitionRequestStageNone DeleteTransitionRequestStage = `None`
const DeleteTransitionRequestStageProduction DeleteTransitionRequestStage = `Production`
const DeleteTransitionRequestStageStaging DeleteTransitionRequestStage = `Staging`

func (*DeleteTransitionRequestStage) Set added in v0.9.0

Set raw string value and validate it against allowed values

func (*DeleteTransitionRequestStage) String added in v0.9.0

String representation for fmt.Print

func (*DeleteTransitionRequestStage) Type added in v0.9.0

Type always returns DeleteTransitionRequestStage to satisfy [pflag.Value] interface

type DeleteWebhookRequest

type DeleteWebhookRequest struct {
	// Webhook ID required to delete a registry webhook.
	Id string `json:"-" url:"id,omitempty"`

	ForceSendFields []string `json:"-"`
}

Delete a webhook

func (DeleteWebhookRequest) MarshalJSON added in v0.23.0

func (s DeleteWebhookRequest) MarshalJSON() ([]byte, error)

func (*DeleteWebhookRequest) UnmarshalJSON added in v0.23.0

func (s *DeleteWebhookRequest) UnmarshalJSON(b []byte) error

type DeleteWebhookResponse added in v0.34.0

type DeleteWebhookResponse struct {
}

type Experiment

type Experiment struct {
	// Location where artifacts for the experiment are stored.
	ArtifactLocation string `json:"artifact_location,omitempty"`
	// Creation time
	CreationTime int64 `json:"creation_time,omitempty"`
	// Unique identifier for the experiment.
	ExperimentId string `json:"experiment_id,omitempty"`
	// Last update time
	LastUpdateTime int64 `json:"last_update_time,omitempty"`
	// Current life cycle stage of the experiment: "active" or "deleted".
	// Deleted experiments are not returned by APIs.
	LifecycleStage string `json:"lifecycle_stage,omitempty"`
	// Human readable name that identifies the experiment.
	Name string `json:"name,omitempty"`
	// Tags: Additional metadata key-value pairs.
	Tags []ExperimentTag `json:"tags,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (Experiment) MarshalJSON added in v0.23.0

func (s Experiment) MarshalJSON() ([]byte, error)

func (*Experiment) UnmarshalJSON added in v0.23.0

func (s *Experiment) UnmarshalJSON(b []byte) error

type ExperimentAccessControlRequest added in v0.15.0

type ExperimentAccessControlRequest struct {
	// name of the group
	GroupName string `json:"group_name,omitempty"`
	// Permission level
	PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"`
	// application ID of a service principal
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// name of the user
	UserName string `json:"user_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ExperimentAccessControlRequest) MarshalJSON added in v0.23.0

func (s ExperimentAccessControlRequest) MarshalJSON() ([]byte, error)

func (*ExperimentAccessControlRequest) UnmarshalJSON added in v0.23.0

func (s *ExperimentAccessControlRequest) UnmarshalJSON(b []byte) error

type ExperimentAccessControlResponse added in v0.15.0

type ExperimentAccessControlResponse struct {
	// All permissions.
	AllPermissions []ExperimentPermission `json:"all_permissions,omitempty"`
	// Display name of the user or service principal.
	DisplayName string `json:"display_name,omitempty"`
	// name of the group
	GroupName string `json:"group_name,omitempty"`
	// Name of the service principal.
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// name of the user
	UserName string `json:"user_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ExperimentAccessControlResponse) MarshalJSON added in v0.23.0

func (s ExperimentAccessControlResponse) MarshalJSON() ([]byte, error)

func (*ExperimentAccessControlResponse) UnmarshalJSON added in v0.23.0

func (s *ExperimentAccessControlResponse) UnmarshalJSON(b []byte) error

type ExperimentPermission added in v0.15.0

type ExperimentPermission struct {
	Inherited bool `json:"inherited,omitempty"`

	InheritedFromObject []string `json:"inherited_from_object,omitempty"`
	// Permission level
	PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ExperimentPermission) MarshalJSON added in v0.23.0

func (s ExperimentPermission) MarshalJSON() ([]byte, error)

func (*ExperimentPermission) UnmarshalJSON added in v0.23.0

func (s *ExperimentPermission) UnmarshalJSON(b []byte) error

type ExperimentPermissionLevel added in v0.15.0

type ExperimentPermissionLevel string

Permission level

const ExperimentPermissionLevelCanEdit ExperimentPermissionLevel = `CAN_EDIT`
const ExperimentPermissionLevelCanManage ExperimentPermissionLevel = `CAN_MANAGE`
const ExperimentPermissionLevelCanRead ExperimentPermissionLevel = `CAN_READ`

func (*ExperimentPermissionLevel) Set added in v0.15.0

Set raw string value and validate it against allowed values

func (*ExperimentPermissionLevel) String added in v0.15.0

func (f *ExperimentPermissionLevel) String() string

String representation for fmt.Print

func (*ExperimentPermissionLevel) Type added in v0.15.0

Type always returns ExperimentPermissionLevel to satisfy [pflag.Value] interface

type ExperimentPermissions added in v0.15.0

type ExperimentPermissions struct {
	AccessControlList []ExperimentAccessControlResponse `json:"access_control_list,omitempty"`

	ObjectId string `json:"object_id,omitempty"`

	ObjectType string `json:"object_type,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ExperimentPermissions) MarshalJSON added in v0.23.0

func (s ExperimentPermissions) MarshalJSON() ([]byte, error)

func (*ExperimentPermissions) UnmarshalJSON added in v0.23.0

func (s *ExperimentPermissions) UnmarshalJSON(b []byte) error

type ExperimentPermissionsDescription added in v0.15.0

type ExperimentPermissionsDescription struct {
	Description string `json:"description,omitempty"`
	// Permission level
	PermissionLevel ExperimentPermissionLevel `json:"permission_level,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ExperimentPermissionsDescription) MarshalJSON added in v0.23.0

func (s ExperimentPermissionsDescription) MarshalJSON() ([]byte, error)

func (*ExperimentPermissionsDescription) UnmarshalJSON added in v0.23.0

func (s *ExperimentPermissionsDescription) UnmarshalJSON(b []byte) error

type ExperimentPermissionsRequest added in v0.15.0

type ExperimentPermissionsRequest struct {
	AccessControlList []ExperimentAccessControlRequest `json:"access_control_list,omitempty"`
	// The experiment for which to get or manage permissions.
	ExperimentId string `json:"-" url:"-"`
}

type ExperimentTag

type ExperimentTag struct {
	// The tag key.
	Key string `json:"key,omitempty"`
	// The tag value.
	Value string `json:"value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ExperimentTag) MarshalJSON added in v0.23.0

func (s ExperimentTag) MarshalJSON() ([]byte, error)

func (*ExperimentTag) UnmarshalJSON added in v0.23.0

func (s *ExperimentTag) UnmarshalJSON(b []byte) error

type ExperimentsAPI

type ExperimentsAPI struct {
	// contains filtered or unexported fields
}

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 analysis in other tools. Experiments are maintained in a Databricks hosted MLflow tracking server.

Experiments are located in the workspace file tree. You manage experiments using the same tools you use to manage other workspace objects such as folders, notebooks, and libraries.

func NewExperiments

func NewExperiments(client *client.DatabricksClient) *ExperimentsAPI

func (*ExperimentsAPI) CreateExperiment

func (a *ExperimentsAPI) CreateExperiment(ctx context.Context, request CreateExperiment) (*CreateExperimentResponse, error)

Create experiment.

Creates an experiment with a name. Returns the ID of the newly created experiment. Validates that another experiment with the same name does not already exist and fails if another experiment with the same name already exists.

Throws `RESOURCE_ALREADY_EXISTS` if a experiment with the given name exists.

Example (Experiments)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

experiment, err := w.Experiments.CreateExperiment(ctx, ml.CreateExperiment{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", experiment)

// cleanup

err = w.Experiments.DeleteExperiment(ctx, ml.DeleteExperiment{
	ExperimentId: experiment.ExperimentId,
})
if err != nil {
	panic(err)
}
Output:

Example (MLflowRuns)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

experiment, err := w.Experiments.CreateExperiment(ctx, ml.CreateExperiment{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", experiment)

// cleanup

err = w.Experiments.DeleteExperiment(ctx, ml.DeleteExperiment{
	ExperimentId: experiment.ExperimentId,
})
if err != nil {
	panic(err)
}
Output:

func (*ExperimentsAPI) CreateRun

func (a *ExperimentsAPI) CreateRun(ctx context.Context, request CreateRun) (*CreateRunResponse, error)

Create a run.

Creates a new run within an experiment. A run is usually a single execution of a machine learning or data ETL pipeline. MLflow uses runs to track the `mlflowParam`, `mlflowMetric` and `mlflowRunTag` associated with a single execution.

Example (MLflowRuns)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

experiment, err := w.Experiments.CreateExperiment(ctx, ml.CreateExperiment{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", experiment)

created, err := w.Experiments.CreateRun(ctx, ml.CreateRun{
	ExperimentId: experiment.ExperimentId,
	Tags: []ml.RunTag{ml.RunTag{
		Key:   "foo",
		Value: "bar",
	}},
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

// cleanup

err = w.Experiments.DeleteExperiment(ctx, ml.DeleteExperiment{
	ExperimentId: experiment.ExperimentId,
})
if err != nil {
	panic(err)
}
err = w.Experiments.DeleteRun(ctx, ml.DeleteRun{
	RunId: created.Run.Info.RunId,
})
if err != nil {
	panic(err)
}
Output:

func (*ExperimentsAPI) DeleteExperiment

func (a *ExperimentsAPI) DeleteExperiment(ctx context.Context, request DeleteExperiment) error

Delete an experiment.

Marks an experiment and associated metadata, runs, metrics, params, and tags for deletion. If the experiment uses FileStore, artifacts associated with experiment are also deleted.

func (*ExperimentsAPI) DeleteRun

func (a *ExperimentsAPI) DeleteRun(ctx context.Context, request DeleteRun) error

Delete a run.

Marks a run for deletion.

func (*ExperimentsAPI) DeleteRuns added in v0.17.0

func (a *ExperimentsAPI) DeleteRuns(ctx context.Context, request DeleteRuns) (*DeleteRunsResponse, error)

Delete runs by creation time.

Bulk delete runs in an experiment that were created prior to or at the specified timestamp. Deletes at most max_runs per request. To call this API from a Databricks Notebook in Python, you can use the client code snippet on https://learn.microsoft.com/en-us/azure/databricks/mlflow/runs#bulk-delete.

func (*ExperimentsAPI) DeleteTag

func (a *ExperimentsAPI) DeleteTag(ctx context.Context, request DeleteTag) error

Delete a tag.

Deletes a tag on a run. Tags are run metadata that can be updated during a run and after a run completes.

func (*ExperimentsAPI) GetByName

Get metadata.

Gets metadata for an experiment.

This endpoint will return deleted experiments, but prefers the active experiment if an active and deleted experiment share the same name. If multiple deleted experiments share the same name, the API will return one of them.

Throws `RESOURCE_DOES_NOT_EXIST` if no experiment with the specified name exists.

func (*ExperimentsAPI) GetExperiment

Get an experiment.

Gets metadata for an experiment. This method works on deleted experiments.

Example (Experiments)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

experiment, err := w.Experiments.CreateExperiment(ctx, ml.CreateExperiment{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", experiment)

_, err = w.Experiments.GetExperiment(ctx, ml.GetExperimentRequest{
	ExperimentId: experiment.ExperimentId,
})
if err != nil {
	panic(err)
}

// cleanup

err = w.Experiments.DeleteExperiment(ctx, ml.DeleteExperiment{
	ExperimentId: experiment.ExperimentId,
})
if err != nil {
	panic(err)
}
Output:

func (*ExperimentsAPI) GetHistory

func (a *ExperimentsAPI) GetHistory(ctx context.Context, request GetHistoryRequest) listing.Iterator[Metric]

Get history of a given metric within a run.

Gets a list of all values for the specified metric for a given run.

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) GetHistoryAll added in v0.18.0

func (a *ExperimentsAPI) GetHistoryAll(ctx context.Context, request GetHistoryRequest) ([]Metric, error)

Get history of a given metric within a run.

Gets a list of all values for the specified metric for a given run.

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) GetPermissionLevels added in v0.19.0

Get experiment permission levels.

Gets the permission levels that a user can have on an object.

func (*ExperimentsAPI) GetPermissionLevelsByExperimentId added in v0.19.0

func (a *ExperimentsAPI) GetPermissionLevelsByExperimentId(ctx context.Context, experimentId string) (*GetExperimentPermissionLevelsResponse, error)

Get experiment permission levels.

Gets the permission levels that a user can have on an object.

func (*ExperimentsAPI) GetPermissions added in v0.19.0

Get experiment permissions.

Gets the permissions of an experiment. Experiments can inherit permissions from their root object.

func (*ExperimentsAPI) GetPermissionsByExperimentId added in v0.19.0

func (a *ExperimentsAPI) GetPermissionsByExperimentId(ctx context.Context, experimentId string) (*ExperimentPermissions, error)

Get experiment permissions.

Gets the permissions of an experiment. Experiments can inherit permissions from their root object.

func (*ExperimentsAPI) GetRun

func (a *ExperimentsAPI) GetRun(ctx context.Context, request GetRunRequest) (*GetRunResponse, error)

Get a run.

Gets the metadata, metrics, params, and tags for a run. In the case where multiple metrics with the same key are logged for a run, return only the value with the latest timestamp.

If there are multiple values with the latest timestamp, return the maximum of these values.

func (*ExperimentsAPI) Impl

Impl returns low-level Experiments API implementation Deprecated: use MockExperimentsInterface instead.

func (*ExperimentsAPI) ListArtifacts added in v0.24.0

Get all artifacts.

List artifacts for a run. Takes an optional `artifact_path` prefix. If it is specified, the response contains only artifacts with the specified prefix.",

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) ListArtifactsAll

func (a *ExperimentsAPI) ListArtifactsAll(ctx context.Context, request ListArtifactsRequest) ([]FileInfo, error)

Get all artifacts.

List artifacts for a run. Takes an optional `artifact_path` prefix. If it is specified, the response contains only artifacts with the specified prefix.",

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) ListExperiments added in v0.24.0

List experiments.

Gets a list of all experiments.

This method is generated by Databricks SDK Code Generator.

Example (Experiments)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.Experiments.ListExperimentsAll(ctx, ml.ListExperimentsRequest{})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*ExperimentsAPI) ListExperimentsAll

func (a *ExperimentsAPI) ListExperimentsAll(ctx context.Context, request ListExperimentsRequest) ([]Experiment, error)

List experiments.

Gets a list of all experiments.

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) LogBatch

func (a *ExperimentsAPI) LogBatch(ctx context.Context, request LogBatch) error

Log a batch.

Logs a batch of metrics, params, and tags for a run. If any data failed to be persisted, the server will respond with an error (non-200 status code).

In case of error (due to internal server error or an invalid request), partial data may be written.

You can write metrics, params, and tags in interleaving fashion, but within a given entity type are guaranteed to follow the order specified in the request body.

The overwrite behavior for metrics, params, and tags is as follows:

* Metrics: metric values are never overwritten. Logging a metric (key, value, timestamp) appends to the set of values for the metric with the provided key.

* Tags: tag values can be overwritten by successive writes to the same tag key. That is, if multiple tag values with the same key are provided in the same API request, the last-provided tag value is written. Logging the same tag (key, value) is permitted. Specifically, logging a tag is idempotent.

* Parameters: once written, param values cannot be changed (attempting to overwrite a param value will result in an error). However, logging the same param (key, value) is permitted. Specifically, logging a param is idempotent.

Request Limits ------------------------------- A single JSON-serialized API request may be up to 1 MB in size and contain:

* No more than 1000 metrics, params, and tags in total * Up to 1000 metrics * Up to 100 params * Up to 100 tags

For example, a valid request might contain 900 metrics, 50 params, and 50 tags, but logging 900 metrics, 50 params, and 51 tags is invalid.

The following limits also apply to metric, param, and tag keys and values:

* Metric keys, param keys, and tag keys can be up to 250 characters in length * Parameter and tag values can be up to 250 characters in length

func (*ExperimentsAPI) LogInputs added in v0.9.0

func (a *ExperimentsAPI) LogInputs(ctx context.Context, request LogInputs) error

Log inputs to a run.

**NOTE:** Experimental: This API may change or be removed in a future release without warning.

func (*ExperimentsAPI) LogMetric

func (a *ExperimentsAPI) LogMetric(ctx context.Context, request LogMetric) error

Log a metric.

Logs a metric for a run. A metric is a key-value pair (string key, float value) with an associated timestamp. Examples include the various metrics that represent ML model accuracy. A metric can be logged multiple times.

func (*ExperimentsAPI) LogModel

func (a *ExperimentsAPI) LogModel(ctx context.Context, request LogModel) error

Log a model.

**NOTE:** Experimental: This API may change or be removed in a future release without warning.

func (*ExperimentsAPI) LogParam

func (a *ExperimentsAPI) LogParam(ctx context.Context, request LogParam) error

Log a param.

Logs a param used for a run. A param is a key-value pair (string key, string value). Examples include hyperparameters used for ML model training and constant dates and values used in an ETL pipeline. A param can be logged only once for a run.

func (*ExperimentsAPI) RestoreExperiment

func (a *ExperimentsAPI) RestoreExperiment(ctx context.Context, request RestoreExperiment) error

Restores an experiment.

Restore an experiment marked for deletion. This also restores associated metadata, runs, metrics, params, and tags. If experiment uses FileStore, underlying artifacts associated with experiment are also restored.

Throws `RESOURCE_DOES_NOT_EXIST` if experiment was never created or was permanently deleted.

func (*ExperimentsAPI) RestoreRun

func (a *ExperimentsAPI) RestoreRun(ctx context.Context, request RestoreRun) error

Restore a run.

Restores a deleted run.

func (*ExperimentsAPI) RestoreRuns added in v0.17.0

func (a *ExperimentsAPI) RestoreRuns(ctx context.Context, request RestoreRuns) (*RestoreRunsResponse, error)

Restore runs by deletion time.

Bulk restore runs in an experiment that were deleted no earlier than the specified timestamp. Restores at most max_runs per request. To call this API from a Databricks Notebook in Python, you can use the client code snippet on https://learn.microsoft.com/en-us/azure/databricks/mlflow/runs#bulk-restore.

func (*ExperimentsAPI) SearchExperiments added in v0.24.0

func (a *ExperimentsAPI) SearchExperiments(ctx context.Context, request SearchExperiments) listing.Iterator[Experiment]

Search experiments.

Searches for experiments that satisfy specified search criteria.

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) SearchExperimentsAll

func (a *ExperimentsAPI) SearchExperimentsAll(ctx context.Context, request SearchExperiments) ([]Experiment, error)

Search experiments.

Searches for experiments that satisfy specified search criteria.

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) SearchRuns added in v0.24.0

func (a *ExperimentsAPI) SearchRuns(ctx context.Context, request SearchRuns) listing.Iterator[Run]

Search for runs.

Searches for runs that satisfy expressions.

Search expressions can use `mlflowMetric` and `mlflowParam` keys.",

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) SearchRunsAll

func (a *ExperimentsAPI) SearchRunsAll(ctx context.Context, request SearchRuns) ([]Run, error)

Search for runs.

Searches for runs that satisfy expressions.

Search expressions can use `mlflowMetric` and `mlflowParam` keys.",

This method is generated by Databricks SDK Code Generator.

func (*ExperimentsAPI) SetExperimentTag

func (a *ExperimentsAPI) SetExperimentTag(ctx context.Context, request SetExperimentTag) error

Set a tag.

Sets a tag on an experiment. Experiment tags are metadata that can be updated.

func (*ExperimentsAPI) SetPermissions added in v0.19.0

Set experiment permissions.

Sets permissions on an experiment. Experiments can inherit permissions from their root object.

func (*ExperimentsAPI) SetTag

func (a *ExperimentsAPI) SetTag(ctx context.Context, request SetTag) error

Set a tag.

Sets a tag on a run. Tags are run metadata that can be updated during a run and after a run completes.

func (*ExperimentsAPI) UpdateExperiment

func (a *ExperimentsAPI) UpdateExperiment(ctx context.Context, request UpdateExperiment) error

Update an experiment.

Updates experiment metadata.

Example (Experiments)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

experiment, err := w.Experiments.CreateExperiment(ctx, ml.CreateExperiment{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", experiment)

err = w.Experiments.UpdateExperiment(ctx, ml.UpdateExperiment{
	NewName:      fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	ExperimentId: experiment.ExperimentId,
})
if err != nil {
	panic(err)
}

// cleanup

err = w.Experiments.DeleteExperiment(ctx, ml.DeleteExperiment{
	ExperimentId: experiment.ExperimentId,
})
if err != nil {
	panic(err)
}
Output:

func (*ExperimentsAPI) UpdatePermissions added in v0.19.0

Update experiment permissions.

Updates the permissions on an experiment. Experiments can inherit permissions from their root object.

func (*ExperimentsAPI) UpdateRun

func (a *ExperimentsAPI) UpdateRun(ctx context.Context, request UpdateRun) (*UpdateRunResponse, error)

Update a run.

Updates run metadata.

Example (MLflowRuns)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

experiment, err := w.Experiments.CreateExperiment(ctx, ml.CreateExperiment{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", experiment)

created, err := w.Experiments.CreateRun(ctx, ml.CreateRun{
	ExperimentId: experiment.ExperimentId,
	Tags: []ml.RunTag{ml.RunTag{
		Key:   "foo",
		Value: "bar",
	}},
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

_, err = w.Experiments.UpdateRun(ctx, ml.UpdateRun{
	RunId:  created.Run.Info.RunId,
	Status: ml.UpdateRunStatusKilled,
})
if err != nil {
	panic(err)
}

// cleanup

err = w.Experiments.DeleteExperiment(ctx, ml.DeleteExperiment{
	ExperimentId: experiment.ExperimentId,
})
if err != nil {
	panic(err)
}
err = w.Experiments.DeleteRun(ctx, ml.DeleteRun{
	RunId: created.Run.Info.RunId,
})
if err != nil {
	panic(err)
}
Output:

func (*ExperimentsAPI) WithImpl

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 MockExperimentsInterface instead.

type ExperimentsInterface added in v0.29.0

type ExperimentsInterface 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 MockExperimentsInterface instead.
	WithImpl(impl ExperimentsService) ExperimentsInterface

	// Impl returns low-level Experiments API implementation
	// Deprecated: use MockExperimentsInterface instead.
	Impl() ExperimentsService

	// Create experiment.
	//
	// Creates an experiment with a name. Returns the ID of the newly created
	// experiment. Validates that another experiment with the same name does not
	// already exist and fails if another experiment with the same name already
	// exists.
	//
	// Throws `RESOURCE_ALREADY_EXISTS` if a experiment with the given name exists.
	CreateExperiment(ctx context.Context, request CreateExperiment) (*CreateExperimentResponse, error)

	// Create a run.
	//
	// Creates a new run within an experiment. A run is usually a single execution
	// of a machine learning or data ETL pipeline. MLflow uses runs to track the
	// `mlflowParam`, `mlflowMetric` and `mlflowRunTag` associated with a single
	// execution.
	CreateRun(ctx context.Context, request CreateRun) (*CreateRunResponse, error)

	// Delete an experiment.
	//
	// Marks an experiment and associated metadata, runs, metrics, params, and tags
	// for deletion. If the experiment uses FileStore, artifacts associated with
	// experiment are also deleted.
	DeleteExperiment(ctx context.Context, request DeleteExperiment) error

	// Delete a run.
	//
	// Marks a run for deletion.
	DeleteRun(ctx context.Context, request DeleteRun) error

	// Delete runs by creation time.
	//
	// Bulk delete runs in an experiment that were created prior to or at the
	// specified timestamp. Deletes at most max_runs per request. To call this API
	// from a Databricks Notebook in Python, you can use the client code snippet on
	// https://learn.microsoft.com/en-us/azure/databricks/mlflow/runs#bulk-delete.
	DeleteRuns(ctx context.Context, request DeleteRuns) (*DeleteRunsResponse, error)

	// Delete a tag.
	//
	// Deletes a tag on a run. Tags are run metadata that can be updated during a
	// run and after a run completes.
	DeleteTag(ctx context.Context, request DeleteTag) error

	// Get metadata.
	//
	// Gets metadata for an experiment.
	//
	// This endpoint will return deleted experiments, but prefers the active
	// experiment if an active and deleted experiment share the same name. If
	// multiple deleted experiments share the same name, the API will return one of
	// them.
	//
	// Throws `RESOURCE_DOES_NOT_EXIST` if no experiment with the specified name
	// exists.
	GetByName(ctx context.Context, request GetByNameRequest) (*GetExperimentResponse, error)

	// Get an experiment.
	//
	// Gets metadata for an experiment. This method works on deleted experiments.
	GetExperiment(ctx context.Context, request GetExperimentRequest) (*GetExperimentResponse, error)

	// Get history of a given metric within a run.
	//
	// Gets a list of all values for the specified metric for a given run.
	//
	// This method is generated by Databricks SDK Code Generator.
	GetHistory(ctx context.Context, request GetHistoryRequest) listing.Iterator[Metric]

	// Get history of a given metric within a run.
	//
	// Gets a list of all values for the specified metric for a given run.
	//
	// This method is generated by Databricks SDK Code Generator.
	GetHistoryAll(ctx context.Context, request GetHistoryRequest) ([]Metric, error)

	// Get experiment permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error)

	// Get experiment permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevelsByExperimentId(ctx context.Context, experimentId string) (*GetExperimentPermissionLevelsResponse, error)

	// Get experiment permissions.
	//
	// Gets the permissions of an experiment. Experiments can inherit permissions
	// from their root object.
	GetPermissions(ctx context.Context, request GetExperimentPermissionsRequest) (*ExperimentPermissions, error)

	// Get experiment permissions.
	//
	// Gets the permissions of an experiment. Experiments can inherit permissions
	// from their root object.
	GetPermissionsByExperimentId(ctx context.Context, experimentId string) (*ExperimentPermissions, error)

	// Get a run.
	//
	// Gets the metadata, metrics, params, and tags for a run. In the case where
	// multiple metrics with the same key are logged for a run, return only the
	// value with the latest timestamp.
	//
	// If there are multiple values with the latest timestamp, return the maximum of
	// these values.
	GetRun(ctx context.Context, request GetRunRequest) (*GetRunResponse, error)

	// Get all artifacts.
	//
	// List artifacts for a run. Takes an optional `artifact_path` prefix. If it is
	// specified, the response contains only artifacts with the specified prefix.",
	//
	// This method is generated by Databricks SDK Code Generator.
	ListArtifacts(ctx context.Context, request ListArtifactsRequest) listing.Iterator[FileInfo]

	// Get all artifacts.
	//
	// List artifacts for a run. Takes an optional `artifact_path` prefix. If it is
	// specified, the response contains only artifacts with the specified prefix.",
	//
	// This method is generated by Databricks SDK Code Generator.
	ListArtifactsAll(ctx context.Context, request ListArtifactsRequest) ([]FileInfo, error)

	// List experiments.
	//
	// Gets a list of all experiments.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListExperiments(ctx context.Context, request ListExperimentsRequest) listing.Iterator[Experiment]

	// List experiments.
	//
	// Gets a list of all experiments.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListExperimentsAll(ctx context.Context, request ListExperimentsRequest) ([]Experiment, error)

	// Log a batch.
	//
	// Logs a batch of metrics, params, and tags for a run. If any data failed to be
	// persisted, the server will respond with an error (non-200 status code).
	//
	// In case of error (due to internal server error or an invalid request),
	// partial data may be written.
	//
	// You can write metrics, params, and tags in interleaving fashion, but within a
	// given entity type are guaranteed to follow the order specified in the request
	// body.
	//
	// The overwrite behavior for metrics, params, and tags is as follows:
	//
	// * Metrics: metric values are never overwritten. Logging a metric (key, value,
	// timestamp) appends to the set of values for the metric with the provided key.
	//
	// * Tags: tag values can be overwritten by successive writes to the same tag
	// key. That is, if multiple tag values with the same key are provided in the
	// same API request, the last-provided tag value is written. Logging the same
	// tag (key, value) is permitted. Specifically, logging a tag is idempotent.
	//
	// * Parameters: once written, param values cannot be changed (attempting to
	// overwrite a param value will result in an error). However, logging the same
	// param (key, value) is permitted. Specifically, logging a param is idempotent.
	//
	// Request Limits ------------------------------- A single JSON-serialized API
	// request may be up to 1 MB in size and contain:
	//
	// * No more than 1000 metrics, params, and tags in total * Up to 1000 metrics *
	// Up to 100 params * Up to 100 tags
	//
	// For example, a valid request might contain 900 metrics, 50 params, and 50
	// tags, but logging 900 metrics, 50 params, and 51 tags is invalid.
	//
	// The following limits also apply to metric, param, and tag keys and values:
	//
	// * Metric keys, param keys, and tag keys can be up to 250 characters in length
	// * Parameter and tag values can be up to 250 characters in length
	LogBatch(ctx context.Context, request LogBatch) error

	// Log inputs to a run.
	//
	// **NOTE:** Experimental: This API may change or be removed in a future release
	// without warning.
	LogInputs(ctx context.Context, request LogInputs) error

	// Log a metric.
	//
	// Logs a metric for a run. A metric is a key-value pair (string key, float
	// value) with an associated timestamp. Examples include the various metrics
	// that represent ML model accuracy. A metric can be logged multiple times.
	LogMetric(ctx context.Context, request LogMetric) error

	// Log a model.
	//
	// **NOTE:** Experimental: This API may change or be removed in a future release
	// without warning.
	LogModel(ctx context.Context, request LogModel) error

	// Log a param.
	//
	// Logs a param used for a run. A param is a key-value pair (string key, string
	// value). Examples include hyperparameters used for ML model training and
	// constant dates and values used in an ETL pipeline. A param can be logged only
	// once for a run.
	LogParam(ctx context.Context, request LogParam) error

	// Restores an experiment.
	//
	// Restore an experiment marked for deletion. This also restores associated
	// metadata, runs, metrics, params, and tags. If experiment uses FileStore,
	// underlying artifacts associated with experiment are also restored.
	//
	// Throws `RESOURCE_DOES_NOT_EXIST` if experiment was never created or was
	// permanently deleted.
	RestoreExperiment(ctx context.Context, request RestoreExperiment) error

	// Restore a run.
	//
	// Restores a deleted run.
	RestoreRun(ctx context.Context, request RestoreRun) error

	// Restore runs by deletion time.
	//
	// Bulk restore runs in an experiment that were deleted no earlier than the
	// specified timestamp. Restores at most max_runs per request. To call this API
	// from a Databricks Notebook in Python, you can use the client code snippet on
	// https://learn.microsoft.com/en-us/azure/databricks/mlflow/runs#bulk-restore.
	RestoreRuns(ctx context.Context, request RestoreRuns) (*RestoreRunsResponse, error)

	// Search experiments.
	//
	// Searches for experiments that satisfy specified search criteria.
	//
	// This method is generated by Databricks SDK Code Generator.
	SearchExperiments(ctx context.Context, request SearchExperiments) listing.Iterator[Experiment]

	// Search experiments.
	//
	// Searches for experiments that satisfy specified search criteria.
	//
	// This method is generated by Databricks SDK Code Generator.
	SearchExperimentsAll(ctx context.Context, request SearchExperiments) ([]Experiment, error)

	// Search for runs.
	//
	// Searches for runs that satisfy expressions.
	//
	// Search expressions can use `mlflowMetric` and `mlflowParam` keys.",
	//
	// This method is generated by Databricks SDK Code Generator.
	SearchRuns(ctx context.Context, request SearchRuns) listing.Iterator[Run]

	// Search for runs.
	//
	// Searches for runs that satisfy expressions.
	//
	// Search expressions can use `mlflowMetric` and `mlflowParam` keys.",
	//
	// This method is generated by Databricks SDK Code Generator.
	SearchRunsAll(ctx context.Context, request SearchRuns) ([]Run, error)

	// Set a tag.
	//
	// Sets a tag on an experiment. Experiment tags are metadata that can be
	// updated.
	SetExperimentTag(ctx context.Context, request SetExperimentTag) error

	// Set experiment permissions.
	//
	// Sets permissions on an experiment. Experiments can inherit permissions from
	// their root object.
	SetPermissions(ctx context.Context, request ExperimentPermissionsRequest) (*ExperimentPermissions, error)

	// Set a tag.
	//
	// Sets a tag on a run. Tags are run metadata that can be updated during a run
	// and after a run completes.
	SetTag(ctx context.Context, request SetTag) error

	// Update an experiment.
	//
	// Updates experiment metadata.
	UpdateExperiment(ctx context.Context, request UpdateExperiment) error

	// Update experiment permissions.
	//
	// Updates the permissions on an experiment. Experiments can inherit permissions
	// from their root object.
	UpdatePermissions(ctx context.Context, request ExperimentPermissionsRequest) (*ExperimentPermissions, error)

	// Update a run.
	//
	// Updates run metadata.
	UpdateRun(ctx context.Context, request UpdateRun) (*UpdateRunResponse, error)
}

type ExperimentsService

type ExperimentsService interface {

	// Create experiment.
	//
	// Creates an experiment with a name. Returns the ID of the newly created
	// experiment. Validates that another experiment with the same name does not
	// already exist and fails if another experiment with the same name already
	// exists.
	//
	// Throws `RESOURCE_ALREADY_EXISTS` if a experiment with the given name
	// exists.
	CreateExperiment(ctx context.Context, request CreateExperiment) (*CreateExperimentResponse, error)

	// Create a run.
	//
	// Creates a new run within an experiment. A run is usually a single
	// execution of a machine learning or data ETL pipeline. MLflow uses runs to
	// track the `mlflowParam`, `mlflowMetric` and `mlflowRunTag` associated
	// with a single execution.
	CreateRun(ctx context.Context, request CreateRun) (*CreateRunResponse, error)

	// Delete an experiment.
	//
	// Marks an experiment and associated metadata, runs, metrics, params, and
	// tags for deletion. If the experiment uses FileStore, artifacts associated
	// with experiment are also deleted.
	DeleteExperiment(ctx context.Context, request DeleteExperiment) error

	// Delete a run.
	//
	// Marks a run for deletion.
	DeleteRun(ctx context.Context, request DeleteRun) error

	// Delete runs by creation time.
	//
	// Bulk delete runs in an experiment that were created prior to or at the
	// specified timestamp. Deletes at most max_runs per request. To call this
	// API from a Databricks Notebook in Python, you can use the client code
	// snippet on
	// https://learn.microsoft.com/en-us/azure/databricks/mlflow/runs#bulk-delete.
	DeleteRuns(ctx context.Context, request DeleteRuns) (*DeleteRunsResponse, error)

	// Delete a tag.
	//
	// Deletes a tag on a run. Tags are run metadata that can be updated during
	// a run and after a run completes.
	DeleteTag(ctx context.Context, request DeleteTag) error

	// Get metadata.
	//
	// Gets metadata for an experiment.
	//
	// This endpoint will return deleted experiments, but prefers the active
	// experiment if an active and deleted experiment share the same name. If
	// multiple deleted experiments share the same name, the API will return one
	// of them.
	//
	// Throws `RESOURCE_DOES_NOT_EXIST` if no experiment with the specified name
	// exists.
	GetByName(ctx context.Context, request GetByNameRequest) (*GetExperimentResponse, error)

	// Get an experiment.
	//
	// Gets metadata for an experiment. This method works on deleted
	// experiments.
	GetExperiment(ctx context.Context, request GetExperimentRequest) (*GetExperimentResponse, error)

	// Get history of a given metric within a run.
	//
	// Gets a list of all values for the specified metric for a given run.
	//
	// Use GetHistoryAll() to get all Metric instances, which will iterate over every result page.
	GetHistory(ctx context.Context, request GetHistoryRequest) (*GetMetricHistoryResponse, error)

	// Get experiment permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevels(ctx context.Context, request GetExperimentPermissionLevelsRequest) (*GetExperimentPermissionLevelsResponse, error)

	// Get experiment permissions.
	//
	// Gets the permissions of an experiment. Experiments can inherit
	// permissions from their root object.
	GetPermissions(ctx context.Context, request GetExperimentPermissionsRequest) (*ExperimentPermissions, error)

	// Get a run.
	//
	// Gets the metadata, metrics, params, and tags for a run. In the case where
	// multiple metrics with the same key are logged for a run, return only the
	// value with the latest timestamp.
	//
	// If there are multiple values with the latest timestamp, return the
	// maximum of these values.
	GetRun(ctx context.Context, request GetRunRequest) (*GetRunResponse, error)

	// Get all artifacts.
	//
	// List artifacts for a run. Takes an optional `artifact_path` prefix. If it
	// is specified, the response contains only artifacts with the specified
	// prefix.",
	//
	// Use ListArtifactsAll() to get all FileInfo instances, which will iterate over every result page.
	ListArtifacts(ctx context.Context, request ListArtifactsRequest) (*ListArtifactsResponse, error)

	// List experiments.
	//
	// Gets a list of all experiments.
	//
	// Use ListExperimentsAll() to get all Experiment instances, which will iterate over every result page.
	ListExperiments(ctx context.Context, request ListExperimentsRequest) (*ListExperimentsResponse, error)

	// Log a batch.
	//
	// Logs a batch of metrics, params, and tags for a run. If any data failed
	// to be persisted, the server will respond with an error (non-200 status
	// code).
	//
	// In case of error (due to internal server error or an invalid request),
	// partial data may be written.
	//
	// You can write metrics, params, and tags in interleaving fashion, but
	// within a given entity type are guaranteed to follow the order specified
	// in the request body.
	//
	// The overwrite behavior for metrics, params, and tags is as follows:
	//
	// * Metrics: metric values are never overwritten. Logging a metric (key,
	// value, timestamp) appends to the set of values for the metric with the
	// provided key.
	//
	// * Tags: tag values can be overwritten by successive writes to the same
	// tag key. That is, if multiple tag values with the same key are provided
	// in the same API request, the last-provided tag value is written. Logging
	// the same tag (key, value) is permitted. Specifically, logging a tag is
	// idempotent.
	//
	// * Parameters: once written, param values cannot be changed (attempting to
	// overwrite a param value will result in an error). However, logging the
	// same param (key, value) is permitted. Specifically, logging a param is
	// idempotent.
	//
	// Request Limits ------------------------------- A single JSON-serialized
	// API request may be up to 1 MB in size and contain:
	//
	// * No more than 1000 metrics, params, and tags in total * Up to 1000
	// metrics * Up to 100 params * Up to 100 tags
	//
	// For example, a valid request might contain 900 metrics, 50 params, and 50
	// tags, but logging 900 metrics, 50 params, and 51 tags is invalid.
	//
	// The following limits also apply to metric, param, and tag keys and
	// values:
	//
	// * Metric keys, param keys, and tag keys can be up to 250 characters in
	// length * Parameter and tag values can be up to 250 characters in length
	LogBatch(ctx context.Context, request LogBatch) error

	// Log inputs to a run.
	//
	// **NOTE:** Experimental: This API may change or be removed in a future
	// release without warning.
	LogInputs(ctx context.Context, request LogInputs) error

	// Log a metric.
	//
	// Logs a metric for a run. A metric is a key-value pair (string key, float
	// value) with an associated timestamp. Examples include the various metrics
	// that represent ML model accuracy. A metric can be logged multiple times.
	LogMetric(ctx context.Context, request LogMetric) error

	// Log a model.
	//
	// **NOTE:** Experimental: This API may change or be removed in a future
	// release without warning.
	LogModel(ctx context.Context, request LogModel) error

	// Log a param.
	//
	// Logs a param used for a run. A param is a key-value pair (string key,
	// string value). Examples include hyperparameters used for ML model
	// training and constant dates and values used in an ETL pipeline. A param
	// can be logged only once for a run.
	LogParam(ctx context.Context, request LogParam) error

	// Restores an experiment.
	//
	// Restore an experiment marked for deletion. This also restores associated
	// metadata, runs, metrics, params, and tags. If experiment uses FileStore,
	// underlying artifacts associated with experiment are also restored.
	//
	// Throws `RESOURCE_DOES_NOT_EXIST` if experiment was never created or was
	// permanently deleted.
	RestoreExperiment(ctx context.Context, request RestoreExperiment) error

	// Restore a run.
	//
	// Restores a deleted run.
	RestoreRun(ctx context.Context, request RestoreRun) error

	// Restore runs by deletion time.
	//
	// Bulk restore runs in an experiment that were deleted no earlier than the
	// specified timestamp. Restores at most max_runs per request. To call this
	// API from a Databricks Notebook in Python, you can use the client code
	// snippet on
	// https://learn.microsoft.com/en-us/azure/databricks/mlflow/runs#bulk-restore.
	RestoreRuns(ctx context.Context, request RestoreRuns) (*RestoreRunsResponse, error)

	// Search experiments.
	//
	// Searches for experiments that satisfy specified search criteria.
	//
	// Use SearchExperimentsAll() to get all Experiment instances, which will iterate over every result page.
	SearchExperiments(ctx context.Context, request SearchExperiments) (*SearchExperimentsResponse, error)

	// Search for runs.
	//
	// Searches for runs that satisfy expressions.
	//
	// Search expressions can use `mlflowMetric` and `mlflowParam` keys.",
	//
	// Use SearchRunsAll() to get all Run instances, which will iterate over every result page.
	SearchRuns(ctx context.Context, request SearchRuns) (*SearchRunsResponse, error)

	// Set a tag.
	//
	// Sets a tag on an experiment. Experiment tags are metadata that can be
	// updated.
	SetExperimentTag(ctx context.Context, request SetExperimentTag) error

	// Set experiment permissions.
	//
	// Sets permissions on an experiment. Experiments can inherit permissions
	// from their root object.
	SetPermissions(ctx context.Context, request ExperimentPermissionsRequest) (*ExperimentPermissions, error)

	// Set a tag.
	//
	// Sets a tag on a run. Tags are run metadata that can be updated during a
	// run and after a run completes.
	SetTag(ctx context.Context, request SetTag) error

	// Update an experiment.
	//
	// Updates experiment metadata.
	UpdateExperiment(ctx context.Context, request UpdateExperiment) error

	// Update experiment permissions.
	//
	// Updates the permissions on an experiment. Experiments can inherit
	// permissions from their root object.
	UpdatePermissions(ctx context.Context, request ExperimentPermissionsRequest) (*ExperimentPermissions, error)

	// Update a run.
	//
	// Updates run metadata.
	UpdateRun(ctx context.Context, request UpdateRun) (*UpdateRunResponse, error)
}

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 analysis in other tools. Experiments are maintained in a Databricks hosted MLflow tracking server.

Experiments are located in the workspace file tree. You manage experiments using the same tools you use to manage other workspace objects such as folders, notebooks, and libraries.

type FileInfo

type FileInfo struct {
	// Size in bytes. Unset for directories.
	FileSize int64 `json:"file_size,omitempty"`
	// Whether the path is a directory.
	IsDir bool `json:"is_dir,omitempty"`
	// Path relative to the root artifact directory run.
	Path string `json:"path,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (FileInfo) MarshalJSON added in v0.23.0

func (s FileInfo) MarshalJSON() ([]byte, error)

func (*FileInfo) UnmarshalJSON added in v0.23.0

func (s *FileInfo) UnmarshalJSON(b []byte) error

type GetByNameRequest

type GetByNameRequest struct {
	// Name of the associated experiment.
	ExperimentName string `json:"-" url:"experiment_name"`
}

Get metadata

type GetExperimentPermissionLevelsRequest added in v0.15.0

type GetExperimentPermissionLevelsRequest struct {
	// The experiment for which to get or manage permissions.
	ExperimentId string `json:"-" url:"-"`
}

Get experiment permission levels

type GetExperimentPermissionLevelsResponse added in v0.15.0

type GetExperimentPermissionLevelsResponse struct {
	// Specific permission levels
	PermissionLevels []ExperimentPermissionsDescription `json:"permission_levels,omitempty"`
}

type GetExperimentPermissionsRequest added in v0.15.0

type GetExperimentPermissionsRequest struct {
	// The experiment for which to get or manage permissions.
	ExperimentId string `json:"-" url:"-"`
}

Get experiment permissions

type GetExperimentRequest

type GetExperimentRequest struct {
	// ID of the associated experiment.
	ExperimentId string `json:"-" url:"experiment_id"`
}

Get an experiment

type GetExperimentResponse added in v0.18.0

type GetExperimentResponse struct {
	// Experiment details.
	Experiment *Experiment `json:"experiment,omitempty"`
}

type GetHistoryRequest

type GetHistoryRequest struct {
	// Maximum number of Metric records to return per paginated request. Default
	// is set to 25,000. If set higher than 25,000, a request Exception will be
	// raised.
	MaxResults int `json:"-" url:"max_results,omitempty"`
	// Name of the metric.
	MetricKey string `json:"-" url:"metric_key"`
	// Token indicating the page of metric histories to fetch.
	PageToken string `json:"-" url:"page_token,omitempty"`
	// ID of the run from which to fetch metric values. Must be provided.
	RunId string `json:"-" url:"run_id,omitempty"`
	// [Deprecated, use run_id instead] ID of the run from which to fetch metric
	// values. This field will be removed in a future MLflow version.
	RunUuid string `json:"-" url:"run_uuid,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get history of a given metric within a run

func (GetHistoryRequest) MarshalJSON added in v0.23.0

func (s GetHistoryRequest) MarshalJSON() ([]byte, error)

func (*GetHistoryRequest) UnmarshalJSON added in v0.23.0

func (s *GetHistoryRequest) UnmarshalJSON(b []byte) error

type GetLatestVersionsRequest

type GetLatestVersionsRequest struct {
	// Registered model unique name identifier.
	Name string `json:"name"`
	// List of stages.
	Stages []string `json:"stages,omitempty"`
}

type GetLatestVersionsResponse

type GetLatestVersionsResponse struct {
	// Latest version models for each requests stage. Only return models with
	// current `READY` status. If no `stages` provided, returns the latest
	// version for each stage, including `"None"`.
	ModelVersions []ModelVersion `json:"model_versions,omitempty"`
}

type GetMetricHistoryResponse

type GetMetricHistoryResponse struct {
	// All logged values for this metric.
	Metrics []Metric `json:"metrics,omitempty"`
	// Token that can be used to retrieve the next page of metric history
	// results
	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (GetMetricHistoryResponse) MarshalJSON added in v0.23.0

func (s GetMetricHistoryResponse) MarshalJSON() ([]byte, error)

func (*GetMetricHistoryResponse) UnmarshalJSON added in v0.23.0

func (s *GetMetricHistoryResponse) UnmarshalJSON(b []byte) error

type GetModelRequest

type GetModelRequest struct {
	// Registered model unique name identifier.
	Name string `json:"-" url:"name"`
}

Get model

type GetModelResponse

type GetModelResponse struct {
	RegisteredModelDatabricks *ModelDatabricks `json:"registered_model_databricks,omitempty"`
}

type GetModelVersionDownloadUriRequest

type GetModelVersionDownloadUriRequest struct {
	// Name of the registered model
	Name string `json:"-" url:"name"`
	// Model version number
	Version string `json:"-" url:"version"`
}

Get a model version URI

type GetModelVersionDownloadUriResponse

type GetModelVersionDownloadUriResponse struct {
	// URI corresponding to where artifacts for this model version are stored.
	ArtifactUri string `json:"artifact_uri,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (GetModelVersionDownloadUriResponse) MarshalJSON added in v0.23.0

func (s GetModelVersionDownloadUriResponse) MarshalJSON() ([]byte, error)

func (*GetModelVersionDownloadUriResponse) UnmarshalJSON added in v0.23.0

func (s *GetModelVersionDownloadUriResponse) UnmarshalJSON(b []byte) error

type GetModelVersionRequest

type GetModelVersionRequest struct {
	// Name of the registered model
	Name string `json:"-" url:"name"`
	// Model version number
	Version string `json:"-" url:"version"`
}

Get a model version

type GetModelVersionResponse

type GetModelVersionResponse struct {
	ModelVersion *ModelVersion `json:"model_version,omitempty"`
}

type GetRegisteredModelPermissionLevelsRequest added in v0.15.0

type GetRegisteredModelPermissionLevelsRequest struct {
	// The registered model for which to get or manage permissions.
	RegisteredModelId string `json:"-" url:"-"`
}

Get registered model permission levels

type GetRegisteredModelPermissionLevelsResponse added in v0.15.0

type GetRegisteredModelPermissionLevelsResponse struct {
	// Specific permission levels
	PermissionLevels []RegisteredModelPermissionsDescription `json:"permission_levels,omitempty"`
}

type GetRegisteredModelPermissionsRequest added in v0.15.0

type GetRegisteredModelPermissionsRequest struct {
	// The registered model for which to get or manage permissions.
	RegisteredModelId string `json:"-" url:"-"`
}

Get registered model permissions

type GetRunRequest

type GetRunRequest struct {
	// ID of the run to fetch. Must be provided.
	RunId string `json:"-" url:"run_id"`
	// [Deprecated, use run_id instead] ID of the run to fetch. This field will
	// be removed in a future MLflow version.
	RunUuid string `json:"-" url:"run_uuid,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get a run

func (GetRunRequest) MarshalJSON added in v0.23.0

func (s GetRunRequest) MarshalJSON() ([]byte, error)

func (*GetRunRequest) UnmarshalJSON added in v0.23.0

func (s *GetRunRequest) UnmarshalJSON(b []byte) error

type GetRunResponse

type GetRunResponse struct {
	// Run metadata (name, start time, etc) and data (metrics, params, and
	// tags).
	Run *Run `json:"run,omitempty"`
}

type HttpUrlSpec

type HttpUrlSpec struct {
	// Value of the authorization header that should be sent in the request sent
	// by the wehbook. It should be of the form `"<auth type> <credentials>"`.
	// If set to an empty string, no authorization header will be included in
	// the request.
	Authorization string `json:"authorization,omitempty"`
	// Enable/disable SSL certificate validation. Default is true. For
	// self-signed certificates, this field must be false AND the destination
	// server must disable certificate validation as well. For security
	// purposes, it is encouraged to perform secret validation with the
	// HMAC-encoded portion of the payload and acknowledge the risk associated
	// with disabling hostname validation whereby it becomes more likely that
	// requests can be maliciously routed to an unintended host.
	EnableSslVerification bool `json:"enable_ssl_verification,omitempty"`
	// Shared secret required for HMAC encoding payload. The HMAC-encoded
	// payload will be sent in the header as: { "X-Databricks-Signature":
	// $encoded_payload }.
	Secret string `json:"secret,omitempty"`
	// External HTTPS URL called on event trigger (by using a POST request).
	Url string `json:"url"`

	ForceSendFields []string `json:"-"`
}

func (HttpUrlSpec) MarshalJSON added in v0.23.0

func (s HttpUrlSpec) MarshalJSON() ([]byte, error)

func (*HttpUrlSpec) UnmarshalJSON added in v0.23.0

func (s *HttpUrlSpec) UnmarshalJSON(b []byte) error

type HttpUrlSpecWithoutSecret

type HttpUrlSpecWithoutSecret struct {
	// Enable/disable SSL certificate validation. Default is true. For
	// self-signed certificates, this field must be false AND the destination
	// server must disable certificate validation as well. For security
	// purposes, it is encouraged to perform secret validation with the
	// HMAC-encoded portion of the payload and acknowledge the risk associated
	// with disabling hostname validation whereby it becomes more likely that
	// requests can be maliciously routed to an unintended host.
	EnableSslVerification bool `json:"enable_ssl_verification,omitempty"`
	// External HTTPS URL called on event trigger (by using a POST request).
	Url string `json:"url,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (HttpUrlSpecWithoutSecret) MarshalJSON added in v0.23.0

func (s HttpUrlSpecWithoutSecret) MarshalJSON() ([]byte, error)

func (*HttpUrlSpecWithoutSecret) UnmarshalJSON added in v0.23.0

func (s *HttpUrlSpecWithoutSecret) UnmarshalJSON(b []byte) error

type InputTag added in v0.9.0

type InputTag struct {
	// The tag key.
	Key string `json:"key,omitempty"`
	// The tag value.
	Value string `json:"value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (InputTag) MarshalJSON added in v0.23.0

func (s InputTag) MarshalJSON() ([]byte, error)

func (*InputTag) UnmarshalJSON added in v0.23.0

func (s *InputTag) UnmarshalJSON(b []byte) error

type JobSpec

type JobSpec struct {
	// The personal access token used to authorize webhook's job runs.
	AccessToken string `json:"access_token"`
	// ID of the job that the webhook runs.
	JobId string `json:"job_id"`
	// URL of the workspace containing the job that this webhook runs. If not
	// specified, the job’s workspace URL is assumed to be the same as the
	// workspace where the webhook is created.
	WorkspaceUrl string `json:"workspace_url,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (JobSpec) MarshalJSON added in v0.23.0

func (s JobSpec) MarshalJSON() ([]byte, error)

func (*JobSpec) UnmarshalJSON added in v0.23.0

func (s *JobSpec) UnmarshalJSON(b []byte) error

type JobSpecWithoutSecret

type JobSpecWithoutSecret struct {
	// ID of the job that the webhook runs.
	JobId string `json:"job_id,omitempty"`
	// URL of the workspace containing the job that this webhook runs. Defaults
	// to the workspace URL in which the webhook is created. If not specified,
	// the job’s workspace is assumed to be the same as the webhook’s.
	WorkspaceUrl string `json:"workspace_url,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (JobSpecWithoutSecret) MarshalJSON added in v0.23.0

func (s JobSpecWithoutSecret) MarshalJSON() ([]byte, error)

func (*JobSpecWithoutSecret) UnmarshalJSON added in v0.23.0

func (s *JobSpecWithoutSecret) UnmarshalJSON(b []byte) error

type ListArtifactsRequest

type ListArtifactsRequest struct {
	// Token indicating the page of artifact results to fetch
	PageToken string `json:"-" url:"page_token,omitempty"`
	// Filter artifacts matching this path (a relative path from the root
	// artifact directory).
	Path string `json:"-" url:"path,omitempty"`
	// ID of the run whose artifacts to list. Must be provided.
	RunId string `json:"-" url:"run_id,omitempty"`
	// [Deprecated, use run_id instead] ID of the run whose artifacts to list.
	// This field will be removed in a future MLflow version.
	RunUuid string `json:"-" url:"run_uuid,omitempty"`

	ForceSendFields []string `json:"-"`
}

Get all artifacts

func (ListArtifactsRequest) MarshalJSON added in v0.23.0

func (s ListArtifactsRequest) MarshalJSON() ([]byte, error)

func (*ListArtifactsRequest) UnmarshalJSON added in v0.23.0

func (s *ListArtifactsRequest) UnmarshalJSON(b []byte) error

type ListArtifactsResponse

type ListArtifactsResponse struct {
	// File location and metadata for artifacts.
	Files []FileInfo `json:"files,omitempty"`
	// Token that can be used to retrieve the next page of artifact results
	NextPageToken string `json:"next_page_token,omitempty"`
	// Root artifact directory for the run.
	RootUri string `json:"root_uri,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ListArtifactsResponse) MarshalJSON added in v0.23.0

func (s ListArtifactsResponse) MarshalJSON() ([]byte, error)

func (*ListArtifactsResponse) UnmarshalJSON added in v0.23.0

func (s *ListArtifactsResponse) UnmarshalJSON(b []byte) error

type ListExperimentsRequest

type ListExperimentsRequest struct {
	// Maximum number of experiments desired. If `max_results` is unspecified,
	// return all experiments. If `max_results` is too large, it'll be
	// automatically capped at 1000. Callers of this endpoint are encouraged to
	// pass max_results explicitly and leverage page_token to iterate through
	// experiments.
	MaxResults int `json:"-" url:"max_results,omitempty"`
	// Token indicating the page of experiments to fetch
	PageToken string `json:"-" url:"page_token,omitempty"`
	// Qualifier for type of experiments to be returned. If unspecified, return
	// only active experiments.
	ViewType string `json:"-" url:"view_type,omitempty"`

	ForceSendFields []string `json:"-"`
}

List experiments

func (ListExperimentsRequest) MarshalJSON added in v0.23.0

func (s ListExperimentsRequest) MarshalJSON() ([]byte, error)

func (*ListExperimentsRequest) UnmarshalJSON added in v0.23.0

func (s *ListExperimentsRequest) UnmarshalJSON(b []byte) error

type ListExperimentsResponse

type ListExperimentsResponse struct {
	// Paginated Experiments beginning with the first item on the requested
	// page.
	Experiments []Experiment `json:"experiments,omitempty"`
	// Token that can be used to retrieve the next page of experiments. Empty
	// token means no more experiment is available for retrieval.
	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ListExperimentsResponse) MarshalJSON added in v0.23.0

func (s ListExperimentsResponse) MarshalJSON() ([]byte, error)

func (*ListExperimentsResponse) UnmarshalJSON added in v0.23.0

func (s *ListExperimentsResponse) UnmarshalJSON(b []byte) error

type ListModelsRequest

type ListModelsRequest struct {
	// Maximum number of registered models desired. Max threshold is 1000.
	MaxResults int `json:"-" url:"max_results,omitempty"`
	// Pagination token to go to the next page based on a previous query.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

List models

func (ListModelsRequest) MarshalJSON added in v0.23.0

func (s ListModelsRequest) MarshalJSON() ([]byte, error)

func (*ListModelsRequest) UnmarshalJSON added in v0.23.0

func (s *ListModelsRequest) UnmarshalJSON(b []byte) error

type ListModelsResponse

type ListModelsResponse struct {
	// Pagination token to request next page of models for the same query.
	NextPageToken string `json:"next_page_token,omitempty"`

	RegisteredModels []Model `json:"registered_models,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ListModelsResponse) MarshalJSON added in v0.23.0

func (s ListModelsResponse) MarshalJSON() ([]byte, error)

func (*ListModelsResponse) UnmarshalJSON added in v0.23.0

func (s *ListModelsResponse) UnmarshalJSON(b []byte) error

type ListRegistryWebhooks

type ListRegistryWebhooks struct {
	// Token that can be used to retrieve the next page of artifact results
	NextPageToken string `json:"next_page_token,omitempty"`
	// Array of registry webhooks.
	Webhooks []RegistryWebhook `json:"webhooks,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ListRegistryWebhooks) MarshalJSON added in v0.23.0

func (s ListRegistryWebhooks) MarshalJSON() ([]byte, error)

func (*ListRegistryWebhooks) UnmarshalJSON added in v0.23.0

func (s *ListRegistryWebhooks) UnmarshalJSON(b []byte) error

type ListTransitionRequestsRequest

type ListTransitionRequestsRequest struct {
	// Name of the model.
	Name string `json:"-" url:"name"`
	// Version of the model.
	Version string `json:"-" url:"version"`
}

List transition requests

type ListTransitionRequestsResponse

type ListTransitionRequestsResponse struct {
	// Array of open transition requests.
	Requests []Activity `json:"requests,omitempty"`
}

type ListWebhooksRequest

type ListWebhooksRequest struct {
	// If `events` is specified, any webhook with one or more of the specified
	// trigger events is included in the output. If `events` is not specified,
	// webhooks of all event types are included in the output.
	Events []RegistryWebhookEvent `json:"-" url:"events,omitempty"`
	// If not specified, all webhooks associated with the specified events are
	// listed, regardless of their associated model.
	ModelName string `json:"-" url:"model_name,omitempty"`
	// Token indicating the page of artifact results to fetch
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

List registry webhooks

func (ListWebhooksRequest) MarshalJSON added in v0.23.0

func (s ListWebhooksRequest) MarshalJSON() ([]byte, error)

func (*ListWebhooksRequest) UnmarshalJSON added in v0.23.0

func (s *ListWebhooksRequest) UnmarshalJSON(b []byte) error

type LogBatch

type LogBatch struct {
	// Metrics to log. A single request can contain up to 1000 metrics, and up
	// to 1000 metrics, params, and tags in total.
	Metrics []Metric `json:"metrics,omitempty"`
	// Params to log. A single request can contain up to 100 params, and up to
	// 1000 metrics, params, and tags in total.
	Params []Param `json:"params,omitempty"`
	// ID of the run to log under
	RunId string `json:"run_id,omitempty"`
	// Tags to log. A single request can contain up to 100 tags, and up to 1000
	// metrics, params, and tags in total.
	Tags []RunTag `json:"tags,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (LogBatch) MarshalJSON added in v0.23.0

func (s LogBatch) MarshalJSON() ([]byte, error)

func (*LogBatch) UnmarshalJSON added in v0.23.0

func (s *LogBatch) UnmarshalJSON(b []byte) error

type LogBatchResponse added in v0.34.0

type LogBatchResponse struct {
}

type LogInputs added in v0.9.0

type LogInputs struct {
	// Dataset inputs
	Datasets []DatasetInput `json:"datasets,omitempty"`
	// ID of the run to log under
	RunId string `json:"run_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (LogInputs) MarshalJSON added in v0.23.0

func (s LogInputs) MarshalJSON() ([]byte, error)

func (*LogInputs) UnmarshalJSON added in v0.23.0

func (s *LogInputs) UnmarshalJSON(b []byte) error

type LogInputsResponse added in v0.34.0

type LogInputsResponse struct {
}

type LogMetric

type LogMetric struct {
	// Name of the metric.
	Key string `json:"key"`
	// ID of the run under which to log the metric. Must be provided.
	RunId string `json:"run_id,omitempty"`
	// [Deprecated, use run_id instead] ID of the run under which to log the
	// metric. This field will be removed in a future MLflow version.
	RunUuid string `json:"run_uuid,omitempty"`
	// Step at which to log the metric
	Step int64 `json:"step,omitempty"`
	// Unix timestamp in milliseconds at the time metric was logged.
	Timestamp int64 `json:"timestamp"`
	// Double value of the metric being logged.
	Value float64 `json:"value"`

	ForceSendFields []string `json:"-"`
}

func (LogMetric) MarshalJSON added in v0.23.0

func (s LogMetric) MarshalJSON() ([]byte, error)

func (*LogMetric) UnmarshalJSON added in v0.23.0

func (s *LogMetric) UnmarshalJSON(b []byte) error

type LogMetricResponse added in v0.34.0

type LogMetricResponse struct {
}

type LogModel

type LogModel struct {
	// MLmodel file in json format.
	ModelJson string `json:"model_json,omitempty"`
	// ID of the run to log under
	RunId string `json:"run_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (LogModel) MarshalJSON added in v0.23.0

func (s LogModel) MarshalJSON() ([]byte, error)

func (*LogModel) UnmarshalJSON added in v0.23.0

func (s *LogModel) UnmarshalJSON(b []byte) error

type LogModelResponse added in v0.34.0

type LogModelResponse struct {
}

type LogParam

type LogParam struct {
	// Name of the param. Maximum size is 255 bytes.
	Key string `json:"key"`
	// ID of the run under which to log the param. Must be provided.
	RunId string `json:"run_id,omitempty"`
	// [Deprecated, use run_id instead] ID of the run under which to log the
	// param. This field will be removed in a future MLflow version.
	RunUuid string `json:"run_uuid,omitempty"`
	// String value of the param being logged. Maximum size is 500 bytes.
	Value string `json:"value"`

	ForceSendFields []string `json:"-"`
}

func (LogParam) MarshalJSON added in v0.23.0

func (s LogParam) MarshalJSON() ([]byte, error)

func (*LogParam) UnmarshalJSON added in v0.23.0

func (s *LogParam) UnmarshalJSON(b []byte) error

type LogParamResponse added in v0.34.0

type LogParamResponse struct {
}

type Metric

type Metric struct {
	// Key identifying this metric.
	Key string `json:"key,omitempty"`
	// Step at which to log the metric.
	Step int64 `json:"step,omitempty"`
	// The timestamp at which this metric was recorded.
	Timestamp int64 `json:"timestamp,omitempty"`
	// Value associated with this metric.
	Value float64 `json:"value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (Metric) MarshalJSON added in v0.23.0

func (s Metric) MarshalJSON() ([]byte, error)

func (*Metric) UnmarshalJSON added in v0.23.0

func (s *Metric) UnmarshalJSON(b []byte) error

type Model

type Model struct {
	// Timestamp recorded when this `registered_model` was created.
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// Description of this `registered_model`.
	Description string `json:"description,omitempty"`
	// Timestamp recorded when metadata for this `registered_model` was last
	// updated.
	LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
	// Collection of latest model versions for each stage. Only contains models
	// with current `READY` status.
	LatestVersions []ModelVersion `json:"latest_versions,omitempty"`
	// Unique name for the model.
	Name string `json:"name,omitempty"`
	// Tags: Additional metadata key-value pairs for this `registered_model`.
	Tags []ModelTag `json:"tags,omitempty"`
	// User that created this `registered_model`
	UserId string `json:"user_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (Model) MarshalJSON added in v0.23.0

func (s Model) MarshalJSON() ([]byte, error)

func (*Model) UnmarshalJSON added in v0.23.0

func (s *Model) UnmarshalJSON(b []byte) error

type ModelDatabricks

type ModelDatabricks struct {
	// Creation time of the object, as a Unix timestamp in milliseconds.
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// User-specified description for the object.
	Description string `json:"description,omitempty"`
	// Unique identifier for the object.
	Id string `json:"id,omitempty"`
	// Time of the object at last update, as a Unix timestamp in milliseconds.
	LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
	// Array of model versions, each the latest version for its stage.
	LatestVersions []ModelVersion `json:"latest_versions,omitempty"`
	// Name of the model.
	Name string `json:"name,omitempty"`
	// Permission level of the requesting user on the object. For what is
	// allowed at each level, see [MLflow Model permissions](..).
	PermissionLevel PermissionLevel `json:"permission_level,omitempty"`
	// Array of tags associated with the model.
	Tags []ModelTag `json:"tags,omitempty"`
	// The username of the user that created the object.
	UserId string `json:"user_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ModelDatabricks) MarshalJSON added in v0.23.0

func (s ModelDatabricks) MarshalJSON() ([]byte, error)

func (*ModelDatabricks) UnmarshalJSON added in v0.23.0

func (s *ModelDatabricks) UnmarshalJSON(b []byte) error

type ModelRegistryAPI

type ModelRegistryAPI struct {
	// contains filtered or unexported fields
}

Note: This API reference documents APIs for the Workspace Model Registry. Databricks recommends using [Models in Unity Catalog](/api/workspace/registeredmodels) instead. Models in Unity Catalog provides centralized model governance, cross-workspace access, lineage, and deployment. Workspace Model Registry will be deprecated in the future.

The Workspace Model Registry is a centralized model repository and a UI and set of APIs that enable you to manage the full lifecycle of MLflow Models.

func NewModelRegistry

func NewModelRegistry(client *client.DatabricksClient) *ModelRegistryAPI

func (*ModelRegistryAPI) ApproveTransitionRequest

Approve transition request.

Approves a model version stage transition request.

func (*ModelRegistryAPI) CreateComment

func (a *ModelRegistryAPI) CreateComment(ctx context.Context, request CreateComment) (*CreateCommentResponse, error)

Post a comment.

Posts a comment on a model version. A comment can be submitted either by a user or programmatically to display relevant information about the model. For example, test results or deployment errors.

Example (ModelVersionComments)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

model, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)

mv, err := w.ModelRegistry.CreateModelVersion(ctx, ml.CreateModelVersionRequest{
	Name:   model.RegisteredModel.Name,
	Source: "dbfs:/tmp",
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", mv)

created, err := w.ModelRegistry.CreateComment(ctx, ml.CreateComment{
	Comment: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	Name:    mv.ModelVersion.Name,
	Version: mv.ModelVersion.Version,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

// cleanup

err = w.ModelRegistry.DeleteComment(ctx, ml.DeleteCommentRequest{
	Id: created.Comment.Id,
})
if err != nil {
	panic(err)
}
Output:

func (*ModelRegistryAPI) CreateModel

Create a model.

Creates a new registered model with the name specified in the request body.

Throws `RESOURCE_ALREADY_EXISTS` if a registered model with the given name exists.

Example (ModelVersionComments)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

model, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)
Output:

Example (ModelVersions)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

model, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)
Output:

Example (Models)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)
Output:

func (*ModelRegistryAPI) CreateModelVersion

Create a model version.

Creates a model version.

Example (ModelVersionComments)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

model, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)

mv, err := w.ModelRegistry.CreateModelVersion(ctx, ml.CreateModelVersionRequest{
	Name:   model.RegisteredModel.Name,
	Source: "dbfs:/tmp",
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", mv)
Output:

Example (ModelVersions)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

model, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)

created, err := w.ModelRegistry.CreateModelVersion(ctx, ml.CreateModelVersionRequest{
	Name:   model.RegisteredModel.Name,
	Source: "dbfs:/tmp",
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)
Output:

func (*ModelRegistryAPI) CreateTransitionRequest

Make a transition request.

Creates a model version stage transition request.

func (*ModelRegistryAPI) CreateWebhook

Create a webhook.

**NOTE**: This endpoint is in Public Preview.

Creates a registry webhook.

Example (RegistryWebhooks)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.ModelRegistry.CreateWebhook(ctx, ml.CreateRegistryWebhook{
	Description: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	Events:      []ml.RegistryWebhookEvent{ml.RegistryWebhookEventModelVersionCreated},
	HttpUrlSpec: &ml.HttpUrlSpec{
		Url: w.Config.CanonicalHostName(),
	},
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

// cleanup

err = w.ModelRegistry.DeleteWebhook(ctx, ml.DeleteWebhookRequest{
	Id: created.Webhook.Id,
})
if err != nil {
	panic(err)
}
Output:

func (*ModelRegistryAPI) DeleteComment

func (a *ModelRegistryAPI) DeleteComment(ctx context.Context, request DeleteCommentRequest) error

Delete a comment.

Deletes a comment on a model version.

func (*ModelRegistryAPI) DeleteModel

func (a *ModelRegistryAPI) DeleteModel(ctx context.Context, request DeleteModelRequest) error

Delete a model.

Deletes a registered model.

func (*ModelRegistryAPI) DeleteModelTag

func (a *ModelRegistryAPI) DeleteModelTag(ctx context.Context, request DeleteModelTagRequest) error

Delete a model tag.

Deletes the tag for a registered model.

func (*ModelRegistryAPI) DeleteModelVersion

func (a *ModelRegistryAPI) DeleteModelVersion(ctx context.Context, request DeleteModelVersionRequest) error

Delete a model version.

Deletes a model version.

func (*ModelRegistryAPI) DeleteModelVersionTag

func (a *ModelRegistryAPI) DeleteModelVersionTag(ctx context.Context, request DeleteModelVersionTagRequest) error

Delete a model version tag.

Deletes a model version tag.

func (*ModelRegistryAPI) DeleteTransitionRequest

func (a *ModelRegistryAPI) DeleteTransitionRequest(ctx context.Context, request DeleteTransitionRequestRequest) error

Delete a transition request.

Cancels a model version stage transition request.

func (*ModelRegistryAPI) DeleteWebhook

func (a *ModelRegistryAPI) DeleteWebhook(ctx context.Context, request DeleteWebhookRequest) error

Delete a webhook.

**NOTE:** This endpoint is in Public Preview.

Deletes a registry webhook.

func (*ModelRegistryAPI) GetLatestVersions added in v0.24.0

Get the latest version.

Gets the latest version of a registered model.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) GetLatestVersionsAll

func (a *ModelRegistryAPI) GetLatestVersionsAll(ctx context.Context, request GetLatestVersionsRequest) ([]ModelVersion, error)

Get the latest version.

Gets the latest version of a registered model.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) GetModel

func (a *ModelRegistryAPI) GetModel(ctx context.Context, request GetModelRequest) (*GetModelResponse, error)

Get model.

Get the details of a model. This is a Databricks workspace version of the MLflow endpoint that also returns the model's Databricks workspace ID and the permission level of the requesting user on the model.

Example (Models)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

model, err := w.ModelRegistry.GetModel(ctx, ml.GetModelRequest{
	Name: created.RegisteredModel.Name,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)
Output:

func (*ModelRegistryAPI) GetModelVersion

Get a model version.

Get a model version.

func (*ModelRegistryAPI) GetModelVersionDownloadUri

Get a model version URI.

Gets a URI to download the model version.

func (*ModelRegistryAPI) GetPermissionLevels added in v0.19.0

Get registered model permission levels.

Gets the permission levels that a user can have on an object.

func (*ModelRegistryAPI) GetPermissionLevelsByRegisteredModelId added in v0.19.0

func (a *ModelRegistryAPI) GetPermissionLevelsByRegisteredModelId(ctx context.Context, registeredModelId string) (*GetRegisteredModelPermissionLevelsResponse, error)

Get registered model permission levels.

Gets the permission levels that a user can have on an object.

func (*ModelRegistryAPI) GetPermissions added in v0.19.0

Get registered model permissions.

Gets the permissions of a registered model. Registered models can inherit permissions from their root object.

func (*ModelRegistryAPI) GetPermissionsByRegisteredModelId added in v0.19.0

func (a *ModelRegistryAPI) GetPermissionsByRegisteredModelId(ctx context.Context, registeredModelId string) (*RegisteredModelPermissions, error)

Get registered model permissions.

Gets the permissions of a registered model. Registered models can inherit permissions from their root object.

func (*ModelRegistryAPI) Impl

Impl returns low-level ModelRegistry API implementation Deprecated: use MockModelRegistryInterface instead.

func (*ModelRegistryAPI) ListModels added in v0.24.0

List models.

Lists all available registered models, up to the limit specified in __max_results__.

This method is generated by Databricks SDK Code Generator.

Example (Models)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.ModelRegistry.ListModelsAll(ctx, ml.ListModelsRequest{})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*ModelRegistryAPI) ListModelsAll

func (a *ModelRegistryAPI) ListModelsAll(ctx context.Context, request ListModelsRequest) ([]Model, error)

List models.

Lists all available registered models, up to the limit specified in __max_results__.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) ListTransitionRequests added in v0.24.0

func (a *ModelRegistryAPI) ListTransitionRequests(ctx context.Context, request ListTransitionRequestsRequest) listing.Iterator[Activity]

List transition requests.

Gets a list of all open stage transition requests for the model version.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) ListTransitionRequestsAll

func (a *ModelRegistryAPI) ListTransitionRequestsAll(ctx context.Context, request ListTransitionRequestsRequest) ([]Activity, error)

List transition requests.

Gets a list of all open stage transition requests for the model version.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) ListWebhooks added in v0.24.0

List registry webhooks.

**NOTE:** This endpoint is in Public Preview.

Lists all registry webhooks.

This method is generated by Databricks SDK Code Generator.

Example (RegistryWebhooks)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

all, err := w.ModelRegistry.ListWebhooksAll(ctx, ml.ListWebhooksRequest{})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", all)
Output:

func (*ModelRegistryAPI) ListWebhooksAll

func (a *ModelRegistryAPI) ListWebhooksAll(ctx context.Context, request ListWebhooksRequest) ([]RegistryWebhook, error)

List registry webhooks.

**NOTE:** This endpoint is in Public Preview.

Lists all registry webhooks.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) RejectTransitionRequest

Reject a transition request.

Rejects a model version stage transition request.

func (*ModelRegistryAPI) RenameModel

Rename a model.

Renames a registered model.

func (*ModelRegistryAPI) SearchModelVersions added in v0.24.0

Searches model versions.

Searches for specific model versions based on the supplied __filter__.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) SearchModelVersionsAll

func (a *ModelRegistryAPI) SearchModelVersionsAll(ctx context.Context, request SearchModelVersionsRequest) ([]ModelVersion, error)

Searches model versions.

Searches for specific model versions based on the supplied __filter__.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) SearchModels added in v0.24.0

func (a *ModelRegistryAPI) SearchModels(ctx context.Context, request SearchModelsRequest) listing.Iterator[Model]

Search models.

Search for registered models based on the specified __filter__.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) SearchModelsAll

func (a *ModelRegistryAPI) SearchModelsAll(ctx context.Context, request SearchModelsRequest) ([]Model, error)

Search models.

Search for registered models based on the specified __filter__.

This method is generated by Databricks SDK Code Generator.

func (*ModelRegistryAPI) SetModelTag

func (a *ModelRegistryAPI) SetModelTag(ctx context.Context, request SetModelTagRequest) error

Set a tag.

Sets a tag on a registered model.

func (*ModelRegistryAPI) SetModelVersionTag

func (a *ModelRegistryAPI) SetModelVersionTag(ctx context.Context, request SetModelVersionTagRequest) error

Set a version tag.

Sets a model version tag.

func (*ModelRegistryAPI) SetPermissions added in v0.19.0

Set registered model permissions.

Sets permissions on a registered model. Registered models can inherit permissions from their root object.

func (*ModelRegistryAPI) TestRegistryWebhook

Test a webhook.

**NOTE:** This endpoint is in Public Preview.

Tests a registry webhook.

func (*ModelRegistryAPI) TransitionStage

Transition a stage.

Transition a model version's stage. This is a Databricks workspace version of the MLflow endpoint that also accepts a comment associated with the transition to be recorded.",

func (*ModelRegistryAPI) UpdateComment

func (a *ModelRegistryAPI) UpdateComment(ctx context.Context, request UpdateComment) (*UpdateCommentResponse, error)

Update a comment.

Post an edit to a comment on a model version.

Example (ModelVersionComments)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

model, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)

mv, err := w.ModelRegistry.CreateModelVersion(ctx, ml.CreateModelVersionRequest{
	Name:   model.RegisteredModel.Name,
	Source: "dbfs:/tmp",
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", mv)

created, err := w.ModelRegistry.CreateComment(ctx, ml.CreateComment{
	Comment: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	Name:    mv.ModelVersion.Name,
	Version: mv.ModelVersion.Version,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

_, err = w.ModelRegistry.UpdateComment(ctx, ml.UpdateComment{
	Comment: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	Id:      created.Comment.Id,
})
if err != nil {
	panic(err)
}

// cleanup

err = w.ModelRegistry.DeleteComment(ctx, ml.DeleteCommentRequest{
	Id: created.Comment.Id,
})
if err != nil {
	panic(err)
}
Output:

func (*ModelRegistryAPI) UpdateModel

func (a *ModelRegistryAPI) UpdateModel(ctx context.Context, request UpdateModelRequest) error

Update model.

Updates a registered model.

Example (Models)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

model, err := w.ModelRegistry.GetModel(ctx, ml.GetModelRequest{
	Name: created.RegisteredModel.Name,
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)

err = w.ModelRegistry.UpdateModel(ctx, ml.UpdateModelRequest{
	Name:        model.RegisteredModelDatabricks.Name,
	Description: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
Output:

func (*ModelRegistryAPI) UpdateModelVersion

func (a *ModelRegistryAPI) UpdateModelVersion(ctx context.Context, request UpdateModelVersionRequest) error

Update model version.

Updates the model version.

Example (ModelVersions)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

model, err := w.ModelRegistry.CreateModel(ctx, ml.CreateModelRequest{
	Name: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", model)

created, err := w.ModelRegistry.CreateModelVersion(ctx, ml.CreateModelVersionRequest{
	Name:   model.RegisteredModel.Name,
	Source: "dbfs:/tmp",
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

err = w.ModelRegistry.UpdateModelVersion(ctx, ml.UpdateModelVersionRequest{
	Description: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	Name:        created.ModelVersion.Name,
	Version:     created.ModelVersion.Version,
})
if err != nil {
	panic(err)
}
Output:

func (*ModelRegistryAPI) UpdatePermissions added in v0.19.0

Update registered model permissions.

Updates the permissions on a registered model. Registered models can inherit permissions from their root object.

func (*ModelRegistryAPI) UpdateWebhook

func (a *ModelRegistryAPI) UpdateWebhook(ctx context.Context, request UpdateRegistryWebhook) error

Update a webhook.

**NOTE:** This endpoint is in Public Preview.

Updates a registry webhook.

Example (RegistryWebhooks)
ctx := context.Background()
w, err := databricks.NewWorkspaceClient()
if err != nil {
	panic(err)
}

created, err := w.ModelRegistry.CreateWebhook(ctx, ml.CreateRegistryWebhook{
	Description: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
	Events:      []ml.RegistryWebhookEvent{ml.RegistryWebhookEventModelVersionCreated},
	HttpUrlSpec: &ml.HttpUrlSpec{
		Url: w.Config.CanonicalHostName(),
	},
})
if err != nil {
	panic(err)
}
logger.Infof(ctx, "found %v", created)

err = w.ModelRegistry.UpdateWebhook(ctx, ml.UpdateRegistryWebhook{
	Id:          created.Webhook.Id,
	Description: fmt.Sprintf("sdk-%x", time.Now().UnixNano()),
})
if err != nil {
	panic(err)
}

// cleanup

err = w.ModelRegistry.DeleteWebhook(ctx, ml.DeleteWebhookRequest{
	Id: created.Webhook.Id,
})
if err != nil {
	panic(err)
}
Output:

func (*ModelRegistryAPI) WithImpl

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 MockModelRegistryInterface instead.

type ModelRegistryInterface added in v0.29.0

type ModelRegistryInterface 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 MockModelRegistryInterface instead.
	WithImpl(impl ModelRegistryService) ModelRegistryInterface

	// Impl returns low-level ModelRegistry API implementation
	// Deprecated: use MockModelRegistryInterface instead.
	Impl() ModelRegistryService

	// Approve transition request.
	//
	// Approves a model version stage transition request.
	ApproveTransitionRequest(ctx context.Context, request ApproveTransitionRequest) (*ApproveTransitionRequestResponse, error)

	// Post a comment.
	//
	// Posts a comment on a model version. A comment can be submitted either by a
	// user or programmatically to display relevant information about the model. For
	// example, test results or deployment errors.
	CreateComment(ctx context.Context, request CreateComment) (*CreateCommentResponse, error)

	// Create a model.
	//
	// Creates a new registered model with the name specified in the request body.
	//
	// Throws `RESOURCE_ALREADY_EXISTS` if a registered model with the given name
	// exists.
	CreateModel(ctx context.Context, request CreateModelRequest) (*CreateModelResponse, error)

	// Create a model version.
	//
	// Creates a model version.
	CreateModelVersion(ctx context.Context, request CreateModelVersionRequest) (*CreateModelVersionResponse, error)

	// Make a transition request.
	//
	// Creates a model version stage transition request.
	CreateTransitionRequest(ctx context.Context, request CreateTransitionRequest) (*CreateTransitionRequestResponse, error)

	// Create a webhook.
	//
	// **NOTE**: This endpoint is in Public Preview.
	//
	// Creates a registry webhook.
	CreateWebhook(ctx context.Context, request CreateRegistryWebhook) (*CreateWebhookResponse, error)

	// Delete a comment.
	//
	// Deletes a comment on a model version.
	DeleteComment(ctx context.Context, request DeleteCommentRequest) error

	// Delete a model.
	//
	// Deletes a registered model.
	DeleteModel(ctx context.Context, request DeleteModelRequest) error

	// Delete a model tag.
	//
	// Deletes the tag for a registered model.
	DeleteModelTag(ctx context.Context, request DeleteModelTagRequest) error

	// Delete a model version.
	//
	// Deletes a model version.
	DeleteModelVersion(ctx context.Context, request DeleteModelVersionRequest) error

	// Delete a model version tag.
	//
	// Deletes a model version tag.
	DeleteModelVersionTag(ctx context.Context, request DeleteModelVersionTagRequest) error

	// Delete a transition request.
	//
	// Cancels a model version stage transition request.
	DeleteTransitionRequest(ctx context.Context, request DeleteTransitionRequestRequest) error

	// Delete a webhook.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Deletes a registry webhook.
	DeleteWebhook(ctx context.Context, request DeleteWebhookRequest) error

	// Get the latest version.
	//
	// Gets the latest version of a registered model.
	//
	// This method is generated by Databricks SDK Code Generator.
	GetLatestVersions(ctx context.Context, request GetLatestVersionsRequest) listing.Iterator[ModelVersion]

	// Get the latest version.
	//
	// Gets the latest version of a registered model.
	//
	// This method is generated by Databricks SDK Code Generator.
	GetLatestVersionsAll(ctx context.Context, request GetLatestVersionsRequest) ([]ModelVersion, error)

	// Get model.
	//
	// Get the details of a model. This is a Databricks workspace version of the
	// [MLflow endpoint] that also returns the model's Databricks workspace ID and
	// the permission level of the requesting user on the model.
	//
	// [MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#get-registeredmodel
	GetModel(ctx context.Context, request GetModelRequest) (*GetModelResponse, error)

	// Get a model version.
	//
	// Get a model version.
	GetModelVersion(ctx context.Context, request GetModelVersionRequest) (*GetModelVersionResponse, error)

	// Get a model version URI.
	//
	// Gets a URI to download the model version.
	GetModelVersionDownloadUri(ctx context.Context, request GetModelVersionDownloadUriRequest) (*GetModelVersionDownloadUriResponse, error)

	// Get registered model permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevels(ctx context.Context, request GetRegisteredModelPermissionLevelsRequest) (*GetRegisteredModelPermissionLevelsResponse, error)

	// Get registered model permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevelsByRegisteredModelId(ctx context.Context, registeredModelId string) (*GetRegisteredModelPermissionLevelsResponse, error)

	// Get registered model permissions.
	//
	// Gets the permissions of a registered model. Registered models can inherit
	// permissions from their root object.
	GetPermissions(ctx context.Context, request GetRegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error)

	// Get registered model permissions.
	//
	// Gets the permissions of a registered model. Registered models can inherit
	// permissions from their root object.
	GetPermissionsByRegisteredModelId(ctx context.Context, registeredModelId string) (*RegisteredModelPermissions, error)

	// List models.
	//
	// Lists all available registered models, up to the limit specified in
	// __max_results__.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListModels(ctx context.Context, request ListModelsRequest) listing.Iterator[Model]

	// List models.
	//
	// Lists all available registered models, up to the limit specified in
	// __max_results__.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListModelsAll(ctx context.Context, request ListModelsRequest) ([]Model, error)

	// List transition requests.
	//
	// Gets a list of all open stage transition requests for the model version.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListTransitionRequests(ctx context.Context, request ListTransitionRequestsRequest) listing.Iterator[Activity]

	// List transition requests.
	//
	// Gets a list of all open stage transition requests for the model version.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListTransitionRequestsAll(ctx context.Context, request ListTransitionRequestsRequest) ([]Activity, error)

	// List registry webhooks.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Lists all registry webhooks.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListWebhooks(ctx context.Context, request ListWebhooksRequest) listing.Iterator[RegistryWebhook]

	// List registry webhooks.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Lists all registry webhooks.
	//
	// This method is generated by Databricks SDK Code Generator.
	ListWebhooksAll(ctx context.Context, request ListWebhooksRequest) ([]RegistryWebhook, error)

	// Reject a transition request.
	//
	// Rejects a model version stage transition request.
	RejectTransitionRequest(ctx context.Context, request RejectTransitionRequest) (*RejectTransitionRequestResponse, error)

	// Rename a model.
	//
	// Renames a registered model.
	RenameModel(ctx context.Context, request RenameModelRequest) (*RenameModelResponse, error)

	// Searches model versions.
	//
	// Searches for specific model versions based on the supplied __filter__.
	//
	// This method is generated by Databricks SDK Code Generator.
	SearchModelVersions(ctx context.Context, request SearchModelVersionsRequest) listing.Iterator[ModelVersion]

	// Searches model versions.
	//
	// Searches for specific model versions based on the supplied __filter__.
	//
	// This method is generated by Databricks SDK Code Generator.
	SearchModelVersionsAll(ctx context.Context, request SearchModelVersionsRequest) ([]ModelVersion, error)

	// Search models.
	//
	// Search for registered models based on the specified __filter__.
	//
	// This method is generated by Databricks SDK Code Generator.
	SearchModels(ctx context.Context, request SearchModelsRequest) listing.Iterator[Model]

	// Search models.
	//
	// Search for registered models based on the specified __filter__.
	//
	// This method is generated by Databricks SDK Code Generator.
	SearchModelsAll(ctx context.Context, request SearchModelsRequest) ([]Model, error)

	// Set a tag.
	//
	// Sets a tag on a registered model.
	SetModelTag(ctx context.Context, request SetModelTagRequest) error

	// Set a version tag.
	//
	// Sets a model version tag.
	SetModelVersionTag(ctx context.Context, request SetModelVersionTagRequest) error

	// Set registered model permissions.
	//
	// Sets permissions on a registered model. Registered models can inherit
	// permissions from their root object.
	SetPermissions(ctx context.Context, request RegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error)

	// Test a webhook.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Tests a registry webhook.
	TestRegistryWebhook(ctx context.Context, request TestRegistryWebhookRequest) (*TestRegistryWebhookResponse, error)

	// Transition a stage.
	//
	// Transition a model version's stage. This is a Databricks workspace version of
	// the [MLflow endpoint] that also accepts a comment associated with the
	// transition to be recorded.",
	//
	// [MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#transition-modelversion-stage
	TransitionStage(ctx context.Context, request TransitionModelVersionStageDatabricks) (*TransitionStageResponse, error)

	// Update a comment.
	//
	// Post an edit to a comment on a model version.
	UpdateComment(ctx context.Context, request UpdateComment) (*UpdateCommentResponse, error)

	// Update model.
	//
	// Updates a registered model.
	UpdateModel(ctx context.Context, request UpdateModelRequest) error

	// Update model version.
	//
	// Updates the model version.
	UpdateModelVersion(ctx context.Context, request UpdateModelVersionRequest) error

	// Update registered model permissions.
	//
	// Updates the permissions on a registered model. Registered models can inherit
	// permissions from their root object.
	UpdatePermissions(ctx context.Context, request RegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error)

	// Update a webhook.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Updates a registry webhook.
	UpdateWebhook(ctx context.Context, request UpdateRegistryWebhook) error
}

type ModelRegistryService

type ModelRegistryService interface {

	// Approve transition request.
	//
	// Approves a model version stage transition request.
	ApproveTransitionRequest(ctx context.Context, request ApproveTransitionRequest) (*ApproveTransitionRequestResponse, error)

	// Post a comment.
	//
	// Posts a comment on a model version. A comment can be submitted either by
	// a user or programmatically to display relevant information about the
	// model. For example, test results or deployment errors.
	CreateComment(ctx context.Context, request CreateComment) (*CreateCommentResponse, error)

	// Create a model.
	//
	// Creates a new registered model with the name specified in the request
	// body.
	//
	// Throws `RESOURCE_ALREADY_EXISTS` if a registered model with the given
	// name exists.
	CreateModel(ctx context.Context, request CreateModelRequest) (*CreateModelResponse, error)

	// Create a model version.
	//
	// Creates a model version.
	CreateModelVersion(ctx context.Context, request CreateModelVersionRequest) (*CreateModelVersionResponse, error)

	// Make a transition request.
	//
	// Creates a model version stage transition request.
	CreateTransitionRequest(ctx context.Context, request CreateTransitionRequest) (*CreateTransitionRequestResponse, error)

	// Create a webhook.
	//
	// **NOTE**: This endpoint is in Public Preview.
	//
	// Creates a registry webhook.
	CreateWebhook(ctx context.Context, request CreateRegistryWebhook) (*CreateWebhookResponse, error)

	// Delete a comment.
	//
	// Deletes a comment on a model version.
	DeleteComment(ctx context.Context, request DeleteCommentRequest) error

	// Delete a model.
	//
	// Deletes a registered model.
	DeleteModel(ctx context.Context, request DeleteModelRequest) error

	// Delete a model tag.
	//
	// Deletes the tag for a registered model.
	DeleteModelTag(ctx context.Context, request DeleteModelTagRequest) error

	// Delete a model version.
	//
	// Deletes a model version.
	DeleteModelVersion(ctx context.Context, request DeleteModelVersionRequest) error

	// Delete a model version tag.
	//
	// Deletes a model version tag.
	DeleteModelVersionTag(ctx context.Context, request DeleteModelVersionTagRequest) error

	// Delete a transition request.
	//
	// Cancels a model version stage transition request.
	DeleteTransitionRequest(ctx context.Context, request DeleteTransitionRequestRequest) error

	// Delete a webhook.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Deletes a registry webhook.
	DeleteWebhook(ctx context.Context, request DeleteWebhookRequest) error

	// Get the latest version.
	//
	// Gets the latest version of a registered model.
	//
	// Use GetLatestVersionsAll() to get all ModelVersion instances
	GetLatestVersions(ctx context.Context, request GetLatestVersionsRequest) (*GetLatestVersionsResponse, error)

	// Get model.
	//
	// Get the details of a model. This is a Databricks workspace version of the
	// [MLflow endpoint] that also returns the model's Databricks workspace ID
	// and the permission level of the requesting user on the model.
	//
	// [MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#get-registeredmodel
	GetModel(ctx context.Context, request GetModelRequest) (*GetModelResponse, error)

	// Get a model version.
	//
	// Get a model version.
	GetModelVersion(ctx context.Context, request GetModelVersionRequest) (*GetModelVersionResponse, error)

	// Get a model version URI.
	//
	// Gets a URI to download the model version.
	GetModelVersionDownloadUri(ctx context.Context, request GetModelVersionDownloadUriRequest) (*GetModelVersionDownloadUriResponse, error)

	// Get registered model permission levels.
	//
	// Gets the permission levels that a user can have on an object.
	GetPermissionLevels(ctx context.Context, request GetRegisteredModelPermissionLevelsRequest) (*GetRegisteredModelPermissionLevelsResponse, error)

	// Get registered model permissions.
	//
	// Gets the permissions of a registered model. Registered models can inherit
	// permissions from their root object.
	GetPermissions(ctx context.Context, request GetRegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error)

	// List models.
	//
	// Lists all available registered models, up to the limit specified in
	// __max_results__.
	//
	// Use ListModelsAll() to get all Model instances, which will iterate over every result page.
	ListModels(ctx context.Context, request ListModelsRequest) (*ListModelsResponse, error)

	// List transition requests.
	//
	// Gets a list of all open stage transition requests for the model version.
	//
	// Use ListTransitionRequestsAll() to get all Activity instances
	ListTransitionRequests(ctx context.Context, request ListTransitionRequestsRequest) (*ListTransitionRequestsResponse, error)

	// List registry webhooks.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Lists all registry webhooks.
	//
	// Use ListWebhooksAll() to get all RegistryWebhook instances, which will iterate over every result page.
	ListWebhooks(ctx context.Context, request ListWebhooksRequest) (*ListRegistryWebhooks, error)

	// Reject a transition request.
	//
	// Rejects a model version stage transition request.
	RejectTransitionRequest(ctx context.Context, request RejectTransitionRequest) (*RejectTransitionRequestResponse, error)

	// Rename a model.
	//
	// Renames a registered model.
	RenameModel(ctx context.Context, request RenameModelRequest) (*RenameModelResponse, error)

	// Searches model versions.
	//
	// Searches for specific model versions based on the supplied __filter__.
	//
	// Use SearchModelVersionsAll() to get all ModelVersion instances, which will iterate over every result page.
	SearchModelVersions(ctx context.Context, request SearchModelVersionsRequest) (*SearchModelVersionsResponse, error)

	// Search models.
	//
	// Search for registered models based on the specified __filter__.
	//
	// Use SearchModelsAll() to get all Model instances, which will iterate over every result page.
	SearchModels(ctx context.Context, request SearchModelsRequest) (*SearchModelsResponse, error)

	// Set a tag.
	//
	// Sets a tag on a registered model.
	SetModelTag(ctx context.Context, request SetModelTagRequest) error

	// Set a version tag.
	//
	// Sets a model version tag.
	SetModelVersionTag(ctx context.Context, request SetModelVersionTagRequest) error

	// Set registered model permissions.
	//
	// Sets permissions on a registered model. Registered models can inherit
	// permissions from their root object.
	SetPermissions(ctx context.Context, request RegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error)

	// Test a webhook.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Tests a registry webhook.
	TestRegistryWebhook(ctx context.Context, request TestRegistryWebhookRequest) (*TestRegistryWebhookResponse, error)

	// Transition a stage.
	//
	// Transition a model version's stage. This is a Databricks workspace
	// version of the [MLflow endpoint] that also accepts a comment associated
	// with the transition to be recorded.",
	//
	// [MLflow endpoint]: https://www.mlflow.org/docs/latest/rest-api.html#transition-modelversion-stage
	TransitionStage(ctx context.Context, request TransitionModelVersionStageDatabricks) (*TransitionStageResponse, error)

	// Update a comment.
	//
	// Post an edit to a comment on a model version.
	UpdateComment(ctx context.Context, request UpdateComment) (*UpdateCommentResponse, error)

	// Update model.
	//
	// Updates a registered model.
	UpdateModel(ctx context.Context, request UpdateModelRequest) error

	// Update model version.
	//
	// Updates the model version.
	UpdateModelVersion(ctx context.Context, request UpdateModelVersionRequest) error

	// Update registered model permissions.
	//
	// Updates the permissions on a registered model. Registered models can
	// inherit permissions from their root object.
	UpdatePermissions(ctx context.Context, request RegisteredModelPermissionsRequest) (*RegisteredModelPermissions, error)

	// Update a webhook.
	//
	// **NOTE:** This endpoint is in Public Preview.
	//
	// Updates a registry webhook.
	UpdateWebhook(ctx context.Context, request UpdateRegistryWebhook) error
}

Note: This API reference documents APIs for the Workspace Model Registry. Databricks recommends using [Models in Unity Catalog](/api/workspace/registeredmodels) instead. Models in Unity Catalog provides centralized model governance, cross-workspace access, lineage, and deployment. Workspace Model Registry will be deprecated in the future.

The Workspace Model Registry is a centralized model repository and a UI and set of APIs that enable you to manage the full lifecycle of MLflow Models.

type ModelTag

type ModelTag struct {
	// The tag key.
	Key string `json:"key,omitempty"`
	// The tag value.
	Value string `json:"value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ModelTag) MarshalJSON added in v0.23.0

func (s ModelTag) MarshalJSON() ([]byte, error)

func (*ModelTag) UnmarshalJSON added in v0.23.0

func (s *ModelTag) UnmarshalJSON(b []byte) error

type ModelVersion

type ModelVersion struct {
	// Timestamp recorded when this `model_version` was created.
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// Current stage for this `model_version`.
	CurrentStage string `json:"current_stage,omitempty"`
	// Description of this `model_version`.
	Description string `json:"description,omitempty"`
	// Timestamp recorded when metadata for this `model_version` was last
	// updated.
	LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
	// Unique name of the model
	Name string `json:"name,omitempty"`
	// MLflow run ID used when creating `model_version`, if `source` was
	// generated by an experiment run stored in MLflow tracking server.
	RunId string `json:"run_id,omitempty"`
	// Run Link: Direct link to the run that generated this version
	RunLink string `json:"run_link,omitempty"`
	// URI indicating the location of the source model artifacts, used when
	// creating `model_version`
	Source string `json:"source,omitempty"`
	// Current status of `model_version`
	Status ModelVersionStatus `json:"status,omitempty"`
	// Details on current `status`, if it is pending or failed.
	StatusMessage string `json:"status_message,omitempty"`
	// Tags: Additional metadata key-value pairs for this `model_version`.
	Tags []ModelVersionTag `json:"tags,omitempty"`
	// User that created this `model_version`.
	UserId string `json:"user_id,omitempty"`
	// Model's version number.
	Version string `json:"version,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ModelVersion) MarshalJSON added in v0.23.0

func (s ModelVersion) MarshalJSON() ([]byte, error)

func (*ModelVersion) UnmarshalJSON added in v0.23.0

func (s *ModelVersion) UnmarshalJSON(b []byte) error

type ModelVersionDatabricks

type ModelVersionDatabricks struct {
	// Creation time of the object, as a Unix timestamp in milliseconds.
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// Stage of the model version. Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	CurrentStage Stage `json:"current_stage,omitempty"`
	// User-specified description for the object.
	Description string `json:"description,omitempty"`
	// Time of the object at last update, as a Unix timestamp in milliseconds.
	LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
	// Name of the model.
	Name string `json:"name,omitempty"`
	// Permission level of the requesting user on the object. For what is
	// allowed at each level, see [MLflow Model permissions](..).
	PermissionLevel PermissionLevel `json:"permission_level,omitempty"`
	// Unique identifier for the MLflow tracking run associated with the source
	// model artifacts.
	RunId string `json:"run_id,omitempty"`
	// URL of the run associated with the model artifacts. This field is set at
	// model version creation time only for model versions whose source run is
	// from a tracking server that is different from the registry server.
	RunLink string `json:"run_link,omitempty"`
	// URI that indicates the location of the source model artifacts. This is
	// used when creating the model version.
	Source string `json:"source,omitempty"`
	// The status of the model version. Valid values are: *
	// `PENDING_REGISTRATION`: Request to register a new model version is
	// pending as server performs background tasks.
	//
	// * `FAILED_REGISTRATION`: Request to register a new model version has
	// failed.
	//
	// * `READY`: Model version is ready for use.
	Status Status `json:"status,omitempty"`
	// Details on the current status, for example why registration failed.
	StatusMessage string `json:"status_message,omitempty"`
	// Array of tags that are associated with the model version.
	Tags []ModelVersionTag `json:"tags,omitempty"`
	// The username of the user that created the object.
	UserId string `json:"user_id,omitempty"`
	// Version of the model.
	Version string `json:"version,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ModelVersionDatabricks) MarshalJSON added in v0.23.0

func (s ModelVersionDatabricks) MarshalJSON() ([]byte, error)

func (*ModelVersionDatabricks) UnmarshalJSON added in v0.23.0

func (s *ModelVersionDatabricks) UnmarshalJSON(b []byte) error

type ModelVersionStatus

type ModelVersionStatus string

Current status of `model_version`

const ModelVersionStatusFailedRegistration ModelVersionStatus = `FAILED_REGISTRATION`
const ModelVersionStatusPendingRegistration ModelVersionStatus = `PENDING_REGISTRATION`
const ModelVersionStatusReady ModelVersionStatus = `READY`

func (*ModelVersionStatus) Set

func (f *ModelVersionStatus) Set(v string) error

Set raw string value and validate it against allowed values

func (*ModelVersionStatus) String

func (f *ModelVersionStatus) String() string

String representation for fmt.Print

func (*ModelVersionStatus) Type

func (f *ModelVersionStatus) Type() string

Type always returns ModelVersionStatus to satisfy [pflag.Value] interface

type ModelVersionTag

type ModelVersionTag struct {
	// The tag key.
	Key string `json:"key,omitempty"`
	// The tag value.
	Value string `json:"value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (ModelVersionTag) MarshalJSON added in v0.23.0

func (s ModelVersionTag) MarshalJSON() ([]byte, error)

func (*ModelVersionTag) UnmarshalJSON added in v0.23.0

func (s *ModelVersionTag) UnmarshalJSON(b []byte) error

type Param

type Param struct {
	// Key identifying this param.
	Key string `json:"key,omitempty"`
	// Value associated with this param.
	Value string `json:"value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (Param) MarshalJSON added in v0.23.0

func (s Param) MarshalJSON() ([]byte, error)

func (*Param) UnmarshalJSON added in v0.23.0

func (s *Param) UnmarshalJSON(b []byte) error

type PermissionLevel

type PermissionLevel string

Permission level of the requesting user on the object. For what is allowed at each level, see [MLflow Model permissions](..).

const PermissionLevelCanEdit PermissionLevel = `CAN_EDIT`
const PermissionLevelCanManage PermissionLevel = `CAN_MANAGE`
const PermissionLevelCanManageProductionVersions PermissionLevel = `CAN_MANAGE_PRODUCTION_VERSIONS`
const PermissionLevelCanManageStagingVersions PermissionLevel = `CAN_MANAGE_STAGING_VERSIONS`
const PermissionLevelCanRead PermissionLevel = `CAN_READ`

func (*PermissionLevel) Set

func (f *PermissionLevel) Set(v string) error

Set raw string value and validate it against allowed values

func (*PermissionLevel) String

func (f *PermissionLevel) String() string

String representation for fmt.Print

func (*PermissionLevel) Type

func (f *PermissionLevel) Type() string

Type always returns PermissionLevel to satisfy [pflag.Value] interface

type RegisteredModelAccessControlRequest added in v0.15.0

type RegisteredModelAccessControlRequest struct {
	// name of the group
	GroupName string `json:"group_name,omitempty"`
	// Permission level
	PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"`
	// application ID of a service principal
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// name of the user
	UserName string `json:"user_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RegisteredModelAccessControlRequest) MarshalJSON added in v0.23.0

func (s RegisteredModelAccessControlRequest) MarshalJSON() ([]byte, error)

func (*RegisteredModelAccessControlRequest) UnmarshalJSON added in v0.23.0

func (s *RegisteredModelAccessControlRequest) UnmarshalJSON(b []byte) error

type RegisteredModelAccessControlResponse added in v0.15.0

type RegisteredModelAccessControlResponse struct {
	// All permissions.
	AllPermissions []RegisteredModelPermission `json:"all_permissions,omitempty"`
	// Display name of the user or service principal.
	DisplayName string `json:"display_name,omitempty"`
	// name of the group
	GroupName string `json:"group_name,omitempty"`
	// Name of the service principal.
	ServicePrincipalName string `json:"service_principal_name,omitempty"`
	// name of the user
	UserName string `json:"user_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RegisteredModelAccessControlResponse) MarshalJSON added in v0.23.0

func (s RegisteredModelAccessControlResponse) MarshalJSON() ([]byte, error)

func (*RegisteredModelAccessControlResponse) UnmarshalJSON added in v0.23.0

func (s *RegisteredModelAccessControlResponse) UnmarshalJSON(b []byte) error

type RegisteredModelPermission added in v0.15.0

type RegisteredModelPermission struct {
	Inherited bool `json:"inherited,omitempty"`

	InheritedFromObject []string `json:"inherited_from_object,omitempty"`
	// Permission level
	PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RegisteredModelPermission) MarshalJSON added in v0.23.0

func (s RegisteredModelPermission) MarshalJSON() ([]byte, error)

func (*RegisteredModelPermission) UnmarshalJSON added in v0.23.0

func (s *RegisteredModelPermission) UnmarshalJSON(b []byte) error

type RegisteredModelPermissionLevel added in v0.15.0

type RegisteredModelPermissionLevel string

Permission level

const RegisteredModelPermissionLevelCanEdit RegisteredModelPermissionLevel = `CAN_EDIT`
const RegisteredModelPermissionLevelCanManage RegisteredModelPermissionLevel = `CAN_MANAGE`
const RegisteredModelPermissionLevelCanManageProductionVersions RegisteredModelPermissionLevel = `CAN_MANAGE_PRODUCTION_VERSIONS`
const RegisteredModelPermissionLevelCanManageStagingVersions RegisteredModelPermissionLevel = `CAN_MANAGE_STAGING_VERSIONS`
const RegisteredModelPermissionLevelCanRead RegisteredModelPermissionLevel = `CAN_READ`

func (*RegisteredModelPermissionLevel) Set added in v0.15.0

Set raw string value and validate it against allowed values

func (*RegisteredModelPermissionLevel) String added in v0.15.0

String representation for fmt.Print

func (*RegisteredModelPermissionLevel) Type added in v0.15.0

Type always returns RegisteredModelPermissionLevel to satisfy [pflag.Value] interface

type RegisteredModelPermissions added in v0.15.0

type RegisteredModelPermissions struct {
	AccessControlList []RegisteredModelAccessControlResponse `json:"access_control_list,omitempty"`

	ObjectId string `json:"object_id,omitempty"`

	ObjectType string `json:"object_type,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RegisteredModelPermissions) MarshalJSON added in v0.23.0

func (s RegisteredModelPermissions) MarshalJSON() ([]byte, error)

func (*RegisteredModelPermissions) UnmarshalJSON added in v0.23.0

func (s *RegisteredModelPermissions) UnmarshalJSON(b []byte) error

type RegisteredModelPermissionsDescription added in v0.15.0

type RegisteredModelPermissionsDescription struct {
	Description string `json:"description,omitempty"`
	// Permission level
	PermissionLevel RegisteredModelPermissionLevel `json:"permission_level,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RegisteredModelPermissionsDescription) MarshalJSON added in v0.23.0

func (s RegisteredModelPermissionsDescription) MarshalJSON() ([]byte, error)

func (*RegisteredModelPermissionsDescription) UnmarshalJSON added in v0.23.0

func (s *RegisteredModelPermissionsDescription) UnmarshalJSON(b []byte) error

type RegisteredModelPermissionsRequest added in v0.15.0

type RegisteredModelPermissionsRequest struct {
	AccessControlList []RegisteredModelAccessControlRequest `json:"access_control_list,omitempty"`
	// The registered model for which to get or manage permissions.
	RegisteredModelId string `json:"-" url:"-"`
}

type RegistryWebhook

type RegistryWebhook struct {
	// Creation time of the object, as a Unix timestamp in milliseconds.
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// User-specified description for the webhook.
	Description string `json:"description,omitempty"`
	// Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A
	// new model version was created for the associated model.
	//
	// * `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was
	// changed.
	//
	// * `TRANSITION_REQUEST_CREATED`: A user requested a model version’s
	// stage be transitioned.
	//
	// * `COMMENT_CREATED`: A user wrote a comment on a registered model.
	//
	// * `REGISTERED_MODEL_CREATED`: A new registered model was created. This
	// event type can only be specified for a registry-wide webhook, which can
	// be created by not specifying a model name in the create request.
	//
	// * `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was
	// transitioned to staging.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was
	// transitioned to production.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
	//
	// * `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model
	// version be transitioned to staging.
	//
	// * `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model
	// version be transitioned to production.
	//
	// * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model
	// version be archived.
	Events []RegistryWebhookEvent `json:"events,omitempty"`

	HttpUrlSpec *HttpUrlSpecWithoutSecret `json:"http_url_spec,omitempty"`
	// Webhook ID
	Id string `json:"id,omitempty"`

	JobSpec *JobSpecWithoutSecret `json:"job_spec,omitempty"`
	// Time of the object at last update, as a Unix timestamp in milliseconds.
	LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
	// Name of the model whose events would trigger this webhook.
	ModelName string `json:"model_name,omitempty"`
	// Enable or disable triggering the webhook, or put the webhook into test
	// mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an
	// associated event happens.
	//
	// * `DISABLED`: Webhook is not triggered.
	//
	// * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is
	// not triggered on a real event.
	Status RegistryWebhookStatus `json:"status,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RegistryWebhook) MarshalJSON added in v0.23.0

func (s RegistryWebhook) MarshalJSON() ([]byte, error)

func (*RegistryWebhook) UnmarshalJSON added in v0.23.0

func (s *RegistryWebhook) UnmarshalJSON(b []byte) error

type RegistryWebhookEvent

type RegistryWebhookEvent string
const RegistryWebhookEventCommentCreated RegistryWebhookEvent = `COMMENT_CREATED`
const RegistryWebhookEventModelVersionCreated RegistryWebhookEvent = `MODEL_VERSION_CREATED`
const RegistryWebhookEventModelVersionTagSet RegistryWebhookEvent = `MODEL_VERSION_TAG_SET`
const RegistryWebhookEventModelVersionTransitionedStage RegistryWebhookEvent = `MODEL_VERSION_TRANSITIONED_STAGE`
const RegistryWebhookEventModelVersionTransitionedToArchived RegistryWebhookEvent = `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`
const RegistryWebhookEventModelVersionTransitionedToProduction RegistryWebhookEvent = `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`
const RegistryWebhookEventModelVersionTransitionedToStaging RegistryWebhookEvent = `MODEL_VERSION_TRANSITIONED_TO_STAGING`
const RegistryWebhookEventRegisteredModelCreated RegistryWebhookEvent = `REGISTERED_MODEL_CREATED`
const RegistryWebhookEventTransitionRequestCreated RegistryWebhookEvent = `TRANSITION_REQUEST_CREATED`
const RegistryWebhookEventTransitionRequestToArchivedCreated RegistryWebhookEvent = `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`
const RegistryWebhookEventTransitionRequestToProductionCreated RegistryWebhookEvent = `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`
const RegistryWebhookEventTransitionRequestToStagingCreated RegistryWebhookEvent = `TRANSITION_REQUEST_TO_STAGING_CREATED`

func (*RegistryWebhookEvent) Set

func (f *RegistryWebhookEvent) Set(v string) error

Set raw string value and validate it against allowed values

func (*RegistryWebhookEvent) String

func (f *RegistryWebhookEvent) String() string

String representation for fmt.Print

func (*RegistryWebhookEvent) Type

func (f *RegistryWebhookEvent) Type() string

Type always returns RegistryWebhookEvent to satisfy [pflag.Value] interface

type RegistryWebhookStatus

type RegistryWebhookStatus string

Enable or disable triggering the webhook, or put the webhook into test mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.

* `DISABLED`: Webhook is not triggered.

* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a real event.

const RegistryWebhookStatusActive RegistryWebhookStatus = `ACTIVE`

Webhook is triggered when an associated event happens.

const RegistryWebhookStatusDisabled RegistryWebhookStatus = `DISABLED`

Webhook is not triggered.

const RegistryWebhookStatusTestMode RegistryWebhookStatus = `TEST_MODE`

Webhook can be triggered through the test endpoint, but is not triggered on a real event.

func (*RegistryWebhookStatus) Set

Set raw string value and validate it against allowed values

func (*RegistryWebhookStatus) String

func (f *RegistryWebhookStatus) String() string

String representation for fmt.Print

func (*RegistryWebhookStatus) Type

func (f *RegistryWebhookStatus) Type() string

Type always returns RegistryWebhookStatus to satisfy [pflag.Value] interface

type RejectTransitionRequest

type RejectTransitionRequest struct {
	// User-provided comment on the action.
	Comment string `json:"comment,omitempty"`
	// Name of the model.
	Name string `json:"name"`
	// Target stage of the transition. Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	Stage Stage `json:"stage"`
	// Version of the model.
	Version string `json:"version"`

	ForceSendFields []string `json:"-"`
}

func (RejectTransitionRequest) MarshalJSON added in v0.23.0

func (s RejectTransitionRequest) MarshalJSON() ([]byte, error)

func (*RejectTransitionRequest) UnmarshalJSON added in v0.23.0

func (s *RejectTransitionRequest) UnmarshalJSON(b []byte) error

type RejectTransitionRequestResponse

type RejectTransitionRequestResponse struct {
	// Activity recorded for the action.
	Activity *Activity `json:"activity,omitempty"`
}

type RenameModelRequest

type RenameModelRequest struct {
	// Registered model unique name identifier.
	Name string `json:"name"`
	// If provided, updates the name for this `registered_model`.
	NewName string `json:"new_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RenameModelRequest) MarshalJSON added in v0.23.0

func (s RenameModelRequest) MarshalJSON() ([]byte, error)

func (*RenameModelRequest) UnmarshalJSON added in v0.23.0

func (s *RenameModelRequest) UnmarshalJSON(b []byte) error

type RenameModelResponse

type RenameModelResponse struct {
	RegisteredModel *Model `json:"registered_model,omitempty"`
}

type RestoreExperiment

type RestoreExperiment struct {
	// ID of the associated experiment.
	ExperimentId string `json:"experiment_id"`
}

type RestoreExperimentResponse added in v0.34.0

type RestoreExperimentResponse struct {
}

type RestoreRun

type RestoreRun struct {
	// ID of the run to restore.
	RunId string `json:"run_id"`
}

type RestoreRunResponse added in v0.34.0

type RestoreRunResponse struct {
}

type RestoreRuns added in v0.17.0

type RestoreRuns struct {
	// The ID of the experiment containing the runs to restore.
	ExperimentId string `json:"experiment_id"`
	// An optional positive integer indicating the maximum number of runs to
	// restore. The maximum allowed value for max_runs is 10000.
	MaxRuns int `json:"max_runs,omitempty"`
	// The minimum deletion timestamp in milliseconds since the UNIX epoch for
	// restoring runs. Only runs deleted no earlier than this timestamp are
	// restored.
	MinTimestampMillis int64 `json:"min_timestamp_millis"`

	ForceSendFields []string `json:"-"`
}

func (RestoreRuns) MarshalJSON added in v0.23.0

func (s RestoreRuns) MarshalJSON() ([]byte, error)

func (*RestoreRuns) UnmarshalJSON added in v0.23.0

func (s *RestoreRuns) UnmarshalJSON(b []byte) error

type RestoreRunsResponse added in v0.17.0

type RestoreRunsResponse struct {
	// The number of runs restored.
	RunsRestored int `json:"runs_restored,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RestoreRunsResponse) MarshalJSON added in v0.23.0

func (s RestoreRunsResponse) MarshalJSON() ([]byte, error)

func (*RestoreRunsResponse) UnmarshalJSON added in v0.23.0

func (s *RestoreRunsResponse) UnmarshalJSON(b []byte) error

type Run

type Run struct {
	// Run data.
	Data *RunData `json:"data,omitempty"`
	// Run metadata.
	Info *RunInfo `json:"info,omitempty"`
	// Run inputs.
	Inputs *RunInputs `json:"inputs,omitempty"`
}

type RunData

type RunData struct {
	// Run metrics.
	Metrics []Metric `json:"metrics,omitempty"`
	// Run parameters.
	Params []Param `json:"params,omitempty"`
	// Additional metadata key-value pairs.
	Tags []RunTag `json:"tags,omitempty"`
}

type RunInfo

type RunInfo struct {
	// URI of the directory where artifacts should be uploaded. This can be a
	// local path (starting with "/"), or a distributed file system (DFS) path,
	// like `s3://bucket/directory` or `dbfs:/my/directory`. If not set, the
	// local `./mlruns` directory is chosen.
	ArtifactUri string `json:"artifact_uri,omitempty"`
	// Unix timestamp of when the run ended in milliseconds.
	EndTime int64 `json:"end_time,omitempty"`
	// The experiment ID.
	ExperimentId string `json:"experiment_id,omitempty"`
	// Current life cycle stage of the experiment : OneOf("active", "deleted")
	LifecycleStage string `json:"lifecycle_stage,omitempty"`
	// Unique identifier for the run.
	RunId string `json:"run_id,omitempty"`
	// [Deprecated, use run_id instead] Unique identifier for the run. This
	// field will be removed in a future MLflow version.
	RunUuid string `json:"run_uuid,omitempty"`
	// Unix timestamp of when the run started in milliseconds.
	StartTime int64 `json:"start_time,omitempty"`
	// Current status of the run.
	Status RunInfoStatus `json:"status,omitempty"`
	// User who initiated the run. This field is deprecated as of MLflow 1.0,
	// and will be removed in a future MLflow release. Use 'mlflow.user' tag
	// instead.
	UserId string `json:"user_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RunInfo) MarshalJSON added in v0.23.0

func (s RunInfo) MarshalJSON() ([]byte, error)

func (*RunInfo) UnmarshalJSON added in v0.23.0

func (s *RunInfo) UnmarshalJSON(b []byte) error

type RunInfoStatus

type RunInfoStatus string

Current status of the run.

const RunInfoStatusFailed RunInfoStatus = `FAILED`
const RunInfoStatusFinished RunInfoStatus = `FINISHED`
const RunInfoStatusKilled RunInfoStatus = `KILLED`
const RunInfoStatusRunning RunInfoStatus = `RUNNING`
const RunInfoStatusScheduled RunInfoStatus = `SCHEDULED`

func (*RunInfoStatus) Set

func (f *RunInfoStatus) Set(v string) error

Set raw string value and validate it against allowed values

func (*RunInfoStatus) String

func (f *RunInfoStatus) String() string

String representation for fmt.Print

func (*RunInfoStatus) Type

func (f *RunInfoStatus) Type() string

Type always returns RunInfoStatus to satisfy [pflag.Value] interface

type RunInputs added in v0.9.0

type RunInputs struct {
	// Run metrics.
	DatasetInputs []DatasetInput `json:"dataset_inputs,omitempty"`
}

type RunTag

type RunTag struct {
	// The tag key.
	Key string `json:"key,omitempty"`
	// The tag value.
	Value string `json:"value,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (RunTag) MarshalJSON added in v0.23.0

func (s RunTag) MarshalJSON() ([]byte, error)

func (*RunTag) UnmarshalJSON added in v0.23.0

func (s *RunTag) UnmarshalJSON(b []byte) error

type SearchExperiments

type SearchExperiments struct {
	// String representing a SQL filter condition (e.g. "name ILIKE
	// 'my-experiment%'")
	Filter string `json:"filter,omitempty"`
	// Maximum number of experiments desired. Max threshold is 3000.
	MaxResults int64 `json:"max_results,omitempty"`
	// List of columns for ordering search results, which can include experiment
	// name and last updated timestamp with an optional "DESC" or "ASC"
	// annotation, where "ASC" is the default. Tiebreaks are done by experiment
	// id DESC.
	OrderBy []string `json:"order_by,omitempty"`
	// Token indicating the page of experiments to fetch
	PageToken string `json:"page_token,omitempty"`
	// Qualifier for type of experiments to be returned. If unspecified, return
	// only active experiments.
	ViewType SearchExperimentsViewType `json:"view_type,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (SearchExperiments) MarshalJSON added in v0.23.0

func (s SearchExperiments) MarshalJSON() ([]byte, error)

func (*SearchExperiments) UnmarshalJSON added in v0.23.0

func (s *SearchExperiments) UnmarshalJSON(b []byte) error

type SearchExperimentsResponse

type SearchExperimentsResponse struct {
	// Experiments that match the search criteria
	Experiments []Experiment `json:"experiments,omitempty"`
	// Token that can be used to retrieve the next page of experiments. An empty
	// token means that no more experiments are available for retrieval.
	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (SearchExperimentsResponse) MarshalJSON added in v0.23.0

func (s SearchExperimentsResponse) MarshalJSON() ([]byte, error)

func (*SearchExperimentsResponse) UnmarshalJSON added in v0.23.0

func (s *SearchExperimentsResponse) UnmarshalJSON(b []byte) error

type SearchExperimentsViewType

type SearchExperimentsViewType string

Qualifier for type of experiments to be returned. If unspecified, return only active experiments.

const SearchExperimentsViewTypeActiveOnly SearchExperimentsViewType = `ACTIVE_ONLY`
const SearchExperimentsViewTypeAll SearchExperimentsViewType = `ALL`
const SearchExperimentsViewTypeDeletedOnly SearchExperimentsViewType = `DELETED_ONLY`

func (*SearchExperimentsViewType) Set

Set raw string value and validate it against allowed values

func (*SearchExperimentsViewType) String

func (f *SearchExperimentsViewType) String() string

String representation for fmt.Print

func (*SearchExperimentsViewType) Type

Type always returns SearchExperimentsViewType to satisfy [pflag.Value] interface

type SearchModelVersionsRequest

type SearchModelVersionsRequest struct {
	// String filter condition, like "name='my-model-name'". Must be a single
	// boolean condition, with string values wrapped in single quotes.
	Filter string `json:"-" url:"filter,omitempty"`
	// Maximum number of models desired. Max threshold is 10K.
	MaxResults int `json:"-" url:"max_results,omitempty"`
	// List of columns to be ordered by including model name, version, stage
	// with an optional "DESC" or "ASC" annotation, where "ASC" is the default.
	// Tiebreaks are done by latest stage transition timestamp, followed by name
	// ASC, followed by version DESC.
	OrderBy []string `json:"-" url:"order_by,omitempty"`
	// Pagination token to go to next page based on previous search query.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

Searches model versions

func (SearchModelVersionsRequest) MarshalJSON added in v0.23.0

func (s SearchModelVersionsRequest) MarshalJSON() ([]byte, error)

func (*SearchModelVersionsRequest) UnmarshalJSON added in v0.23.0

func (s *SearchModelVersionsRequest) UnmarshalJSON(b []byte) error

type SearchModelVersionsResponse

type SearchModelVersionsResponse struct {
	// Models that match the search criteria
	ModelVersions []ModelVersion `json:"model_versions,omitempty"`
	// Pagination token to request next page of models for the same search
	// query.
	NextPageToken string `json:"next_page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (SearchModelVersionsResponse) MarshalJSON added in v0.23.0

func (s SearchModelVersionsResponse) MarshalJSON() ([]byte, error)

func (*SearchModelVersionsResponse) UnmarshalJSON added in v0.23.0

func (s *SearchModelVersionsResponse) UnmarshalJSON(b []byte) error

type SearchModelsRequest

type SearchModelsRequest struct {
	// String filter condition, like "name LIKE 'my-model-name'". Interpreted in
	// the backend automatically as "name LIKE '%my-model-name%'". Single
	// boolean condition, with string values wrapped in single quotes.
	Filter string `json:"-" url:"filter,omitempty"`
	// Maximum number of models desired. Default is 100. Max threshold is 1000.
	MaxResults int `json:"-" url:"max_results,omitempty"`
	// List of columns for ordering search results, which can include model name
	// and last updated timestamp with an optional "DESC" or "ASC" annotation,
	// where "ASC" is the default. Tiebreaks are done by model name ASC.
	OrderBy []string `json:"-" url:"order_by,omitempty"`
	// Pagination token to go to the next page based on a previous search query.
	PageToken string `json:"-" url:"page_token,omitempty"`

	ForceSendFields []string `json:"-"`
}

Search models

func (SearchModelsRequest) MarshalJSON added in v0.23.0

func (s SearchModelsRequest) MarshalJSON() ([]byte, error)

func (*SearchModelsRequest) UnmarshalJSON added in v0.23.0

func (s *SearchModelsRequest) UnmarshalJSON(b []byte) error

type SearchModelsResponse

type SearchModelsResponse struct {
	// Pagination token to request the next page of models.
	NextPageToken string `json:"next_page_token,omitempty"`
	// Registered Models that match the search criteria.
	RegisteredModels []Model `json:"registered_models,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (SearchModelsResponse) MarshalJSON added in v0.23.0

func (s SearchModelsResponse) MarshalJSON() ([]byte, error)

func (*SearchModelsResponse) UnmarshalJSON added in v0.23.0

func (s *SearchModelsResponse) UnmarshalJSON(b []byte) error

type SearchRuns

type SearchRuns struct {
	// List of experiment IDs to search over.
	ExperimentIds []string `json:"experiment_ids,omitempty"`
	// A filter expression over params, metrics, and tags, that allows returning
	// a subset of runs. The syntax is a subset of SQL that supports ANDing
	// together binary operations between a param, metric, or tag and a
	// constant.
	//
	// Example: `metrics.rmse < 1 and params.model_class = 'LogisticRegression'`
	//
	// You can select columns with special characters (hyphen, space, period,
	// etc.) by using double quotes: `metrics."model class" = 'LinearRegression'
	// and tags."user-name" = 'Tomas'`
	//
	// Supported operators are `=`, `!=`, `>`, `>=`, `<`, and `<=`.
	Filter string `json:"filter,omitempty"`
	// Maximum number of runs desired. Max threshold is 50000
	MaxResults int `json:"max_results,omitempty"`
	// List of columns to be ordered by, including attributes, params, metrics,
	// and tags with an optional "DESC" or "ASC" annotation, where "ASC" is the
	// default. Example: ["params.input DESC", "metrics.alpha ASC",
	// "metrics.rmse"] Tiebreaks are done by start_time DESC followed by run_id
	// for runs with the same start time (and this is the default ordering
	// criterion if order_by is not provided).
	OrderBy []string `json:"order_by,omitempty"`
	// Token for the current page of runs.
	PageToken string `json:"page_token,omitempty"`
	// Whether to display only active, only deleted, or all runs. Defaults to
	// only active runs.
	RunViewType SearchRunsRunViewType `json:"run_view_type,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (SearchRuns) MarshalJSON added in v0.23.0

func (s SearchRuns) MarshalJSON() ([]byte, error)

func (*SearchRuns) UnmarshalJSON added in v0.23.0

func (s *SearchRuns) UnmarshalJSON(b []byte) error

type SearchRunsResponse

type SearchRunsResponse struct {
	// Token for the next page of runs.
	NextPageToken string `json:"next_page_token,omitempty"`
	// Runs that match the search criteria.
	Runs []Run `json:"runs,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (SearchRunsResponse) MarshalJSON added in v0.23.0

func (s SearchRunsResponse) MarshalJSON() ([]byte, error)

func (*SearchRunsResponse) UnmarshalJSON added in v0.23.0

func (s *SearchRunsResponse) UnmarshalJSON(b []byte) error

type SearchRunsRunViewType

type SearchRunsRunViewType string

Whether to display only active, only deleted, or all runs. Defaults to only active runs.

const SearchRunsRunViewTypeActiveOnly SearchRunsRunViewType = `ACTIVE_ONLY`
const SearchRunsRunViewTypeAll SearchRunsRunViewType = `ALL`
const SearchRunsRunViewTypeDeletedOnly SearchRunsRunViewType = `DELETED_ONLY`

func (*SearchRunsRunViewType) Set

Set raw string value and validate it against allowed values

func (*SearchRunsRunViewType) String

func (f *SearchRunsRunViewType) String() string

String representation for fmt.Print

func (*SearchRunsRunViewType) Type

func (f *SearchRunsRunViewType) Type() string

Type always returns SearchRunsRunViewType to satisfy [pflag.Value] interface

type SetExperimentTag

type SetExperimentTag struct {
	// ID of the experiment under which to log the tag. Must be provided.
	ExperimentId string `json:"experiment_id"`
	// Name of the tag. Maximum size depends on storage backend. All storage
	// backends are guaranteed to support key values up to 250 bytes in size.
	Key string `json:"key"`
	// String value of the tag being logged. Maximum size depends on storage
	// backend. All storage backends are guaranteed to support key values up to
	// 5000 bytes in size.
	Value string `json:"value"`
}

type SetExperimentTagResponse added in v0.34.0

type SetExperimentTagResponse struct {
}

type SetModelTagRequest

type SetModelTagRequest struct {
	// Name of the tag. Maximum size depends on storage backend. If a tag with
	// this name already exists, its preexisting value will be replaced by the
	// specified `value`. All storage backends are guaranteed to support key
	// values up to 250 bytes in size.
	Key string `json:"key"`
	// Unique name of the model.
	Name string `json:"name"`
	// String value of the tag being logged. Maximum size depends on storage
	// backend. All storage backends are guaranteed to support key values up to
	// 5000 bytes in size.
	Value string `json:"value"`
}

type SetModelTagResponse added in v0.34.0

type SetModelTagResponse struct {
}

type SetModelVersionTagRequest

type SetModelVersionTagRequest struct {
	// Name of the tag. Maximum size depends on storage backend. If a tag with
	// this name already exists, its preexisting value will be replaced by the
	// specified `value`. All storage backends are guaranteed to support key
	// values up to 250 bytes in size.
	Key string `json:"key"`
	// Unique name of the model.
	Name string `json:"name"`
	// String value of the tag being logged. Maximum size depends on storage
	// backend. All storage backends are guaranteed to support key values up to
	// 5000 bytes in size.
	Value string `json:"value"`
	// Model version number.
	Version string `json:"version"`
}

type SetModelVersionTagResponse added in v0.34.0

type SetModelVersionTagResponse struct {
}

type SetTag

type SetTag struct {
	// Name of the tag. Maximum size depends on storage backend. All storage
	// backends are guaranteed to support key values up to 250 bytes in size.
	Key string `json:"key"`
	// ID of the run under which to log the tag. Must be provided.
	RunId string `json:"run_id,omitempty"`
	// [Deprecated, use run_id instead] ID of the run under which to log the
	// tag. This field will be removed in a future MLflow version.
	RunUuid string `json:"run_uuid,omitempty"`
	// String value of the tag being logged. Maximum size depends on storage
	// backend. All storage backends are guaranteed to support key values up to
	// 5000 bytes in size.
	Value string `json:"value"`

	ForceSendFields []string `json:"-"`
}

func (SetTag) MarshalJSON added in v0.23.0

func (s SetTag) MarshalJSON() ([]byte, error)

func (*SetTag) UnmarshalJSON added in v0.23.0

func (s *SetTag) UnmarshalJSON(b []byte) error

type SetTagResponse added in v0.34.0

type SetTagResponse struct {
}

type Stage

type Stage string

Stage of the model version. Valid values are:

* `None`: The initial stage of a model version.

* `Staging`: Staging or pre-production stage.

* `Production`: Production stage.

* `Archived`: Archived stage.

const StageArchived Stage = `Archived`

Archived stage.

const StageNone Stage = `None`

The initial stage of a model version.

const StageProduction Stage = `Production`

Production stage.

const StageStaging Stage = `Staging`

Staging or pre-production stage.

func (*Stage) Set

func (f *Stage) Set(v string) error

Set raw string value and validate it against allowed values

func (*Stage) String

func (f *Stage) String() string

String representation for fmt.Print

func (*Stage) Type

func (f *Stage) Type() string

Type always returns Stage to satisfy [pflag.Value] interface

type Status

type Status string

The status of the model version. Valid values are: * `PENDING_REGISTRATION`: Request to register a new model version is pending as server performs background tasks.

* `FAILED_REGISTRATION`: Request to register a new model version has failed.

* `READY`: Model version is ready for use.

const StatusFailedRegistration Status = `FAILED_REGISTRATION`

Request to register a new model version has failed.

const StatusPendingRegistration Status = `PENDING_REGISTRATION`

Request to register a new model version is pending as server performs background tasks.

const StatusReady Status = `READY`

Model version is ready for use.

func (*Status) Set

func (f *Status) Set(v string) error

Set raw string value and validate it against allowed values

func (*Status) String

func (f *Status) String() string

String representation for fmt.Print

func (*Status) Type

func (f *Status) Type() string

Type always returns Status to satisfy [pflag.Value] interface

type TestRegistryWebhook

type TestRegistryWebhook struct {
	// Body of the response from the webhook URL
	Body string `json:"body,omitempty"`
	// Status code returned by the webhook URL
	StatusCode int `json:"status_code,omitempty"`

	ForceSendFields []string `json:"-"`
}

Test webhook response object.

func (TestRegistryWebhook) MarshalJSON added in v0.23.0

func (s TestRegistryWebhook) MarshalJSON() ([]byte, error)

func (*TestRegistryWebhook) UnmarshalJSON added in v0.23.0

func (s *TestRegistryWebhook) UnmarshalJSON(b []byte) error

type TestRegistryWebhookRequest

type TestRegistryWebhookRequest struct {
	// If `event` is specified, the test trigger uses the specified event. If
	// `event` is not specified, the test trigger uses a randomly chosen event
	// associated with the webhook.
	Event RegistryWebhookEvent `json:"event,omitempty"`
	// Webhook ID
	Id string `json:"id"`
}

type TestRegistryWebhookResponse

type TestRegistryWebhookResponse struct {
	// Test webhook response object.
	Webhook *TestRegistryWebhook `json:"webhook,omitempty"`
}

type TransitionModelVersionStageDatabricks

type TransitionModelVersionStageDatabricks struct {
	// Specifies whether to archive all current model versions in the target
	// stage.
	ArchiveExistingVersions bool `json:"archive_existing_versions"`
	// User-provided comment on the action.
	Comment string `json:"comment,omitempty"`
	// Name of the model.
	Name string `json:"name"`
	// Target stage of the transition. Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	Stage Stage `json:"stage"`
	// Version of the model.
	Version string `json:"version"`

	ForceSendFields []string `json:"-"`
}

func (TransitionModelVersionStageDatabricks) MarshalJSON added in v0.23.0

func (s TransitionModelVersionStageDatabricks) MarshalJSON() ([]byte, error)

func (*TransitionModelVersionStageDatabricks) UnmarshalJSON added in v0.23.0

func (s *TransitionModelVersionStageDatabricks) UnmarshalJSON(b []byte) error

type TransitionRequest

type TransitionRequest struct {
	// Array of actions on the activity allowed for the current viewer.
	AvailableActions []ActivityAction `json:"available_actions,omitempty"`
	// User-provided comment associated with the transition request.
	Comment string `json:"comment,omitempty"`
	// Creation time of the object, as a Unix timestamp in milliseconds.
	CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
	// Target stage of the transition (if the activity is stage transition
	// related). Valid values are:
	//
	// * `None`: The initial stage of a model version.
	//
	// * `Staging`: Staging or pre-production stage.
	//
	// * `Production`: Production stage.
	//
	// * `Archived`: Archived stage.
	ToStage Stage `json:"to_stage,omitempty"`
	// The username of the user that created the object.
	UserId string `json:"user_id,omitempty"`

	ForceSendFields []string `json:"-"`
}

Transition request details.

func (TransitionRequest) MarshalJSON added in v0.23.0

func (s TransitionRequest) MarshalJSON() ([]byte, error)

func (*TransitionRequest) UnmarshalJSON added in v0.23.0

func (s *TransitionRequest) UnmarshalJSON(b []byte) error

type TransitionStageResponse

type TransitionStageResponse struct {
	ModelVersion *ModelVersionDatabricks `json:"model_version,omitempty"`
}

type UpdateComment

type UpdateComment struct {
	// User-provided comment on the action.
	Comment string `json:"comment"`
	// Unique identifier of an activity
	Id string `json:"id"`
}

type UpdateCommentResponse

type UpdateCommentResponse struct {
	// Comment details.
	Comment *CommentObject `json:"comment,omitempty"`
}

type UpdateExperiment

type UpdateExperiment struct {
	// ID of the associated experiment.
	ExperimentId string `json:"experiment_id"`
	// If provided, the experiment's name is changed to the new name. The new
	// name must be unique.
	NewName string `json:"new_name,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (UpdateExperiment) MarshalJSON added in v0.23.0

func (s UpdateExperiment) MarshalJSON() ([]byte, error)

func (*UpdateExperiment) UnmarshalJSON added in v0.23.0

func (s *UpdateExperiment) UnmarshalJSON(b []byte) error

type UpdateExperimentResponse added in v0.34.0

type UpdateExperimentResponse struct {
}

type UpdateModelRequest

type UpdateModelRequest struct {
	// If provided, updates the description for this `registered_model`.
	Description string `json:"description,omitempty"`
	// Registered model unique name identifier.
	Name string `json:"name"`

	ForceSendFields []string `json:"-"`
}

func (UpdateModelRequest) MarshalJSON added in v0.23.0

func (s UpdateModelRequest) MarshalJSON() ([]byte, error)

func (*UpdateModelRequest) UnmarshalJSON added in v0.23.0

func (s *UpdateModelRequest) UnmarshalJSON(b []byte) error

type UpdateModelResponse added in v0.34.0

type UpdateModelResponse struct {
}

type UpdateModelVersionRequest

type UpdateModelVersionRequest struct {
	// If provided, updates the description for this `registered_model`.
	Description string `json:"description,omitempty"`
	// Name of the registered model
	Name string `json:"name"`
	// Model version number
	Version string `json:"version"`

	ForceSendFields []string `json:"-"`
}

func (UpdateModelVersionRequest) MarshalJSON added in v0.23.0

func (s UpdateModelVersionRequest) MarshalJSON() ([]byte, error)

func (*UpdateModelVersionRequest) UnmarshalJSON added in v0.23.0

func (s *UpdateModelVersionRequest) UnmarshalJSON(b []byte) error

type UpdateModelVersionResponse added in v0.34.0

type UpdateModelVersionResponse struct {
}

type UpdateRegistryWebhook

type UpdateRegistryWebhook struct {
	// User-specified description for the webhook.
	Description string `json:"description,omitempty"`
	// Events that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A
	// new model version was created for the associated model.
	//
	// * `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was
	// changed.
	//
	// * `TRANSITION_REQUEST_CREATED`: A user requested a model version’s
	// stage be transitioned.
	//
	// * `COMMENT_CREATED`: A user wrote a comment on a registered model.
	//
	// * `REGISTERED_MODEL_CREATED`: A new registered model was created. This
	// event type can only be specified for a registry-wide webhook, which can
	// be created by not specifying a model name in the create request.
	//
	// * `MODEL_VERSION_TAG_SET`: A user set a tag on the model version.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was
	// transitioned to staging.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was
	// transitioned to production.
	//
	// * `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived.
	//
	// * `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model
	// version be transitioned to staging.
	//
	// * `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model
	// version be transitioned to production.
	//
	// * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model
	// version be archived.
	Events []RegistryWebhookEvent `json:"events,omitempty"`

	HttpUrlSpec *HttpUrlSpec `json:"http_url_spec,omitempty"`
	// Webhook ID
	Id string `json:"id"`

	JobSpec *JobSpec `json:"job_spec,omitempty"`
	// Enable or disable triggering the webhook, or put the webhook into test
	// mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an
	// associated event happens.
	//
	// * `DISABLED`: Webhook is not triggered.
	//
	// * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is
	// not triggered on a real event.
	Status RegistryWebhookStatus `json:"status,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (UpdateRegistryWebhook) MarshalJSON added in v0.23.0

func (s UpdateRegistryWebhook) MarshalJSON() ([]byte, error)

func (*UpdateRegistryWebhook) UnmarshalJSON added in v0.23.0

func (s *UpdateRegistryWebhook) UnmarshalJSON(b []byte) error

type UpdateRun

type UpdateRun struct {
	// Unix timestamp in milliseconds of when the run ended.
	EndTime int64 `json:"end_time,omitempty"`
	// ID of the run to update. Must be provided.
	RunId string `json:"run_id,omitempty"`
	// [Deprecated, use run_id instead] ID of the run to update.. This field
	// will be removed in a future MLflow version.
	RunUuid string `json:"run_uuid,omitempty"`
	// Updated status of the run.
	Status UpdateRunStatus `json:"status,omitempty"`

	ForceSendFields []string `json:"-"`
}

func (UpdateRun) MarshalJSON added in v0.23.0

func (s UpdateRun) MarshalJSON() ([]byte, error)

func (*UpdateRun) UnmarshalJSON added in v0.23.0

func (s *UpdateRun) UnmarshalJSON(b []byte) error

type UpdateRunResponse

type UpdateRunResponse struct {
	// Updated metadata of the run.
	RunInfo *RunInfo `json:"run_info,omitempty"`
}

type UpdateRunStatus

type UpdateRunStatus string

Updated status of the run.

const UpdateRunStatusFailed UpdateRunStatus = `FAILED`
const UpdateRunStatusFinished UpdateRunStatus = `FINISHED`
const UpdateRunStatusKilled UpdateRunStatus = `KILLED`
const UpdateRunStatusRunning UpdateRunStatus = `RUNNING`
const UpdateRunStatusScheduled UpdateRunStatus = `SCHEDULED`

func (*UpdateRunStatus) Set

func (f *UpdateRunStatus) Set(v string) error

Set raw string value and validate it against allowed values

func (*UpdateRunStatus) String

func (f *UpdateRunStatus) String() string

String representation for fmt.Print

func (*UpdateRunStatus) Type

func (f *UpdateRunStatus) Type() string

Type always returns UpdateRunStatus to satisfy [pflag.Value] interface

type UpdateWebhookResponse added in v0.34.0

type UpdateWebhookResponse struct {
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL