func GetConfig(network *net.Network, configKey string) (string, error) { url := fmt.Sprintf("/v1/server/config/%s", configKey) body, err := network.SendGetRequest(url) if err != nil { return "", err } return string(body), nil }
func ShuttingDown(network *net.Network) string { url := "/v1/server/shuttingDown" body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func State(network *net.Network) string { url := "/v1/server/ha/state" body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
// WIP func ClearStates(network *net.Network) string { url := "/v1/server/ha/states/clear" body, err := network.SendEmptyPostRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func GetConfig(network *net.Network, configKey string) string { url := fmt.Sprintf("/v1/server/config/%s", configKey) body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func LocatedLocations(network *net.Network) (string, error) { url := "/v1/locations/usage/LocatedLocations" body, err := network.SendGetRequest(url) if err != nil { return "", err } return string(body), nil }
func Spec(network *net.Network, application, entity string) (string, error) { urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/spec", application, entity) body, err := network.SendGetRequest(urlStr) if nil != err { return "", err } return string(body), nil }
func Machines(network *net.Network) (string, error) { url := fmt.Sprintf("/v1/usage/machines") body, err := network.SendGetRequest(url) if err != nil { return "", err } return string(body), nil }
func Application(network *net.Network, application string) (string, error) { url := fmt.Sprintf("/v1/usage/applications/%s", application) body, err := network.SendGetRequest(url) if err != nil { return "", err } return string(body), nil }
func State(network *net.Network) (string, error) { url := "/v1/server/ha/state" body, err := network.SendGetRequest(url) if err != nil { return "", err } return string(body), nil }
func Spec(network *net.Network, application, entity string) string { urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/spec", application, entity) body, err := network.SendGetRequest(urlStr) if err != nil { fmt.Println(err) } return string(body) }
func UpExtended(network *net.Network) (string, error) { url := "/v1/server/up/extended" body, err := network.SendGetRequest(url) if err != nil { return "", err } return string(body), nil }
func ShuttingDown(network *net.Network) (string, error) { url := "/v1/server/shuttingDown" body, err := network.SendGetRequest(url) if err != nil { return "", err } return string(body), nil }
func Reload(network *net.Network) (string, error) { url := "/v1/server/properties/reload" body, err := network.SendEmptyPostRequest(url) if err != nil { return "", err } return string(body), nil }
func Application(network *net.Network, application string) string { url := fmt.Sprintf("/v1/usage/applications/%s", application) body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func ActivityStream(network *net.Network, activity, streamId string) string { url := fmt.Sprintf("/v1/activities/%s/stream/%s", activity, streamId) body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
// WIP func CreateLocation(network *net.Network, locationId string) (string, error) { url := fmt.Sprintf("/v1/locations", locationId) body, err := network.SendEmptyPostRequest(url) if err != nil { return "", err } return string(body), nil }
func PolicyStatus(network *net.Network, application, entity, policy string) string { url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s", application, entity, policy) body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func Rename(network *net.Network, application, entity, newName string) (string, error) { urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/name?name=%s", application, entity, url.QueryEscape(newName)) body, err := network.SendEmptyPostRequest(urlStr) if nil != err { return "", err } return string(body), nil }
func CurrentState(network *net.Network, application, entity string) string { url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/current-state", application, entity) body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
// WIP func Priority(network *net.Network) string { url := "/v1/server/ha/priority" body, err := network.SendEmptyPostRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func DestroyPolicy(network *net.Network, application, entity, policy string) string { url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/destroy", application, entity, policy) body, err := network.SendEmptyPostRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func Export(network *net.Network) string { url := "/v1/server/ha/persist/export" body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
// WIP func CreateLocation(network *net.Network, locationId string) string { url := fmt.Sprintf("/v1/locations", locationId) body, err := network.SendEmptyPostRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func Reload(network *net.Network) string { url := "/v1/server/properties/reload" body, err := network.SendEmptyPostRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func LocatedLocations(network *net.Network) string { url := "/v1/locations/usage/LocatedLocations" body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func UpExtended(network *net.Network) string { url := "/v1/server/up/extended" body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func Machines(network *net.Network) string { url := fmt.Sprintf("/v1/usage/machines") body, err := network.SendGetRequest(url) if err != nil { fmt.Println(err) } return string(body) }
func ActivityStream(network *net.Network, activity, streamId string) (string, error) { url := fmt.Sprintf("/v1/activities/%s/stream/%s", activity, streamId) body, err := network.SendGetRequest(url) if nil != err { return "", err } return string(body), nil }
func Export(network *net.Network) (string, error) { url := "/v1/server/ha/persist/export" body, err := network.SendGetRequest(url) if err != nil { return "", nil } return string(body) }