Skip to content

Latest commit

 

History

History
280 lines (201 loc) · 3.21 KB

API.md

File metadata and controls

280 lines (201 loc) · 3.21 KB

API

Authors: Jubin Jose, Nibin Peter

API definitions

1. Get Aquila Port node status:

[GET] /

request:

{}

response:

{
    {"nodeId":<UUID String>}
}

2. Database exists:

[HEAD] /{database name}

request:

{}

response:

{}

3. Create Database:

[PUT] /{database name}

request:

{}

response:

{
  "ok":<Status Boolean>
}

4. Get Database Information:

[GET] /{database name}

request:

{}

response:

{
  "db_name":<Database name String>
}

5. Bulk Insert Documents:

[POST] /{database name}/_bulk_docs

request:

[{
    "id": <Document ID String>,
    "deleted": <Delete status Boolean>,
    "timestamp": <UNIX Timestamp String>,
    "payload": <Payload data String>,
    "signature": <Payload signature String>
},
  ...
]

response:

[{
    "id": <Document ID String>,
    "deleted": <Delete status Boolean>,
    "timestamp": <UNIX Timestamp String>,
  	"version": <Version number String>,
    "payload": <Payload data String>,
    "signature": <Payload signature String>
},
  ...
]

6. Bulk Get Documents:

[GET] /{database name}/_all_docs

request:

{}

response:

[{
    "id": <Document ID String>,
    "deleted": <Delete status Boolean>,
    "timestamp": <UNIX Timestamp String>,
  	"version": <Version number String>,
    "payload": <Payload data String>,
    "signature": <Payload signature String>
},
  ...
]

7. Get Changes List:

[GET] /{database name}/_changes

request:

{}

response:

{
  "last_seq": <Last Sequence Integer>,
  "pending": <Pending results Integer>,
  "results": [
    {
      "changes": [
        {
          "rev": <Version number String>
        }
      ],
      "id": <Document ID String>,
      "seq": <Document sequence Integer>,
      "deleted": <Deleted status Boolean>
    },
    ...
  ]
}

8. Send Revision Differences:

[POST] /{database name}/_revs_diff

request:

{
    <Document ID String>: [
        <Version number String>
    ],
  	...
}

response:

{
  <Document ID String>: [
    <Version number String>
  ],
  ...
}

9. Commit Replicated Changes:

[POST] /{database name}/_ensure_full_commit

request:

{}

response:

{
  "ok":<Commit status Boolean>
}

10. Update Replication Checkpoint:

[PUT] /{database name}/_local

request:

{
    "id": <Replication ID String>,
    "ok": true,
    "rev": <Version number String>
}

response:

{
    "id": <Replication ID String>,
    "ok": true,
    "rev": <Version number String>
}

11. Enable Push Replication:

[POST] /{database name}/replicate

request:

{
    "target": <Target node ex:"http://localhost:5007/" String>
}

response:

{
    "target": <Target node ex:"http://localhost:5007/" String>
}

12. Disable Push Replication:

[DELETE] /{database name}/replicate

request:

{
    "target": <Target node ex:"http://localhost:5007/" String>
}

response:

{
    "target": <Target node ex:"http://localhost:5007/" String>
}