API: Add clone endpoints to API
This commit is contained in:
parent
6d789da727
commit
4ef578ba7f
1 changed files with 30 additions and 0 deletions
30
src/api.js
30
src/api.js
|
|
@ -76,8 +76,38 @@ async function getActivationKeys() {
|
|||
return request.data.body;
|
||||
}
|
||||
|
||||
// get clones of a compose
|
||||
async function getClones(id, limit, offset) {
|
||||
const params = new URLSearchParams({
|
||||
limit,
|
||||
offset,
|
||||
});
|
||||
const path = `/composes/${id}/clones?${params}`;
|
||||
const request = await axios.get(IMAGE_BUILDER_API.concat(path));
|
||||
return request.data;
|
||||
}
|
||||
|
||||
async function getCloneStatus(id) {
|
||||
const path = `/clones/${id}`;
|
||||
const request = await axios.get(IMAGE_BUILDER_API.concat(path));
|
||||
return request.data;
|
||||
}
|
||||
|
||||
async function cloneImage(composeId, body) {
|
||||
const path = `/composes/${composeId}/clone`;
|
||||
const request = await axios.post(
|
||||
IMAGE_BUILDER_API.concat(path),
|
||||
body,
|
||||
postHeaders
|
||||
);
|
||||
return request.data;
|
||||
}
|
||||
|
||||
export default {
|
||||
cloneImage,
|
||||
composeImage,
|
||||
getClones,
|
||||
getCloneStatus,
|
||||
getComposes,
|
||||
getComposeStatus,
|
||||
getPackages,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue