Routes package

Backend package for the collection of the API URLs routes definitions.

The API uses routes to determine which controller and action method to execute. Routes should use meaningful URL users can remember and use directly when interfacing the API.

All routes defined in this package are build based on flask blueprints and the extension flask_smorest. This allows to split the routes between multiple sections collecting the related methods per module.

The flask extension flask_smorest allows to produce a OpenAPI JSON specification which can be used by automation tools. For example swagger can use such specification to produce an user friendly GUI for the API.

Benchmarks routes

Benchmark URL routes. Collection of controller methods to create and operate existing benchmarks on the database.

approve(*args, **kwargs)

(Admins) Approves a benchmark to include it on default list methods

Use this method to approve an specific benchmark submitted by an user. It is a custom method, as side effect, it removes the submit report associated as it is no longer needed.

create(*args, **kwargs)

(Users) Uploads a new benchmark

Use this method to create a new benchmarks in the database so it can be accessed by the application users. The method returns the complete created benchmark (if succeeds).

Note: Benchmark use JSON Schemas to implement results validation.

delete(*args, **kwargs)

(Admins) Deletes an existing benchmark

Use this method to delete a specific benchmark from the database.

get(*args, **kwargs)

(Public) Retrieves benchmark details

Use this method to retrieve a specific benchmark from the database.

list(*args, **kwargs)

(Public) Filters and list benchmarks

Use this method to get a list of benchmarks filtered according to your requirements. The response returns a pagination object with the filtered benchmarks (if succeeds).

reject(*args, **kwargs)

(Admins) Rejects a benchmark to safe delete it.

Use this method instead of DELETE as it raises 422 in case the resource was already approved. Use this method to reject an specific benchmark submitted by an user. It is a custom method, as side effect, it removes the submit report associated as it is no longer needed.

search(*args, **kwargs)

(Public) Filters and list benchmarks

Use this method to get a list of benchmarks based on a general search of terms. For example, calling this method with terms=v1&terms=0 returns all benchmarks with ‘v1’ and ‘0’ on the ‘docker_image’, ‘docker_tag’ or ‘description’ fields. The response returns a pagination object with the filtered benchmarks (if succeeds).

update(*args, **kwargs)

(Admins) Implements JSON Put for benchmarks

Use this method to update a specific benchmark from the database.

Reports routes

Report URL routes. Collection of controller methods to create and operate existing reports on the database.

approve_claim(*args, **kwargs)

(Admin) Accepts an existing claim

Use this method to approve an specific resource submitted by an user. It is a custom method, as side effect, it removes the submit report associated as it is no longer needed.

get(*args, **kwargs)

(Public) Retrieves claim details

Use this method to retrieve a specific claim from the database.

list_claims(*args, **kwargs)

(Admins) Filters and lists claims

Use this method to get a list of claims filtered according to your requirements. The response returns a pagination object with the filtered claims (if succeeds).

list_submits(*args, **kwargs)

(Admins) Filters and list submits

Use this method to get a list of submits filtered according to your requirements. The response returns a pagination object with the filtered submits (if succeeds).

reject_claim(*args, **kwargs)

(Admin) Refuses an existing claim

Use this method to reject an specific resource submitted by an user. It is a custom method, as side effect, it removes the resource and the submit report associated as it is no longer needed.

Results routes

Results URL routes. Collection of controller methods to create and operate existing benchmark results on the database.

claim(*args, **kwargs)

(Users) Reports a result

Use this method to create a report for a specific result so the administrators are aware of issues. The reported result is hidden from generic responses until the issue is corrected and approved by the administrators.

create(*args, **kwargs)

(Users) Uploads a new result

Use this method to create a new result in the database so it can be accessed by the application users. The method returns the complete created result (if succeeds).

The uploaded result must pass the benchmark JSON Schema to be accepted, otherwise 422 UnprocessableEntity is produced. In addition, an execution_datetime must be provided in order to indicate the time when the benchmark was executed. It should be in ISO8601 format and include the timezone.

delete(*args, **kwargs)

(Admin) Deletes an existing result

Use this method to delete a specific result from the database.

get(*args, **kwargs)

