Vridlo/api/vridlo.assemblers.tasks

From ALT Linux Wiki

vridlo.assembler.tasks

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

GET:/v1/assembler/<slug>/tasks.json

Returns a list of tasks, which are presented in the system. Do not poll this method more than once an hour. Added into API v1.0.

Authentication

This method requires NO authentication.

Inline Arguments

  • slug is string
The assembler slug

Arguments

NOTE: Arguments can be provided as arguments along with headers fields.
  • per_page (Optional)
Number of items to return per page. If this argument is omitted, it defaults to 10. The maximum allowed value is 50.
  • page (Optional)
The page of results to return. If this argument is omitted, it defaults to 1.

Examples

Example Request Url
GET:/v1/assembler/core/tasks.json
Example Good Response
[
  {
     "no": 100000,
     "uri": "http://git.altlinux.org/tasks/100000",
     "state": "DONE",
     "shared": true,
     "test": false,
     "try": 1,
     "iteration": 1,
     "owner_slug": "user",
     "assembler_slug": "core",
     "source_path_slug": "p8_core",
     "changed_at": "1574870479",
     "exercise_count": 0,
  }
]
Example Bad Response

Error response 416:

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

Return Codes

  • 200 (OK)
The resource list is accessible. Returned data responds to the current state of the resource list, and reading the list is finished.
  • 206 (Partial Content)
The resource list is accessible. Returned data responds to the current state of the resource list, and reading the list is NOT finished yet.
  • 416 (Range Not Satisfiable)
The resource list is accessible. But data can't be returned since range provided don't match the list boundaries.
  • 422.3 (SSL is required)
SSL is required to access the Vridlo API.
  • 500 (Service currently unavailable)
The requested service is temporarily unavailable.

POST:/v1/assembler/<slug>/tasks.json

Creates the task 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 task permissions token to task model.

Inline Arguments

  • slug is string
The assembler slug

Arguments

  • no is integer (Mandatory)
Integer number of the task for the specified assebler. Must be unique among the task names for the specified assember, and contains only digits.
  • owner_slug is string (Mandatory)
Slug of user, which is the task owner. The user MUST be presented.
  • source_path_slug is string (Mandatory)
Slug of the source path for the task. The source path MUST be presented.
  • uri is uri (Optional)
External URI of the task. Can be blank, defaulting to blank.
  • shared is boolean (Optional)
Is it the shared task, defaulting to false
  • test is boolean (Optional)
Is it the the test only task, defaulting to true
  • changed_at is time (Optional)
Time of changing the task, can be in any of known RFC format, defaulting to now on server side

Examples

Example Request Url
POST:/v1/assembler/core/tasks.json?no=100000&uri="http://git.altlinux.org/tasks/100000"&shared=false&test=false&owner_slug=user&source_path_slug=sisyphus_core&changed_at=1574870479
Example Request Form
POST:/v1/assembler/core/tasks.json
DATA:
{
   "no": 100000,
   "uri": "http://git.altlinux.org/tasks/100000",
   "shared": false,
   "test": false,
   "owner_slug": "user",
   "source_path_slug": "sisyphus_core",
   "changed_at": "1574870479",
}
Example Good Response

Good response with created record:

{
   "no": 100000,
   "uri": "http://git.altlinux.org/tasks/100000",
   "state": "NEW",
   "shared": false,
   "test": false,
   "try": 1,
   "iteration": 1,
   "owner_slug": "user",
   "assembler_slug": "core",
   "source_path_slug": "sisyphus_core",
   "changed_at": "2019-11-27 19:01:19 +0300",
   "exercise_count": 0,
}
Example Bad Response

Error response 423:

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

Return Codes

  • 200 (OK)
The resource wasn't found, and was created. Returned data responds to the current state of the resource.
  • 422.3 (SSL is required)
SSL is required to access the Vridlo API.
  • 422.5 (Invalid incoming data)
The incoming data is invalid. See details for help.
  • 404 (Not Found)
The record with provided slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.

GET:/v1/assembler/<slug>/tasks/<no>.json

