-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: ability to add/remove lockable resources through API #103
Comments
I also would like some kind of REST API for this, so I could lock stuff in one Jenkins instance from a another Jenkins instance. I can use the GET calls that the lockable resources frontend uses, but i don't think it was intended for that kind of usage: When I used the "reserve" endpoint it would always return with status code 302, even if the lock had already been locked by someone else. |
I also wish there was also a REST API for this. In the meantime I created a python API to control lockable resources (reserve, unreserve, list etc). Hope that can help. |
I also would like a REST API. We have a resource that can be used externally from outside Jenkins. E.g. I would like to lock the resource from outside Jenkins. |
@odin- For the time being , you can put all the logic in a groovy code (groovy code support locking functionality) in a scripted or a declarative pipeline and then call your job remotely using curl or from some other point. |
FWIW, a PR to define an There is also JCasC support to pre-define resources, and a way to define "ephemeral" resources by just trying to lock a non-existing one. Other than that, groovy code, scripted pipelines and Jenkins Shared Libraries are in position to import the LockableResourcesManager and/or LockableResource classes and call their methods for lower-level manipulations. |
This was recently closed, but I'm also pushing for something similar in #305 with a |
Is there any API documentation on what is supported? |
You can create a new resource with this Groovy Code and finally get the list of all available resources with this code snippet
|
It would be really useful to able to add/remove lockable resources via an API (either REST or through the groovy console). This would enable the locks to represent real world non-static things - i.e. as you scale your infrastructure, you can scale your locks to reflect this.
The text was updated successfully, but these errors were encountered: