Repositories
A repository has a large number of moving parts. Over time, you'll be able to access all of these using the API as well as the web interface. At present, you can access a list of all available repositories for any project within your account with various properties (as shown below).
API URLs
You an use any of the API urls below to retrieve information about repositories within individual projects. You need to pass the project's permalink into the URL for all requests.
Data | Method | URL |
All repositories for a specific project | GET | /project/repositories |
Create repository | POST | /project/repositories |
Specific repository | GET | /project/repository |
Delete repository | DELETE | /project/repository |
Object Properties
The XML output below shows the properties which are returned by default when accessing project details.
GET /project/repository
<repository>
<name>Gem</name>
<permalink>gem</permalink>
<disk-usage>450560</disk-usage>
<last-commit-ref>57f5897e1c14631dbecfa29b647bef02cc631559</last-commit-ref>
<clone-url>git@codebasehq.com:account/codebase/gem.git</clone-url>
<source></source>
<sync type="boolean">false</sync>
<last-sync-at type="datetime" nil="true"></last-sync-at>
</repository>
name
contains the repositories's name as enteredpermalink
is the permalink for the repositorydisk-usage
the amount of disk space this repository is using in bytes.last-commit-ref
the reference of the last commit which was pushed into this repository.clone-url
the URL which can be used to checkout/clone this repository.
All other variables are part of the importing and sync options (currently only available on Git repositories).
source
the URL of the repository where this repository was imported from. Blank if the repository was not imported.sync
whether or not this repository is currently being kept in sync with thesource
.last-sync-at
the last time we fetched data from the remote repository (source
).
Creating Repository
Just send the name SCM type, and optionally the permalink of your repository to /project/repositories
POST /project/repositories
<repository>
<name>Gem</name>
<scm>git</scm>
</repository>