Documentation ¶
Index ¶
- type Client
- func (c *Client) GetJob(jobID int) (*Job, error)
- func (c *Client) GetOperationStates(operation string, wid string) (*OperationStates, error)
- func (c *Client) GetOperationWorkflow(operation string, wid string) (*OperationWorkflow, error)
- func (c *Client) KillJob(jobID int) error
- func (c *Client) RequestPowerStatus(node string) (*OperationResponse, error)
- func (c *Client) SubmitDeployment(operation DeploymentOperation) (*OperationResponse, error)
- func (c *Client) SubmitJob(jobReq JobRequest) (int, error)
- func (c *Client) SubmitPowerOperation(operation PowerOperation) (*OperationResponse, error)
- func (c *Client) SubmitRebootOperation(operation RebootOperation) (*OperationResponse, error)
- type DeploymentOperation
- type DeploymentOperationCustomOperation
- type DeploymentOperationEnvironment
- type Job
- type JobRequest
- type OperationResponse
- type OperationStates
- type OperationWorkflow
- type PowerOperation
- type RebootOperation
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 (*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) 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