Connect#
Configure a relations and roles between unryo service.
You need to provide authentication parameters for all queries. To learn more, see API Introduction.
Get all roles and relations#
Code samples
curl -X GET {server}/api/v1/nodes \
-H 'Accept: application/json' \
-H 'Unryo-Token: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
-H 'Authorization: Basic {access-token}'
GET /api/v1/nodes
A node represent the role and the relations for a given service.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Unryo-Token | header | string(uuid) | true | Token generated by the endpoint token |
Example responses
200 Response
{
"value": [
{
"node": {
"id": "Alerts_Portal",
"namespace": "1.0",
"service": "1.0",
"roles": [
{
"label": null,
"relation": null,
"role": null,
"protocol": null,
"support": null,
"parameters": null
}
]
}
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | List relations and roles | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » value | [object] | false | none | none |
| »» node | object | false | none | none |
| »»» id | string | false | none | none |
| »»» namespace | string | false | none | none |
| »»» service | string | false | none | none |
| »»» roles | [object] | false | none | none |
| »»»» label | string | true | none | none |
| »»»» relation | string | true | none | none |
| »»»» role | string | true | none | none |
| »»»» protocol | string | true | none | none |
| »»»» support | [string] | true | none | none |
| »»»» parameters | object | false | none | Dynamic { [key]: [value] }. You can created at maximum 32 pairs of {[key]: [value]} |
| »»»»» additionalProperties | string | false | none | none |
| »»»»» key | string | false | none | none |
Enumerated Values#
| Property | Value |
|---|---|
| role | producer |
| role | receiver |
| role | supplier |
| role | consumer |
| role | service |
Create roles and relations.#
Code samples
curl -X POST {server}/api/v1/ping \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Unryo-Token: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
-H 'Authorization: Basic {access-token}'
POST /api/v1/ping
By default, the ping endpoint is trigger every 5 minutes. It will update the roles and relations between services.
Body parameter
{
"node": {
"id": "Alerts_Portal",
"namespace": "1.0",
"service": "1.0",
"roles": [
{
"label": "1.0",
"relation": "1.0",
"role": "[",
"protocol": "1.0",
"support": [
null
],
"parameters": {}
}
]
},
"metadata": {
"key": "string",
"property1": "string",
"property2": "string"
},
"health": {
"issues": [
{
"category": "string",
"description": "string",
"severity": 1,
"weight": 100
}
]
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Unryo-Token | header | string(uuid) | true | Token generated by the endpoint token |
| body | body | any | false | none |
Example responses
200 Response
{
"nodes": {
"label": [
{
"node": {
"id": "Alerts_Portal",
"namespace": "1.0",
"service": "1.0",
"roles": [
null
]
}
}
]
},
"expiration": 300000
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successfully created a role and relation | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » nodes | object | false | none | The label will be replaced by the rule.label attribute in the request body |
| »» label | [object] | false | none | none |
| »»» node | object | false | none | none |
| »»»» id | string | false | none | none |
| »»»» namespace | string | false | none | none |
| »»»» service | string | false | none | none |
| »»»» roles | [object] | false | none | none |
| »»»»» label | string | true | none | none |
| »»»»» relation | string | true | none | none |
| »»»»» role | string | true | none | none |
| »»»»» protocol | string | true | none | none |
| »»»»» support | [string] | true | none | none |
| »»»»» parameters | object | false | none | Dynamic { [key]: [value] }. You can created at maximum 32 pairs of {[key]: [value]} |
| »»»»»» additionalProperties | string | false | none | none |
| »»»»»» key | string | false | none | none |
| » expiration | integer | false | none | none |
Enumerated Values#
| Property | Value |
|---|---|
| role | producer |
| role | receiver |
| role | supplier |
| role | consumer |
| role | service |
Get all namespaces#
Code samples
curl -X GET {server}/api/v1/namespaces \
-H 'Accept: application/json' \
-H 'Unryo-Token: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
-H 'Authorization: Bearer {access-token}'
GET /api/v1/namespaces
Get all namespaces present in the given token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Unryo-Token | header | string(uuid) | true | Token generated by the endpoint token |
Example responses
200 Response
{
"value": [
{
"id": "dev"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successfully list namespace | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » value | [object] | false | none | none |
| »» id | string | false | none | none |
Get namespace#
Code samples
curl -X GET {server}/api/v1/namespaces/{namespace} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET /api/v1/namespaces/{namespace}
Get a namespace using the specified namespace name
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| namespace | path | string | true | none |
Example responses
200 Response
{
"value": {
"id": "dev"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Received a namespace | Inline |
| 404 | Not Found | Namespace Not found | None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » value | object | false | none | none |
| »» id | string | false | none | none |
Create a namespace#
Code samples
curl -X PUT {server}/api/v1/namespaces/{namespace} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT /api/v1/namespaces/{namespace}
Create a namespace inside the specified unryo token
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| namespace | path | string | true | none |
Example responses
201 Response
{
"value": {
"id": "dev"
}
}
409 Response
"The namespace already exists."
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successfully created a namespace | Inline |
| 409 | Conflict | Create an other namespace with the same name | string |
Response Schema
Status Code 201
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » value | object | false | none | none |
| »» id | string | false | none | none |
Delete a namespace#
Code samples
curl -X DELETE {server}/api/v1/namespaces/{namespace} \
-H 'Authorization: Bearer {access-token}'
DELETE /api/v1/namespaces/{namespace}
Delete a namespace given by the specified namespace
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| namespace | path | string | true | none |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Successfully deleted a namespace | None |
Get all token#
Code samples
curl -X GET {server}/api/v1/namespaces/{namespace}/tokens \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET /api/v1/namespaces/{namespace}/tokens
Get all token specified by the namespace
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| namespace | path | string | true | none |
Example responses
200 Response
{
"value": [
{
"id": "3Ynsr8D6plYTG5eZZFOoGI",
"token": "string",
"type": "node",
"secret": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successfully retrived a list of token | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » value | [object] | false | none | none |
| »» id | string | true | none | none |
| »» token | string | true | none | none |
| »» type | string | true | none | none |
| »» secret | string | false | none | none |
Enumerated Values#
| Property | Value |
|---|---|
| type | node |
| type | secret |
Create a token#
Code samples
curl -X POST {server}/api/v1/namespaces/{namespace}/tokens \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST /api/v1/namespaces/{namespace}/tokens
Create a token specified by the namespace
Body parameter
{
"type": "node",
"expiration": 0
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| namespace | path | string | true | none |
| body | body | object | false | none |
| » type | body | string | false | none |
| » expiration | body | integer¦null | false | none |
Enumerated Values#
| Parameter | Value |
|---|---|
| » type | node |
| » type | secret |
Example responses
201 Response
{
"value": {
"id": "3Ynsr8D6plYTG5eZZFOoGI",
"token": "string",
"type": "node",
"secret": "string"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | Successfully created a token | Inline |
Response Schema
Status Code 201
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » value | object | false | none | none |
| »» id | string | true | none | none |
| »» token | string | true | none | none |
| »» type | string | true | none | none |
| »» secret | string | false | none | none |
Enumerated Values#
| Property | Value |
|---|---|
| type | node |
| type | secret |
Update a token#
Code samples
curl -X PATCH {server}/api/v1/namespaces/{namespace}/tokens/{token} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH /api/v1/namespaces/{namespace}/tokens/{token}
Update a token specified by the namespace
Body parameter
{
"value": {
"type": "node",
"expiration": 0
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| namespace | path | string | true | none |
| token | path | string | true | Token generated inside a namespace |
| body | body | object | false | none |
| » value | body | object | false | none |
| »» type | body | string | false | none |
| »» expiration | body | integer¦null | false | none |
Enumerated Values#
| Parameter | Value |
|---|---|
| »» type | node |
| »» type | secret |
Example responses
200 Response
{
"value": {
"id": "3Ynsr8D6plYTG5eZZFOoGI",
"token": "string",
"type": "node",
"secret": "string"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Successfully Updated a token | Inline |
| 404 | Not Found | The token is not found | None |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » value | object | false | none | none |
| »» id | string | true | none | none |
| »» token | string | true | none | none |
| »» type | string | true | none | none |
| »» secret | string | false | none | none |
Enumerated Values#
| Property | Value |
|---|---|
| type | node |
| type | secret |
Delete a token#
Code samples
curl -X DELETE {server}/api/v1/namespaces/{namespace}/tokens/{token} \
-H 'Authorization: Bearer {access-token}'
DELETE /api/v1/namespaces/{namespace}/tokens/{token}
Delete a token specified by the namespace
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| namespace | path | string | true | none |
| token | path | string | true | Token generated inside a namespace |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 204 | No Content | Deleted Token | None |