Documentation
¶
Index ¶
- Variables
- func DeleteServer(ac *client.AlpaconClient, serverName string) error
- func GetServerDetail(ac *client.AlpaconClient, serverName string) ([]byte, error)
- func GetServerIDByName(ac *client.AlpaconClient, serverName string) (string, error)
- func GetServerNameByID(ac *client.AlpaconClient, serverID string) (string, error)
- func UpdateServer(ac *client.AlpaconClient, serverName string) ([]byte, error)
- type RegistrationMethodGuideJsonResponse
- type RegistrationMethodGuideRequest
- type RegistrationTokenCreatedResponse
- type RegistrationTokenDetails
- type RegistrationTokenRequest
- type ServerAttributes
- type ServerDetails
- type ServerStatus
- type ServerStatusMeta
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrRegistrationTokenNotFound = errors.New("no registration token found with the given name")
ErrRegistrationTokenNotFound is returned when no registration token matches the given name.
Functions ¶
func DeleteServer ¶
func DeleteServer(ac *client.AlpaconClient, serverName string) error
func GetServerDetail ¶
func GetServerDetail(ac *client.AlpaconClient, serverName string) ([]byte, error)
func GetServerIDByName ¶
func GetServerIDByName(ac *client.AlpaconClient, serverName string) (string, error)
func GetServerNameByID ¶
func GetServerNameByID(ac *client.AlpaconClient, serverID string) (string, error)
func UpdateServer ¶ added in v1.2.0
func UpdateServer(ac *client.AlpaconClient, serverName string) ([]byte, error)
Types ¶
type RegistrationMethodGuideJsonResponse ¶ added in v1.4.2
type RegistrationMethodGuideJsonResponse struct {
MethodID string `json:"method_id"`
Platform string `json:"platform"`
PlatformLabel string `json:"platform_label"`
AlpaconURL string `json:"alpacon_url"`
PackageProxy *string `json:"package_proxy"`
AllowSudoWithMFA bool `json:"allow_sudo_with_mfa"`
TokenKey string `json:"token_key"`
ServerName string `json:"server_name"`
InstallCommands []string `json:"install_commands"`
RegisterCommand string `json:"register_command"`
}
RegistrationMethodGuideJsonResponse is the structured JSON response from the guide API.
func GetRegistrationGuideJSON ¶ added in v1.4.2
func GetRegistrationGuideJSON(ac *client.AlpaconClient, platform, serverName, tokenID string) (RegistrationMethodGuideJsonResponse, error)
type RegistrationMethodGuideRequest ¶ added in v1.4.2
type RegistrationMethodGuideRequest struct {
Platform string `json:"platform"`
ServerName string `json:"server_name,omitempty"`
RegistrationToken string `json:"registration_token,omitempty"`
}
RegistrationMethodGuideRequest is the request body for the guide API.
type RegistrationTokenCreatedResponse ¶ added in v1.4.2
type RegistrationTokenCreatedResponse struct {
ID string `json:"id"`
Name string `json:"name"`
AllowedGroups []string `json:"allowed_groups"`
Key string `json:"key"`
AddedAt string `json:"added_at"`
}
RegistrationTokenCreatedResponse holds the result after creating a server registration token. The Key field is only returned once at creation time.
func CreateRegistrationToken ¶ added in v1.4.2
func CreateRegistrationToken(ac *client.AlpaconClient, req RegistrationTokenRequest) (RegistrationTokenCreatedResponse, error)
type RegistrationTokenDetails ¶ added in v1.4.2
type RegistrationTokenDetails struct {
ID string `json:"id"`
Name string `json:"name"`
AllowedGroups []string `json:"allowed_groups"`
Enabled bool `json:"enabled"`
AddedAt string `json:"added_at"`
}
RegistrationTokenDetails is used when listing or looking up existing tokens. The Key field is not included—it is only available at creation time.
func GetRegistrationTokenByName ¶ added in v1.4.2
func GetRegistrationTokenByName(ac *client.AlpaconClient, name string) (RegistrationTokenDetails, error)
func ListRegistrationTokens ¶ added in v1.4.2
func ListRegistrationTokens(ac *client.AlpaconClient) ([]RegistrationTokenDetails, error)
type RegistrationTokenRequest ¶ added in v1.4.2
type RegistrationTokenRequest struct {
Name string `json:"name"`
AllowedGroups []string `json:"allowed_groups,omitempty"`
}
RegistrationTokenRequest is used to create a new server registration token.
type ServerAttributes ¶
type ServerAttributes struct {
Name string `json:"name"`
IP string `json:"ip" table:"IP"`
OS string `json:"os" table:"OS"`
Connected bool `json:"connected"`
Owner string `json:"owner"`
}
func GetServerList ¶
func GetServerList(ac *client.AlpaconClient) ([]ServerAttributes, error)
type ServerDetails ¶
type ServerDetails struct {
ID string `json:"id"`
Name string `json:"name"`
RemoteIP string `json:"remote_ip"`
Status ServerStatus `json:"status"`
IsConnected bool `json:"is_connected"`
Commissioned bool `json:"commissioned"`
Starred bool `json:"starred"`
CPUPhysicalCores int `json:"cpu_physical_cores"`
CPULogicalCores int `json:"cpu_logical_cores"`
CPUType string `json:"cpu_type"`
PhysicalMemory int64 `json:"physical_memory"`
OSName string `json:"os_name"`
OSVersion string `json:"os_version"`
Load float64 `json:"load"`
BootTime time.Time `json:"boot_time"`
Owner types.UserSummary `json:"owner"`
Groups []string `json:"groups"`
}
type ServerStatus ¶
Click to show internal directories.
Click to hide internal directories.