How can I update all subversion repository username and passwords

I have 270+ subversion repositories in fisheye.  How can I update the username and password in each of then programmatically?

It looks like I might be able to from the last PUT example at https://docs.atlassian.com/fisheye-crucible/latest/wadl/fecru.html#d1e1487, but I'm not sure what "p4" is.

I'm hoping to PUT something like the first example,

{   "description" : "My old SVN repo",   "enabled" : false,   "svn" : {     "path" : "/amazingapp_old",   "auth" : {       "username" : "newton",     "password" : "apple"     },     "caseSensitive" : true "  } }

 

Thanks in advance,

Scott

2 answers

1 accepted

This widget could not be displayed.

Hi Scott,

To get the list of all your svn repositories use this REST endpoint:

GET https://[fisheye]/rest-service-fecru/admin/repositories?type=svn&limit=500

this will return a list of svn repositories where you can get repository names. Note this is a paged (default 100) response, so you can append the limit parameter to have all the results in one request.

Example:

{start: 0,
 limit: 100,
 lastPage: true, 
 size: 30,
 values: [
   {type: "svn",
    name: "someSvnRepo1", 
    storeDiff: true,
    enabled: false,
    svn: {
        url: "https://somesvnrepo1/svn",
        path: "/repo",
        usingBuiltinSymbolicRules: true,
        auth: {username: "user1", password: "pass2"}
    }},
   {type: "svn",
    name: "someSvnRepo2", 
    storeDiff: true,
    enabled: false,
    svn: {
        url: "https://somesvnrepo2/svn",
        path: "/repo",
        usingBuiltinSymbolicRules: true,
        auth: {username: "user2", password: "pass2"}
    }},
...

Now you can send a PUT request with just the data that you want to modify (other properties will be left untouched), so you could iterate over the list above and send following requests to update the username and password:

PUT https://[fisheye]/rest-service-fecru/admin/repositories/someSvnRepo1

with the following payload:

{
    enabled : true,
    svn: {
        auth: {username: "user1", password: "pass2"}
    }
}

Note, no need to set enabled=true - I have just added it to show the JSON structure of the payload.

The p4 you are referring to is an example of how to update a Perforce repository.

Also note there is a python client that could help you writing this script: https://bitbucket.org/atlassian/fecru-rest-examples/src

Hi Maciej, That's just the confirmation I needed.  I just updated all my repos.

Thanks a bunch!

Scott

This widget could not be displayed.

P4 is Perforce repository. 

That makes sense now.  Thanks!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

135 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you