Vridlo/api/vridlo.assemblers.tasks.exercises

vridlo.assemblers.tasks.exercises
It allows accessing to a list of exercises, which are presented in the system. Do not poll this method more than once an hour. Added into API v1.0.

GET:/v1/assembler/ /tasks//exercises.json
Returns a list of exercises, which are presented in the systemfor the specific assembler and task. Do not poll this method more than once an hour. Added into API v1.0.

Authentication
This method requires NO authentication.

Inline Arguments
The assembler slug Integer number of the task for the specified assembler.
 * slug is string
 * task_no is integer

Arguments
NOTE: Arguments can be provided as arguments along with headers fields.

Number of items to return per page. If this argument is omitted, it defaults to 10. The maximum allowed value is 50. The page of results to return. If this argument is omitted, it defaults to 1.
 * per_page (Optional)
 * page (Optional)

Example Request Url
GET:/v1/assembler/core/tasks/100000/exercises.json

Example Good Response
[  {      "no": "100", "kind": "repo", "pkgname": "python-sphinx-objects", "resource": "http://git.altlinux.org/people/cronbuild/packages/python-sphinx-objects.inv.git", "sha": "0c4cd35c9f88f2a8bda272d9851089dd3e695845", "committer_slug": "user", "task_no": 100000, "assembler_slug": "core", "source_path_slug": "sisyphus_core", "approver_slugs": [ "user", "user1" ], } ]

Example Bad Response
Error response 416:

{  "message": "Error text according the active language", }

Return Codes
The resource list is accessible. Returned data responds to the current state of the resource list, and reading the list is finished.
 * 200 (OK)

The resource list is accessible. Returned data responds to the current state of the resource list, and reading the list is NOT finished yet.
 * 206 (Partial Content)

The resource list is accessible. But data can't be returned since range provided don't match the list boundaries.
 * 416 (Range Not Satisfiable)

SSL is required to access the Vridlo API.
 * 422.3 (SSL is required)

The requested service is temporarily unavailable.
 * 500 (Service currently unavailable)

POST:/v1/assembler/ /tasks//exercises.json
Creates the exercise using the set of properties passed as form data or get parameter array, and returns state of the created record as JSON. Added into API v1.0.

Authentication
This method requires authenticated user with write exercise permissions token to exercise model.

Inline Arguments
The assembler slug Integer number of the task for the specified assembler.
 * slug is string
 * task_no is integer

Arguments
Integer number of the exercise for the specified assebler. Must be unique among the exercise number for the specified assember, and tasks, and contains only digits. Slug of user, which is the exercise committer. The user MUST be presented. name of package for the exercise. The name MUST be presented. Kind of a resource, can of "repo", "srpm", "copy", "delete" Resource to build or copy from. Mandatory, when kind is of "repo", "srpm", or "copy", otherwise can be blank, defaulting to blank. Sha check sum of build commit, Mandatory, when kind is of "repo" or "srpm", otherwise can be blank, defaulting to blank. Array of the approver slugs, defaulting to empty array.
 * no is integer (Mandatory)
 * committer_slug is string (Mandatory)
 * pkgname is string (Mandatory)
 * kind is string (Mandatory)
 * resource is string (Optional)
 * sha is string (Optional)
 * approver_slugs is array of string (Optional)

Example Request Url
POST:/v1/assembler/core/tasks/100000/exercises.json?no=100&kind=repo&pkgname=python-sphinx-objects&resource="http://git.altlinux.org/people/cronbuild/packages/python-sphinx-objects.inv.git"&sha=0c4cd35c9f88f2a8bda272d9851089dd3e695845&committer_slug=user

Example Request Form
POST:/v1/assembler/core/tasks/100000/exercises.json DATA: {   "no": "100", "kind": "repo", "pkgname": "python-sphinx-objects", "resource": "http://git.altlinux.org/people/cronbuild/packages/python-sphinx-objects.inv.git", "sha": "0c4cd35c9f88f2a8bda272d9851089dd3e695845", "committer_slug": "user", "approver_slugs": [], }

Example Good Response
Good response with created record:

{   "no": "100", "kind": "repo", "pkgname": "python-sphinx-objects", "resource": "http://git.altlinux.org/people/cronbuild/packages/python-sphinx-objects.inv.git", "sha": "0c4cd35c9f88f2a8bda272d9851089dd3e695845", "committer_slug": "user", "task_no": 100000, "assembler_slug": "core", "source_path_slug": "sisyphus_core", "approver_slugs": [], }

Example Bad Response
Error response 423:

{  "error_code": 3, "message": "Error text according the active language", }

Return Codes
The resource wasn't found, and was created. Returned data responds to the current state of the resource.
 * 200 (OK)

SSL is required to access the Vridlo API.
 * 422.3 (SSL is required)

The incoming data is invalid. See details for help.
 * 422.5 (Invalid incoming data)

The record with provided slug is not found.
 * 404 (Not Found)

The Internal Server Error has occurred.
 * 500 (Internal Server Error)

GET:/v1/assembler/ /tasks//exercises/.json
Gets properties of the exercise specified by URI-parameter, and returns then as JSON. Do not poll this method more than once an hour. Added into API v1.0.

Authentication
This method requires NO authentication.

