POST /api/v3/gateway
Create a gateway

Creates a gateway with given parameters

Params

Param name Description
gateway
required

Object containing information about the gateway to be created


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X GET -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"gateway":{"name":"Vertical gateway"}}' https://api.datonis.io/api/v3/gateway

Response (returns details of the gateway created)
{
  "gateway": {
    "gateway_key": "4ea741566a",
    "gateway_type": null,
    "name": "Vertical gateway",
    "gateway_version": null,
    "tags": "",
    "adapters": [

    ]
  }
}

GET /api/v3/gateway
List all gateways

Returns a list of all gateways belonging to an account as per the specified criteria. This API is paginated and returns 20 gateways by default. A gateway is uniquely identified by a 'gateway_key'. This key should be used in all the other API referencing a particular gateway.

Params

Param name Description
page
optional

Page number of results to be fetched, Default 1


Value: Must be Integer.
per
optional

Number of gateways records to be returned in one page, Default 20


Value: Must be Integer.
order_by
optional

Field on which resultant gateways should be sorted


Value: Must be a String
order
optional

Order, asc or desc, in which results should be sorted


Value: Must be a String
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
search
optional

Keywords based on which gateways should be searched. Currently you can search gateways on - name or tag


Value: Must be a String
scope
optional

Matching condition if multiple keywords are specified for search. Valid values are “all” or “any”. Default is “all”


Value: Must be a String

Examples

Request - listing all gateways without any criteria
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" https://api.datonis.io/api/v3/gateway

Response (returns first 20 records)
{
  "gateway": [
    {
      "gateway_key": "a1aad6t93b",
      "gateway_type": null,
      "name": "gosling123",
      "gateway_version": null,
      "tags": "bavdhan,pune",
      "adapters": [

      ]
    },
    {
      "gateway_key": "e54986t366",
      "gateway_type": "kura",
      "name": "trial",
      "gateway_version": "4.5.160",
      "tags": "hji",
      "adapters": [
        {
          "type": null,
          "configuration": "{}",
          "enabled": true,
          "adapter_pid": "com.altizon.gateway.SimulatorAdapter"
        },
        {
          "type": null,
          "configuration": "{}",
          "enabled": false,
          "adapter_pid": "com.altizon.gateway.OPCUAAdapter"
        }
      ]
    }
  ],
  "total_count": 1,
  "page": 1
}

GET /api/v3/gateway/:gateway_key
Fetch information for a gateway

Returns details of the gateway requested

Params

Param name Description
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request - get details of the specified gateway (gateway_key specified as a part of the url)
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A"  https://api.datonis.io/api/v3/gateway/e54986t366

Response (returns details of the gateway requested)
{
  "gateway": {
    "gateway_key": "e54986t366",
    "gateway_type": "kura",
    "name": "trial",
    "gateway_version": "4.5.160",
    "tags": "hji",
    "adapters": [
      {
        "type": null,
        "configuration": "{}",
        "enabled": true,
        "adapter_pid": "com.altizon.gateway.SimulatorAdapter"
      },
      {
        "type": null,
        "configuration": "{}",
        "enabled": false,
        "adapter_pid": "com.altizon.gateway.OPCUAAdapter"
      }
    ]
  }
}

PUT /api/v3/gateway/:gateway_key
Updates a gateway

Updates a gateway with given parameters

Params

Param name Description
gateway
required

Object containing information about the gateway to be updated


Value: Must be a Hash
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request - containing parameters to be modified
  curl -X PUT -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"gateway":{"tags":"Pune"}}' https://api.datonis.io/api/v3/gateway/4ea741566a

Response (returns details of the gateway updated)
{
  "gateway": {
    "gateway_key": "4ea741566a",
    "gateway_type": null,
    "name": "Vertical gateway",
    "gateway_version": null,
    "tags": "Pune",
    "adapters": [

    ]
  }
}

DELETE /api/v3/gateway/:gateway_key
Delete a gateway

Deletes the specified gateway from the system. All associated data is also lost.

Params

Param name Description
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request
  curl -X DELETE -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A"  https://api.datonis.io/api/v3/gateway/4ea741566a

Response
{
}

GET /api/v3/gateway/:gateway_key/configuration
Fetch configuration

Fetch information about the configuration of a gateway

Params

Param name Description
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean

Examples

Request - get configuration details of the specified gateway (gateway_key specified as a part of the url)
  curl -X GET  -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" https://api.datonis.io/api/v3/gateway/4ea741566a/configuration

Response (returns gateway configuration in encoded form)
{
  "result": "data:text/html;charset=utf-8,%3Chtml+lang%3D%22en%22%3E%3Chead%3E%3Ctitle%3EEmbedded+Window%3C%2Ftitle%3E%3C%2Fhead%3E%3Cbody%3E%3Ch1%3E42%3C%2Fh1%3E%3C%2Fbody%3E%3C%2Fhtml%3E"
}

POST /api/v3/gateway/register
Register gateway

Register gateway initially with the gateway type and version

Params

Param name Description
pretty
optional

Return a pretty formatted response if true, Default is false


Value: Must be a Boolean
type
optional

Type of gateway e.g. Datonis Edge or other


Value: Must be a String
version
optional

Gateway version


Value: Must be a String
configuration
optional

Specify the gateway configuration as data URI


Value: Must be a String

Examples

Request - containing parameters to be registered
  curl -X POST -H "Content-Type:application/json" -H "X-Auth-Token:WtUFnj8pvSxVnH9e_xkq7A" -d '{"gateway":{"gateway_key":"4ea741566a","gateway_version":"4.5.160","gateway_type":"kura","config":"hello world"}}' https://api.datonis.io/api/v3/gateways/register

Response
{
}