Example #1
0
func PostConfig(network *net.Network, application, entity, config, value string) (string, error) {
	url := fmt.Sprintf("/v1/applications/%s/entities/%s/config", application, entity)
	val := []byte(value)
	body, err := network.SendPostRequest(url, val)
	if nil != err {
		return "", err
	}
	return string(body), nil
}
Example #2
0
func CreateFromBytes(network *net.Network, blueprint []byte) (models.TaskSummary, error) {
	url := "/v1/applications"
	var response models.TaskSummary
	body, err := network.SendPostRequest(url, blueprint)
	if err != nil {
		return response, err
	}
	err = json.Unmarshal(body, &response)
	return response, err
}
Example #3
0
func PostConfig(network *net.Network, application, entity, config, value string) string {
	url := fmt.Sprintf("/v1/applications/%s/entities/%s/config", application, entity)
	val := []byte(value)
	body, err := network.SendPostRequest(url, val)
	if err != nil {
		fmt.Println(err)
	}

	return string(body)
}
Example #4
0
func CreateFromBytes(network *net.Network, blueprint []byte) models.TaskSummary {
	url := "/v1/applications"

	body, err := network.SendPostRequest(url, blueprint)
	if err != nil {
		fmt.Println(err)
	}
	var response models.TaskSummary
	err = json.Unmarshal(body, &response)
	if err != nil {
		fmt.Println(err)
	}
	return response
}