Exemplo n.º 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
}
Exemplo n.º 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
}
Exemplo n.º 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)
}
Exemplo n.º 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
}