Manage Cloud Profiles
This article lists REST API requests concerning cloud profiles.
To get a list of all available cloud profiles, use:
GET/app/rest/cloud/profiles
To get a specific profile, use:
GET/app/rest/cloud/profiles/<cloudProfileLocator>
where cloudProfileLocator
is typed as CloudProfileLocator.
For example, to get profiles belonging to the MyProject
project, use:
GET/app/rest/cloud/profiles/project:MyProject
To get cloud images, use:
GET/app/rest/cloud/images
This call, similarly to the above, supports the locator parameter:
GET/app/rest/cloud/images/<cloudImageLocator>
Here, cloudImageLocator
is typed as CloudImageLocator.
For example, to get cloud image with ID my-ec2-image
under amazon-1
cloud profile, use:
GET/app/rest/cloud/images/id:(id:my-ec2-image,profileId:amazon-1)
To get cloud instances, use:
GET/app/rest/cloud/instances
This call, similarly to the above, supports the locator parameter:
GET/app/rest/cloud/instances/<cloudInstanceLocator>
where cloudInstanceLocator
is typed as CloudInstanceLocator.
To extend previous example, use the following request to get cloud instance i-0a7c2f04a1e58ca53
started from my-ec2-image
under amazon-1
cloud profile:
GET/app/rest/cloud/images/id:(id:i-0a7c2f04a1e58ca53,imageId:my-ec2-image,profileId:amazon-1)
To start a new cloud instance, use:
POST/app/rest/cloud/instances
The request accepts the following payload:
<cloudInstance id="profileId:<profileId>,imageId:<imageId>,id:<instanceId>" name="<instanceName>">
<image id="profileId:<profileId>,id:<imageId>" name="<imageName>"/>
</cloudInstance>
{
"id" : "profileId:<profileId>,imageId:<imageId>,id:<instanceId>",
"name" : "<instanceName>",
"image": {
"id": "profileId:<profileId>,id:<imageId>",
"name": "<imageName>"
}
}
To stop a running cloud instance, send a POST request to either /app/rest/cloud/instances/<cloudInstanceLocator>/actions/stop
or /app/rest/cloud/instances/<cloudInstanceLocator>/actions/forceStop
endpoint.
The .../actions/stop
endpoint requests ensure that agents are not terminated during a build. Use this endpoint to tell an agent it should stop after finishing its current tasks.

To immediately wind down a cloud agent even if it's currently busy, send a POST request to the .../actions/forceStop
endpoint (recommended), or a DELETE request to the /app/rest/cloud/instances/<cloudInstanceLocator>
endpoint.
POST http://localhost:8111/app/rest/cloud/instances/id:(id:i-0ce24a92a92285423,imageId:Win-Server-2022-xLarge,profileId:amazon-1)/actions/forceStop
# or
DELETE http://localhost:8111/app/rest/cloud/instances/id:(id:i-0ce24a92a92285423,imageId:Win-Server-2022-xLarge,profileId:amazon-1)
Thanks for your feedback!