(Public) Retrieves result details

Use this method to retrieve a specific result from the database.

get_uploader(*args, **kwargs)

(Admins) Retrieves result uploader

Use this method to retrieve the uploader of a specific result from the database.

list(*args, **kwargs)

(Public) Filters and list results

Use this method to get a list of results filtered according to your requirements. The response returns a pagination object with the filtered results (if succeeds).

This method allows to return results filtered by values inside the result. The filter is composed by 3 arguments separated by spaces (‘%20’ on URL-encoding): <path.separated.by.dots> <operator> <value>

There are five filter operators:

  • Equals (==): Return results where path value is exact to the query value. For example filters=cpu.count == 5

  • Greater than (>): Return results where path value strictly greater than the query value. For example filters=cpu.count > 5

  • Less than (<): Return results where path value strictly lower than the query value. For example filters=cpu.count < 5

  • Greater or equal (>=): Return results where path value is equal or greater than the query value. For example filters=cpu.count >= 5

  • Less or equal (<=): Return results where path value is equal or lower than the query value. For example filters=cpu.count <= 5

Note that in the provided examples the filter is not URL-encoded as most libraries do it automatically, however there might be exception. In such cases, use the url encoding guide at: https://datatracker.ietf.org/doc/html/rfc3986#section-2.1

list_claims(*args, **kwargs)

(Owner or Admins) Returns the result claims.

Use this method to retrieve all the result claims.

search(*args, **kwargs)

(Public) Filters and list results

Use this method to get a list of results based on a general search of terms. For example, calling this method with terms=v1&terms=0 returns all results with ‘v1’ and ‘0’ on the ‘docker_image’, ‘docker_tag’, ‘site_name’, ‘flavor_name’ fields or ‘tags’. The response returns a pagination object with the filtered results (if succeeds).

update_tags(*args, **kwargs)

(Owner or Admin) Updates an existing result tags

Use this method to update tags on a specific result from the database.

Sites routes

Site URL routes. Collection of controller methods to create and operate existing sites on the database.

approve(*args, **kwargs)

(Admins) Approves a site to include it on default list methods

Use this method to approve an specific site submitted by an user. It is a custom method, as side effect, it removes the submit report associated as it is no longer needed.

create(*args, **kwargs)

(Users) Uploads a new site

Use this method to create a new site in the database so it can be accessed by the application users. The method returns the complete created site (if succeeds).

create_flavor(*args, **kwargs)

(Users) Uploads a new flavor

Use this method to create a new flavors in the database so it can be accessed by the application users. The method returns the complete created flavor (if succeeds).

delete(*args, **kwargs)

(Admins) Deletes an existing site

Use this method to delete a specific site from the database.

get(*args, **kwargs)

(Public) Retrieves site details

Use this method to retrieve a specific site from the database.

list(*args, **kwargs)

(Public) Filters and list sites

Use this method to get a list of sites filtered according to your requirements. The response returns a pagination object with the filtered sites (if succeeds).

list_flavors(*args, **kwargs)

(Public) Filters and list flavors

Use this method to get a list of flavors filtered according to your requirements. The response returns a pagination object with the filtered flavors (if succeeds).

reject(*args, **kwargs)

(Admins) Rejects a site to safe delete it.

Use this method instead of DELETE as it raises 422 in case the resource was already approved.

Use this method to reject an specific site submitted by an user. It is a custom method, as side effect, it removes the submit report associated as it is no longer needed.

search(*args, **kwargs)

(Public) Filters and list sites

Use this method to get a list of sites based on a general search of terms. For example, calling this method with terms=K&terms=T returns all sites with ‘K’ and ‘T’ on the ‘name’, ‘address’, or ‘description’ fields. The response returns a pagination object with the filtered sites (if succeeds).

search_flavors(*args, **kwargs)

(Public) Filters and list flavors

Use this method to get a list of flavors based on a general search of terms. For example, calling this method with terms=K&terms=T returns all flavors with ‘K’ and ‘T’ on the ‘name’, or ‘description’ fields. The response returns a pagination object with the filtered flavors (if succeeds).

update(*args, **kwargs)

