Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Fonoster Team committed Jun 2, 2019
1 parent d0beceb commit 56add90
Show file tree
Hide file tree
Showing 29 changed files with 1,086 additions and 231 deletions.
50 changes: 50 additions & 0 deletions docs/api/System/info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
This method returns information about the server.

**URL**

`/system/info`

**Method**

`GET`

**Parameters**

This method does not receive any parameters.

**Request body**

Do not supply a request body with this method.

**Response**

If successful this method returns relevant information about the server.

**Sample Call**

```json
GET /api/v1beta1/system/info
{

}

HTTP/1.1 200 OK
{
"status": "200",
"message": "Successful request",
"result" : {
"apiVersion": "v1beta1",
"kind": "Peer",
"metadata": {
"name": "Asterisk PBX",
"ref": "pr2c77f4"
},
"spec": {
"credentials": {
"username": "ast",
"secret": "1234"
}
}
}
}
```
Empty file added docs/api/System/status.md
Empty file.
34 changes: 21 additions & 13 deletions docs/api/agents/create.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Creates a new Agent resource. The Domain must exist before creating the Agent. Otherwise, this method responds with a `UNFULFILLED_DEPENDENCY_RESPONSE`.
Creates a new Agent resource. The Domain must exist before creating the Agent.
Otherwise, this method responds with a `UNFULFILLED_DEPENDENCY_RESPONSE`.

**URL**

Expand All @@ -14,7 +15,7 @@ This method does not receive any parameters.

**Request body**

A file containing an [Agent](/configuration/agents) resource in `json` or `yaml` format.
A file containing an [Agent](/configuration/agents) resource in `json` format.

**Response**

Expand All @@ -23,17 +24,24 @@ If successful this method creates an Agent resource.
**Sample Call**

```json
POST /api/{apiversion}/agents
- apiVersion: v1beta1
kind: Agent
metadata:
name: John Doe
spec:
credentials:
username: '1001'
secret: '1234'
domains: [sip.local]
POST /api/v1beta1/agents
{
"apiVersion": "v1beta1",
"kind": "Agent",
"metadata": {
"name": "John Doe"
},
"spec": {
"credentials": {
"username": "1001",
"secret": "1234"
},
"domains": [
"sip.local"
]
}
}

HTTP/1.1 201 Created
{"status": "201", "Successful request"}
{"status": "201", "message": "Created"}
```
2 changes: 1 addition & 1 deletion docs/api/agents/delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If successful this method removes an Agent resource.
**Sample Call**

```json
DELETE /api/{apiversion}/agents/{ref}
DELETE /api/v1beta1/agents/ag3f77f6
{

}
Expand Down
24 changes: 22 additions & 2 deletions docs/api/agents/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,31 @@ If successful this method returns an Agent resource.
**Sample Call**

```json
GET /api/{apiversion}/agents/{ref}
GET /api/v1beta1/agents/ag3f77f6
{

}

HTTP/1.1 200 OK
{"status": "200", "Successful request"}
{
"status": "200",
"message": "Successful request",
"result" : {
"apiVersion": "v1beta1",
"kind": "Agent",
"metadata": {
"name": "John Doe",
"ref": "ag3f77f6"
},
"spec": {
"credentials": {
"username": "1001",
"secret": "1234"
},
"domains": [
"sip.local"
]
}
}
}
```
26 changes: 24 additions & 2 deletions docs/api/agents/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This method returns a list of Agent resources.
| --- | :--------- | :--------- | :--------- |
| filter | query | string | Use filter to narrow the elements shown. |

Note: The filter parameter uses [JsonPath](https://github.com/json-path/JsonPath) format

**Request body**

Do not supply a request body with this method.
Expand All @@ -25,11 +27,31 @@ If successful this method returns a list of Agent resources.
**Sample Call**

```json
GET /api/{apiversion}/agents
GET /api/v1beta1/agents
{

}

