Documentation
¶
Overview ¶
Package types defines shared types used by the CLI.
Index ¶
- func GetFunction[T any](resourceType string, metadata []FunctionMetadata[T]) (T, bool)
- func SupportedResourceTypes[T any](metadata []FunctionMetadata[T]) []string
- type Application
- type Applications
- type Auth0User
- type Auth0UserList
- type CapabilityVolumeSource
- type Config
- type Conflict
- type Conflicts
- type Dataplane
- type Dataplanes
- type Event
- type Events
- type ExecuteableResourceStatus
- type FunctionMetadata
- type Image
- type ImageBuild
- type ImageBuildLog
- type ImageBuildLogs
- type ImageBuilds
- type Images
- type Initializer
- type Initializers
- type Job
- type JobSubmission
- type JobSubmissions
- type Jobs
- type MountRequest
- type Nodepool
- type Nodepools
- type PVCStatus
- type Ping
- type Pings
- type Role
- type Service
- type ServiceRequest
- type Services
- type Settings
- type Snapshot
- type Snapshots
- type StorageClass
- type StorageClasses
- type VolumeSource
- type VolumeStatus
- type Workbench
- type Workbenches
- type Workspace
- type WorkspaceRequest
- type WorkspaceRequestWithMetadata
- type Workspaces
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFunction ¶
func GetFunction[T any]( resourceType string, metadata []FunctionMetadata[T], ) (T, bool)
GetFunction returns the function bound to a resource type.
func SupportedResourceTypes ¶
func SupportedResourceTypes[T any](metadata []FunctionMetadata[T]) []string
SupportedResourceTypes returns the plural form of the resources represented by the given FunctionMetadata slice. The returned slice is sorted by the singular name so that error messages line up with the order of the commands which are sorted by the singular name.
Types ¶
type Application ¶
type Application struct {
ID string `json:"id,omitempty"`
Description string `json:"description,omitempty"`
DisplayName string `json:"display_name,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty"`
Services []string `json:"services,omitempty"`
}
Application represents an application.
func AsApplicationSlice ¶
func AsApplicationSlice(source Applications) []Application
AsApplicationSlice converts Applications to a plain slice.
type Auth0User ¶
type Auth0User struct {
Version int `json:"version,omitempty"`
ID string `json:"id,omitempty"`
DatabaseID string `json:"databaseId,omitempty"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
CreationTimeStamp time.Time `json:"creationTimeStamp,omitempty"`
Roles []Role `json:"roles,omitempty"`
UserMetadata map[string]any `json:"userMetadata,omitempty"`
}
Auth0User is the representation of a user in the auth0Admin service.
type Auth0UserList ¶
type Auth0UserList struct {
Version int `json:"version"`
Accept string `json:"accept"`
Count int `json:"count"`
Start int `json:"start"`
Limit int `json:"limit"`
Name string `json:"name"`
Items []Auth0User `json:"items"`
}
Auth0UserList is the representation of a list of users in the auth0Admin service.
type CapabilityVolumeSource ¶
type CapabilityVolumeSource struct {
Name string `json:"name"`
PullPolicy string `json:"pullPolicy,omitempty"`
}
CapabilityVolumeSource identifies a capability to be mounted into a Job or Workbench.
type Config ¶
type Config struct {
Endpoint string `json:"endpoint,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Output string `json:"output,omitempty"`
}
Config holds CLI configuration values.
type Conflict ¶
type Conflict struct {
ConflictControllerID string `json:"conflict_controller_id,omitempty"`
ConflictID string `json:"conflict_id,omitempty"`
ConflictName string `json:"conflict_name,omitempty"`
ConflictNodeID string `json:"conflict_node_id,omitempty"`
ConflictType string `json:"conflict_type,omitempty"`
ControllerID string `json:"controller_id,omitempty"`
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
NodeID string `json:"node_id,omitempty"`
Type string `json:"type,omitempty"`
WorkspaceControllerID string `json:"workspace_controller_id,omitempty" wbctl:"alias:volume_controller_id"`
WorkspaceID string `json:"workspace_id,omitempty" wbctl:"alias:volume_id"`
WorkspaceName string `json:"workspace_name,omitempty" wbctl:"alias:volume_name"`
}
Conflict represents a conflict record.
func AsConflictSlice ¶
AsConflictSlice converts Conflicts to a plain slice.
type Dataplane ¶
type Dataplane struct {
ID string `json:"id,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Spec map[string]interface{} `json:"spec,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
State string `json:"state,omitempty"`
Message string `json:"message,omitempty"`
}
Dataplane represents a dataplane.
type Event ¶
type Event struct {
ID string `json:"id,omitempty"`
Action string `json:"action,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Kind string `json:"kind,omitempty"`
Note string `json:"note,omitempty"`
Reason string `json:"reason,omitempty"`
ResourceType string `json:"resource_type,omitempty"`
Type string `json:"type,omitempty"`
}
Event represents an event.
func AsEventSlice ¶
AsEventSlice converts Events to a plain slice.
type ExecuteableResourceStatus ¶
type ExecuteableResourceStatus struct {
Name string `json:"name,omitempty"`
Deleted bool `json:"deleted,omitempty"`
NodeID string `json:"nodeId,omitempty"`
Status corev1.PodStatus `json:"status,omitempty"`
}
ExecuteableResourceStatus describes a resource's execution status.
type FunctionMetadata ¶
FunctionMetadata binds resource names to implementations.
type Image ¶
type Image struct {
Context string `json:"context,omitempty" wbctl:"editable"`
ControllerID string `json:"controller_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
CurrentState string `json:"current_state,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty" wbctl:"editable"`
Description string `json:"description,omitempty" wbctl:"editable"`
Email string `json:"email,omitempty"`
ID string `json:"id,omitempty"`
ImageName string `json:"image_name,omitempty" wbctl:"editable"`
ImageRegistry string `json:"image_registry,omitempty" wbctl:"editable"`
ImageTag string `json:"image_tag,omitempty" wbctl:"editable"`
Labels map[string]string `json:"labels,omitempty" wbctl:"editable"`
LatestImageBuildControllerID string `json:"latest_image_build_controller_id,omitempty"`
LatestImageBuildID string `json:"latest_image_build_id,omitempty"`
Message string `json:"message,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
Name string `json:"name,omitempty" wbctl:"editable"`
PodStatus []ExecuteableResourceStatus `json:"pod_status,omitempty"`
Spec map[string]interface{} `json:"spec,omitempty" wbctl:"editable"`
SubPath string `json:"sub_path,omitempty" wbctl:"editable"`
TenantID string `json:"tenant_id,omitempty"`
Username string `json:"username,omitempty"`
}
Image represents an image.
func AsImageSlice ¶
AsImageSlice converts Images to a plain slice.
type ImageBuild ¶
type ImageBuild struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ControllerID string `json:"controller_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty"`
ImageID string `json:"image_id,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
LogURL string `json:"log_url,omitempty"`
PodStatus []ExecuteableResourceStatus `json:"pod_status,omitempty"`
}
ImageBuild represents an image build.
func AsImageBuildSlice ¶
func AsImageBuildSlice(source ImageBuilds) []ImageBuild
AsImageBuildSlice converts ImageBuilds to a plain slice.
type ImageBuildLog ¶
type ImageBuildLog struct {
BuildID string `json:"build_id,omitempty"`
ContainerName string `json:"container_name,omitempty"`
ControllerID string `json:"controller_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty"`
Log string `json:"log,omitempty"`
}
ImageBuildLog represents an image build log entry.
func AsImageBuildLogSlice ¶
func AsImageBuildLogSlice(source ImageBuildLogs) []ImageBuildLog
AsImageBuildLogSlice converts ImageBuildLogs to a plain slice.
type ImageBuildLogs ¶
type ImageBuildLogs []ImageBuildLog
ImageBuildLogs is a slice of ImageBuildLog values.
type Initializer ¶
type Initializer struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty"`
}
Initializer represents a workspace initializer.
func AsInitializerSlice ¶
func AsInitializerSlice(source Initializers) []Initializer
AsInitializerSlice converts Initializers to a plain slice.
type Job ¶
type Job struct {
ApplicationID string `json:"application_id,omitempty" wbctl:"editable"`
Context string `json:"context,omitempty" wbctl:"editable"`
CreatedAt *time.Time `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty" wbctl:"editable"`
Description string `json:"description,omitempty" wbctl:"editable"`
Email string `json:"email,omitempty"`
ID string `json:"id,omitempty"`
Labels map[string]string `json:"labels,omitempty" wbctl:"editable"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
MostRecentJobSubmissionAt *time.Time `json:"most_recent_job_submission_at,omitempty"`
MostRecentJobSubmissionID string `json:"most_recent_job_submission_id,omitempty"`
Name string `json:"name,omitempty" wbctl:"editable"`
Nodepool string `json:"nodepool,omitempty" wbctl:"editable"`
Properties map[string]interface{} `json:"properties,omitempty" wbctl:"editable"`
Schedule string `json:"schedule,omitempty" wbctl:"editable"`
Services []ServiceRequest `json:"services,omitempty" wbctl:"editable"`
Spec map[string]interface{} `json:"spec,omitempty" wbctl:"editable"`
SubPath string `json:"sub_path,omitempty" wbctl:"editable"`
TenantID string `json:"tenant_id,omitempty"`
Username string `json:"username,omitempty"`
WorkspaceNames map[string]string `json:"workspace_names,omitempty" wbctl:"alias:volume_names"`
Workspaces []WorkspaceRequest `json:"workspaces,omitempty" wbctl:"alias:volumes,editable"`
Mounts []MountRequest `json:"mounts,omitempty" wbctl:"alias:volumes,editable"`
}
Job represents a scheduled or ad hoc job.
type JobSubmission ¶
type JobSubmission struct {
ID string `json:"id,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
TenantID string `json:"tenant_id,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty"`
JobID string `json:"job_id,omitempty"`
JobName string `json:"job_name,omitempty"`
Env map[string]string `json:"env,omitempty"`
Workspaces []WorkspaceRequest `json:"workspaces,omitempty" wbctl:"alias:volumes"`
Labels map[string]string `json:"labels,omitempty"`
Nodepool string `json:"nodepool,omitempty"`
ControllerID string `json:"controller_id,omitempty"`
URL string `json:"url,omitempty"`
CurrentState string `json:"current_state,omitempty"`
Message string `json:"message,omitempty"`
PodStatus []ExecuteableResourceStatus `json:"pod_status,omitempty"`
Email string `json:"email,omitempty"`
Username string `json:"username,omitempty"`
CanceledAt *time.Time `json:"canceled_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Runtime float64 `json:"runtime,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
Scheduled bool `json:"scheduled,omitempty"`
LogURL string `json:"log_url,omitempty"`
}
JobSubmission represents a job submission record.
func AsJobSubmissionSlice ¶
func AsJobSubmissionSlice(source JobSubmissions) []JobSubmission
AsJobSubmissionSlice converts JobSubmissions to a plain slice.
func AsNodepoolSlice ¶
func AsNodepoolSlice(source JobSubmissions) []JobSubmission
AsNodepoolSlice converts JobSubmissions to a plain slice.
type JobSubmissions ¶
type JobSubmissions []JobSubmission
JobSubmissions is a slice of JobSubmission values.
type MountRequest ¶
type MountRequest struct {
MountPath string `json:"mountPath,omitempty"`
VolumeSource *VolumeSource `json:"volumeSource,omitempty"`
}
MountRequest identifies a mount path and volume source to be mounted into a Job or Workbench.
type Nodepool ¶
type Nodepool struct {
ID string `json:"id,omitempty"`
DisplayName string `json:"display_name,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty"`
Description string `json:"description,omitempty"`
}
Nodepool represents a node pool.
type PVCStatus ¶
type PVCStatus struct {
Deleted bool `json:"deleted,omitempty"`
Status corev1.PersistentVolumeClaimStatus `json:"status,omitempty"`
}
PVCStatus describes a persistent volume claim status.
type Ping ¶
type Ping struct {
DataplaneID string `json:"dataplane_id,omitempty"`
RequestAt *time.Time `json:"request_at,omitempty"`
ResponseAt *time.Time `json:"status_updated_at,omitempty"`
State string `json:"status_state,omitempty"`
Message string `json:"status_message,omitempty"`
}
Ping represents a ping response.
func AsPingSlice ¶
AsPingSlice converts Pings to a plain slice.
type Service ¶
type Service struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty"`
}
Service represents a service.
func AsServiceSlice ¶
AsServiceSlice converts Services to a plain slice.
type ServiceRequest ¶
type ServiceRequest struct {
ID string `json:"id,omitempty"`
Env map[string]string `json:"env,omitempty"`
Image string `json:"image,omitempty"`
}
ServiceRequest describes a service request payload.
type Snapshot ¶
type Snapshot struct {
ControllerID string `json:"controller_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty" wbctl:"editable"`
Description string `json:"description,omitempty" wbctl:"editable"`
Email string `json:"email,omitempty"`
ID string `json:"id,omitempty"`
Message string `json:"message,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
Name string `json:"name,omitempty" wbctl:"editable"`
Properties map[string]interface{} `json:"properties,omitempty" wbctl:"editable"`
Spec *snapshot1.VolumeSnapshotSpec `json:"spec,omitempty" wbctl:"editable"`
State string `json:"state,omitempty"`
TenantID string `json:"tenant_id,omitempty"`
Username string `json:"username,omitempty"`
VolumeStatus *VolumeStatus `json:"volume_status,omitempty"`
WorkspaceSource *Workspace `json:"workspace_source,omitempty" wbctl:"alias:volume_source"`
}
Snapshot represents a snapshot.
func AsSnapshotSlice ¶
AsSnapshotSlice converts Snapshots to a plain slice.
type StorageClass ¶
type StorageClass struct {
ID string `json:"id,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Description string `json:"description,omitempty"`
AccessMode string `json:"access_mode,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty"`
}
StorageClass represents a storage class.
type StorageClasses ¶
type StorageClasses []StorageClass
StorageClasses is a slice of StorageClass values.
type VolumeSource ¶
type VolumeSource struct {
corev1.VolumeSource `json:",inline"`
Capability *CapabilityVolumeSource `json:"capability,omitempty"`
}
VolumeSource is a corev1.VolumeSource with an additional volume source that supports a Workbench capability mount.
type VolumeStatus ¶
type VolumeStatus struct {
Name string `json:"name,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Status snapshot1.VolumeSnapshotStatus `json:"status,omitempty"`
}
VolumeStatus describes a snapshot volume status.
type Workbench ¶
type Workbench struct {
ID string `json:"id,omitempty"`
ApplicationID string `json:"application_id,omitempty" wbctl:"editable"`
ControllerID string `json:"controller_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
CurrentState string `json:"current_state,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty" wbctl:"editable"`
DesiredState string `json:"desired_state,omitempty"` // On get
Email string `json:"email,omitempty"`
Labels map[string]string `json:"labels,omitempty" wbctl:"editable"`
Message string `json:"message,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
Name string `json:"name,omitempty" wbctl:"editable"`
Nodepool string `json:"nodepool,omitempty" wbctl:"editable"`
PodStatus []ExecuteableResourceStatus `json:"pod_status,omitempty"`
PodStatusAt *time.Time `json:"pod_status_at,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty" wbctl:"editable"`
Services []ServiceRequest `json:"services,omitempty" wbctl:"editable"`
State string `json:"state,omitempty" wbctl:"editable,seedfield:DesiredState"`
URL string `json:"url,omitempty"`
Username string `json:"username,omitempty"`
WorkspaceNames map[string]string `json:"workspace_names,omitempty" wbctl:"alias:volume_names"`
Workspaces []WorkspaceRequest `json:"workspaces,omitempty" wbctl:"alias:volumes,editable"`
Mounts []MountRequest `json:"mounts,omitempty" wbctl:"alias:volumes,editable"`
}
Workbench represents a workbench.
func AsWorkbenchSlice ¶
func AsWorkbenchSlice(source Workbenches) []Workbench
AsWorkbenchSlice converts Workbenches to a plain slice.
type Workspace ¶
type Workspace struct {
ControllerID string `json:"controller_id,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
DataplaneID string `json:"dataplane_id,omitempty" wbctl:"editable"`
Description string `json:"description,omitempty" wbctl:"editable"`
Email string `json:"email,omitempty"`
ID string `json:"id,omitempty"`
Initializers []ServiceRequest `json:"initializers,omitempty" wbctl:"editable"`
Message string `json:"message,omitempty"`
ModifiedAt *time.Time `json:"modified_at,omitempty"`
ModifiedBy string `json:"modified_by,omitempty"`
Name string `json:"name,omitempty" wbctl:"editable"`
PVCStatus PVCStatus `json:"pvc_status,omitempty"`
PodStatus []ExecuteableResourceStatus `json:"pod_status,omitempty"`
PodStatusAt *time.Time `json:"pod_status_at,omitempty"`
Properties map[string]interface{} `json:"properties,omitempty" wbctl:"editable"`
State string `json:"state,omitempty"`
StorageSizeG float64 `json:"storage_size_g,omitempty"`
StorageSpec *corev1.PersistentVolumeClaimSpec `json:"storage_spec,omitempty" wbctl:"editable"`
StorageType string `json:"storage_type,omitempty" wbctl:"editable"`
Username string `json:"username,omitempty"`
}
Workspace represents a workspace.
func AsWorkspaceSlice ¶
func AsWorkspaceSlice(source Workspaces) []Workspace
AsWorkspaceSlice converts Workspaces to a plain slice.
type WorkspaceRequest ¶
type WorkspaceRequest struct {
ID string `json:"id,omitempty"`
MountName string `json:"mountName,omitempty"`
EphemeralPVC *corev1.PersistentVolumeClaimSpec `json:"ephemeralPVC,omitempty"`
}
WorkspaceRequest describes a workspace request payload.
type WorkspaceRequestWithMetadata ¶
type WorkspaceRequestWithMetadata struct {
WorkspaceRequest
HomeDir bool
DbID string
}
WorkspaceRequestWithMetadata wraps a workspace request with home directory and db id metadata.