Repositories API
- Get a single repository
- Projects of a single repository
- Packages of a single repository
- Update a single repository
- Create repository
- Destroy repository
- Add member to a single repository
- Remove member from a single repository
- Add project to a single repository
- Remove project from a single repository
- Update signatures for a single repository
- Add ‘.repo.lock’ file
- Remove ‘.repo.lock’ file
Get a single repository
GET /api/v1/repositories/:id.json
Parameters:
- id
- Required Integer identifier of current repository.
Response:
{
"repository": {
"id": "resource id",
"name": "name",
"created_at": "created at date and time",
"updated_at": "updated at date and time",
"description": "description",
"publish_without_qa": "publication without QA",
"publish_builds_only_from_branch": "platform name",
"platform": {
"id": "platform id",
"name": "platform name",
"visibility": "platform visibility",
"platform_type": "platform type",
"url": "platform data page path"
},
"url": "url to repository resource"
}
}
Example:
{
"repository": {
"id": 30,
"name": "main",
"created_at": 1346762587,
"updated_at": 1346841731,
"platform": {
"id": 1,
"name": "rosa2012",
"visibility": "open",
"platform_type": "main",
"url": "/api/v1/platforms/1.json"
},
"url": "/api/v1/repositories/30.json",
"description": "description",
"publish_without_qa": true,
"publish_builds_only_from_branch": "platform_name"
}
}
Projects of a single repository
GET /api/v1/repositories/:id/projects.json
Parameters:
- id
- Required Integer identifier of current repository.
Response:
{
"repository": {
"id": "resource id",
"name": "repository name",
"url": "url to repository resource",
"projects": [
{
"id": "project id",
"name": "project name",
"visibility": "visibility (open/hidden)",
"fullname": "project fullname",
"url": "url to project data page",
"git_url": "path to project git",
"ssh_url": "path to project git over ssh",
"maintainer": {
"id": "user id",
"uname": "user uname",
"name": "user name",
"url": "api user path",
"email": "user email"
}
}
]
},
"url": "url to projects data"
}
Example:
{
"repository": {
"id": 30,
"name": "main",
"url": "/api/v1/repositories/30.json",
"projects": [
{
"id": 666,
"name": "evil_tools",
"visibility": "open",
"fullname": "abf/evil_tools",
"url": "/api/v1/projects/666.json",
"git_url": "https:/ivan@abf.rosalinux.ru/jaroslav_garkin/hwinfo.git",
"ssh_url": "git@abf.rosalinux.ru:jaroslav_garkin/hwinfo.git",
"maintainer": {
"id": 1,
"name": "Ivan Aivazovsky",
"uname": "ivan_aivazovsky",
"url": "/api/v1/users/1.json",
"email": "ivan.aivazovsky@email.ru "
}
}
]
},
"url": "/api/v1/repositories/30/projects.json"
}
Packages of a single repository
Available only for owner and admins of main platform. Only one request for each platform per 15 minutes!
GET /api/v1/repositories/:id/packages.csv
Parameters:
- id
- Required Integer identifier of current repository.
Response:
Project owner,Project name,Package name,Epoch,Version,Release,Maintainer uname,Maintainer email,Committer uname,Committer email
project_owner,project_name,package_name,epoch,version,release,maintainer_uname,maintainer_email,committer_uname,committer_email
...
Example:
Project owner,Project name,Package name,Epoch,Version,Release,Maintainer uname,Maintainer email,Committer uname,Committer email
openmandriva,perl-Algorithm-Diff,perl-Algorithm-Diff,,1.190.200,6,ivan_aivazovsky,ivan_aivazovsky@test.com,peter_1,peter_1@test.com
openmandriva,perl-Net-SSLeay,perl-Net-SSLeay,,1.510.0,3,ivan_aivazovsky,ivan_aivazovsky@test.com,peter_1,peter_1@test.com
Update a single repository
PUT /api/v1/repositories/:id.json
Parameters:
- id
- Required Integer identifier of current repository.
Input:
- description:
- Optional String repository description.
- publish_without_qa:
- Optional Boolean status of publication without QA.
- publish_builds_only_from_branch:
-
Optional String allows to publish builds only from branch. Only for repositories from
main
platform. Default value:nil
.
Request:
{
"repository": {
"description": "description",
"publish_without_qa": true,
"publish_builds_only_from_branch": "platform_name"
}
}
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"repository": {
"id": 12,
"message": "Repository has been updated successfully"
}
}
Create repository
POST /api/v1/repositories.json
Input:
- platform_id
- Required Integer identifier of platform.
- description:
- Required String repository description.
- name:
- Required String repository name.
- publish_without_qa:
-
Optional Boolean status of publication without QA. Default:
true
. - publish_builds_only_from_branch:
-
Optional String allows to publish builds only from branch. Only for repositories from
main
platform. Default value:nil
.
Request:
{
"repository": {
"description": "description",
"publish_without_qa": true,
"publish_builds_only_from_branch": "platform_name",
"platform_id": 15,
"name": "repository name"
}
}
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"repository": {
"id": 12,
"message": "Repository has been created successfully"
}
}
Destroy repository
A repository with main
name can’t be deleted from personal
platform.
DELETE /api/v1/repositories/:id.json
Parameters:
- id
- Required Integer identifier of current repository.
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"repository": {
"id": 12,
"message": "Repository has been destroyed successfully"
}
}
Add member to a single repository
Only for repositories from main
platform.
PUT /api/v1/repositories/:id/add_member.json
Parameters:
- id
- Required Integer identifier of current repository
Input:
- member_id
- Required Integer identifier of new member
- type
-
Required String
Group
orUser
type of new member
Request:
{
"member_id": 34,
"type": "User"
}
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Examples:
{
"repository": {
"id": 56,
"message": "User '32' has been added to repository successfully"
}
}
{
"repository": {
"id": 56,
"message": "Group '31' has been added to repository successfully"
}
}
Remove member from a single repository
Only for repositories from main
platform.
DELETE /api/v1/repositories/:id/remove_member.json
Parameters:
- id
- Required Integer identifier of current repository
Input:
- member_id
- Required Integer identifier of member
- type
-
Required String
Group
orUser
type of member
Request:
{
"member_id": 34,
"type": "User"
}
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Examples:
{
"repository": {
"id": 56,
"message": "User '32' has been removed from repository successfully"
}
}
{
"repository": {
"id": 56,
"message": "Group '31' has been removed from repository successfully"
}
}
Add project to a single repository
PUT /api/v1/repositories/:id/add_project.json
Parameters:
- id
- Required Integer identifier of current repository
Input:
- project_id
- Required Integer identifier of project
Request:
{
"project_id": 34
}
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Examples:
{
"repository": {
"id": 56,
"message": "Project '32' has been added to repository successfully"
}
}
Remove project from a single repository
DELETE /api/v1/repositories/:id/remove_project.json
Parameters:
- id
- Required Integer identifier of current repository
Input:
- project_id
- Required Integer identifier of project
Request:
{
"project_id": 34
}
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Examples:
{
"repository": {
"id": 56,
"message": "Project '32' has been removed from repository successfully"
}
}
Update signatures for a single repository
Only for repositories from main
platform.
PUT /api/v1/repositories/:id/signatures.json
Parameters:
- id
- Required Integer identifier of current repository
Input:
- public
- Required String public key
- secret
- Required String secret key
Request:
{
"repository": {
"public": "public key",
"secret": "secret key"
}
}
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Examples:
{
"repository": {
"id": 56,
"message": "Signatures have been updated for repository successfully"
}
}
Add ‘.repo.lock’ file
Presence of .repo.lock
file means that mirror is currently synchronising the repository state. Only for repositories from main
platform.
PUT /api/v1/repositories/:id/add_repo_lock_file.json
Parameters:
- id
- Required Integer identifier of current repository
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"repository": {
"id": 56,
"message": "'.repo.lock' file has been added to repository successfully"
}
}
Remove ‘.repo.lock’ file
Presence of .repo.lock
file means that mirror is currently synchronising the repository state. Only for repositories from main
platform.
DELETE /api/v1/repositories/:id/remove_repo_lock_file.json
Parameters:
- id
- Required Integer identifier of current repository
Response:
{
"repository": {
"id": "repository id (null if failed)",
"message": "success or fail message"
}
}
Example:
{
"repository": {
"id": 56,
"message": "'.repo.lock' file has been removed from repository successfully"
}
}