Vridlo/api/vridlo.arches

From ALT Linux Wiki

vridlo.arches

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

GET:/v1/arches.json

Returns a list of arches, 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

NOTE: Arguments can be provided as arguments along with headers fields.
  • per_page is natural optional
Number of items to return per page. If this argument is omitted, it defaults to 10. The maximum allowed value is 50.
  • page is natural optional
The page of results to return. If this argument is omitted, it defaults to 1.
  • slug is string optional
Slug of the RPM architecture. Examples: i586, aarch64. If it begins with tilda char it is treated as regexp.
  • names is string optional
Search over the architecture names array. If it begins with tilda char it is treated as regexp.
  • relative_path is string optional
File path part relative from the assembler's path base for exporting of the source or built RPMs. If it begins with tilda char it is treated as regexp.

Examples

Example Request Url
GET:/v1/arches.json?names=~Arch
Example Good Response
[
   {
      "slug": "x86_64",
      "relative_path": "export/path/to"
      "names": [
         {
            "kind": "title",
            "text": "x86_64 Arch",
            "icu_locale": "en_US",
         },
      },
      apps_count: 0
   },
   {
      "slug": "i587",
      "relative_path": "export/path/to/sec/"
      "names": [
         {
            "kind": "title",
            "text": "i587 Arch",
            "icu_locale": "en_US",
         },
      },
      apps_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/arches.json

Creates the arch 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. Added into API v1.0.

Authentication

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

Arguments

  • names is Name array mandatory
Name array for the architecture. It can include the only title kind texts.
  • slug is string mandatory write-once
Slug of the RPM architecture. Can contain only letters, digits and underscores. Is unique per system.
  • relative_path is string optional
File path part relative from the assembler's path base for exporting of the source or built RPMs.

Examples

Example Request Form
POST:/v1/arches.json
DATA:
{
   "slug": "i587",
   "export_path_base": "i587",
   "names": [
      {
         "kind": "title",
         "text": "i587 Arch",
         "icu_locale": "en_US",
      },
   },
}
Example Good Response

Good response with created record:

{
   "slug": "i587",
   "export_path_base": "i587",
   "names": [
      {
         "id": 1010,
         "kind": "title",
         "text": "i587 Arch",
         "icu_locale": "en_US",
      },
   },
   apps_count: 0
}


Example Bad Response

Error response 422:

{
  "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.
  • 404 (Not Found)
The record with provided slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.

GET:/v1/arches/<slug>.json

Gets properties of the arch specified by <slug> 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.

Arguments

This method requires NO arguments.

Examples

Example Request Url
GET:/v1/arches/i587.json
Example Good Response

Good response with the returned record:

{
   "slug": "i587",
   "export_path_base": "i587",
   "names": [
      {
         "id": 1010,
         "kind": "title",
         "text": "i587 Arch",
         "icu_locale": "en_US",
      },
   },
   apps_count: 0
}


Example Bad Response

Error response 422:

{
  "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/arches/<slug>.json

Sets one or many properties of the arch specified by <slug> URI-parameter, and returns updated state as JSON. Added into API v1.0.

Authentication

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

Arguments

NOTE: Blank fields will be skipped
  • names is Name array mandatory
Name array for the architecture. It can include the only title kind texts.
  • slug is string mandatory write-once
Slug of the RPM architecture. Can contain only letters, digits and underscores. Is unique per system.
  • relative_path is string optional
File path part relative from the assembler's path base for exporting of the source or built RPMs.

Examples

Example Request Form
PATCH:/v1/arches/ca.json
DATA:
{
   "names": [
      {
         "id": 1010,
         "kind": "title",
         "text": "i587 Arch",
         "icu_locale": "en_US",
      },
   },
}
Example Good Response
{
   "slug": "i587",
   "export_path_base": "i587",
   "names": [
      {
         "id": 1010,
         "kind": "title",
         "text": "i587 Arch",
         "icu_locale": "en_US",
      },
   },
   apps_count: 0
}
Example Bad Response

Error response 422:

{
  "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.
  • 404 (Not Found)
The record with provided id/slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.

DELETE:/v1/arches/<slug>.json

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

Authentication

This method requires write authentication with write permission token to arch model.

Arguments

This method requires NO arguments.

Examples

Example Request Url
DELETE:/v1/arches/i587.json
Example Good Response

Good response returning deleted record:

{
   "slug": "i587",
   "export_path_base": "i587",
   "names": [
      {
         "kind": "title",
         "text": "i587 Arch",
         "icu_locale": "en_US",
      },
   },
   apps_count: 0
}
Example Bad Response

Error response 422:

{
  "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.