MCPcopy Create free account
hub / github.com/cloudbase/garm / GetInstance

Method GetInstance

runner/runner.go:925–935  ·  view source on GitHub ↗
(ctx context.Context, instanceName string)

Source from the content-addressed store, hash-verified

923}
924
925func (r *Runner) GetInstance(ctx context.Context, instanceName string) (params.Instance, error) {
926 if !auth.IsAdmin(ctx) {
927 return params.Instance{}, runnerErrors.ErrUnauthorized
928 }
929
930 instance, err := r.store.GetInstance(ctx, instanceName)
931 if err != nil {
932 return params.Instance{}, fmt.Errorf("error fetching instance: %w", err)
933 }
934 return instance, nil
935}
936
937func (r *Runner) ListAllInstances(ctx context.Context) ([]params.Instance, error) {
938 if !auth.IsAdmin(ctx) {

Callers 1

GetAgentJWTTokenMethod · 0.95

Calls 2

IsAdminFunction · 0.92
GetInstanceMethod · 0.65

Tested by

no test coverage detected