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

From ALT Linux Wiki
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== vridlo.source_path.slug ==
== vridlo.source_paths ==


This allows accessing to the specified source path record by <slug> URI-parameter. Added into API v1.0.
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. It implements operation on the [[Vridlo/types/SourcePath|SourcePath]] structure.


=== Path ===
=== GET:/v1/source_paths.json ===


/v1/source_paths/<slug>
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.


=== Methods ===
==== Authentication ====


==== POST ====
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'''''
Search by specified slug, if provided value begins with "/", it is treated as regexp.
*  '''name''' is ''string '''optional'''''
Search by specified name, if provided value begins with "/", it is treated as regexp.
*  '''assembler_slug''' is ''string '''optional'''''
Search by specified assembler slug, if provided value begins with "/", it is treated as regexp.
*  '''relative_path''' is ''string '''optional'''''
Search by specified relative path, if provided value begins with "/", it is treated as regexp.
*  '''branch''' is ''string '''optional'''''
Search by specified branch name, if provided value begins with "/", it is treated as regexp.
*  '''arch''' is ''string '''optional'''''
Search by specified arch, if provided value begins with "/", it is treated as regexp.
 
==== Examples ====
===== Example Request Url =====
 
GET:/v1/tags.json?name=/Core/
 
===== Example Good Response =====
 
[
    {
      "slug": "sp",
      "name": "Core Assembler p9 i586 Path",
      "assembler_slug": "core",
      "relative_path": "p9/i586",
      "repo_slug": "p9",
      "arch_slug": "i586",
    },
    {
      "slug": "sp2",
      "name": "Core Assembler p9 x96_64 Path",
      "assembler_slug": "core",
      "relative_path": "p9/x86_64",
      "repo_slug": "p9",
      "arch_slug": "x86_64",
    },
    {
      "slug": "sp3",
      "name": "Core Assembler p8 i586 Path",
      "assembler_slug": "core",
      "relative_path": "p8/i586",
      "repo_slug": "p8",
      "arch_slug": "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.
 
=== POST:/v1/source_paths.json ===


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


===== Authentication =====
==== Authentication ====


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


===== Arguments =====
==== Arguments ====


* slug (Mandatory)
* '''slug''' is ''string '''mandatory write-once'''''
  Slug of the branch paths. Must be unique per system.
  Slug of the source path. Can contain only letters and underscores. Must be unique per system.
* name (Mandatory)
* '''arch_slug''' is ''string '''mandatory write-once'''''
  Name of the branch paths. Must be unique among the branch paths.
  Slug of the arch. Must be valid [[Vridlo/types/Arch|arch]] among the all arches.
* assembler_slug (Mandatory)
* '''name''' is ''string '''mandatory'''''
  Slug of the assembler. Must be valid among the assembler slugs.
  Source path name. Must be unique among the branch paths.
* repo (Mandatory)
* '''repo_slug''' is ''string '''mandatory'''''
  Name of the repo. Must be valid among the the repos.
  Slug of the repo. Must be valid among the [[Vridlo/types/Repo|repos]].
* arch (Mandatory)
* '''assembler_slug''' is ''string '''optional'''''
  Name of the arch. Must be valid arch among the all arches.
  Assembler slug, which the source path belongs to. Can be blank, in case when the path is the standalone path. Must be valid among the [[Vridlo/types/Assembler|assembler]] slugs if presented.
* relative_path (Mandatory)
* '''relative_path''' is ''string '''optional'''''
  File path part relative from the assembler's path base for exporting of the source or built RPMs.
  File path part relative from the assembler's path base for exporting of the source or built RPMs.


===== Example Response =====
==== Examples ====
===== Example Request Url =====
 
POST:/v1/source_paths.json?name=Core Assembler Source Path&slug=sp&assembler_slug=ca&repo=p9&arch=i586&relative_path=p9/i586
 
===== Example Request Form =====
 
POST:/v1/source_paths.json
DATA:
{
  "slug": "sp",
  "name": "Core Assembler Source Path",
  "assembler_slug": "ca",
  "repo_slug": "p9",
  "arch_slug": "i586",
  "relative_path": "p9/i586",
}
 
===== Example Good Response =====


Good response with created record:
Good response with created record:


  [
  {
  {
   "slug": "sp",
   "slug": "ca",
   "name": "Core Assembler Source Path",
   "name": "Core Assembler",
   "assembler_slug": "ca",
   "assembler_slug": "core",
   "repo_slug": "p9",
   "repo": "p9",
   "arch_slug": "i586",
   "arch": "i586",
   "relative_path": "p9/i586",
   "relative_path": "p9/i586",
  }
}
]
 
===== Example Bad Response =====


Error response ''423'':
Error response ''423'':


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


===== Return Codes =====
===== Return Codes =====
Line 62: Line 155:
* '''422.3''' (''SSL is required'')
* '''422.3''' (''SSL is required'')
  SSL is required to access the Vridlo API.
  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'')
* '''404''' (''Not Found'')
Line 84: Line 162:
  The Internal Server Error has occurred.
  The Internal Server Error has occurred.


==== GET ====
=== GET:/v1/assemblers/<slug>.json ===


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


===== Authentication =====
==== Authentication ====


This method requires NO authentication.
This method requires NO authentication.


===== Arguments =====
==== Inline argument ====
 
*  '''slug''' is ''string '''mandatory'''''
Slug of the source path. Can contain only letters and underscores. Must be unique per system.
 
==== Arguments ====


This method requires NO arguments.
This method requires NO arguments.


===== Example Response =====
==== Examples ====
===== Example Request Url =====
 
GET:/v1/assemblers/sp
 
===== Example Good Response =====


Good response:
Good response with the returned record:


  [
  {
  {
   "slug": "sp",
   "slug": "ca",
   "name": "Core Assembler Source Path",
   "name": "Core Assembler",
   "assembler_slug": "ca",
   "assembler_slug": "core",
   "repo_slug": "p9",
   "repo": "p9",
   "arch_slug": "i586",
   "arch": "i586",
   "relative_path": "p9/i586",
   "relative_path": "p9/i586",
  }
}
]
 
===== Example Bad Response =====


Error response ''423'':
Error response ''422'':


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


===== Return Codes =====
==== Return Codes ====


* '''200''' (''OK'')
* '''200''' (''OK'')
Line 133: Line 220:
  The Internal Server Error has occurred.
  The Internal Server Error has occurred.


==== PUT/PATCH ====
=== PATCH:/v1/source_paths/<slug>.json ===


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


===== Authentication =====
==== Authentication ====


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


===== Arguments =====
==== Inline argument ====
 
*  '''slug''' is ''string '''mandatory'''''
Slug of the source path. Can contain only letters and underscores. Must be unique per system.


* slug (Mandatory)
==== Arguments ====
Slug of the branch paths. Must be unique per system.
 
* name (Mandatory)
* '''name''' is ''string '''optional'''''
  Name of the branch paths. Must be unique among the branch paths.
  Source path name. Must be unique among the branch paths.
* assembler_slug (Mandatory)
* '''repo_slug''' is ''string '''optional'''''
  Slug of the assembler. Must be valid among the assembler slugs.
  Slug of the repo. Must be valid among the [[Vridlo/types/Repo|repos]].
* repo (Mandatory)
* '''assembler_slug''' is ''string '''optional'''''
  Name of the repo. Must be valid among the the repos.
  Assembler slug, which the source path belongs to. Can be blank, in case when the path is the standalone path. Must be valid among the [[Vridlo/types/Assembler|assembler]] slugs if presented.
* arch (Mandatory)
* '''relative_path''' is ''string '''optional'''''
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.
  File path part relative from the assembler's path base for exporting of the source or built RPMs.


===== Example Request =====
==== Examples ====
===== Example Request Url =====


PUT:/v1/source_paths/ca?name=Core_Assembler
PATCH:/v1/source_paths/sp?name=Core_Assembler_New


===== Example Response =====
===== Example Request Form =====


Good response:
PATCH:/v1/source_paths/sp
DATA:
{
  "name": "Core_Assembler_New",
  }


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


Error response ''423'':
Error response ''422'':


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


===== Return Codes =====
==== Return Codes ====


* '''200''' (''OK'')
* '''200''' (''OK'')
Line 193: Line 276:
* '''422.3''' (''SSL is required'')
* '''422.3''' (''SSL is required'')
  SSL is required to access the Vridlo API.
  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'')
* '''404''' (''Not Found'')
Line 215: Line 283:
  The Internal Server Error has occurred.
  The Internal Server Error has occurred.


==== DELETE ====
=== DELETE:/v1/source_paths/<slug>.json ===


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


===== Authentication =====
==== Authentication ====


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


===== Arguments =====
==== Inline argument ====
 
*  '''slug''' is ''string '''mandatory'''''
Slug of the source path. Can contain only letters and underscores. Must be unique per system.
 
==== Arguments ====


This method requires NO arguments.
This method requires NO arguments.


===== Example Response =====
==== Examples ====
===== Example Request Url =====
 
DELETE:/v1/source_paths/sp.json
 
===== Example Good Response =====


Good response returning deleted record:
Good response returning deleted record:


  [
  {
  {
   "slug": "sp",
   "slug": "ca",
   "name": "Core Assembler Source Path",
   "name": "Core Assembler",
   "assembler_slug": "ca",
   "assembler_slug": "core",
   "repo_slug": "p9",
   "repo": "p9",
   "arch_slug": "i586",
   "arch": "i586",
   "relative_path": "p9/i586",
   "relative_path": "p9/i586",
  }
}
]
 
===== Example Bad Response =====


Error response ''423'':
Error response ''422'':


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


===== Return Codes =====
==== Return Codes ====


* '''200''' (''OK'')
* '''200''' (''OK'')

Latest revision as of 19:50, 4 December 2019

vridlo.source_paths

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. It implements operation on the SourcePath structure.

GET:/v1/source_paths.json

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

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
Search by specified slug, if provided value begins with "/", it is treated as regexp.
  • name is string optional
Search by specified name, if provided value begins with "/", it is treated as regexp.
  • assembler_slug is string optional
Search by specified assembler slug, if provided value begins with "/", it is treated as regexp.
  • relative_path is string optional
Search by specified relative path, if provided value begins with "/", it is treated as regexp.
  • branch is string optional
Search by specified branch name, if provided value begins with "/", it is treated as regexp.
  • arch is string optional
Search by specified arch, if provided value begins with "/", it is treated as regexp.

Examples

Example Request Url
GET:/v1/tags.json?name=/Core/
Example Good Response
[
   {
      "slug": "sp",
      "name": "Core Assembler p9 i586 Path",
      "assembler_slug": "core",
      "relative_path": "p9/i586",
      "repo_slug": "p9",
      "arch_slug": "i586",
   },
   {
      "slug": "sp2",
      "name": "Core Assembler p9 x96_64 Path",
      "assembler_slug": "core",
      "relative_path": "p9/x86_64",
      "repo_slug": "p9",
      "arch_slug": "x86_64",
   },
   {
      "slug": "sp3",
      "name": "Core Assembler p8 i586 Path",
      "assembler_slug": "core",
      "relative_path": "p8/i586",
      "repo_slug": "p8",
      "arch_slug": "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.

POST:/v1/source_paths.json

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

Authentication

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

Arguments

  • slug is string mandatory write-once
Slug of the source path. Can contain only letters and underscores. Must be unique per system.
  • arch_slug is string mandatory write-once
Slug of the arch. Must be valid arch among the all arches.
  • name is string mandatory
Source path name. Must be unique among the branch paths.
  • repo_slug is string mandatory
Slug of the repo. Must be valid among the repos.
  • assembler_slug is string optional
Assembler slug, which the source path belongs to. Can be blank, in case when the path is the standalone path. Must be valid among the assembler slugs if presented.
  • 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 Url
POST:/v1/source_paths.json?name=Core Assembler Source Path&slug=sp&assembler_slug=ca&repo=p9&arch=i586&relative_path=p9/i586
Example Request Form
POST:/v1/source_paths.json
DATA:
{
  "slug": "sp",
  "name": "Core Assembler Source Path",
  "assembler_slug": "ca",
  "repo_slug": "p9",
  "arch_slug": "i586",
  "relative_path": "p9/i586",
}
Example Good Response

Good response with created record:

{
  "slug": "sp",
  "name": "Core Assembler Source Path",
  "assembler_slug": "ca",
  "repo_slug": "p9",
  "arch_slug": "i586",
  "relative_path": "p9/i586",
}
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.
  • 404 (Not Found)
The record with provided slug is not found.
  • 500 (Internal Server Error)
The Internal Server Error has occurred.

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

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

Authentication

This method requires NO authentication.

Inline argument

  • slug is string mandatory
Slug of the source path. Can contain only letters and underscores. Must be unique per system.

Arguments

This method requires NO arguments.

Examples

Example Request Url
GET:/v1/assemblers/sp
Example Good Response

Good response with the returned record:

{
  "slug": "sp",
  "name": "Core Assembler Source Path",
  "assembler_slug": "ca",
  "repo_slug": "p9",
  "arch_slug": "i586",
  "relative_path": "p9/i586",
}
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/source_paths/<slug>.json

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.

Inline argument

  • slug is string mandatory
Slug of the source path. Can contain only letters and underscores. Must be unique per system.

Arguments

  • name is string optional
Source path name. Must be unique among the branch paths.
  • repo_slug is string optional
Slug of the repo. Must be valid among the repos.
  • assembler_slug is string optional
Assembler slug, which the source path belongs to. Can be blank, in case when the path is the standalone path. Must be valid among the assembler slugs if presented.
  • 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 Url
PATCH:/v1/source_paths/sp?name=Core_Assembler_New
Example Request Form
PATCH:/v1/source_paths/sp
DATA:
{
  "name": "Core_Assembler_New",
 }
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/source_paths/<slug>.json

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.

Inline argument

  • slug is string mandatory
Slug of the source path. Can contain only letters and underscores. Must be unique per system.

Arguments

This method requires NO arguments.

Examples

Example Request Url
DELETE:/v1/source_paths/sp.json
Example Good Response

Good response returning deleted record:

{
  "slug": "sp",
  "name": "Core Assembler Source Path",
  "assembler_slug": "ca",
  "repo_slug": "p9",
  "arch_slug": "i586",
  "relative_path": "p9/i586",
}
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.