Early draft of the Open Encoder API. This is in early development and subject to change without notice.
Authentication API resource.
Method | Endpoint | Description |
---|---|---|
POST | /api/register | Register a user. |
POST | /api/login | Login user. |
POST /api/register
Content-Type: application/json
{
"username": "foo@bar.com",
"password": "baz"
}
Content-Type: application/json
{
"user": "foo@bar.com",
"message": "User registered"
}
POST /api/login
Content-Type: application/json
{
"username": "foo@bar.com",
"password": "baz"
}
Content-Type: application/json
{
"token": "<jwt token>"
}
Jobs API resource.
Method | Endpoint | Description |
---|---|---|
POST | /api/jobs | Create encode job. |
GET | /api/jobs | Get jobs list. |
GET | /api/jobs/:job_id | Get job details. |
GET | /api/jobs/:job_id/status | Get job status. |
POST | /api/jobs/:job_id/cancel | Cancel job. |
POST | /api/jobs/:job_id/restart | Restart job. |
POST /api/job
Content-Type: application/json
{
"preset": "h264_baseline_360p_600",
"source": "s3:///src/tears-of-steel-2s.mp4",
"dest": "s3:///dst/tears-of-steel-2s/"
}
Content-Type: application/json
{
"message": "Job created",
"status": 200
}
GET /api/jobs
Content-Type: application/json
{
"count": 2,
"items": [
{
"id": 2,
"guid": "bkl9gbj5bidgus7kjoog",
"preset": "h264_baseline_360p_600",
"created_date": "2019-07-14T00:00:00Z"
},
{
"id": 1,
"guid": "bkl9gb35bidgus7kjoo0",
"preset": "h264_baseline_360p_600",
"created_date": "2019-07-14T00:00:00Z"
}
]
}
GET /api/jobs/:job_id
Content-Type: application/json
{
"id": 2,
"guid": "bkl9gbj5bidgus7kjoog",
"preset": "h264_baseline_360p_600",
"created_date": "2019-07-14t00:00:00z"
}
GET /api/jobs/:job_id/status
Content-Type: application/json
{
"status": 200,
"job_status": "encoding"
}
POST /api/jobs/:job_id/cancel
Content-Type: application/json
{
"status": 200,
}
POST /api/jobs/:job_id/restart
Content-Type: application/json
{
"status": 200,
}
Machines API resource.
Method | Endpoint | Description |
---|---|---|
POST | /api/machines | Create a machine. |
GET | /api/machines | Get machines list. |
DELETE | /api/machines/:id | Delete a machine by ID. |
DELETE | /api/machines | Delete all machines by tag. |
GET | /api/machines/regions | Get machine regions list. |
GET | /api/machines/sizes | Get machine sizes list. |
POST /api/machines
Content-Type: application/json
{
"provider": "digitalocean",
"region": "sfo1",
"size": "s-1vcpu-1gb",
"count": 1
}
Content-Type: application/json
{
"machine": [
{
"id": 154372950,
"provider": "digitalocean"
}
]
}
GET /api/machines
Content-Type: application/json
{
"machines": [
{
"id": 154485626,
"name": "openencoder-worker",
"status": "new",
"size_slug": "s-1vcpu-1gb",
"created_at": "2019-08-11T05:50:26Z",
"region": "San Francisco 1",
"tags": [
"openencoder"
],
"provider": "digitalocean"
}
]
}
DELETE /api/machines/:id
Content-Type: application/json
Content-Type: application/json
{
"machine": {
"id": 154472730,
"provider": "digitalocean"
}
}
This will delete all machines tagged with openencoder
.
DELETE /api/machine
Content-Type: application/json
Content-Type: application/json
{
"deleted": true
}
GET /api/machines/regions
Content-Type: application/json
{
"regions": [
{
"name": "New York 1",
"slug": "nyc1",
"sizes": [
"32gb",
"16gb"
],
"available": true
}
]
}
GET /api/machines/sizes
Content-Type: application/json
{
"sizes": [
{
"slug": "512mb",
"available": true,
"price_monthly": 5,
"price_hourly": 0.007439999841153622
},
{
"slug": "s-1vcpu-1gb",
"available": true,
"price_monthly": 5,
"price_hourly": 0.007439999841153622
}
]
}
Presets API resource.
Method | Endpoint | Description |
---|---|---|
POST | /api/presets | Create preset. |
GET | /api/presets | Get presets list. |
GET | /api/presets/:preset_id | Get preset details. |
PUT | /api/presets/:preset_id | Update preset. |
POST /api/presets
Content-Type: application/json
{
"name": "preset name",
"description": "preset description",
"data": "<json string of ffmpeg preset data>",
"active": true
}
Content-Type: application/json
{
"id": 1,
"name": "preset name",
"description": "preset description",
"data": "<json string of ffmpeg preset data>",
"active": true
}
GET /api/presets
Content-Type: application/json
{
"count": 2,
"items": [
{
"id": 4,
"name": "h264_main_1080p_6000",
"description": "h264_main_1080p_6000",
"data": "<json data>",
"active": true
},
{
"id": 3,
"name": "h264_main_720p_3000",
"description": "h264_main_720p_3000",
"data": "<json data>",
"active": true
},
]
}
GET /api/presets/:preset_id
Content-Type: application/json
{
"preset": {
"id": 1,
"name": "h264_baseline_360p_600",
"description": "h264_baseline_360p_600",
"data": "<json data>",
"output": "h264_baseline_360p_600.mp4",
"active": true
},
"status": 200
}
POST /api/preset/:preset_id
Content-Type: application/json
{
"name": "preset name",
"description": "preset description",
"data": "<json string of ffmpeg preset data>",
"active": true
}
Content-Type: application/json
{
"id": 1,
"name": "preset name",
"description": "preset description",
"data": "<json string of ffmpeg preset data>",
"active": true
}