help editing cloud profiles using TeamCity REST api
Hello,
I was just wondering if anyone could share some advice for editing cloud profiles using the REST api.
I'm sending a PUT request with the updated settings to the project features url with the feature id set to the profile, but it doesn't seem to work as expected.
ex. I delete an instance externally and update source_images_json. However, the deleted instance id still shows up in the profile. On the server, the xml element corresponding to the instance still exists in the project config.
I want to use the REST to update the profile when instances are created or terminated externally, but it seems like I would also need to modify the project feature corresponding to each instance as well. I might be missing something here, so any help would be appreciated, thanks!
Please sign in to leave a comment.
Hi,
could you mention which TeamCity version exactly are you running? If you could post as well a sample request that would be helpful in replicating the issue.
I'm running 2017.1.5. I try to remove an instance from the profile by updating source_images_json, but the instance still shows up in the profile even though it's been removed from source_images_json. There is a CloudImage element for it on disk.
curl --basic --user ${TC_REST_USER}:${TC_REST_PASSWORD} --header 'Content-Type: application/xml' --request PUT "http://teamcity:8111/app/rest/projects/id:_Root/projectFeatures/id:${PROFILE_ID}" --data @/tmp/${PROFILE_ID}.xml