Updated API Functions (markdown)
parent
a301780700
commit
1232332097
|
@ -8,74 +8,6 @@
|
|||
* API fucntions that accept data do so via json objects in the request body.
|
||||
* API functions do not return a Success or error state, this information is passed by the HTTP Status Code.
|
||||
|
||||
# Syntax of this document
|
||||
[(Implementation) Status] function(parameter, [optional parameter]) -> return values
|
||||
|
||||
# API Functions
|
||||
## Domains
|
||||
### Get list of domains
|
||||
`GET /api/domains?query=foo&sort=id-asc,name-desc,type-asc,records-asc`
|
||||
|
||||
**Response**
|
||||
```json
|
||||
{
|
||||
"pages": {
|
||||
"current": 21,
|
||||
"total": 42
|
||||
},
|
||||
"results": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "example.com",
|
||||
"type": "MASTER",
|
||||
"records": 21
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### Create new domain
|
||||
`POST /api/domains`
|
||||
|
||||
**Body**
|
||||
```json
|
||||
{
|
||||
"name": "example.com",
|
||||
"type": "MASTER"
|
||||
}
|
||||
```
|
||||
|
||||
**Response**
|
||||
```json
|
||||
{
|
||||
"id": 21
|
||||
"name": "example.com",
|
||||
"type": "MASTER"
|
||||
}
|
||||
```
|
||||
|
||||
### Delete domain
|
||||
`DELETE /api/domains/{id}`
|
||||
|
||||
### Get single domain
|
||||
`GET /api/domains/{id}`
|
||||
|
||||
**Response**
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"name": "example.com",
|
||||
"type": "MASTER",
|
||||
"records": 21
|
||||
}
|
||||
```
|
||||
|
||||
## Records
|
||||
### Create
|
||||
* [TODO] create(name, type, content, ttl, [priority])
|
||||
### Read
|
||||
* [TODO] get(id) -> type, content, ttl, [priority])
|
||||
### Update
|
||||
* [TODO] set(id, [content, ttl, priority])
|
||||
### Delete
|
||||
* [TODO] delete(id)
|
||||
* [Domains][[API Domains]]
|
Loading…
Reference in a new issue