1 Works only for Subversion repositories. That boolean flag determines if you want to create “trunk”, “branches” and “tags” directories in your new repository or not. If true, Beanstalk will create those directories as rev. 1 of your repository.
2 see the list of available color labels at the end of the page.
GET /api/repositories.xml
Click to expand…
http-response<?xml version="1.0" encoding="UTF-8"?>
<repositories type="array">
<repository>
<account-id type="integer">9247</account-id>
<anonymous type="boolean">false</anonymous>
<color-label>label-blue</color-label>
<created-at type="datetime">
2007-06-14T22:15:37Z
</created-at>
<id type="integer">82346</id>
<type>SubversionRepository</id>
<last-commit-at type="datetime">
2009-11-18T13:21:24Z
</last-commit-at>
<name>ProjectAlpha</name>
<revision type="integer">36</revision>
<storage-used-bytes type="integer">
151130112
</storage-used-bytes>
<title>Beanstalk</title>
<updated-at type="datetime">
2009-11-18T13:21:42Z
</updated-at>
</repository>
<repository>
<account-id type="integer">7334</account-id>
<anonymous type="boolean">false</anonymous>
<color-label>label-</color-label>
<created-at type="datetime">
2007-07-23T06:59:15Z
</created-at>
<id type="integer">63722</id>
<type>SubversionRepository</id>
<last-commit-at type="datetime">
2007-07-23T08:11:13Z
</last-commit-at>
<name>mt</name>
<revision type="integer">2</revision>
<storage-used-bytes type="integer">
180224
</storage-used-bytes>
<title>Super Repository</title>
<updated-at type="datetime">
2009-08-10T06:05:39Z
</updated-at>
</repository>
</repositories>
Beanstalk::API::Repository.find(:all)
GET /api/repositories/58.xml
Click to expand…
http-response<?xml version="1.0" encoding="UTF-8"?>
<repository>
<account-id type="integer">9247</account-id>
<anonymous type="boolean">false</anonymous>
<color-label>label-blue</color-label>
<created-at type="datetime">
2007-06-14T22:15:37Z
</created-at>
<id type="integer">82346</id>
<type>SubversionRepository</id>
<last-commit-at type="datetime">
2009-11-18T13:21:24Z
</last-commit-at>
<name>ProjectAlpha</name>
<revision type="integer">36</revision>
<storage-used-bytes type="integer">
151130112
</storage-used-bytes>
<title>Beanstalk</title>
<updated-at type="datetime">
2009-11-18T13:21:42Z
</updated-at>
</repository>
Beanstalk::API::Repository.find(58)
See a list of writable attributes at the top of the page.
POST /api/repositories.xml
<?xml version="1.0" encoding="UTF-8"?>
<repository>
<name>shiny_new_repo</name>
<title>Bubblegum</title>
</repository>
Click to expand…
http-response<?xml version="1.0" encoding="UTF-8"?>
<repository>
<account-id type="integer">9247</account-id>
<anonymous type="boolean">false</anonymous>
<color-label>label-blue</color-label>
<created-at type="datetime">
2007-06-14T22:15:37Z
</created-at>
<id type="integer">82346</id>
<type>SubversionRepository</id>
<last-commit-at type="datetime">
2009-11-18T13:21:24Z
</last-commit-at>
<name>ProjectAlpha</name>
<revision type="integer">36</revision>
<storage-used-bytes type="integer">
151130112
</storage-used-bytes>
<title>Beanstalk</title>
<updated-at type="datetime">
2009-11-18T13:21:42Z
</updated-at>
</repository>
--OR IF INVALID--
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Name can't be blank</error>
</errors>
Beanstalk::API::Repository.create(
:name => "repo_name",
:title => "Repo Name"
)
See a list of writable attributes at the top of the page. You only need to pass the attributes that you want to change.
PUT /api/repositories/58.xml
<?xml version="1.0" encoding="UTF-8"?>
<repository>
<name>bahroma_tunec</name>
<title>bla</title>
<color_label>label-red</color_label>
</repository>
Click to expand…
http-responseHEAD 200 OK
--OR IF INVALID--
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Name can't be blank</error>
</errors>
Or using the ruby lib:
repo = Beanstalk::API::Repository.find(58)
repo.title = "New Neat Title"
repo.save