Debian Cloud Image Finder API

General notes

This app aims to make Debian official cloud images more easily accessible to users. Users will be able to search for images based on their attributes, follow instructions to run the images on providers and also follow a RSS feed which will notify about new images releases.

https://www.getpostman.com/collections/8346a24dfed7b06f9521

API detail

Auth

Login

For the login we use Basic Auth, so for this step to work you should access the URL on your browser and type your credentials.

Success

If everything goes well a token should appear within a JSON response. This token needs to be used to perform write and delete actions on DB and have a 30 min expiration.

Error

If you typed a wrong username or password an error message saying “Could not verify” should appear.

curl -X GET "http://image-finder.debian.net/api/login"
GET /api/login HTTP/1.1
Host: image-finder.debian.net

Image

Add Image

Parameter Type
name String
arch String
release String
img_type String
vendor String
version String
job_url String
package String
provider_id Integer
created_at Date(yyyy-MM-dd)
curl -X POST -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" -d '{
	"name":"",
	"arch":"",
	"release":"",
	"img_type":"",
	"vendor":"",
	"version":"",
	"job_url":"",
	"package":"",
	"provider_id":0,
	"created_at":""
}' "http://image-finder.debian.net/api/image"
POST /api/image HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

{
	"name":"",
	"arch":"",
	"release":"",
	"img_type":"",
	"vendor":"",
	"version":"",
	"job_url":"",
	"package":"",
	"provider_id":0,
	"created_at":""
}

Update Image

Parameter Type
name String
arch String
release String
img_type String
vendor String
version String
job_url String
package String
created_at Date(yyyy-MM-dd)
curl -X PUT -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" -d '{
	"name":"",
	"arch":"",
	"release":"",
	"img_type":"",
	"vendor":"",
	"version":"",
	"job_url":"",
	"package":"",
	"created_at":""
}' "http://image-finder.debian.net/api/image/{IMAGE_ID}"
PUT /api/image/%7BIMAGE_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

{
	"name":"",
	"arch":"",
	"release":"",
	"img_type":"",
	"vendor":"",
	"version":"",
	"job_url":"",
	"package":"",
	"created_at":""
}

Get All Images

curl -X GET -H "Content-Type: application/json" "http://image-finder.debian.net/api/image"
GET /api/image HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json

Get Image by ID

curl -X GET -H "Content-Type: application/json" "http://image-finder.debian.net/api/image/{IMAGE_ID}"
GET /api/image/%7BIMAGE_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json

Delete Image

curl -X DELETE -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" "http://image-finder.debian.net/api/image/{IMAGE_ID}"
DELETE /api/image/%7BIMAGE_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

Provider

Add Provider

curl -X POST -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" -d '{
	"name":"",
	"description":"",
	"markdown_file": ""
}' "http://image-finder.debian.net/api/provider"
POST /api/provider HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

{
	"name":"",
	"description":"",
	"markdown_file": ""
}

Update Provider

curl -X PUT -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" -d '{
	"name":"",
	"description":"",
	"markdown_file": ""
}' "http://image-finder.debian.net/api/provider/{PROVIDER_ID}"
PUT /api/provider/%7BPROVIDER_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

{
	"name":"",
	"description":"",
	"markdown_file": ""
}

Get All Providers

curl -X GET -H "Content-Type: application/json" "http://image-finder.debian.net/api/provider"
GET /api/provider HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json

Get Provider by ID

curl -X GET -H "Content-Type: application/json" "http://image-finder.debian.net/api/provider/{PROVIDER_ID}"
GET /api/provider/%7BPROVIDER_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json

Delete Provider

curl -X DELETE -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" "http://image-finder.debian.net/api/provider/{PROVIDED_ID}"
DELETE /api/provider/%7BPROVIDED_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

User

Get All Users

curl -X GET -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" "http://image-finder.debian.net/api/user"
GET /api/user HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

Get User by ID

curl -X GET -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" "http://image-finder.debian.net/api/user/{USER_PUBLIC_ID}"
GET /api/user/%7BUSER_PUBLIC_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

Add User

curl -X POST -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" -d '{
	"name":"",
	"password":""
}' "http://image-finder.debian.net/api/user"
POST /api/user HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

{
	"name":"",
	"password":""
}

Promote User

curl -X PUT -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" "http://image-finder.debian.net/api/user/promote/{USER_PUBLIC_ID}"
PUT /api/user/promote/%7BUSER_PUBLIC_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

Delete User

curl -X DELETE -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" "http://image-finder.debian.net/api/user/{USER_PUBLIC_ID}"
DELETE /api/user/%7BUSER_PUBLIC_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

Unpromote User

curl -X PUT -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" "http://image-finder.debian.net/api/user/unpromote/{USER_PUBLIC_ID}"
PUT /api/user/unpromote/%7BUSER_PUBLIC_ID%7D HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

Change Password User

curl -X POST -H "Content-Type: application/json" -H "x-access-token: {YOUR_TOKEN}" -d '{
	"old_password":"",
	"new_password":"",
	"repeat_password": ""
}' "http://image-finder.debian.net/api/user/change_password"
POST /api/user/change_password HTTP/1.1
Host: image-finder.debian.net
Content-Type: application/json
x-access-token: {YOUR_TOKEN}

{
	"old_password":"",
	"new_password":"",
	"repeat_password": ""
}