autopilot

package
v1.20.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInstance

func SetInstance(i Ops)

SetInstance replaces the instance with the provided one. Should be used only for testing purposes.

Types

type ActionApprovalInterface

type ActionApprovalInterface interface {
	// CreateActionApproval creates the ActionApproval object
	CreateActionApproval(actionApproval *autv1alpha1.ActionApproval) (*autv1alpha1.ActionApproval, error)
	// GetActionApproval gets the ActionApproval for the provided name
	GetActionApproval(namespace, name string) (*autv1alpha1.ActionApproval, error)
	// UpdateActionApproval updates the ActionApproval
	UpdateActionApproval(namespace string, actionApproval *autv1alpha1.ActionApproval) (*autv1alpha1.ActionApproval, error)
	// DeleteActionApproval deletes the ActionApproval of the given name
	DeleteActionApproval(namespace, name string) error
	// ListActionApprovals lists ActionApproval
	ListActionApprovals(namespace string) (*autv1alpha1.ActionApprovalList, error)
}

ActionApprovalInterface has methods to work with ActionApproval resources.

type Client

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

Client provides a wrapper for the autopilot client.

func New

New builds a new autopilot client.

func NewForConfig

func NewForConfig(cfg *rest.Config) (*Client, error)

NewForConfig builds a new autopilot client for the given config.

func (*Client) CreateActionApproval

func (c *Client) CreateActionApproval(actionApproval *autv1alpha1.ActionApproval) (*autv1alpha1.ActionApproval, error)

CreateActionApproval creates the ActionApproval object

func (*Client) CreateAutopilotRule

func (c *Client) CreateAutopilotRule(rule *autv1alpha1.AutopilotRule) (*autv1alpha1.AutopilotRule, error)

CreateAutopilotRule creates the AutopilotRule object

func (*Client) CreateAutopilotRuleObject

func (c *Client) CreateAutopilotRuleObject(ruleObject *autv1alpha1.AutopilotRuleObject) (*autv1alpha1.AutopilotRuleObject, error)

CreateAutopilotRuleObject creates the AutopilotRuleObject object

func (*Client) DeleteActionApproval

func (c *Client) DeleteActionApproval(namespace, name string) error

DeleteActionApproval deletes the ActionApproval of the given name

func (*Client) DeleteAutopilotRule

func (c *Client) DeleteAutopilotRule(name string) error

DeleteAutopilotRule deletes the AutopilotRule of the given name

func (*Client) DeleteAutopilotRuleObject

func (c *Client) DeleteAutopilotRuleObject(namespace, name string) error

DeleteAutopilotRuleObject deletes the AutopilotRuleObject of the given name

func (*Client) GetActionApproval

func (c *Client) GetActionApproval(namespace, name string) (*autv1alpha1.ActionApproval, error)

GetActionApproval gets the ActionApproval for the provided name

func (*Client) GetAutopilotRule

func (c *Client) GetAutopilotRule(name string) (*autv1alpha1.AutopilotRule, error)

GetAutopilotRule gets the AutopilotRule for the provided name

func (*Client) GetAutopilotRuleObject

func (c *Client) GetAutopilotRuleObject(namespace, name string) (*autv1alpha1.AutopilotRuleObject, error)

GetAutopilotRuleObject gets the AutopilotRuleObject for the provided name

func (*Client) ListActionApprovals

func (c *Client) ListActionApprovals(namespace string) (*autv1alpha1.ActionApprovalList, error)

ListActionApprovals lists ActionApproval

func (*Client) ListAutopilotRuleObjects

func (c *Client) ListAutopilotRuleObjects(namespace string) (*autv1alpha1.AutopilotRuleObjectList, error)

ListAutopilotRuleObjects lists AutopilotRuleObjects

func (*Client) ListAutopilotRules

func (c *Client) ListAutopilotRules() (*autv1alpha1.AutopilotRuleList, error)

ListAutopilotRules lists AutopilotRules

func (*Client) SetConfig

func (c *Client) SetConfig(cfg *rest.Config)

SetConfig sets the config and resets the client.

func (*Client) UpdateActionApproval

func (c *Client) UpdateActionApproval(namespace string, actionApproval *autv1alpha1.ActionApproval) (*autv1alpha1.ActionApproval, error)

UpdateActionApproval updates the ActionApproval

func (*Client) UpdateAutopilotRule

func (c *Client) UpdateAutopilotRule(rule *autv1alpha1.AutopilotRule) (*autv1alpha1.AutopilotRule, error)

UpdateAutopilotRule updates the AutopilotRule

func (*Client) UpdateAutopilotRuleObject

func (c *Client) UpdateAutopilotRuleObject(namespace string, ruleObject *autv1alpha1.AutopilotRuleObject) (*autv1alpha1.AutopilotRuleObject, error)

UpdateAutopilotRuleObject updates the AutopilotRuleObject

type Ops

type Ops interface {
	RuleOps
	RuleObjectOps
	ActionApprovalInterface
	// SetConfig sets the config and resets the client
	SetConfig(config *rest.Config)
}

Ops provides an interface to Autopilot operations.

func Instance

func Instance() Ops

Instance returns a singleton instance of the client.

func NewInstanceFromConfigFile

func NewInstanceFromConfigFile(config string) (Ops, error)

NewInstanceFromConfigFile returns new instance of client by using given config file

type RuleObjectOps

type RuleObjectOps interface {
	// CreateAutopilotRuleObject creates the AutopilotRuleObject object
	CreateAutopilotRuleObject(*autv1alpha1.AutopilotRuleObject) (*autv1alpha1.AutopilotRuleObject, error)
	// GetAutopilotRuleObject gets the AutopilotRuleObject for the provided name
	GetAutopilotRuleObject(namespace, name string) (*autv1alpha1.AutopilotRuleObject, error)
	// UpdateAutopilotRuleObject updates the AutopilotRuleObject
	UpdateAutopilotRuleObject(namespace string, object *autv1alpha1.AutopilotRuleObject) (*autv1alpha1.AutopilotRuleObject, error)
	// DeleteAutopilotRuleObject deletes the AutopilotRuleObject of the given name
	DeleteAutopilotRuleObject(namespace, name string) error
	// ListAutopilotRules lists AutopilotRulesObjects
	ListAutopilotRuleObjects(namespace string) (*autv1alpha1.AutopilotRuleObjectList, error)
}

RuleObjectOps is an interface to perform k8s AutopilotRuleObjects operations

type RuleOps

type RuleOps interface {
	// CreateAutopilotRule creates the AutopilotRule object
	CreateAutopilotRule(*autv1alpha1.AutopilotRule) (*autv1alpha1.AutopilotRule, error)
	// GetAutopilotRule gets the AutopilotRule for the provided name
	GetAutopilotRule(string) (*autv1alpha1.AutopilotRule, error)
	// UpdateAutopilotRule updates the AutopilotRule
	UpdateAutopilotRule(*autv1alpha1.AutopilotRule) (*autv1alpha1.AutopilotRule, error)
	// DeleteAutopilotRule deletes the AutopilotRule of the given name
	DeleteAutopilotRule(string) error
	// ListAutopilotRules lists AutopilotRules
	ListAutopilotRules() (*autv1alpha1.AutopilotRuleList, error)
}

RuleOps is an interface to perform k8s AutopilotRule operations

Jump to

Keyboard shortcuts

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