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 }
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 }
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 }