api

package
v0.0.0-...-1402089 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package api provides common functions used by the service and graphql packages.

Index

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 GetHostsAndUserPermissions

func GetHostsAndUserPermissions(ctx context.Context, user *user.DBUser, hostIds []string) ([]host.Host, map[string]gimlet.Permissions, int, error)

func GetReprovisionToNewCallback

func GetReprovisionToNewCallback(ctx context.Context, env evergreen.Environment, username string) func(h *host.Host) (int, error)

func GetRestartJasperCallback

func GetRestartJasperCallback(ctx context.Context, env evergreen.Environment, username string) func(h *host.Host) (int, error)

func GetUpdateHostStatusCallback

func GetUpdateHostStatusCallback(ctx context.Context, env evergreen.Environment,
	status string, notes string, user *user.DBUser) func(h *host.Host) (httpStatus int, err error)

func ModifyHostStatus

func ModifyHostStatus(ctx context.Context, env evergreen.Environment, h *host.Host, newStatus string, notes string, u *user.DBUser) (string, int, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL