Vridlo/api/vridlo.assemblers

From ALT Linux Wiki
< Vridlo/api
Revision as of 12:56, 22 August 2019 by Majioa (talk | contribs)

vridlo.assembler.slug

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

Path

/v1/assemblers/<slug>

Methods

POST

Creates the assembler 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 assembler model.

Arguments
  • slug (Mandatory)
Slug of the assembler. Must be unique per system.
  • name (Mandatory)
Name of the assembler. Must be unique among the assemblers.
  • host (Optional)
Host URI of the assembler. If presented it must be unique among the assemblers.
  • export_path_base (Optional)
File path base for exporting of the source or built RPMs.
Example Response

Good response with created record:

[
 {
  "slug": "ca",
  "name": "Core Assembler"
  "host": "assembler.altlinux.org"
  "source_path_count": 0
  "export_path_base": "/export/path/to"
 }
]

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

GET

Gets properties of the assembler 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"
  "host": "assembler.altlinux.org"
  "source_path_count": 3
  "export_path_base": "/export/path/to"
 }
]

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.
  • 423.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 assembler specified by <slug> URI-parameter, and returns updated state as JSON.

Authentication

This method requires write authentication with write permission to assembler model.

Arguments
  • slug (Mandatory)
Slug of the assembler. Must be unique per system.
  • name (Optional)
Name of the assembler. If presented it must be unique among the assemblers.
  • host (Optional)
Host URI of the assembler. If presented it must be unique among the assemblers.
  • export_path_base (Optional)
File path base for exporting of the source or built RPMs.
Example Request

/v1/assemblers/ca?name=Core_Assembler

Example Response

Good response:

[
 {
  "slug": "ca",
  "name": "Core Assembler"
  "host": "assembler.altlinux.org"
  "source_path_count": 3
  "export_path_base": "/export/path/to"
 }
]

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.
  • 423.3 (SSL is required)
SSL is required to access the Vridlo API.
  • 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 assembler specified by <slug> URI-parameter, and returns state of the destroyed record as JSON.

Authentication

This method requires write authentication with write permission to assembler model.

Arguments

This method requires NO arguments.

Example Response

Good response returning deleted record:

[
 {
  "slug": "ca",
  "name": "Core Assembler"
  "host": "assembler.altlinux.org"
  "source_path_count": 3
  "export_path_base": "/export/path/to"
 }
]

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