Documentation
¶
Overview ¶
Package workbench provides workbench service helpers.
Index ¶
- func AddEnvsToServiceRequests(envs []string, serviceRequests []types.ServiceRequest) []types.ServiceRequest
- func Auth0IDsQuery(ids []string, sortSpec string) url.Values
- func BulkDeleteImages(ctx context.Context, s *WorkbenchService, ids []string) ([]string, error)
- func BulkDeleteJobSubmissions(ctx context.Context, s *WorkbenchService, ids []string) ([]string, error)
- func BulkDeleteJobs(ctx context.Context, s *WorkbenchService, ids []string) ([]string, error)
- func BulkDeleteSnapshots(ctx context.Context, s *WorkbenchService, ids []string) ([]string, error)
- func BulkDeleteWorkbenches(ctx context.Context, s *WorkbenchService, ids []string) ([]string, error)
- func BulkDeleteWorkspaces(ctx context.Context, s *WorkbenchService, ids []string) ([]string, error)
- func BulkUpdateImages(ctx context.Context, s *WorkbenchService, ids []string, body types.Image) (types.Images, error)
- func BulkUpdateJobs(ctx context.Context, s *WorkbenchService, ids []string, body types.Job) (types.Jobs, error)
- func BulkUpdateSnapshots(ctx context.Context, s *WorkbenchService, ids []string, body types.Snapshot) (types.Snapshots, error)
- func BulkUpdateWorkbenches(ctx context.Context, s *WorkbenchService, ids []string, body types.Workbench) (types.Workbenches, error)
- func BulkUpdateWorkspaces(ctx context.Context, s *WorkbenchService, ids []string, body types.Workspace) (types.Workspaces, error)
- func CreateImage(ctx context.Context, s *WorkbenchService, body types.Image) (types.Image, error)
- func CreateJob(ctx context.Context, s *WorkbenchService, body types.Job) (types.Job, error)
- func CreateJobSubmission(ctx context.Context, s *WorkbenchService, body types.JobSubmission) (types.JobSubmission, error)
- func CreateSnapshot(ctx context.Context, s *WorkbenchService, body types.Snapshot) (types.Snapshot, error)
- func CreateWorkbench(ctx context.Context, s *WorkbenchService, body types.Workbench) (types.Workbench, error)
- func CreateWorkspace(ctx context.Context, s *WorkbenchService, body types.Workspace) (types.Workspace, error)
- func DescribeConflicts(_ui ui.UI, resources types.Conflicts) error
- func DescribeDataplanes(_ui ui.UI, resources types.Dataplanes) error
- func DescribeImageBuilds(_ui ui.UI, resources types.ImageBuilds) error
- func DescribeImages(_ui ui.UI, resources types.Images) error
- func DescribeJobSubmissions(_ui ui.UI, resources types.JobSubmissions) error
- func DescribeJobs(_ui ui.UI, resources types.Jobs) error
- func DescribeSnapshots(_ui ui.UI, resources types.Snapshots) error
- func DescribeUsers(_ui ui.UI, resources types.Auth0UserList) error
- func DescribeWorkbenches(_ui ui.UI, resources types.Workbenches) error
- func DescribeWorkspaces(_ui ui.UI, resources types.Workspaces) error
- func Get[T any](ctx context.Context, s *WorkbenchService, path string, query url.Values) result.Result[T]
- func GetAccessToken(s *WorkbenchService) string
- func GetApplicationIDs(ctx context.Context, s *WorkbenchService) ([]string, error)
- func GetApplications(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Applications, error)
- func GetConflicts(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Conflicts, error)
- func GetDataplanes(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Dataplanes, error)
- func GetEvents(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Events, error)
- func GetImageBuilds(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.ImageBuilds, error)
- func GetImages(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Images, error)
- func GetInitializerRequests(ctx context.Context, svc *WorkbenchService, initializerIDs []string) ([]types.ServiceRequest, error)
- func GetInitializers(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Initializers, error)
- func GetJobSubmissions(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.JobSubmissions, error)
- func GetJobs(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Jobs, error)
- func GetNodepoolIDs(ctx context.Context, s *WorkbenchService) ([]string, error)
- func GetNodepools(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Nodepools, error)
- func GetPings(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Pings, error)
- func GetRaw(ctx context.Context, s *WorkbenchService, rawURL string) result.Result[string]
- func GetServiceIDs(ctx context.Context, s *WorkbenchService) ([]string, error)
- func GetServiceRequests(ctx context.Context, svc *WorkbenchService, application string, ...) ([]types.ServiceRequest, error)
- func GetServices(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Services, error)
- func GetSettings(ctx context.Context, s *WorkbenchService, userID string, tenant bool) (types.Settings, error)
- func GetSnapshots(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Snapshots, error)
- func GetStorageClasses(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.StorageClasses, error)
- func GetUsers(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Auth0UserList, error)
- func GetValidDataplaneID(ctx context.Context, svc *WorkbenchService, dataplaneID string) (string, error)
- func GetValidWorkspaceRequests(ctx context.Context, svc *WorkbenchService, workspaceIDs []string) ([]types.WorkspaceRequestWithMetadata, error)
- func GetWorkbenches(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Workbenches, error)
- func GetWorkspaces(ctx context.Context, s *WorkbenchService, ids []string, sortSpec string) (types.Workspaces, error)
- func IDsOrControllerIDsQuery(ids []string, sortSpec string) url.Values
- func IDsQuery(ids []string, sortSpec string) url.Values
- func Post[T any](ctx context.Context, s *WorkbenchService, path string, body any) result.Result[T]
- func PrintAPI(_ui ui.UI, resources API) error
- func PrintApplications(_ui ui.UI, _ string, resources types.Applications) error
- func PrintConflicts(_ui ui.UI, _ string, resources types.Conflicts) error
- func PrintDataplanes(_ui ui.UI, _ string, resources types.Dataplanes) error
- func PrintEvents(_ui ui.UI, _ string, resources types.Events) error
- func PrintImageBuilds(_ui ui.UI, _ string, resources types.ImageBuilds) error
- func PrintImages(_ui ui.UI, token string, resources types.Images) error
- func PrintInitializers(_ui ui.UI, _ string, resources types.Initializers) error
- func PrintJobSubmissions(_ui ui.UI, token string, resources types.JobSubmissions) error
- func PrintJobs(_ui ui.UI, token string, resources types.Jobs) error
- func PrintNodepools(_ui ui.UI, _ string, resources types.Nodepools) error
- func PrintPings(_ui ui.UI, _ string, resources types.Pings) error
- func PrintServices(_ui ui.UI, _ string, resources types.Services) error
- func PrintSettings(_ui ui.UI, resources types.Settings) error
- func PrintSnapshots(_ui ui.UI, token string, resources types.Snapshots) error
- func PrintStorageClasses(_ui ui.UI, _ string, resources types.StorageClasses) error
- func PrintUsers(_ui ui.UI, _ string, resources types.Auth0UserList) error
- func PrintWorkbenches(_ui ui.UI, token string, resources types.Workbenches) error
- func PrintWorkspaces(_ui ui.UI, token string, resources types.Workspaces) error
- func RebuildImage(ctx context.Context, s *WorkbenchService, id string) (bool, error)
- func SetSetting(ctx context.Context, s *WorkbenchService, userID string, name string, ...) (bool, error)
- type API
- type WorkbenchService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddEnvsToServiceRequests ¶
func AddEnvsToServiceRequests( envs []string, serviceRequests []types.ServiceRequest, ) []types.ServiceRequest
AddEnvsToServiceRequests returns a function that will add the given environment strings, in the form `name=value`, to each service request.
func Auth0IDsQuery ¶
Auth0IDsQuery returns an Auth0 compatible query for the given IDs.
func BulkDeleteImages ¶
BulkDeleteImages deletes the images with the given ids.
func BulkDeleteJobSubmissions ¶
func BulkDeleteJobSubmissions(ctx context.Context, s *WorkbenchService, ids []string) ([]string, error)
BulkDeleteJobSubmissions deletes the job submission with the given id.
func BulkDeleteJobs ¶
BulkDeleteJobs deletes the job with the given id.
func BulkDeleteSnapshots ¶
BulkDeleteSnapshots deletes the snapshot with the given id.
func BulkDeleteWorkbenches ¶
func BulkDeleteWorkbenches(ctx context.Context, s *WorkbenchService, ids []string) ([]string, error)
BulkDeleteWorkbenches deletes the workbench with the given id.
func BulkDeleteWorkspaces ¶
BulkDeleteWorkspaces deletes the workspaces with the given ids.
func BulkUpdateImages ¶
func BulkUpdateImages( ctx context.Context, s *WorkbenchService, ids []string, body types.Image, ) (types.Images, error)
BulkUpdateImages applies the given types.Image to all the images with the given ids.
func BulkUpdateJobs ¶
func BulkUpdateJobs( ctx context.Context, s *WorkbenchService, ids []string, body types.Job, ) (types.Jobs, error)
BulkUpdateJobs applies the given types.Job to all the jobs with the given ids.
func BulkUpdateSnapshots ¶
func BulkUpdateSnapshots( ctx context.Context, s *WorkbenchService, ids []string, body types.Snapshot, ) (types.Snapshots, error)
BulkUpdateSnapshots applies the given types.Snapshot to all the snapshots with the given ids.
func BulkUpdateWorkbenches ¶
func BulkUpdateWorkbenches( ctx context.Context, s *WorkbenchService, ids []string, body types.Workbench, ) (types.Workbenches, error)
BulkUpdateWorkbenches applies the given types.Workbench to all the workbenches with the given ids.
func BulkUpdateWorkspaces ¶
func BulkUpdateWorkspaces( ctx context.Context, s *WorkbenchService, ids []string, body types.Workspace, ) (types.Workspaces, error)
BulkUpdateWorkspaces applies the given types.Workspace to all the workspaces with the given ids.
func CreateImage ¶
CreateImage creates an image.
func CreateJobSubmission ¶
func CreateJobSubmission( ctx context.Context, s *WorkbenchService, body types.JobSubmission, ) (types.JobSubmission, error)
CreateJobSubmission creates a job submission.
func CreateSnapshot ¶
func CreateSnapshot( ctx context.Context, s *WorkbenchService, body types.Snapshot, ) (types.Snapshot, error)
CreateSnapshot creates a snapshot.
func CreateWorkbench ¶
func CreateWorkbench( ctx context.Context, s *WorkbenchService, body types.Workbench, ) (types.Workbench, error)
CreateWorkbench creates a workbench.
func CreateWorkspace ¶
func CreateWorkspace( ctx context.Context, s *WorkbenchService, body types.Workspace, ) (types.Workspace, error)
CreateWorkspace creates a workspace.
func DescribeConflicts ¶
DescribeConflicts returns a function that describes the given conflicts.
func DescribeDataplanes ¶
func DescribeDataplanes(_ui ui.UI, resources types.Dataplanes) error
DescribeDataplanes returns a function that describes the given dataplanes.
func DescribeImageBuilds ¶
func DescribeImageBuilds(_ui ui.UI, resources types.ImageBuilds) error
DescribeImageBuilds returns a function that describes the given image builds.
func DescribeImages ¶
DescribeImages returns a function that describes the given images.
func DescribeJobSubmissions ¶
func DescribeJobSubmissions(_ui ui.UI, resources types.JobSubmissions) error
DescribeJobSubmissions returns a function that describes the given job submissions.
func DescribeJobs ¶
DescribeJobs returns a function that describes the given jobs.
func DescribeSnapshots ¶
DescribeSnapshots returns a function that describes the given snapshots.
func DescribeUsers ¶
func DescribeUsers(_ui ui.UI, resources types.Auth0UserList) error
DescribeUsers returns a function that describes the given users.
func DescribeWorkbenches ¶
func DescribeWorkbenches(_ui ui.UI, resources types.Workbenches) error
DescribeWorkbenches returns a function that describes the given workbenches.
func DescribeWorkspaces ¶
func DescribeWorkspaces(_ui ui.UI, resources types.Workspaces) error
DescribeWorkspaces returns a function that describes the given workspaces.
func Get ¶
func Get[T any](ctx context.Context, s *WorkbenchService, path string, query url.Values) result.Result[T]
Get performs an http GET with the given path and query against the given WorkbenchService. The response body is marshaled from JSON into the given type T and returned as a result.
func GetAccessToken ¶
func GetAccessToken(s *WorkbenchService) string
GetAccessToken gets the access token from the given WorkbenchService.
func GetApplicationIDs ¶
func GetApplicationIDs( ctx context.Context, s *WorkbenchService, ) ([]string, error)
GetApplicationIDs returns all application IDs present in the WorkbenchService.
func GetApplications ¶
func GetApplications( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Applications, error)
GetApplications gets the Applications supported by the WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetConflicts ¶
func GetConflicts( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Conflicts, error)
GetConflicts returns the Conflicts currently present in the Workbench Service. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetDataplanes ¶
func GetDataplanes( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Dataplanes, error)
GetDataplanes gets the Dataplanes in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetEvents ¶
func GetEvents( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Events, error)
GetEvents gets the events from the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetImageBuilds ¶
func GetImageBuilds( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.ImageBuilds, error)
GetImageBuilds gets the image builds in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetImages ¶
func GetImages( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Images, error)
GetImages gets the images in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetInitializerRequests ¶
func GetInitializerRequests( ctx context.Context, svc *WorkbenchService, initializerIDs []string, ) ([]types.ServiceRequest, error)
GetInitializerRequests converts the given initializer IDs into a set of service requests that can be included in a Workspace request with those initializers.
func GetInitializers ¶
func GetInitializers( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Initializers, error)
GetInitializers gets the initializers in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetJobSubmissions ¶
func GetJobSubmissions( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.JobSubmissions, error)
GetJobSubmissions gets the job submissions in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetJobs ¶
func GetJobs( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Jobs, error)
GetJobs gets the jobs in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetNodepoolIDs ¶
func GetNodepoolIDs( ctx context.Context, s *WorkbenchService, ) ([]string, error)
GetNodepoolIDs returns all nodepool IDs present in the WorkbenchService.
func GetNodepools ¶
func GetNodepools( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Nodepools, error)
GetNodepools gets the nodepools in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetPings ¶
func GetPings( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Pings, error)
GetPings gets the pings in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetRaw ¶
GetRaw performs an http GET with the given path and query against the given WorkbenchService. The response body is marshaled into a string and returned as a result.
func GetServiceIDs ¶
func GetServiceIDs( ctx context.Context, s *WorkbenchService, ) ([]string, error)
GetServiceIDs returns all service IDs present in the WorkbenchService.
func GetServiceRequests ¶
func GetServiceRequests( ctx context.Context, svc *WorkbenchService, application string, serviceIDs []string, ) ([]types.ServiceRequest, error)
GetServiceRequests converts the given application into a set of service requests that can be included in a Workbench request for that application.
func GetServices ¶
func GetServices( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Services, error)
GetServices gets the services in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetSettings ¶
func GetSettings( ctx context.Context, s *WorkbenchService, userID string, tenant bool, ) (types.Settings, error)
GetSettings returns the Settings currently present in the Workbench Service.
func GetSnapshots ¶
func GetSnapshots( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Snapshots, error)
GetSnapshots gets the snapshots in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetStorageClasses ¶
func GetStorageClasses( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.StorageClasses, error)
GetStorageClasses gets the storage classes in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetUsers ¶
func GetUsers( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Auth0UserList, error)
GetUsers gets the users in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetValidDataplaneID ¶
func GetValidDataplaneID(ctx context.Context, svc *WorkbenchService, dataplaneID string) (string, error)
GetValidDataplaneID looks up a dataplane using the given dataplaneID. If the dataplane exists then its ID is returned. If given an empty dataplaneID then an empty string is returned with no error.
func GetValidWorkspaceRequests ¶
func GetValidWorkspaceRequests( ctx context.Context, svc *WorkbenchService, workspaceIDs []string, ) ([]types.WorkspaceRequestWithMetadata, error)
GetValidWorkspaceRequests takes the given worksaceIDs, fetches those workspaces from the server, and returns the database id and full workspace request body for each.
func GetWorkbenches ¶
func GetWorkbenches( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Workbenches, error)
GetWorkbenches gets the workbenches in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func GetWorkspaces ¶
func GetWorkspaces( ctx context.Context, s *WorkbenchService, ids []string, sortSpec string, ) (types.Workspaces, error)
GetWorkspaces gets the workspaces in the given WorkbenchService. If given any ids, only the matching resources will be returned. Otherwise, all resources are returned.
func IDsOrControllerIDsQuery ¶
IDsOrControllerIDsQuery returns a PostgREST compatible query for the given IDs and sort spec that will match either the actual id or the controller_id columns.
func Post ¶
Post performs an http POST with the given path and query against the given WorkbenchService. The response body is marshaled from JSON into the given type T and returned as a result.
func PrintApplications ¶
PrintApplications returns a function that prints the given applications.
func PrintConflicts ¶
PrintConflicts returns a function that prints the given conflicts.
func PrintDataplanes ¶
PrintDataplanes returns a function that prints the given dataplanes.
func PrintEvents ¶
PrintEvents returns a function that prints the given events.
func PrintImageBuilds ¶
PrintImageBuilds returns a function that prints the given image builds.
func PrintImages ¶
PrintImages returns a function that prints the given images.
func PrintInitializers ¶
PrintInitializers returns a function that prints the given initializers.
func PrintJobSubmissions ¶
PrintJobSubmissions returns a function that prints the given job submissions.
func PrintNodepools ¶
PrintNodepools returns a function that prints the given nodepools.
func PrintPings ¶
PrintPings returns a function that prints the given pings.
func PrintServices ¶
PrintServices returns a function that prints the given services.
func PrintSettings ¶
PrintSettings returns a function that prints the given Settings.
func PrintSnapshots ¶
PrintSnapshots returns a function that prints the given snapshots.
func PrintStorageClasses ¶
PrintStorageClasses returns a function that prints the given storage classes.
func PrintUsers ¶
PrintUsers returns a function that prints the given users.
func PrintWorkbenches ¶
PrintWorkbenches returns a function that prints the given workbenches.
func PrintWorkspaces ¶
PrintWorkspaces returns a function that prints the given workspaces.
func RebuildImage ¶
RebuildImage rebuilds the image with the given id.
Types ¶
type WorkbenchService ¶
type WorkbenchService struct {
// contains filtered or unexported fields
}
WorkbenchService is an exported type. nolint:revive
func NewWorkbenchService ¶
func NewWorkbenchService(endpoint, accessToken, csrfToken string) *WorkbenchService
NewWorkbenchService returns a new workbench service.