api

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.6.1

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

Client is a client to the Grid'5000 REST API

func NewClient added in v1.6.1

func NewClient(username, password, site string) *Client

NewClient returns a new configured Grid'5000 API client

func (*Client) GetJob added in v1.6.1

func (c *Client) GetJob(jobID int) (*Job, error)

GetJob get the job from its id

func (*Client) GetOperationStates

func (c *Client) GetOperationStates(operation string, wid string) (*OperationStates, error)

GetOperationStates fetch and return the states of an operation workflow from its ID

func (*Client) GetOperationWorkflow

func (c *Client) GetOperationWorkflow(operation string, wid string) (*OperationWorkflow, error)

GetOperationWorkflow fetch and return an operation workflow from its ID

func (*Client) KillJob added in v1.6.1

func (c *Client) KillJob(jobID int) error

KillJob ask for deletion of a job

func (*Client) RequestPowerStatus

func (c *Client) RequestPowerStatus(node string) (*OperationResponse, error)

RequestPowerStatus request the power status of the node to the Kadeploy3 API

func (*Client) SubmitDeployment added in v1.6.1

func (c *Client) SubmitDeployment(operation DeploymentOperation) (*OperationResponse, error)

SubmitDeployment submits a new deployment request to g5k api

func (*Client) SubmitJob added in v1.6.1

func (c *Client) SubmitJob(jobReq JobRequest) (int, error)

SubmitJob submit a new job on g5k api and return the job id

func (*Client) SubmitPowerOperation

func (c *Client) SubmitPowerOperation(operation PowerOperation) (*OperationResponse, error)

SubmitPowerOperation submit a power operation to the Kadeploy3 API

func (*Client) SubmitRebootOperation

func (c *Client) SubmitRebootOperation(operation RebootOperation) (*OperationResponse, error)

SubmitRebootOperation submit a reboot operation to the Kadeploy3 API

type DeploymentOperation

type DeploymentOperation struct {
	Nodes            []string                                                              `json:"nodes"`
	Environment      DeploymentOperationEnvironment                                        `json:"environment"`
	CustomOperations map[string]map[string]map[string][]DeploymentOperationCustomOperation `json:"custom_operations,omitempty"`
}

DeploymentOperation stores the attributes for a Deployment operation

type DeploymentOperationCustomOperation

type DeploymentOperationCustomOperation struct {
	Action  string `json:"action"`
	Name    string `json:"name"`
	Command string `json:"command,omitempty"`
}

DeploymentOperationCustomOperation stores the attributes for a custom deployment operation of a Deployment operation

type DeploymentOperationEnvironment

type DeploymentOperationEnvironment struct {
	Kind    string `json:"kind"`
	User    string `json:"user,omitempty"`
	Name    string `json:"name"`
	Version string `json:"version,omitempty"`
}

DeploymentOperationEnvironment stores the attributes about the environment to be deployed by a Deployment operation

type Job

type Job struct {
	UID       int      `json:"uid"`
	State     string   `json:"state"`
	Timelife  int      `json:"walltime"`
	Types     []string `json:"types"`
	StartTime int      `json:"started_at"`
	Nodes     []string `json:"assigned_nodes"`
}

Job represents an existing job

type JobRequest

type JobRequest struct {
	Resources   string   `json:"resources"`
	Command     string   `json:"command"`
	Properties  string   `json:"properties,omitempty"`
	Reservation string   `json:"reservation,omitempty"`
	Types       []string `json:"types"`
	Queue       string   `json:"queue"`
}

JobRequest represents a new job submission

type OperationResponse

type OperationResponse struct {
	WID string `json:"wid"`
}

OperationResponse stores the attributes of the response of the submission of an operation

type OperationStates

type OperationStates map[string]struct {
	Macro string `json:"macro"`
	Micro string `json:"micro"`
	State string `json:"state"`
	Out   string `json:"out,omitempty"`
}

OperationStates stores the State attributes of each nodes concerned by a workflow

type OperationWorkflow

type OperationWorkflow struct {
	WID   string              `json:"wid"`
	Done  bool                `json:"done"`
	Error bool                `json:"error"`
	Nodes map[string][]string `json:"nodes"` // possible keys: ok, ko, processing
}

OperationWorkflow stores the attributes of the Workflow of an operation

type PowerOperation

type PowerOperation struct {
	Nodes  []string `json:"nodes"`
	Status string   `json:"status"`
	Level  string   `json:"level,omitempty"`
}

PowerOperation stores the attributes for a Power operation

type RebootOperation

type RebootOperation struct {
	Kind  string   `json:"kind"`
	Nodes []string `json:"nodes"`
	Level string   `json:"level,omitempty"`
}

RebootOperation stores the attributes for a Reboot operation

Jump to

Keyboard shortcuts

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