(Admins) Updates an existing site

Use this method to update a specific site from the database.

Flavor routes

Flavor URL routes. Collection of controller methods to operate existing flavors on the database.

approve(*args, **kwargs)

(Admins) Approves a flavor to include it on default list methods

Use this method to approve an specific flavor submitted by an user. It is a custom method, as side effect, it removes the submit report associated as it is no longer needed.

delete(*args, **kwargs)

(Admins) Deletes an existing flavor

Use this method to delete a specific flavor from the database.

get(*args, **kwargs)

(Public) Retrieves flavor details

Use this method to retrieve a specific flavor from the database.

reject(*args, **kwargs)

(Admins) Rejects a flavor to safe delete it.

Use this method instead of DELETE as it raises 422 in case the resource was already approved.

Use this method to reject an specific flavor submitted by an user. It is a custom method, as side effect, it removes the submit report associated as it is no longer needed.

site(*args, **kwargs)

(Public) Retrieves flavor site details

Use this method to retrieve the site information from a specific flavor in the database.

update(*args, **kwargs)

(Admins) Updates an existing flavor

Use this method to update a specific flavor from the database.

Tags routes

Tag URL routes. Collection of controller methods to create and operate existing user tags on the database.

create(*args, **kwargs)

(Users) Uploads a new tag

Use this method to create a new tags in the database so it can be accessed by the application users. The method returns the complete created tag (if succeeds).

delete(*args, **kwargs)

(Admins) Deletes an existing tag

Use this method to delete a specific tag from the database.

get(*args, **kwargs)

(Public) Retrieves tag details

Use this method to retrieve a specific tag from the database.

list(*args, **kwargs)

(Public) Filters and list tags

Use this method to get a list of tags filtered according to your requirements. The response returns a pagination object with the filtered tags (if succeeds).

search(*args, **kwargs)

(Public) Filters and list tags

Use this method to get a list of tags based on a general search of terms. For example, calling this method with terms=v1&terms=0 returns all tags with ‘v1’ and ‘0’ on the ‘name’ or ‘description’ fields. The response returns a pagination object with the filtered tags (if succeeds).

update(*args, **kwargs)

(Admins) Updates an existing tag

Use this method to update a specific tag from the database.

Users routes

Users URL routes. Collection of controller methods to create and operate existing users on the database.

claims(*args, **kwargs)

(Users) Returns your uploaded pending claims

Use this method to retrieve all the claims uploaded by your user.

get(*args, **kwargs)

(Users) Retrieves the logged in user info

Use this method to retrieve your user data stored in the database.

list(*args, **kwargs)

(Admins) Filters and list users

Use this method to get a list of users filtered according to your requirements. The response returns a pagination object with the filtered users (if succeeds).

register(*args, **kwargs)

(OIDC Token) Registers the logged in user

Use this method to register yourself into the application. By using this method, you recognize that you have read and understood our terms, conditions and privacy policy at: https://performance.services.fedcloud.eu/privacy_policy

The method will return your stored information.

remove(*args, **kwargs)

(Admins) Removes one or multiple users

Use this method to delete the users filtered according to your requirements. To prevent unintentionally delete all users, the method requires of query arguments, otherwise UnprocessableEntity exception is raised.

results(*args, **kwargs)

(Users) Returns your uploaded results

Use this method to retrieve all the results uploaded by your user. You can use the query parameter to retrieve also those with pending claims.

search(*args, **kwargs)

(Admins) Filters and list users

Use this method to get a list of users based on a general search of terms. For example, calling this method with terms=@hotmail&terms=de returns all users with ‘hotmail’ and ‘de’ on the ‘email’. The response returns a pagination object with the filtered users (if succeeds).

try_admin()

(Admins) Returns 204 if you are admin

Use this method to check that you have the administration rights. If so, the access returns 204, otherwise 401 or 403 are expected. —

Raises
  • Unauthorized – The server could not verify your identity

  • Forbidden – You don’t have the administrator rights

update(*args, **kwargs)

(Users) Updates the logged in user info

Use this method to update your user data in the database. The method returns by default 204, use a GET method to retrieve the new status of your data.