services

package
v0.0.0-...-23a2324 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownProviderType        = errors.New("unknown provider type parameter")
	ErrProviderTypeMismatch       = errors.New("reservation type does not match requested provider type")
	ErrProviderTypeNotImplemented = errors.New("provider type not yet implemented")
	ErrUnknownInstanceTypeName    = errors.New("unknown instance type")
	ErrArchitectureMismatch       = errors.New("instance type and image architecture mismatch")
	ErrBothTypeAndTemplateMissing = errors.New("instance type or launch template not set")
	ErrUnsupportedRegion          = errors.New("unknown region/location/zone")
	ErrInvalidNamePattern         = errors.New("name pattern is not RFC-1035 compatible")
	ErrPubkeyNotFound             = errors.New("no pubkey found")
)
View Source
var ErrMissingExtraPermission = errors.New("missing permission")
View Source
var ErrMissingNameOrBody = errors.New("name or body missing")
View Source
var ErrUnknownProviderFromSources = errors.New("unknown provider returned from sources")
View Source
var ErrUnknownReadinessService = errors.New("unknown service for readiness test")

Functions

func AvailabilityStatus

func AvailabilityStatus(w http.ResponseWriter, r *http.Request)

func AzureOfferingTemplate

func AzureOfferingTemplate(w http.ResponseWriter, r *http.Request)

func CheckPermissionAndRender

func CheckPermissionAndRender(w http.ResponseWriter, r *http.Request, permission string, resources ...string) error

CheckPermissionAndRender can be used to perform an extra permission check that is more detailed than the one performed by the middleware. Do not use this function as the only permission check, permissions should always be enforced via middleware as a bare minimum.

func CreateAWSReservation

func CreateAWSReservation(w http.ResponseWriter, r *http.Request)

func CreateAzureReservation

func CreateAzureReservation(w http.ResponseWriter, r *http.Request)

func CreateGCPReservation

func CreateGCPReservation(w http.ResponseWriter, r *http.Request)

func CreateNoopReservation

func CreateNoopReservation(w http.ResponseWriter, r *http.Request)

CreateNoopReservation is used to create empty reservation that is processed without any operation being made. This is useful when testing the job queue. The endpoint has no payload.

func CreatePubkey

func CreatePubkey(w http.ResponseWriter, r *http.Request)

func CreateReservation

func CreateReservation(w http.ResponseWriter, r *http.Request)

CreateReservation dispatches requests to type provider specific handlers

func DeletePubkey

func DeletePubkey(w http.ResponseWriter, r *http.Request)

func FeatureFlagService

func FeatureFlagService(w http.ResponseWriter, r *http.Request)

func GetPubkey

func GetPubkey(w http.ResponseWriter, r *http.Request)

func GetReservationDetail

func GetReservationDetail(w http.ResponseWriter, r *http.Request)

func GetSourceUploadInfo

func GetSourceUploadInfo(w http.ResponseWriter, r *http.Request)

func ListAllProvisioningSources

func ListAllProvisioningSources(w http.ResponseWriter, r *http.Request)

func ListBuiltinInstanceTypes

func ListBuiltinInstanceTypes(typeFunc InstanceTypesForZoneFunc) func(w http.ResponseWriter, r *http.Request)

func ListLaunchTemplateAWS

func ListLaunchTemplateAWS(w http.ResponseWriter, r *http.Request)

func ListLaunchTemplateGCP

func ListLaunchTemplateGCP(w http.ResponseWriter, r *http.Request)

func ListLaunchTemplates

func ListLaunchTemplates(w http.ResponseWriter, r *http.Request)

func ListProvisioningSourcesByProvider

func ListProvisioningSourcesByProvider(w http.ResponseWriter, r *http.Request, asProviderType models.ProviderType)

func ListPubkeys

func ListPubkeys(w http.ResponseWriter, r *http.Request)

func ListReservations

func ListReservations(w http.ResponseWriter, r *http.Request)

func ListSources

func ListSources(w http.ResponseWriter, r *http.Request)

func MustParseBool

func MustParseBool(str string) (bool, error)

MustParseBool converts string into bool. If string is empty, it returns an error.

func ParseBool

func ParseBool(str string) (*bool, error)

ParseBool converts string into bool. Returns nil when string is empty.

func ParseInt64

func ParseInt64(r *http.Request, param string) (int64, error)

ParseInt64 converts param into int64. If param does not exist, it returns an error. TODO: It would be better to move chi.URLParam call out of this function so it can be also used for URL params. See below for an examples (MustParseBool/ParseBool).

func ReadyBackendService

func ReadyBackendService(w http.ResponseWriter, r *http.Request)

func ReadyService

func ReadyService(w http.ResponseWriter, r *http.Request)

func SourcesStatus

func SourcesStatus(w stdhttp.ResponseWriter, r *stdhttp.Request)

SourcesStatus fetches information from sources and then performs a smallest possible request on the cloud provider (list keys or similar). Reports an error if sources configuration is no longer valid.

func StatusService

func StatusService(w http.ResponseWriter, r *http.Request)

func ValidatePermissions

func ValidatePermissions(w http.ResponseWriter, r *http.Request)

func WelcomeService

func WelcomeService(w http.ResponseWriter, r *http.Request)

Types

type InstanceTypesForZoneFunc

type InstanceTypesForZoneFunc func(region, zone string, supported *bool) ([]*clients.InstanceType, error)

type Vars

type Vars struct {
	APIVersion  string
	BuildCommit string
	BuildTime   string
}

Jump to

Keyboard shortcuts

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