Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TaskName = "tysm_hook_activation" TaskDescriptor = &types.TaskDescriptor{ Name: TaskName, Description: "Create a TTL-bound activation against a TYSM hook-control API.", Category: "tysm", Config: DefaultConfig(), Outputs: []types.TaskOutputDefinition{ { Name: "activation_id", Type: "string", Description: "Server-assigned activation ID; pass to tysm_hook_deactivation as activation_id.", }, { Name: "expires_at", Type: "string", Description: "RFC3339 timestamp at which the server-side TTL expires and the hook reverts to baseline.", }, { Name: "hook", Type: "string", Description: "Name of the hook the activation targets (echoes the input).", }, }, NewTask: NewTask, } )
Functions ¶
func NewTask ¶
func NewTask(ctx *types.TaskContext, options *types.TaskOptions) (types.Task, error)
Types ¶
type Config ¶
type Config struct {
Endpoint string `yaml:"endpoint" json:"endpoint" require:"A" desc:"Base URL of the TYSM API, e.g. http://beacon:8080"`
AuthToken string `yaml:"auth_token" json:"auth_token" desc:"Bearer token sent in the Authorization header. Prefer supplying via configVars."`
Hook string `yaml:"hook" json:"hook" require:"A" desc:"Name of the TYSM hook to activate (e.g. blob-mutator)."`
Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty" desc:"Override the hook's enabled flag while the activation is in force."`
ConfigPatch map[string]interface{} `` /* 142-byte string literal not displayed */
Duration helper.Duration `` /* 160-byte string literal not displayed */
Replace bool `` /* 130-byte string literal not displayed */
}
Config drives a single POST to the TYSM hook-control API.
AuthToken is intentionally yaml-tagged with snake_case: it is expected to be supplied via the task's configVars (e.g. configVars: { auth_token: "tysmApiToken" }) so the secret never lives in the playbook source. Inline assignment under config: still works, it is just discouraged.
func DefaultConfig ¶
func DefaultConfig() Config
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func (*Task) LoadConfig ¶
Click to show internal directories.
Click to hide internal directories.