Example #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
}
Example #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)
}
Example #3
0
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
}
Example #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
}
Example #5
0
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
}
Example #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
}