Exemplo n.º 1
0
func GetConfigValue(network *net.Network, application, entity, policy, config string) (string, error) {
	url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/config/%s", application, entity, policy, config)
	body, err := network.SendGetRequest(url)
	if nil != err {
		return "", err
	}
	return string(body), nil
}
Exemplo n.º 2
0
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)
}
Exemplo n.º 3
0
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
}
Exemplo n.º 4
0
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
}
Exemplo n.º 5
0
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)
}
Exemplo n.º 6
0
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)
}
Exemplo n.º 7
0
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)
}
Exemplo n.º 8
0
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
}
Exemplo n.º 9
0
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
}
Exemplo n.º 10
0
func SensorValue(network *net.Network, application, entity, sensor string) (string, error) {
	url := fmt.Sprintf("/v1/applications/%s/entities/%s/sensors/%s", application, entity, sensor)
	body, err := network.SendGetRequest(url)
	if nil != err {
		return "", err
	}
	return string(body), nil
}
Exemplo n.º 11
0
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)
}
Exemplo n.º 12
0
func GetAllConfigValues(network *net.Network, application, entity, policy, config string) string {
	url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/%s/config", application, entity, policy, config)
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}
Exemplo n.º 13
0
func Version(network *net.Network) string {
	url := "/v1/version"
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}
Exemplo n.º 14
0
func CurrentState(network *net.Network, application, entity string) (string, error) {
	url := fmt.Sprintf("/v1/applications/%s/entities/%s/policies/current-state", application, entity)
	body, err := network.SendGetRequest(url)
	if nil != err {
		return "", err
	}
	return string(body), nil
}
Exemplo n.º 15
0
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)
}
Exemplo n.º 16
0
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
}
Exemplo n.º 17
0
func GetLocation(network *net.Network, locationId string) string {
	url := fmt.Sprintf("/v1/locations/%s", locationId)
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}
Exemplo n.º 18
0
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
}
Exemplo n.º 19
0
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)
}
Exemplo n.º 20
0
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)
}
Exemplo n.º 21
0
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
}
Exemplo n.º 22
0
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
}
Exemplo n.º 23
0
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)
}
Exemplo n.º 24
0
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
}
Exemplo n.º 25
0
func ShuttingDown(network *net.Network) string {
	url := "/v1/server/shuttingDown"
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}
Exemplo n.º 26
0
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)
}
Exemplo n.º 27
0
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)
}
Exemplo n.º 28
0
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)
}
Exemplo n.º 29
0
func Icon(network *net.Network, itemId string) []byte {
	url := fmt.Sprintf("/v1/catalog/icon/%s", itemId)
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return body
}
Exemplo n.º 30
0
//WIP
func Fetch(network *net.Network) (string, error) {
	url := "/v1/applications/fetch"
	body, err := network.SendGetRequest(url)
	if err != nil {
		return "", err
	}
	// TODO return model
	return string(body), nil
}