Inline Arguments
The assembler slug Integer number of the task for the specified assembler. Integer number of the exercise for the specified assembler and task.
 * slug is string
 * task_no is integer
 * no is integer

Arguments
This method requires NO arguments.

Example Request Url
GET:/v1/assembler/core/tasks/100000/exercises/100.json

Example Good Response
Good response with returned record:

{   "no": "100", "kind": "repo", "pkgname": "python-sphinx-objects", "resource": "http://git.altlinux.org/people/cronbuild/packages/python-sphinx-objects.inv.git", "sha": "0c4cd35c9f88f2a8bda272d9851089dd3e695845", "committer_slug": "user", "task_no": 100000, "assembler_slug": "core", "source_path_slug": "sisyphus_core", "approver_slugs": [], }

Example Bad Response
Error response 423:

{  "error_code": 3, "message": "Error text according the active language", }

Return Codes
The resource was found and is accessible. Returned data responds to the current state of the resource.
 * 200 (OK)

SSL is required to access the Vridlo API.
 * 422.3 (SSL is required)

The record with provided slug is not found.
 * 404 (Not Found)

The Internal Server Error has occurred.
 * 500 (Internal Server Error)

PATCH:/v1/assembler/ /tasks//exercises/.json
Overwrites one or many specified only properties of the exercise specified by URI-parameter, and returns updated state as JSON. Added into API v1.0.

Authentication
This method requires write authentication with write exercise token to exercise model.

Inline Arguments
The assembler slug Integer number of the task for the specified assembler. Integer number of the exercise for the specified assembler and task.
 * slug is string
 * task_no is integer
 * no is integer

Arguments
Slug of user, which is the exercise committer. The user MUST be presented. name of package for the exercise. The name MUST be presented. Kind of a resource, can of "repo", "srpm", "copy", "delete" Resource to build or copy from. Mandatory, when kind is of "repo", "srpm", or "copy", otherwise can be blank, defaulting to blank. Sha check sum of build commit, Mandatory, when kind is of "repo" or "srpm", otherwise can be blank, defaulting to blank. Array of the approver slugs, defaulting to empty array.
 * committer_slug is string (Mandatory)
 * pkgname is string (Mandatory)
 * kind is string (Mandatory)
 * resource is string (Optional)
 * sha is string (Optional)
 * approver_slugs is array of string (Optional)

Example Request Url
PATCH:/v1/assembler/core/tasks/100000/exercises/100.json?committer_slug=user1&approver_slugs[]=user2

Example Request Form
PATCH:/v1/assembler/core/tasks/100000/exercises/100.json DATA: {   "committer_slug": "user1", "approver_slugs": [ "user2" ], }

Example Good Response
Good response with updated record:

{   "no": "100", "kind": "repo", "pkgname": "python-sphinx-objects", "resource": "http://git.altlinux.org/people/cronbuild/packages/python-sphinx-objects.inv.git", "sha": "0c4cd35c9f88f2a8bda272d9851089dd3e695845", "committer_slug": "user", "task_no": 100000, "assembler_slug": "core", "source_path_slug": "sisyphus_core", "approver_slugs": [ "user2" ], }

Example Bad Response
Error response 423:

{  "error_code": 3, "message": "Error text according the active language", }

Return Codes
The resource was found and is accessible. Changes were made on the resource successfully. Returned data responds to the current state of the resource.
 * 200 (OK)

The resource was found and is accessible. But no changes were made on the resource.
 * 204 (No Content)

SSL is required to access the Vridlo API.
 * 422.3 (SSL is required)

The incoming data is invalid. See details for help.
 * 422.5 (Invalid incoming data)

The record with provided id/slug is not found.
 * 404 (Not Found)

The Internal Server Error has occurred.
 * 500 (Internal Server Error)

DELETE:/v1/assembler/ /tasks//exercises/.json
Destroys the exercise specified by URI-parameter, and returns state of the destroyed record as JSON. Added into API v1.0.

Authentication
This method requires write authentication with write exercise token to exercise model.

Inline Arguments
The assembler slug Integer number of the task for the specified assembler. Integer number of the exercise for the specified assembler and task.
 * slug is string
 * task_no is integer
 * no is integer

Arguments
This method requires NO arguments.

Example Request Url
DELETE:/v1/assembler/core/tasks/100000/exercises/100.json

Example Good Response
Good response returning deleted record:

{   "no": "100", "kind": "repo", "pkgname": "python-sphinx-objects", "resource": "http://git.altlinux.org/people/cronbuild/packages/python-sphinx-objects.inv.git", "sha": "0c4cd35c9f88f2a8bda272d9851089dd3e695845", "committer_slug": "user", "task_no": 100000, "assembler_slug": "core", "source_path_slug": "sisyphus_core", "approver_slugs": [], }

Example Bad Response
Error response 423:

{  "error_code": 3, "message": "Error text according the active language", }

Return Codes
The resource was found and is accessible, and successfully destroyed. Returned data responds to the state of the destroyed resource.
 * 200 (OK)

SSL is required to access the Vridlo API.
 * 422.3 (SSL is required)

The record with provided slug is not found.
 * 404 (Not Found)

The Internal Server Error has occurred.
 * 500 (Internal Server Error)