Documentation ¶
Overview ¶
Package api provides common functions used by the service and graphql packages.
Index ¶
- Constants
- func GetHostsAndUserPermissions(ctx context.Context, user *user.DBUser, hostIds []string) ([]host.Host, map[string]gimlet.Permissions, int, error)
- func GetReprovisionToNewCallback(ctx context.Context, env evergreen.Environment, username string) func(h *host.Host) (int, error)
- func GetRestartJasperCallback(ctx context.Context, env evergreen.Environment, username string) func(h *host.Host) (int, error)
- func GetUpdateHostStatusCallback(ctx context.Context, env evergreen.Environment, status string, notes string, ...) func(h *host.Host) (httpStatus int, err error)
- func ModifyHostStatus(ctx context.Context, env evergreen.Environment, h *host.Host, newStatus string, ...) (string, int, error)
- func ModifyHostsWithPermissions(hosts []host.Host, perm map[string]gimlet.Permissions, ...) (updated int, httpStatus int, err error)
Constants ¶
View Source
const ( InvalidStatusError = "'%v' is not a valid status" DecommissionStaticHostError = "Cannot decommission static hosts" HostTerminationQueueingError = "Error starting background job for host termination" HostUpdateError = "Error updating host" HostTerminationQueueingSuccess = "Host %v successfully queued for termination" HostStatusUpdateSuccess = "Host status successfully updated from '%v' to '%v'" HostStatusWriteConfirm = "Successfully updated host status" HostRestartJasperConfirm = "Successfully marked host as needing Jasper service restarted" HostReprovisionConfirm = "Successfully marked host as needing to reprovision" )
Variables ¶
This section is empty.
Functions ¶
func ModifyHostStatus ¶
func ModifyHostsWithPermissions ¶
func ModifyHostsWithPermissions(hosts []host.Host, perm map[string]gimlet.Permissions, modifyHost func(h *host.Host) (int, error)) (updated int, httpStatus int, err error)
ModifyHostsWithPermissions performs an update on each of the given hosts for which the permissions allow updates on that host.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.