From 34877ef96dced175981e19412f03c84c3cfdf320 Mon Sep 17 00:00:00 2001 From: Pedro Sanders Date: Thu, 4 Jul 2019 22:43:11 -0400 Subject: [PATCH] Updated docs --- docs/api/location/create.md | 41 ++++++++++++++++++++++ docs/api/location/delete.md | 38 ++++++++++++++++++++ docs/api/{location.md => location/list.md} | 0 docs/api/overview.md | 8 +++-- docs/configuration/general.md | 2 +- mkdocs.yml | 5 ++- 6 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 docs/api/location/create.md create mode 100644 docs/api/location/delete.md rename docs/api/{location.md => location/list.md} (100%) diff --git a/docs/api/location/create.md b/docs/api/location/create.md new file mode 100644 index 000000000..dca4480e8 --- /dev/null +++ b/docs/api/location/create.md @@ -0,0 +1,41 @@ +Adds an entry into the location table + +**URL** + +`/location/{addressOfRecord}` + +**Method** + +`POST` + +**Parameters** + +| Parameter Name | Type | Value | Description +| --- | :--------- | :--------- | :--------- | +| addressOfRecord | path | string | Address of record for the new entry| + +**Request body** + +Supply a json containing an address, port, expires, user values. + +**Response** + +This method adds an entry to the location table. Useful for end-to-end testing. + +**Sample Call** + +```json +POST /api/{apiversion}/location/sip:guest@guest +{ + "user": "guest", + "address": "192.168.1.149", + "port": 5080, + "expires": 3600 +} + +HTTP/1.1 200 OK +{ + "status": 200, + "message": "Added location entry." +} +``` diff --git a/docs/api/location/delete.md b/docs/api/location/delete.md new file mode 100644 index 000000000..b8bd8e977 --- /dev/null +++ b/docs/api/location/delete.md @@ -0,0 +1,38 @@ +Evicts an entry from the location table + +**URL** + +`/location/{addressOfRecord}` + +**Method** + +`DELETE` + +**Parameters** + +| Parameter Name | Type | Value | Description +| --- | :--------- | :--------- | :--------- | +| addressOfRecord | path | string | Address of record for the entry| + +**Request body** + +Do not supply a request body with this method. + +**Response** + +This method removes and entry for the give address of record + +**Sample Call** + +```json +DELETE /api/{apiversion}/location/sip:guest@guest +{ + +} + +HTTP/1.1 200 OK +{ + "status": 200, + "message": "Location entry evicted." +} +``` diff --git a/docs/api/location.md b/docs/api/location/list.md similarity index 100% rename from docs/api/location.md rename to docs/api/location/list.md diff --git a/docs/api/overview.md b/docs/api/overview.md index b2ff79173..0295e82cc 100644 --- a/docs/api/overview.md +++ b/docs/api/overview.md @@ -15,10 +15,14 @@ A JWT token is used to authenticate the server. To obtain the token, use the `/a To obtain the token ```bash -curl -k -u "admin:changeit" https://localhost:4567/api/v1beta1/credentials +curl -k -u "admin:changeit" https://localhost:4567/api/v1beta1/token # Resulted in -eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiJ9.O7hC-ta225epRQlJZO44WC-l2cWohKnJ8lkmlOQpw8Z_xYiwJ6-qDUhHeJEZH9DmwIwz_jD77sj1kQUkXHsbOg +{ + "status":200, + "message":"Successful request", + "result":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiJ9.TZZ4kp5xIdYzs5RRt6_qVxJcOiLdk1IEHFMBSZ7SRENx6kyVhwfAlm-oeM4L2XFIr4evlTCxKEIKc0fZKwPcjw" +} ``` To use the token diff --git a/docs/configuration/general.md b/docs/configuration/general.md index 165ec3599..84302b1d2 100644 --- a/docs/configuration/general.md +++ b/docs/configuration/general.md @@ -12,7 +12,7 @@ can be provided using the file `config/config.yml` located at the root of your R | spec.localnets | Local networks. Use in combination with spec.externAddr | No | | spec.recordRoute | Stay within the signaling path | No | | spec.useToAsAOR | Use the TO header instead of Request URI | No | -| spec.registrarIntf | Force to use received & rport for registration| No | +| spec.registrarIntf | `Internal` will cause the server to use the IP and port it sees(received & rport) from a device attempting to register. Default is `External` | No | | spec.addressInfo.[*] | Custom tag with the DID information | No | | spec.accessControlList.deny.[*] | Deny incoming traffic from network list | No | | spec.accessControlList.allow.[*] | Allow incoming traffic from network list | No | diff --git a/mkdocs.yml b/mkdocs.yml index 055477970..dd829ae14 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,7 +40,10 @@ nav: - Rest API: - Overview: api/overview.md - Credentials: api/credentials.md - - Location: api/location.md + - Location: + - create: api/location/create.md + - delete: api/location/delete.md + - list: api/location/list.md - Registry: api/registry.md - Agents: - create: api/agents/create.md