tysmhookdeactivation

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

README

tysm_hook_deactivation Task

Description

Cancels a TYSM hook activation by issuing DELETE /tysm/v1/activations/{id}. The hook reverts to its baseline (enabled, config) state immediately on the server side.

This task is the cleanup half of the tysm_hook_activation / tysm_hook_deactivation pair. The intended placement is in a test's top-level cleanupTasks: block, so the deactivation runs even if the test fails. Because the server-side TTL on the activation will eventually fire on its own, this task tolerates a 404 Not Found (treats it as success by default — see ignoreNotFound).

Configuration Parameters

  • endpoint:
    Base URL of the TYSM API, e.g. http://beacon:8080. Required.

  • auth_token:
    Bearer token sent in the Authorization header. Required when the TYSM API has auth enabled. Recommended to supply via configVars.

  • activation_id:
    ID of the activation to cancel. Required. Typically supplied via configVars from the upstream tysm_hook_activation task's outputs: configVars: { activation_id: "tasks.<id>.outputs.activation_id" }.

  • ignoreNotFound:
    If true (default), treat HTTP 404 as success on the assumption the server-side TTL already fired. Set to false if you want explicit failure when the activation is no longer present.

Defaults

- name: tysm_hook_deactivation
  config:
    endpoint: ""
    auth_token: ""
    activation_id: ""
    ignoreNotFound: true

Outputs

This task does not produce any outputs.

Example

cleanupTasks:
  - name: tysm_hook_deactivation
    config:
      endpoint: "http://beacon:8080"
    configVars:
      auth_token: "tysmApiToken"
      activation_id: "tasks.kzg_chaos.outputs.activation_id"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TaskName       = "tysm_hook_deactivation"
	TaskDescriptor = &types.TaskDescriptor{
		Name:        TaskName,
		Description: "Cancel a TYSM hook activation. Designed to be placed in a test's cleanupTasks block.",
		Category:    "tysm",
		Config:      DefaultConfig(),
		Outputs:     []types.TaskOutputDefinition{},
		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."`
	ActivationID   string `` /* 176-byte string literal not displayed */
	IgnoreNotFound bool   `` /* 148-byte string literal not displayed */
}

Config drives a single DELETE against the TYSM hook-control API.

ActivationID is yaml-tagged with snake_case so that playbooks can wire it up via configVars from a previous tysm_hook_activation task's outputs:

configVars:
  activation_id: "tasks.kzg_chaos.outputs.activation_id"

AuthToken follows the same convention so the bearer token can be supplied via a runtime variable rather than hard-coded in the playbook.

func DefaultConfig

func DefaultConfig() Config

func (*Config) Validate

func (c *Config) Validate() error

type Task

type Task struct {
	// contains filtered or unexported fields
}

func (*Task) Config

func (t *Task) Config() interface{}

func (*Task) Execute

func (t *Task) Execute(ctx context.Context) error

func (*Task) LoadConfig

func (t *Task) LoadConfig() error

func (*Task) Timeout

func (t *Task) Timeout() time.Duration

Jump to

Keyboard shortcuts

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