control

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package control handles the details of control calls to the O² Control core.

Index

Constants

View Source
const (
	CALL_TIMEOUT              = 55 * time.Second
	SPINNER_TICK              = 100 * time.Millisecond
	HLCONFIG_COMPONENT_PREFIX = "COG-v1"
	HLCONFIG_PATH_PREFIX      = "consul://o2/runtime/"
)

Variables

This section is empty.

Functions

func AddRepo added in v0.10.0

func AddRepo(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) error

AddRepo add a new repository to the available git repositories used for configuration and checks it out.

func CleanTasks added in v0.9.0

func CleanTasks(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func ControlEnvironment

func ControlEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func CreateEnvironment

func CreateEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func DestroyEnvironment

func DestroyEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func GetEnvironments

func GetEnvironments(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func GetInfo

func GetInfo(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func GetTasks

func GetTasks(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func ListRepos added in v0.10.0

func ListRepos(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

ListRepos lists all available git repositories that are used for configuration.

func ListWorkflowTemplates

func ListWorkflowTemplates(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

ListWorkflowTemplates lists the available workflow templates and the git repo on which they reside.

func ModifyEnvironment

func ModifyEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func QueryRoles

func QueryRoles(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func RefreshRepos added in v0.10.0

func RefreshRepos(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

RefreshRepos runs the equivalent of git pull origin/master for all available repositories.

func RemoveRepo added in v0.10.0

func RemoveRepo(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

RemoveRepo removes a git repository based on the indexes reported by ListRepos. If the default repository is removed, the repository with the lowest index is set as the new default. If all repositories are removed, the backend (consul or file) record of the default repository is updated to the relevant viper entry.

func SetDefaultRepo added in v0.10.0

func SetDefaultRepo(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) error

SetDefaultRepo selects the default repository based on the indexes reported by ListRepos. It also updates the backend (consul or file) which holds a record for the default repository which is persistent across core executions.

func SetDefaultRevision added in v0.12.90

func SetDefaultRevision(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) error

SetDefaultRevision selects the default repository revision. This can be done on the global or on the repository level.

func ShowEnvironment

func ShowEnvironment(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

func Teardown

func Teardown(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command, args []string, o io.Writer) (err error)

Types

type ConfigurationPayload added in v0.51.0

type ConfigurationPayload struct {
	Name       string            `json:"name"`
	Workflow   string            `json:"workflow"`
	Revision   string            `json:"revision"`
	Repository string            `json:"repository"`
	Vars       map[string]string `json:"variables"`
	Detectors  []string          `json:"detectors"`
}

type RunFunc

type RunFunc func(*cobra.Command, []string)

func WrapCall

func WrapCall(call ControlCall) RunFunc

Jump to

Keyboard shortcuts

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