HTTP/1.1 200 OK
{"status": "200", "Successful request"}
{
"status": "200",
"message": "Successful request",
"result" : [{
"apiVersion": "v1beta1",
"kind": "Agent",
"metadata": {
"name": "John Doe",
"ref": "ag3f77f6"
},
"spec": {
"credentials": {
"username": "1001",
"secret": "1234"
},
"domains": [
"sip.local"
]
}
}]
}
```
33 changes: 20 additions & 13 deletions docs/api/agents/update.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Updates am existing Agent resource.
Updates an existing Agent resource.

**URL**

Expand All @@ -14,7 +14,7 @@ This method does not receive any parameters.

**Request body**

A file containing an [Agent](/configuration/agents) resource in `json` or `yaml` format.
A file containing an [Agent](/configuration/agents) resource in `json` format.

**Response**

Expand All @@ -23,17 +23,24 @@ If successful this method updates an Agent resource.
**Sample Call**

```json
PUT /api/{apiversion}/agents/{ref}
- apiVersion: v1beta1
kind: Agent
metadata:
name: John Doe
ref: {ref}
spec:
credentials:
username: '1001'
secret: '1234'
domains: [sip.local]
PUT /api/v1beta1/agents/ag3f77f6
{
"apiVersion": "v1beta1",
"kind": "Agent",
"metadata": {
"name": "John Doe",
"ref": "ag3f77f6"
},
"spec": {
"credentials": {
"username": "1001",
"secret": "1234"
},
"domains": [
"sip.local"
]
}
}

HTTP/1.1 200 OK
{"status": "200", "Successful request"}
Expand Down
49 changes: 49 additions & 0 deletions docs/api/dids/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Creates a new DID resource. The Gateway must exist before creating the DID.
Otherwise, this method responds with a `UNFULFILLED_DEPENDENCY_RESPONSE`.

**URL**

`/dids`

**Method**

`POST`

**Parameters**

This method does not receive any parameters.

**Request body**

A file containing a [DID](/configuration/dids) resource in `json` format.

**Response**

If successful this method creates an DID resource.

**Sample Call**

```json
POST /api/v1beta1/dids
{
"apiVersion": "v1beta1",
"kind": "DID",
"metadata": {
"gwRef": "gweef506",
"geoInfo": {
"city": "City, State",
"country": "Country",
"countryISOCode": "US"
}
},
"spec": {
"location": {
"telUrl": "tel:0000000000",
"aorLink": "sip:[email protected]"
}
}
}

HTTP/1.1 201 Created
{"status": "201", "message": "Created"}
```
35 changes: 35 additions & 0 deletions docs/api/dids/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Removes a DID resource from a persistent database.

**URL**

`/dids/{ref}`

**Method**

`DELETE`

**Parameters**

| Parameter Name | Type | Value | Description
| --- | :--------- | :--------- | :--------- |
| ref | path | string | Resource reference|

**Request body**

Do not supply a request body with this method.

**Response**

If successful this method removes a DID resource.

**Sample Call**

```json
DELETE /api/v1beta1/dids/dd50baa4
{

}

HTTP/1.1 200 OK
{"status": "200", "Successful request"}
```
57 changes: 57 additions & 0 deletions docs/api/dids/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
This method returns an Agent resource.

**URL**

`/dids/{ref}`

**Method**

`GET`

**Parameters**

| Parameter Name | Type | Value | Description
| --- | :--------- | :--------- | :--------- |
| ref | path | string | Resource reference|

**Request body**

Do not supply a request body with this method.

**Response**

If successful this method returns a DID resource.

**Sample Call**

```json
GET /api/v1beta1/dids/dd50baa4
{

}

HTTP/1.1 200 OK
{
"status": "200",
"message": "Successful request",
"result" : {
"apiVersion": "v1beta1",
"kind": "DID",
"metadata": {
"ref": "dd50baa4",
"gwRef": "gweef506",
"geoInfo": {
"city": "City, State",
"country": "Country",
"countryISOCode": "US"
}
},
"spec": {
"location": {
"telUrl": "tel:0000000000",
"aorLink": "sip:[email protected]"
}
}
}
}
```
Loading

0 comments on commit 56add90

Please sign in to comment.