Exemple #1
0
func AddCatalog(network *net.Network, filePath string) (string, error) {
	url := "/v1/catalog"
	body, err := network.SendPostFileRequest(url, filePath, "application/json")
	if err != nil {
		return "", err
	}
	return string(body), nil
}
Exemple #2
0
func AddCatalog(network *net.Network, filePath string) string {
	url := "/v1/catalog"
	body, err := network.SendPostFileRequest(url, filePath)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}
func Create(network *net.Network, filePath string) (models.TaskSummary, error) {
	url := "/v1/applications"
	var response models.TaskSummary
	body, err := network.SendPostFileRequest(url, filePath, "application/json")
	if err != nil {
		return response, err
	}
	err = json.Unmarshal(body, &response)
	return response, err
}
Exemple #4
0
func AddChildren(network *net.Network, application, entity, filePath string) (models.TaskSummary, error) {
	urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/children", application, entity)
	var response models.TaskSummary
	body, err := network.SendPostFileRequest(urlStr, filePath, "application/json")
	if err != nil {
		return response, err
	}

	err = json.Unmarshal(body, &response)
	return response, err
}
func Create(network *net.Network, filePath string) models.TaskSummary {
	url := "/v1/applications"
	body, err := network.SendPostFileRequest(url, filePath)
	if err != nil {
		fmt.Println(err)
	}
	var response models.TaskSummary
	err = json.Unmarshal(body, &response)
	if err != nil {
		fmt.Println(err)
	}
	return response
}
Exemple #6
0
func AddChildren(network *net.Network, application, entity, filePath string) models.TaskSummary {
	urlStr := fmt.Sprintf("/v1/applications/%s/entities/%s/children", application, entity)
	body, err := network.SendPostFileRequest(urlStr, filePath)
	if err != nil {
		fmt.Println(err)
	}

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