Documentation
¶
Index ¶
- func LoadOffchainClient(ctx context.Context, domain cldf_domain.Domain, env string, ...) (cldf_offchain.Client, error)
- func ProposeJob(ctx context.Context, req ProposeJobRequest) error
- func ProposeJobs(ctx context.Context, lggr logger.Logger, oc cldf_offchain.Client, ...) error
- func ProposeWithJobDetails(ctx context.Context, lggr logger.Logger, oc cldf_offchain.Client, ...) error
- func RegisterNode(ctx context.Context, jd cldf_offchain.Client, name string, csaKey string, ...) (string, error)
- func UpdateNodes(ctx context.Context, client cldf_offchain.Client, req UpdateNodesRequest) error
- type NodeFinderCfg
- type NodeKey
- type ProposeJobRequest
- type UpdateNodeRequest
- type UpdateNodesRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadOffchainClient ¶ added in v0.39.0
func LoadOffchainClient( ctx context.Context, domain cldf_domain.Domain, env string, config *cldf_config_env.Config, lggr logger.Logger, useRealBackends bool, ) (cldf_offchain.Client, error)
LoadOffchainClient loads an offchain client for the specified domain and environment.
func ProposeJob ¶
func ProposeJob(ctx context.Context, req ProposeJobRequest) error
ProposeJob proposes a job to a node using JD
func ProposeJobs ¶
func ProposeJobs(ctx context.Context, lggr logger.Logger, oc cldf_offchain.Client, jobSpecFilePath string) error
ProposeJobs proposes job specs to nodes using jobspecs file TODO remove when all migrations use Jobs instead of JobSpecs
func ProposeWithJobDetails ¶
func ProposeWithJobDetails(ctx context.Context, lggr logger.Logger, oc cldf_offchain.Client, jobsPath string) error
ProposeWithJobDetails proposes job specs to nodes using jobspecs file
func RegisterNode ¶
func RegisterNode( ctx context.Context, jd cldf_offchain.Client, name string, csaKey string, isBootstrap bool, domain domain.Domain, environment string, extraLabels map[string]string, ) (string, error)
RegisterNode registers a single node with the job distributor. It errors if the node is already registered.
func UpdateNodes ¶ added in v0.39.0
func UpdateNodes(ctx context.Context, client cldf_offchain.Client, req UpdateNodesRequest) error
UpdateNodes updates the nodes with the given configurations.
Types ¶
type NodeFinderCfg ¶ added in v0.39.0
type NodeFinderCfg struct {
KeyType NodeKey // type of key to search for
LabelName *string // name of label to search for when using NodeKey_Label
}
NodeFinderCfg is the configuration for how to find the node to update
func (NodeFinderCfg) Validate ¶ added in v0.39.0
func (c NodeFinderCfg) Validate() error
type ProposeJobRequest ¶
type ProposeJobRequest struct {
Job string // toml
Domain domain.Domain
Environment string
// labels to filter nodes by
NodeLabels map[string]string
// labels to set on the new/updated job object
JobLabels map[string]string
OffchainClient cldf_offchain.Client
Lggr logger.Logger
}
ProposeJobRequest is the request to propose a job to a node using JD
func (ProposeJobRequest) Validate ¶
func (r ProposeJobRequest) Validate() error
Validate validates the request
type UpdateNodeRequest ¶ added in v0.39.0
type UpdateNodeRequest struct {
// Cfg is the configuration for the used to update node
Cfg node.NodeCfg
// contains filtered or unexported fields
}
UpdateNodeRequest is the request to update a node using JD
func NewUpdateNodeRequest ¶ added in v0.39.0
func NewUpdateNodeRequest(cfg node.NodeCfg, f NodeFinderCfg) (*UpdateNodeRequest, error)
NewUpdateNodeRequest creates a new UpdateNodeRequest
func (*UpdateNodeRequest) Labels ¶ added in v0.39.0
func (r *UpdateNodeRequest) Labels() []*ptypes.Label
Labels returns the labels for the node, containing the p2p_id, nop, admin_addr and all tags.
func (*UpdateNodeRequest) NodeKeyCriteria ¶ added in v0.39.0
func (r *UpdateNodeRequest) NodeKeyCriteria() string
NodeKeyCriteria returns the node key criteria
type UpdateNodesRequest ¶ added in v0.39.0
type UpdateNodesRequest struct {
Requests []*UpdateNodeRequest
}
UpdateNodesRequest is the request to update multiple nodes using JD