Gets properties of the task specified by <name> 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

  • slug is string
The assembler slug
  • no is integer
Integer number of the task for the specified assembler.

Arguments

This method requires NO arguments.

Examples

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

Good response with returned record:

{
   "no": 100000,
   "uri": "http://git.altlinux.org/tasks/100000",
   "state": "NEW",
   "shared": false,
   "test": false,
   "try": 1,
   "iteration": 1,
   "owner_slug": "user",
   "assembler_slug": "core",
   "source_path_slug": "sisyphus_core",
   "changed_at": "2019-11-27 19:01:19 +0300",
   "exercise_count": 0,
}
Example Bad Response

Error response 423:

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

Return Codes

  • 200 (OK)
The resource was found and is accessible. Returned data responds to the current state of the resource.
  • 422.3 (SSL is required)
SSL is required to access the Vridlo API.
  • 404 (Not Found)
The record with provided slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.

PATCH:/v1/assembler/<slug>/tasks/<no>.json

Overwrites one or many specified only properties of the task specified by <name> URI-parameter, and returns updated state as JSON. Added into API v1.0.

Authentication

This method requires write authentication with write task token to task model.

Inline Arguments

  • slug is string
The assembler slug
  • no is integer
Integer number of the task for the specified assembler.

Arguments

  • uri is uri (Optional)
External URI of the task. Can be blank, defaulting to blank.
  • shared is boolean (Optional)
Is it the shared task, defaulting to false
  • test is boolean (Optional)
Is it the the test only task, defaulting to true
  • changed_at is time (Optional)
Time of changing the task, can be in any of known RFC format, defaulting to now on server side

Examples

Example Request Url
PATCH:/v1/assembler/core/tasks/100000.json?shared=true
Example Request Form
PATCH:/v1/assembler/core/tasks/100000.json
DATA:
{
   "shared": true,
}
Example Good Response

Good response with updated record:

{
   "no": 100000,
   "uri": "http://git.altlinux.org/tasks/100000",
   "state": "NEW",
   "shared": true,
   "test": false,
   "try": 1,
   "iteration": 1,
   "owner_slug": "user",
   "assembler_slug": "core",
   "source_path_slug": "sisyphus_core",
   "changed_at": "2019-11-27 19:01:19 +0300",
   "exercise_count": 0,
}
Example Bad Response

Error response 423:

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

Return Codes

  • 200 (OK)
The resource was found and is accessible. Changes were made on the resource successfully. Returned data responds to the current state of the resource.
  • 204 (No Content)
The resource was found and is accessible. But no changes were made on the resource.
  • 422.3 (SSL is required)
SSL is required to access the Vridlo API.
  • 422.5 (Invalid incoming data)
The incoming data is invalid. See details for help.
  • 404 (Not Found)
The record with provided id/slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.

DELETE:/v1/assembler/<slug>/tasks/<no>.json

Destroys the task specified by <name> URI-parameter, and returns state of the destroyed record as JSON. Added into API v1.0.

Authentication

This method requires write authentication with write task token to task model.

Inline Arguments

  • slug is string
The assembler slug
  • no is integer
Integer number of the task for the specified assembler.

Arguments

This method requires NO arguments.

Examples

Example Request Url
DELETE:/v1/assembler/core/tasks/100000.json
Example Good Response

Good response returning deleted record:

{
   "no": 100000,
   "uri": "http://git.altlinux.org/tasks/100000",
   "state": "NEW",
   "shared": true,
   "test": false,
   "try": 1,
   "iteration": 1,
   "owner_slug": "user",
   "assembler_slug": "core",
   "source_path_slug": "sisyphus_core",
   "changed_at": "2019-11-27 19:01:19 +0300",
   "exercise_count": 0,
}
Example Bad Response

Error response 423:

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

Return Codes

  • 200 (OK)
The resource was found and is accessible, and successfully destroyed. Returned data responds to the state of the destroyed resource.
  • 422.3 (SSL is required)
SSL is required to access the Vridlo API.
  • 404 (Not Found)
The record with provided slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.