Vridlo/api/vridlo.source paths: Difference between revisions

From ALT Linux Wiki
No edit summary
Line 1: Line 1:
== vridlo.source_path.index ==
It allows accessing to a list of source paths, which are presented in the system. Do not poll this method more than once an hour.
Added into API v1.0.
=== Path ===
/v1/source_paths
=== Methods ===
==== GET ====
Returns a list of source paths, 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.
===== Arguments =====
* 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.
NOTE: Arguments can be provided as arguments along with headers fields.
===== Example Response =====
[
  {
  "name": "Core Assembler p9 i586 Path",
  "assembler_slug": "core",
  "relative_path": "p9/i586",
  "branch": "p9",
  "arch": "i586",
  },
  {
  "name": "Core Assembler p9 x96_64 Path",
  "assembler_slug": "core",
  "relative_path": "p9/x86_64",
  "branch": "p9",
  "arch": "x86_64",
  },
  {
  "name": "Core Assembler p8 i586 Path",
  "assembler_slug": "core",
  "relative_path": "p8/i586",
  "branch": "p8",
  "arch": "i586",
  },
]
===== 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.
== vridlo.source_path.slug ==
== vridlo.source_path.slug ==



Revision as of 15:05, 2 December 2019

vridlo.source_path.index

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

Path

/v1/source_paths

Methods

GET

Returns a list of source paths, 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.

Arguments
  • 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.

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

Example Response
[
 {
  "name": "Core Assembler p9 i586 Path",
  "assembler_slug": "core",
  "relative_path": "p9/i586",
  "branch": "p9",
  "arch": "i586",
 },
 {
  "name": "Core Assembler p9 x96_64 Path",
  "assembler_slug": "core",
  "relative_path": "p9/x86_64",
  "branch": "p9",
  "arch": "x86_64",
 },
 {
  "name": "Core Assembler p8 i586 Path",
  "assembler_slug": "core",
  "relative_path": "p8/i586",
  "branch": "p8",
  "arch": "i586",
 },
]
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.

vridlo.source_path.slug

This allows accessing to the specified source path record by <slug> URI-parameter. Added into API v1.0.

Path

/v1/source_paths/<slug>

Methods

POST

Creates the source path specified by <slug> URI-parameter using he set of properties passed as form data or get parameter array, and returns state of the created record as JSON.

Authentication

This method requires write authentication with write permission to source path model.

Arguments
  • slug (Mandatory)
Slug of the branch paths. Must be unique per system.
  • name (Mandatory)
Name of the branch paths. Must be unique among the branch paths.
  • assembler_slug (Mandatory)
Slug of the assembler. Must be valid among the assembler slugs.
  • repo (Mandatory)
Name of the repo. Must be valid among the the repos.
  • arch (Mandatory)
Name of the arch. Must be valid arch among the all arches.
  • relative_path (Mandatory)
File path part relative from the assembler's path base for exporting of the source or built RPMs.
Example Response

Good response with created record:

[
 {
  "slug": "ca",
  "name": "Core Assembler",
  "assembler_slug": "core",
  "repo": "p9",
  "arch": "i586",
  "relative_path": "p9/i586",
 }
]

Error response 423:

[
 {
  "error_code": 3
 }
]
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 (Slug is already presented)
Slug is already presented among the all slugs.
  • 422.6 (Name is not unique for the record)
Name is not unique for the source paths.
  • 422.7 (Repo is invalid)
Slug is already presented among the all slugs.
  • 422.8 (Arch is invalid)
Slug is already presented among the all slugs.
  • 422.9 (Relative path is invalid)
Slug is already presented among the all slugs.
  • 404 (Not Found)
The record with provided slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.

GET

Gets properties of the source path specified by <slug> URI-parameter, and returns then as JSON. Do not poll this method more than once an hour.

Authentication

This method requires NO authentication.

Arguments

This method requires NO arguments.

Example Response

Good response:

[
 {
  "slug": "ca",
  "name": "Core Assembler",
  "assembler_slug": "core",
  "repo": "p9",
  "arch": "i586",
  "relative_path": "p9/i586",
 }
]

Error response 423:

[
 {
  "error_code": 3
 }
]
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.

PUT/PATCH

Sets one or many properties of the source path specified by <slug> URI-parameter, and returns updated state as JSON.

Authentication

This method requires write authentication with write permission to source path model.

Arguments
  • slug (Mandatory)
Slug of the branch paths. Must be unique per system.
  • name (Mandatory)
Name of the branch paths. Must be unique among the branch paths.
  • assembler_slug (Mandatory)
Slug of the assembler. Must be valid among the assembler slugs.
  • repo (Mandatory)
Name of the repo. Must be valid among the the repos.
  • arch (Mandatory)
Name of the arch. Must be valid arch among the all arches.
  • relative_path (Mandatory)
File path part relative from the assembler's path base for exporting of the source or built RPMs.
Example Request

PUT:/v1/source_paths/ca?name=Core_Assembler

Example Response

Good response:

[
 {
  "slug": "ca",
  "name": "Core Assembler",
  "assembler_slug": "core",
  "repo": "p9",
  "arch": "i586",
  "relative_path": "p9/i586",
 }
]

Error response 423:

[
 {
  "error_code": 3
 }
]
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 (Slug is already presented)
Slug is already presented among the all slugs.
  • 422.6 (Name is not unique for the record)
Name is not unique for the source paths.
  • 422.7 (Repo is invalid)
Slug is already presented among the all slugs.
  • 422.8 (Arch is invalid)
Slug is already presented among the all slugs.
  • 422.9 (Relative path is invalid)
Slug is already presented among the all slugs.
  • 404 (Not Found)
The record with provided id/slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.

DELETE

Destroys the source path specified by <slug> URI-parameter, and returns state of the destroyed record as JSON.

Authentication

This method requires write authentication with write permission to source path model.

Arguments

This method requires NO arguments.

Example Response

Good response returning deleted record:

[
 {
  "slug": "ca",
  "name": "Core Assembler",
  "assembler_slug": "core",
  "repo": "p9",
  "arch": "i586",
  "relative_path": "p9/i586",
 }
]

Error response 423:

[
 {
  "error_code": 3
 }
]
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.