actions

package
v0.0.0-...-e653fdf Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 3 Imported by: 16

Documentation

Index

Constants

View Source
const JujuExecActionName = "juju-exec"

JujuExecActionName defines the action name used by juju-exec.

Variables

View Source
var PredefinedActionsSpec = map[string]charm.ActionSpec{
	JujuExecActionName: {
		Description: "predefined juju-exec action",
		Parallel:    true,
		Params: map[string]interface{}{
			"type":        "object",
			"title":       JujuExecActionName,
			"description": "predefined juju-exec action params",
			"required":    []interface{}{"command", "timeout"},
			"properties": map[string]interface{}{
				"command": map[string]interface{}{
					"type":        "string",
					"description": "command to be ran under juju-exec",
				},
				"timeout": map[string]interface{}{
					"type":        "number",
					"description": "timeout for command execution",
				},
				"workload-context": map[string]interface{}{
					"type":        "boolean",
					"description": "run the command in k8s workload context",
				},
			},
		},
	},
}

PredefinedActionsSpec defines a spec for each predefined action.

Functions

func HasJujuExecAction

func HasJujuExecAction(commands string) bool

HasJujuExecAction returns true if the "juju-exec" binary name appears anywhere in the specified commands.

func IsJujuExecAction

func IsJujuExecAction(name string) bool

IsJujuExecAction returns true if name is the "juju-exec" action.

Types

type ActionMessage

type ActionMessage struct {
	Message   string    `json:"message"`
	Timestamp time.Time `json:"timestamp"`
}

ActionMessage is a timestamped message logged by a running action.

Jump to

Keyboard shortcuts

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