I use the CloudBees Folders subfolder plugin and Credentials Plugin to manage secrets in different pipeline jobs. Let's say I have a Jenkins folder structure like this.
folder1/
folder2/
job1
The folder plugin allows me to have credentials and credentials for folders, so only those jobs in these folders can access these credentials.
I can do this through the user interface, but we rotate these credentials so often and want to automate some of this.
One of the ways we thought to do this is to use the Jenkins CLI .
There are various commands provided by the credential plugin. For instance:
credential list . List of credentials in a specific store
java -jar jenkins-cli.jar -s http: // localhost: 8080 / list-credentials STORE
List of credentials in a specific store
SHOP : store identifier
list-credentials-context-resolvers - Credential List Context Recover
java -jar jenkins-cli.jar -s http: // localhost: 8080 / account-list-contextual resolvers
Credential List Contextual Recovers
list-credential providers . Credential Provider List
java -jar jenkins-cli.jar -s http: // localhost: 8080 / List-credentials-providers
STORE Jenkins , , system::system::jenkins.
, :
✗ java -jar credential-management/build/jenkinsAutomation/Localhost/cli/jenkins-cli.jar -s http://localhost:8080 list-credentials-context-resolvers --username admin --password password
: 
:
✗ java -jar credential-management/build/jenkinsAutomation/Localhost/cli/jenkins-cli.jar -s http://localhost:8080 list-credentials system::system::jenkins --username admin --password password
:

, STORE ( , ).
✗ java -jar credential-management/build/jenkinsAutomation/Localhost/cli/jenkins-cli.jar -s http://localhost:8080 list-credentials folder::items::folder1 --username admin --password password
ERROR: :: items:: folder1 :

STORE , create-credentials-by-xml ? , Groovy ?