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
}