Beispiel #1
0
func GetServerStatus() (ServerStatus, error) {
	var status ServerStatus
	result, _, err := apiclient.Get(apiclient.Url("/appstax/hosting/server"))
	if err == nil {
		err = json.Unmarshal(result, &status)
	}
	return status, err
}
Beispiel #2
0
func GetServerLog(lines int64) (string, error) {
	linesArg := strconv.FormatInt(lines, 10)
	result, _, err := apiclient.Get(apiclient.Url("/appstax/hosting/server/logs?nlines=%s", linesArg))
	return string(result), err
}
Beispiel #3
0
func SendServerAction(action string) error {
	data := map[string]string{"action": action}
	_, _, err := apiclient.Put(apiclient.Url("/appstax/hosting/server"), data)
	return err
}
Beispiel #4
0
func DeleteServer() error {
	_, _, err := apiclient.Delete(apiclient.Url("/appstax/hosting/server"))
	return err
}
Beispiel #5
0
func CreateServer(accessCode string) error {
	data := map[string]string{"accessCode": accessCode}
	_, _, err := apiclient.Post(apiclient.Url("/appstax/hosting/server"), data)
	return err
}
Beispiel #6
0
func UploadServer(archivePath string, progressWriter io.Writer) error {
	_, _, err := apiclient.PostFile(apiclient.Url("/appstax/hosting/server/code"), archivePath, progressWriter)
	return err
}