Documentation
¶
Index ¶
- type SlicerClient
- func (c *SlicerClient) CreateNode(groupName string, request SlicerCreateNodeRequest) (*SlicerCreateNodeResponse, error)
- func (c *SlicerClient) DeleteNode(groupName, nodeName string) error
- func (c *SlicerClient) GetHostGroupNodes(groupName string) ([]SlicerNode, error)
- func (c *SlicerClient) GetHostGroups() ([]SlicerHostGroup, error)
- type SlicerCreateNodeRequest
- type SlicerCreateNodeResponse
- type SlicerHostGroup
- type SlicerNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SlicerClient ¶
type SlicerClient struct {
// contains filtered or unexported fields
}
SlicerClient handles all HTTP communication with the Slicer API
func NewSlicerClient ¶
func NewSlicerClient(baseURL, token string, userAgent string, httpClient *http.Client) *SlicerClient
NewSlicerClient creates a new Slicer API client
func (*SlicerClient) CreateNode ¶
func (c *SlicerClient) CreateNode(groupName string, request SlicerCreateNodeRequest) (*SlicerCreateNodeResponse, error)
CreateNode creates a new node in the specified host group
func (*SlicerClient) DeleteNode ¶
func (c *SlicerClient) DeleteNode(groupName, nodeName string) error
DeleteNode deletes a node from the specified host group
func (*SlicerClient) GetHostGroupNodes ¶
func (c *SlicerClient) GetHostGroupNodes(groupName string) ([]SlicerNode, error)
GetHostGroupNodes fetches nodes for a specific host group
func (*SlicerClient) GetHostGroups ¶
func (c *SlicerClient) GetHostGroups() ([]SlicerHostGroup, error)
GetHostGroups fetches all host groups from the API
type SlicerCreateNodeRequest ¶
type SlicerCreateNodeRequest struct {
RAMGB int `json:"ram_gb"`
CPUs int `json:"cpus"`
ImportUser string `json:"import_user"`
Userdata string `json:"userdata,omitempty"`
SSHKeys []string `json:"ssh_keys,omitempty"`
}
SlicerCreateNodeRequest is the payload for creating a node via the REST API.
type SlicerCreateNodeResponse ¶
type SlicerCreateNodeResponse struct {
Hostname string `json:"hostname"`
IP string `json:"ip"`
CreatedAt string `json:"created_at"`
Arch string `json:"arch,omitempty"`
}
SlicerCreateNodeResponse is the response from the REST API when creating a node.
func (*SlicerCreateNodeResponse) IPAddress ¶
func (n *SlicerCreateNodeResponse) IPAddress() net.IP
type SlicerHostGroup ¶
type SlicerHostGroup struct {
Name string `json:"name"`
Count int `json:"count"`
RAMGB int `json:"ram_gb"`
VCPU int `json:"vcpu"`
Arch string `json:"arch,omitempty"`
GPUCount int `json:"gpu_count,omitempty"`
}
SlicerHostGroup represents a host group from the /hostgroup endpoint.
Click to show internal directories.
Click to hide internal directories.