Rosti API
Companies
Company in Rosti is something like a team. You have an account to access our system with a single set of email/password or token in case of the API. Each account has access to one or more companies. It means you can use different companies for your customers and give them and your teammates separate access to these companies.
You have access to multiple companies with a single access token. All API endpoints require company_id as a part of their URL. That's how you choose the company you want to work with.
When you register to our system your first company is created automatically and it has same name as your account. It's your default company.
Use companies list endpoint to gather list of companies you are registered in.
Authorization
API token can be generated only in web interface and it's implemented as the HTTP header called Authorization. The header looks like this:
Authorization: Token YOUR_TOKEN
Code deploying
Every application is just a description of the environment. But the environment itself is created by containers. Right now, each application has one container, but the API is ready to support more containers within a single application.
If you want to deploy a new code to your application, there are SSH connections, one for each container assigned to your application. You can connect to these SSH servers and upload anything you want there. You can use standard tools like rsync, tar or scp or you can use your own way to do deploys.
SSH access is full, but limited by local system user which is not root. You can run your scripts, use standard Linux tools, but it's not possible to use standard system package manager to install the new stuff. If you need a new stuff feel free to build it your self or use static linked version of tools you want.
Storage
Storage is something what holds your data. Right now it's used for databases and we support MariaDB and PostgreSQL. We generate name of the database and username to access the database, but password is set by you.
You can change the password anytime you want through this API or web interface. Passwords are managed by databases itself.
v1
apps > list
Returns list of applications. You can use SSH access to upload your code into the server. Keys can be updated via POST method.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required |
apps > create
All application endpoints use same serializer, but only a few fields have to be send to this endpoint to create a new application. They are:
* name
* image
* plan
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
name required | Název aplikace. Volte opatrně, protože je napevno spojen s naším systémem a později nejde změnit. |
image required | Runtime tag. Použijte runtime API endpoint pro vyhledání toho správného pro vaši aplikaci. |
domains | Seznam domén oddělených mezerou. Nechte prázdné pro přidělení výchozí domény. |
mode | Nastavení HTTP módu. Hodnota 'http' značí pouze HTTP, 'https+le' znamená HTTPS s certifikátem od LE. Certifikáty pro wildcard domény nejsou podporovány a takové domény budou dostupné jen přes HTTP. |
plan required | ID jednoho z našich balíčků. Použijte API pro list balíčků k nalezení toho pravého. |
app_port | Port na kterém vaše aplikace poslouchá. Může to být jakýkoli port mezi 1024 a 65536 kromě portu 8000. Toto neplatí pro PHP aplikace, které s Nginxem komunikují přes unix socket. |
ssh_keys | Seznam SSH klíčů, které mají přístup k této aplikaci. |
ssh_password | SSH heslo. Použijte pokud chcete heslo změnit. Ve výpisu je hodnota prázdná. |
apps > read
Returns a single application data. You need to know ID of the application.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required | |
id required |
apps > update
It's not necessary to sent everything if you want to change only a single value. Send just the fields for parameters you wish to change. Based on received fields it's possible your application will be restarted.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required | |
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
image | Runtime tag. Použijte runtime API endpoint pro vyhledání toho správného pro vaši aplikaci. |
domains | Seznam domén oddělených mezerou. Nechte prázdné pro přidělení výchozí domény. |
mode | Nastavení HTTP módu. Hodnota 'http' značí pouze HTTP, 'https+le' znamená HTTPS s certifikátem od LE. Certifikáty pro wildcard domény nejsou podporovány a takové domény budou dostupné jen přes HTTP. |
plan | ID jednoho z našich balíčků. Použijte API pro list balíčků k nalezení toho pravého. |
app_port | Port na kterém vaše aplikace poslouchá. Může to být jakýkoli port mezi 1024 a 65536 kromě portu 8000. Toto neplatí pro PHP aplikace, které s Nginxem komunikují přes unix socket. |
ssh_keys | Seznam SSH klíčů, které mají přístup k této aplikaci. |
ssh_password | SSH heslo. Použijte pokud chcete heslo změnit. Ve výpisu je hodnota prázdná. |
apps > delete
Simply destroys every related to the APP specified by id parameter which represents application ID.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required | |
id required |
apps-action > update
This endpoint can be used for some actions related to applications. Right now there are three actions supported:
- start
- stop
- restart
- rebuild
If you stop the application the system removes all containers related to your application, but data are preserved and NOT removed. You can call start action anytime from now and the containers will be created again and app will start working. Restart doesn't destroy anything it just restarts all related containers.
If you want trigger full set of events like when start and stop is called you can use rebuild. It destroys all containers while data are preserved and the system creates the containers again. This action is used by our system mainly, but maybe you will find some use for it.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required | |
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
action required | Akce, kterou chcete provést. Může to být stop, start, restart nebo rebuild. |
apps-status > read
Returns information about status of an application. It helps you to identify if there is a problem with the code running inside your application or with DNS records of its domains.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required | |
id required |
companies > list
Returns list of companies related to this token with their IDs. You can use these IDs to call other endpoints in this API.
plans > list
To create a new app you need to assign a plan and this endpoint gives you list of all available plans we have.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required |
runtimes > list
To create a new app you need to know the runtime id and this list all of our available runtimes.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required |
storages > list
Returns list of existing storages including information necessary to connect to the storage.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required |
storages > create
Creates a new storage with a given storage type (mariadb/pgsql). Use these field to create the storage:
- storage_type
- password
Other fields are generated automatically. When it's done it returns data required to connect to the storage.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
type required | Typ uložiště. Může být mariadb nebo pgsql. |
password required | Použijte toto pole pro nastavení nového hesla. |
note | Popis databáze |
storages > read
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required | |
id required |
storages > update
Sets a new password for the storage. Use password field for this endpoint.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required | |
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
password required | Použijte toto pole pro nastavení nového hesla. |
note | Popis databáze |
storages > delete
Simply destroys the storage identified by ID of the storage.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
company_id required | |
id required |