mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
GITBOOK-204: change request with no subject merged in GitBook
This commit is contained in:
parent
dfd52db80a
commit
1f1547960c
@ -1,4 +1,4 @@
|
|||||||
# Aquarius REST API
|
# Aquarius
|
||||||
|
|
||||||
The universal Aquarius Endpoint is [`https://v4.aquarius.oceanprotocol.com`](https://v4.aquarius.oceanprotocol.com).
|
The universal Aquarius Endpoint is [`https://v4.aquarius.oceanprotocol.com`](https://v4.aquarius.oceanprotocol.com).
|
||||||
|
|
||||||
@ -6,184 +6,233 @@ The universal Aquarius Endpoint is [`https://v4.aquarius.oceanprotocol.com`](htt
|
|||||||
|
|
||||||
### **Get** `/api/aquarius/assets/ddo/<did>`
|
### **Get** `/api/aquarius/assets/ddo/<did>`
|
||||||
|
|
||||||
* Description
|
#### Description
|
||||||
|
|
||||||
Get DDO of a particular asset.
|
Get DDO of a particular asset.
|
||||||
* Parameters
|
|
||||||
|
|
||||||
| name | description | type | in | required |
|
#### Parameters
|
||||||
| ----- | ---------------- | ------ | ---- | -------- |
|
|
||||||
| `did` | DID of the asset | string | path | true |
|
| name | description | type | in | required |
|
||||||
* Example
|
| ----- | ---------------- | ------ | ---- | -------- |
|
||||||
|
| `did` | DID of the asset | string | path | true |
|
||||||
|
|
||||||
|
#### Curl Example
|
||||||
|
|
||||||
|
```
|
||||||
|
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/ddo/did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Javascript Example
|
||||||
|
|
||||||
|
```runkit nodeVersion="18.x.x"
|
||||||
|
const axios = require('axios')
|
||||||
|
const did = 'did:op:ce3f161fb98c64a2ded37fd34e25f28343f2c88d0c8205242df9c621770d4b3b'
|
||||||
|
const response = await axios(`https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/ddo/${did}`)
|
||||||
|
console.log(response.status)
|
||||||
|
console.log(response.data.nftAddress)
|
||||||
|
console.log(response.data.metadata.name)
|
||||||
|
console.log(response.data.metadata.description)
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Responses
|
||||||
|
|
||||||
|
`200`
|
||||||
|
|
||||||
|
* content-type: json
|
||||||
|
* description: On successful operation returns DDO information.
|
||||||
|
|
||||||
|
`404`
|
||||||
|
|
||||||
|
* content-type: json
|
||||||
|
* description: This asset DID is not in ES.
|
||||||
|
* response body:
|
||||||
|
|
||||||
```bash
|
|
||||||
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/ddo/did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6'
|
|
||||||
```
|
```
|
||||||
* Responses
|
{
|
||||||
* 200
|
"error": "Asset DID <did> not found in Elasticsearch."
|
||||||
* content-type: json
|
}
|
||||||
* description: On successful operation returns DDO information.
|
```
|
||||||
* 404
|
|
||||||
* content-type: json
|
|
||||||
* description: This asset DID is not in ES.
|
|
||||||
* response body:
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"error": "Asset DID <did> not found in Elasticsearch."
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### **GET** `/api/aquarius/assets/metadata/<did>`
|
### **GET** `/api/aquarius/assets/metadata/<did>`
|
||||||
|
|
||||||
* Description
|
#### Description
|
||||||
|
|
||||||
Get metadata of a particular asset.
|
Get metadata of a particular asset.
|
||||||
* Parameters
|
|
||||||
|
|
||||||
| name | description | type | in | required |
|
#### Parameters
|
||||||
| ----- | ---------------- | ------ | ---- | -------- |
|
|
||||||
| `did` | DID of the asset | string | path | true |
|
| name | description | type | in | required |
|
||||||
* Example
|
| ----- | ---------------- | ------ | ---- | -------- |
|
||||||
|
| `did` | DID of the asset | string | path | true |
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/metadata/did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Responses
|
||||||
|
|
||||||
|
`200`
|
||||||
|
|
||||||
|
* content-type: json
|
||||||
|
* description: successful operation.
|
||||||
|
|
||||||
|
`404`
|
||||||
|
|
||||||
|
* content-type: json
|
||||||
|
* description: This asset DID is not in ES.
|
||||||
|
* response body:
|
||||||
|
|
||||||
```bash
|
|
||||||
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/metadata/did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6'
|
|
||||||
```
|
```
|
||||||
* Responses
|
{
|
||||||
* 200
|
"error": "Error encountered while retrieving metadata: NotFoundError(404, '{\"_index\":\"aquarius\",\"_type\":\"_doc\",\"_id\":\"<did>\",\"found\":false}')."
|
||||||
* content-type: json
|
}
|
||||||
* description: successful operation.
|
```
|
||||||
* 404
|
|
||||||
* content-type: json
|
|
||||||
* description: This asset DID is not in ES.
|
|
||||||
* response body:
|
|
||||||
|
|
||||||
```
|
|
||||||
{
|
|
||||||
"error": "Error encountered while retrieving metadata: NotFoundError(404, '{\"_index\":\"aquarius\",\"_type\":\"_doc\",\"_id\":\"<did>\",\"found\":false}')."
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### **POST** `/api/aquarius/assets/names`
|
### **POST** `/api/aquarius/assets/names`
|
||||||
|
|
||||||
* Description
|
#### Description
|
||||||
|
|
||||||
Get names of assets as specified in the payload.
|
Get names of assets as specified in the payload.
|
||||||
* Parameters
|
|
||||||
|
|
||||||
| name | description | type | in | required |
|
#### Parameters
|
||||||
| --------- | ------------------ | ---- | ---- | -------- |
|
|
||||||
| `didList` | list of asset DIDs | list | body | true |
|
| name | description | type | in | required |
|
||||||
* Example
|
| --------- | ------------------ | ---- | ---- | -------- |
|
||||||
|
| `didList` | list of asset DIDs | list | body | true |
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/names' \
|
||||||
|
--header 'Content-Type: application/json' \
|
||||||
|
--data-raw '{
|
||||||
|
"didList" : ["did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6"]
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Responses
|
||||||
|
|
||||||
|
`200`
|
||||||
|
|
||||||
|
* content-type: json
|
||||||
|
* description: successful operation.
|
||||||
|
* response body:
|
||||||
|
|
||||||
```bash
|
|
||||||
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/names' \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data-raw '{
|
|
||||||
"didList" : ["did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6"]
|
|
||||||
}'
|
|
||||||
```
|
```
|
||||||
* Responses
|
{"did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6": "Ocean CEX Aggregator: OHLC history for OCEAN/USDT "}
|
||||||
* 200
|
```
|
||||||
* content-type: json
|
|
||||||
* description: successful operation.
|
|
||||||
* response body:
|
|
||||||
|
|
||||||
```
|
`400`
|
||||||
{"did:op:cd086344c275bc7c560e91d472be069a24921e73a2c3798fb2b8caadf8d245d6": "Ocean CEX Aggregator: OHLC history for OCEAN/USDT "}
|
|
||||||
```
|
|
||||||
* 400
|
|
||||||
* content-type: json
|
|
||||||
* description: This asset DID is not in ES.
|
|
||||||
* response body:
|
|
||||||
|
|
||||||
```
|
* content-type: json
|
||||||
{
|
* description: This asset DID is not in ES.
|
||||||
"error": "The requested didList can not be empty."
|
* response body:
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
{
|
||||||
|
"error": "The requested didList can not be empty."
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### **POST** `/api/aquarius/assets/query`
|
### **POST** `/api/aquarius/assets/query`
|
||||||
|
|
||||||
* Description
|
#### **Description**
|
||||||
|
|
||||||
Run a native ES query. Body must be a valid json object.
|
Run a native ES query. Body must be a valid json object.
|
||||||
* Example
|
|
||||||
|
|
||||||
```bash
|
#### Example
|
||||||
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/query' \
|
|
||||||
--header 'Content-Type: application/json' \
|
```bash
|
||||||
--data-raw '{
|
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/query' \
|
||||||
"query": {
|
--header 'Content-Type: application/json' \
|
||||||
"match_all": {}
|
--data-raw '{
|
||||||
}
|
"query": {
|
||||||
}'
|
"match_all": {}
|
||||||
```
|
}
|
||||||
* Responses
|
}'
|
||||||
* 200
|
```
|
||||||
* content-type: json
|
|
||||||
* 500
|
#### Responses
|
||||||
* description: elasticsearch exception
|
|
||||||
|
`200`
|
||||||
|
|
||||||
|
* content-type: json
|
||||||
|
|
||||||
|
`500`
|
||||||
|
|
||||||
|
* description: elasticsearch exception
|
||||||
|
|
||||||
### **POST** `/api/aquarius/assets/ddo/validate`
|
### **POST** `/api/aquarius/assets/ddo/validate`
|
||||||
|
|
||||||
* Description
|
#### Description
|
||||||
|
|
||||||
Validate DDO content. Cosumes `application/octet-stream`
|
Validate DDO content. Cosumes `application/octet-stream`
|
||||||
* Example
|
|
||||||
|
|
||||||
```bash
|
#### Example
|
||||||
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/query/api/v1/aquarius/assets/ddo/validate' \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data-raw '<json_body>'
|
|
||||||
```
|
|
||||||
* Valid body
|
|
||||||
|
|
||||||
```
|
```bash
|
||||||
{
|
curl --location --request POST 'https://v4.aquarius.oceanprotocol.com/api/aquarius/assets/query/api/v1/aquarius/assets/ddo/validate' \
|
||||||
"@context": ["https://w3id.org/did/v1"],
|
--header 'Content-Type: application/json' \
|
||||||
"id": "did:op:56c3d0ac76c02cc5cec98993be2b23c8a681800c08f2ff77d40c895907517280",
|
--data-raw '<json_body>'
|
||||||
"version": "4.1.0",
|
```
|
||||||
"chainId": 1337,
|
|
||||||
"nftAddress": "0xabc",
|
#### Valid body
|
||||||
"metadata": {
|
|
||||||
"created": "2000-10-31T01:30:00.000-05:00Z",
|
```
|
||||||
"updated": "2000-10-31T01:30:00.000-05:00",
|
{
|
||||||
"name": "Ocean protocol white paper",
|
"@context": ["https://w3id.org/did/v1"],
|
||||||
"type": "dataset",
|
"id": "did:op:56c3d0ac76c02cc5cec98993be2b23c8a681800c08f2ff77d40c895907517280",
|
||||||
"description": "Ocean protocol white paper -- description",
|
"version": "4.1.0",
|
||||||
"author": "Ocean Protocol Foundation Ltd.",
|
"chainId": 1337,
|
||||||
"license": "CC-BY",
|
"nftAddress": "0xabc",
|
||||||
"contentLanguage": "en-US",
|
"metadata": {
|
||||||
"tags": ["white-papers"],
|
"created": "2000-10-31T01:30:00.000-05:00Z",
|
||||||
"additionalInformation": {"test-key": "test-value"},
|
"updated": "2000-10-31T01:30:00.000-05:00",
|
||||||
"links": [
|
"name": "Ocean protocol white paper",
|
||||||
"http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/",
|
"type": "dataset",
|
||||||
"http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/",
|
"description": "Ocean protocol white paper -- description",
|
||||||
"http://data.ceda.ac.uk/badc/ukcp09/"
|
"author": "Ocean Protocol Foundation Ltd.",
|
||||||
]
|
"license": "CC-BY",
|
||||||
},
|
"contentLanguage": "en-US",
|
||||||
"services": [
|
"tags": ["white-papers"],
|
||||||
{
|
"additionalInformation": {"test-key": "test-value"},
|
||||||
"id": "test",
|
"links": [
|
||||||
"type": "access",
|
"http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-daily/",
|
||||||
"datatokenAddress": "0xC7EC1970B09224B317c52d92f37F5e1E4fF6B687",
|
"http://data.ceda.ac.uk/badc/ukcp09/data/gridded-land-obs/gridded-land-obs-averages-25km/",
|
||||||
"name": "Download service",
|
"http://data.ceda.ac.uk/badc/ukcp09/"
|
||||||
"description": "Download service",
|
|
||||||
"serviceEndpoint": "http://172.15.0.4:8030/",
|
|
||||||
"timeout": 0,
|
|
||||||
"files": "encryptedFiles"
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
```
|
"services": [
|
||||||
* Responses:
|
{
|
||||||
* 200
|
"id": "test",
|
||||||
* description: successfully request.
|
"type": "access",
|
||||||
* 400
|
"datatokenAddress": "0xC7EC1970B09224B317c52d92f37F5e1E4fF6B687",
|
||||||
* description: Invalid DDO format
|
"name": "Download service",
|
||||||
* 500
|
"description": "Download service",
|
||||||
* description: Error
|
"serviceEndpoint": "http://172.15.0.4:8030/",
|
||||||
|
"timeout": 0,
|
||||||
|
"files": "encryptedFiles"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Responses:
|
||||||
|
|
||||||
|
`200`
|
||||||
|
|
||||||
|
Successfull request.
|
||||||
|
|
||||||
|
`400`
|
||||||
|
|
||||||
|
Invalid DDO format
|
||||||
|
|
||||||
|
`500`
|
||||||
|
|
||||||
|
Error
|
||||||
|
|
||||||
### **POST** `/api/aquarius/assets/triggerCaching`
|
### **POST** `/api/aquarius/assets/triggerCaching`
|
||||||
|
|
||||||
@ -308,17 +357,21 @@ The universal Aquarius Endpoint is [`https://v4.aquarius.oceanprotocol.com`](htt
|
|||||||
|
|
||||||
### **GET** /spec
|
### **GET** /spec
|
||||||
|
|
||||||
* Description
|
#### Description
|
||||||
|
|
||||||
Get swagger spec
|
Get swagger spec
|
||||||
* Example
|
|
||||||
|
|
||||||
```bash
|
#### Example
|
||||||
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/spec'
|
|
||||||
```
|
```bash
|
||||||
* Response
|
curl --location --request GET 'https://v4.aquarius.oceanprotocol.com/spec'
|
||||||
* 200
|
```
|
||||||
* Description: Successful request
|
|
||||||
|
#### Response
|
||||||
|
|
||||||
|
`200`
|
||||||
|
|
||||||
|
Successful request
|
||||||
|
|
||||||
### Postman documentation
|
### Postman documentation
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user