semaphoreui / semaphore

Modern UI and powerful API for Ansible, Terraform, OpenTofu, PowerShell and other DevOps tools.
https://semaphoreui.com
MIT License
10.7k stars 1.07k forks source link

Problem: Want to restore project using API #2419

Open batchdev1337 opened 1 month ago

batchdev1337 commented 1 month ago

Issue

Hello,

I am working on the Semaphore API feature. I successfully restored the project using the Semaphore API, but after that, I made some changes to the JSON backup file and restored it again. I expected that the existing project would be updated, but instead, a new project was created.

I would like some guidance on this issue, as I am planning to design the Semaphore master client setup. My script will keep the client Semaphore updated based on the master Semaphore.

I have also attached a screenshot showing where the same project is duplicated, and I want to overwrite it.

Below is the command that i am using to restore the semaphore project backup:

curl -s -o /dev/null -w "%{http_code}" -X POST "localhost:3001/api/projects/restore"             -H "accept: text/plain; charset=utf-8"             -H "Content-Type: application/json"             -H "Authorization: Bearer <token>"             -d @"83.json" 

Thank you!

Impact

Web-Frontend (what users interact with), Web-Backend (APIs), Semaphore Project

Installation method

Docker

Database

MySQL

Browser

Firefox, Chrome

Semaphore Version

V2.10.15-beta

Ansible Version

No response

Logs & errors

image

Manual installation - system information

No response

Configuration

No response

Additional information

No response

fiftin commented 1 month ago

Hi @batchdev1337 ,

It is possible, will add to docs soon.