mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Rename Process to Instance
This commit is contained in:
@@ -87,13 +87,13 @@ func parseRemoteResponse(resp *http.Response, result any) error {
|
||||
}
|
||||
|
||||
// ListRemoteInstances lists all instances on the remote node
|
||||
func (im *instanceManager) ListRemoteInstances(nodeConfig *config.NodeConfig) ([]*instance.Process, error) {
|
||||
func (im *instanceManager) ListRemoteInstances(nodeConfig *config.NodeConfig) ([]*instance.Instance, error) {
|
||||
resp, err := im.makeRemoteRequest(nodeConfig, "GET", "/api/v1/instances/", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var instances []*instance.Process
|
||||
var instances []*instance.Instance
|
||||
if err := parseRemoteResponse(resp, &instances); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -102,7 +102,7 @@ func (im *instanceManager) ListRemoteInstances(nodeConfig *config.NodeConfig) ([
|
||||
}
|
||||
|
||||
// CreateRemoteInstance creates a new instance on the remote node
|
||||
func (im *instanceManager) CreateRemoteInstance(nodeConfig *config.NodeConfig, name string, options *instance.CreateInstanceOptions) (*instance.Process, error) {
|
||||
func (im *instanceManager) CreateRemoteInstance(nodeConfig *config.NodeConfig, name string, options *instance.CreateInstanceOptions) (*instance.Instance, error) {
|
||||
path := fmt.Sprintf("/api/v1/instances/%s/", name)
|
||||
|
||||
resp, err := im.makeRemoteRequest(nodeConfig, "POST", path, options)
|
||||
@@ -110,7 +110,7 @@ func (im *instanceManager) CreateRemoteInstance(nodeConfig *config.NodeConfig, n
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var inst instance.Process
|
||||
var inst instance.Instance
|
||||
if err := parseRemoteResponse(resp, &inst); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -119,14 +119,14 @@ func (im *instanceManager) CreateRemoteInstance(nodeConfig *config.NodeConfig, n
|
||||
}
|
||||
|
||||
// GetRemoteInstance retrieves an instance by name from the remote node
|
||||
func (im *instanceManager) GetRemoteInstance(nodeConfig *config.NodeConfig, name string) (*instance.Process, error) {
|
||||
func (im *instanceManager) GetRemoteInstance(nodeConfig *config.NodeConfig, name string) (*instance.Instance, error) {
|
||||
path := fmt.Sprintf("/api/v1/instances/%s/", name)
|
||||
resp, err := im.makeRemoteRequest(nodeConfig, "GET", path, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var inst instance.Process
|
||||
var inst instance.Instance
|
||||
if err := parseRemoteResponse(resp, &inst); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func (im *instanceManager) GetRemoteInstance(nodeConfig *config.NodeConfig, name
|
||||
}
|
||||
|
||||
// UpdateRemoteInstance updates an existing instance on the remote node
|
||||
func (im *instanceManager) UpdateRemoteInstance(nodeConfig *config.NodeConfig, name string, options *instance.CreateInstanceOptions) (*instance.Process, error) {
|
||||
func (im *instanceManager) UpdateRemoteInstance(nodeConfig *config.NodeConfig, name string, options *instance.CreateInstanceOptions) (*instance.Instance, error) {
|
||||
path := fmt.Sprintf("/api/v1/instances/%s/", name)
|
||||
|
||||
resp, err := im.makeRemoteRequest(nodeConfig, "PUT", path, options)
|
||||
@@ -143,7 +143,7 @@ func (im *instanceManager) UpdateRemoteInstance(nodeConfig *config.NodeConfig, n
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var inst instance.Process
|
||||
var inst instance.Instance
|
||||
if err := parseRemoteResponse(resp, &inst); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -163,14 +163,14 @@ func (im *instanceManager) DeleteRemoteInstance(nodeConfig *config.NodeConfig, n
|
||||
}
|
||||
|
||||
// StartRemoteInstance starts an instance on the remote node
|
||||
func (im *instanceManager) StartRemoteInstance(nodeConfig *config.NodeConfig, name string) (*instance.Process, error) {
|
||||
func (im *instanceManager) StartRemoteInstance(nodeConfig *config.NodeConfig, name string) (*instance.Instance, error) {
|
||||
path := fmt.Sprintf("/api/v1/instances/%s/start", name)
|
||||
resp, err := im.makeRemoteRequest(nodeConfig, "POST", path, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var inst instance.Process
|
||||
var inst instance.Instance
|
||||
if err := parseRemoteResponse(resp, &inst); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -179,14 +179,14 @@ func (im *instanceManager) StartRemoteInstance(nodeConfig *config.NodeConfig, na
|
||||
}
|
||||
|
||||
// StopRemoteInstance stops an instance on the remote node
|
||||
func (im *instanceManager) StopRemoteInstance(nodeConfig *config.NodeConfig, name string) (*instance.Process, error) {
|
||||
func (im *instanceManager) StopRemoteInstance(nodeConfig *config.NodeConfig, name string) (*instance.Instance, error) {
|
||||
path := fmt.Sprintf("/api/v1/instances/%s/stop", name)
|
||||
resp, err := im.makeRemoteRequest(nodeConfig, "POST", path, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var inst instance.Process
|
||||
var inst instance.Instance
|
||||
if err := parseRemoteResponse(resp, &inst); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -195,14 +195,14 @@ func (im *instanceManager) StopRemoteInstance(nodeConfig *config.NodeConfig, nam
|
||||
}
|
||||
|
||||
// RestartRemoteInstance restarts an instance on the remote node
|
||||
func (im *instanceManager) RestartRemoteInstance(nodeConfig *config.NodeConfig, name string) (*instance.Process, error) {
|
||||
func (im *instanceManager) RestartRemoteInstance(nodeConfig *config.NodeConfig, name string) (*instance.Instance, error) {
|
||||
path := fmt.Sprintf("/api/v1/instances/%s/restart", name)
|
||||
resp, err := im.makeRemoteRequest(nodeConfig, "POST", path, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var inst instance.Process
|
||||
var inst instance.Instance
|
||||
if err := parseRemoteResponse(resp, &inst); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user