Endpoint Register REST version v1
{schema}://{host}/api/{version}
- schema: required(one of http, https - default: http)
- host: required(string - default: localhost)
- version: required(v1)
Endpoints
Operations on endpoints, metadata management.
Registers a new endpoint within a specified application version.
Returns information about endpoints that match query parameters.
post /endpoints
Registers a new endpoint within a specified application version.
- application:endpoint:create
- endpoint:update
EPR supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties- appVersion: required(object)
- name: required(string)
Name of the application version.
- name: required(string)
- metadata: (object)
Endpoint metadata.
- endpointToken: (string - pattern: ^[^+#/.]+$)
Endpoint token. Will be auto-generated if not present.
Must be application-scope unique. Must not contain plus signs (+
), number signs (#
), forward slashes (/
), or periods (.
). - endpointId: (string - pattern: ^[a-zA-Z0-9._~-]+$)
Endpoint ID. Will be auto-generated if not present.
Must be globally unique. Must contain only URL unreserved characters. - relations: (array of epr-api-types.EndpointRegistrationRelation)
Endpoint relation with other endpoints. Only one of the directions - either
to
orfrom
, must be specified in each relation entry. For example, registering an endpoint that represents a room, you can specify two entries with the relation typecontains
- inbound from the endpoint representing a building (from
), and outbound to the endpoint representing a sensor in that room (to
).Items: EndpointRegistrationRelation
- type: required(contains)
Relation type.
- from: (string)
Endpoint ID having the outbound direction of relation type coming to the registering endpoint.
- to: (string)
Endpoint ID having the inbound direction of relation type coming from the registering endpoint.
- type: required(contains)
Example:
{
"appVersion": {
"name": "bqa46oeg14m0thoh7g0l-v1"
},
"metadata": {
"level": 3,
"room": 234
},
"endpointToken": "a57fe4e77de4",
"endpointId": "67b27f9b-c4d1-41dc-b21f-2917b74c467a",
"relations": [
{
"type": "contains",
"to": "f359de38-6763-11ed-9022-0242ac120002"
},
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05"
}
]
}
HTTP status code 201
Endpoint successfully registered within the application version.
Headers
- Location: required(string)
URI in format
{schema}://{host}/epr/api/v1/endpoints/{endpointId}
Example:
https://cloud.kaaiot.com/epr/api/v1/endpoints/79c717d9-eedd-4f71-b9f8-86caf7e309e4
Body
Media type: application/json
Type: object
Properties- token: required(string)
Endpoint token.
- status: required(Inactive)
Status of newly provisioned token is always
Inactive
.
Token status will be automatically changed toActive
after first successful token validation request. - relations: (object)
Represents those relations that were successfully created, and those that failed bo be created for some reason. Is omitted in case all relations were successfully created, or no relations to create were specified in the request.
- successful: required(array of epr-api-types.EndpointRelation)
Successfully handled relations.
Items: EndpointRelation
- type: required(contains)
Relation type.
- from: required(string)
Endpoint ID with the outbound direction of the relation type coming to the endpoint referenced by the
to
key. - to: required(string)
Endpoint ID with the inbound direction of the relation type coming from the endpoint referenced by the
from
key.
- type: required(contains)
- failed: required(array of epr-api-types.EndpointRelationWithReason)
Unsuccessfully handled relations with reason description.
Items: EndpointRelationWithReason
- type: required(contains)
Relation type.
- from: required(string)
Endpoint ID with the outbound direction of the relation type coming to the endpoint referenced by the
to
key. - to: required(string)
Endpoint ID with the inbound direction of the relation type coming from the endpoint referenced by the
from
key. - reason: required(string)
Reason of the relation creation failure.
- type: required(contains)
- successful: required(array of epr-api-types.EndpointRelation)
Example:
{
"token": "02226466-e744-48ac-8f0c-a57fe4e77de4",
"status": "Inactive",
"relations": {
"successful": [
{
"type": "contains",
"from": "67b27f9b-c4d1-41dc-b21f-2917b74c467a",
"to": "f359de38-6763-11ed-9022-0242ac120002"
}
],
"failed": [
{
"type": "contains",
"from": "518ab0c0-e505-4062-9f1f-408da7b3ea05",
"to": "67b27f9b-c4d1-41dc-b21f-2917b74c467a",
"message": "Only one inbound relation with relation type [CONTAINS] is allowed"
}
]
}
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
HTTP status code 404
Relation endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /endpoints
Returns information about endpoints that match query parameters.
- endpoint:read
EPR supports OAuth 2.0 for authenticating all API requests.
Headers
- If-None-Match: (string)
Makes the request conditional.
The server will send the requested endpoint list with200
status only if currentETag
value doesn't match the specified one.
Otherwise,304 Not Modified
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
Query Parameters
- endpointId: (string)
Endpoint identifier, can be one or multiple.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
- applicationName: (string)
Filters endpoints by application name, can be one or multiple.
Example:
my-application
- applicationVersionName: (string)
Filters endpoints by application version name.
Example:
my-application-version
- tenantId: (string)
ID of the tenant endpoints belong to.
Example:
5b39397d-1be2-49a1-ad8b-f641a97e4ce3
- offset: (integer)
Start index that the server should return data from.
Example:
0
- limit: (integer - default: 100)
Maximum number of items to return. To get all items limit must be 0.
Example:
1
- metadataFilter: (string)
Filter endpoints by a multiple metadata key-value pairs.
NOTE Unsafe ASCII characters in the URL must be encoded according to Uniform Resource Locators RFC.Example:
Only endpoints with metadata keys
areaId
equal torouter01
andtype
equal toLinux
are returned:{"areaID": "router01", "type": "Linux"}
- multiFilter: (string)
Filter endpoints by a metadata.
NOTE Unsafe ASCII characters in the URL must be encoded according to Uniform Resource Locators RFC.Example:
Example 1: only endpoints with metadata key
OS
equal toLinux
ORWindows
are returned.
Example 2: only endpoints with metadata keyOS
equal toLinux
ANDendpointId
NOT equal to33b29787-d738-41e3-8252-5b9ddd51c65c
are returned:Example 1: {"or": [{"key": "OS", "operator": "IN", "values": ["Linux","Windows"]}]} Example 2: {"and": [{"key": "OS", "operator": "IN", "values": ["Linux"]}, {"key": "endpointId", "operator": "NOT_IN", "values": ["33b29787-d738-41e3-8252-5b9ddd51c65c"]}]} Example 1: {"and": [{"key": "OS", "operator": "IN_REGEX", "values": ["indow"]}]} Example 1: {"and": [{"key": "OS", "operator": "NOT_IN_REGEX", "values": ["indow"]}]}
- regex: (string)
Regex to match endpoints by. Fields that participate in the match: ID, metadata keys and values, application version name.
Example:
linux*
- filterId: (string)
Filter endpoints by matching filter ID(s). If multiple
filterId
specified, the resultset will contain only endpoints that match all filters. Only querying by the filters withactive
status is allowed. - include: (one of metadata, filters)
- `metadata` – include `metadata` fields and `metadataUpdatedDate` fields in response.
- `filters` – include `matching_filters` fields in response.
By default, no metadata and filters are returned.
HTTP status code 200
Endpoints are successfully retrieved.
Headers
- ETag: required(string)
Represents the current endpoint list state.
The value can be used inIf-Match
andIf-None-Match
headers.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
Body
Media type: application/json
Type: object
Properties- totalElements: required(integer)
Total number of elements available for retrieval. Current response may return only a part of all available elements.
- content: required(array of epr-api-types.Endpoint)
Items: Endpoint
- endpointId: required(string)
Unique identifier of endpoint.
- createdDate: required(datetime)
Endpoint registration data in ISO 8601 format (UTC timezone).
- appName: required(string)
Application name that endpoint belongs to.
- appVersion: required(object)
Information about endpoint registration wthin specific application version.
- name: required(string)
Name of the application version.
- registeredDate: required(datetime)
Date when endpoint registration data was created within specific application version.
- name: required(string)
- metadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- metadataUpdatedDate: (datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the endpoint metadata was last updated.
- filters: required(array of string)
List of filters that matches to the endpoint.
- endpointId: required(string)
Example:
{
"totalElements": 1,
"content": [
{
"endpointId": "5a67aa97-1f5c-41eb-a066-8e004157062b",
"createdDate": "2017-04-20T11:19:57.848Z",
"appName": "bqa46oeg14m0thoh7g0l",
"appVersion": {
"name": "example_app_v1",
"registeredDate": "2017-04-20T11:19:57.848Z"
},
"metadata": {
"OS": {
"type": "Linux",
"version": "4.10.6"
},
"tag": {
"id": "1"
},
"anyJsonType": [
11
]
},
"metadataUpdatedDate" : "2017-04-20T12:07:19.112Z",
"filters": [
"9e569809-e316-422f-851e-8d916ea0e89a"
]
}
]
}
HTTP status code 304
Resource(s) not modified.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Searches endpoints.
post /endpoints/search
Searches endpoints.
- endpoint:read
EPR supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties- and: required(array of endpoint-types.KeyValueFilter)
And.
Items: KeyValueFilter
- key: required(string)
Key. Supported keys:
endpointId
,appVersionName
,appName
, or any endpoint metadata key. - values: required(array of string)
Values that the key must be tested against.
- operator: (one of IN, NOT_IN, IN_REGEX, NOT_IN_REGEX - default: IN)
IN - matches if the key is equal to one of the value.
NOT_IN - matches if the key is NOT equal to all the values.
IN_REGEX - matches if the key matches one of the regex value.
NOT_IN_REGEX - matches if the key does NOT match all the regex values.
- key: required(string)
- or: required(array of endpoint-types.KeyValueFilter)
Or.
Items: KeyValueFilter
- key: required(string)
Key. Supported keys:
endpointId
,appVersionName
,appName
, or any endpoint metadata key. - values: required(array of string)
Values that the key must be tested against.
- operator: (one of IN, NOT_IN, IN_REGEX, NOT_IN_REGEX - default: IN)
IN - matches if the key is equal to one of the value.
NOT_IN - matches if the key is NOT equal to all the values.
IN_REGEX - matches if the key matches one of the regex value.
NOT_IN_REGEX - matches if the key does NOT match all the regex values.
- key: required(string)
Example:
{
"and": [
{
"key": "OS",
"operator": "IN",
"values": [
"Linux"
]
},
{
"key": "endpointId",
"operator": "NOT_IN",
"values": [
"33b29787-d738-41e3-8252-5b9ddd51c65c"
]
}
]
}
HTTP status code 200
Body
Media type: application/json
Type: object
Properties- totalElements: required(integer)
Total number of elements available for retrieval. Current response may return only a part of all available elements.
- content: required(array of epr-api-types.Endpoint)
Items: Endpoint
- endpointId: required(string)
Unique identifier of endpoint.
- createdDate: required(datetime)
Endpoint registration data in ISO 8601 format (UTC timezone).
- appName: required(string)
Application name that endpoint belongs to.
- appVersion: required(object)
Information about endpoint registration wthin specific application version.
- name: required(string)
Name of the application version.
- registeredDate: required(datetime)
Date when endpoint registration data was created within specific application version.
- name: required(string)
- metadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- metadataUpdatedDate: (datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the endpoint metadata was last updated.
- filters: required(array of string)
List of filters that matches to the endpoint.
- endpointId: required(string)
Example:
{
"totalElements": 1,
"content": [
{
"endpointId": "5a67aa97-1f5c-41eb-a066-8e004157062b",
"createdDate": "2017-04-20T11:19:57.848Z",
"appName": "bqa46oeg14m0thoh7g0l",
"appVersion": {
"name": "example_app_v1",
"registeredDate": "2017-04-20T11:19:57.848Z"
},
"metadata": {
"OS": {
"type": "Linux",
"version": "4.10.6"
},
"tag": {
"id": "1"
},
"anyJsonType": [
11
]
},
"metadataUpdatedDate" : "2017-04-20T12:07:19.112Z",
"filters": [
"9e569809-e316-422f-851e-8d916ea0e89a"
]
}
]
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Deletes endpoints in batch.
post /endpoints/delete
Deletes endpoints in batch.
- endpoint:delete
EPR supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties- multiFilter: required(object)
Multi-filter to delete endpoints by.
- and: required(array of endpoint-types.KeyValueFilter)
And.
Items: KeyValueFilter
- key: required(string)
Key. Supported keys:
endpointId
,appVersionName
,appName
, or any endpoint metadata key. - values: required(array of string)
Values that the key must be tested against.
- operator: (one of IN, NOT_IN, IN_REGEX, NOT_IN_REGEX - default: IN)
IN - matches if the key is equal to one of the value.
NOT_IN - matches if the key is NOT equal to all the values.
IN_REGEX - matches if the key matches one of the regex value.
NOT_IN_REGEX - matches if the key does NOT match all the regex values.
- key: required(string)
- or: required(array of endpoint-types.KeyValueFilter)
Or.
Items: KeyValueFilter
- key: required(string)
Key. Supported keys:
endpointId
,appVersionName
,appName
, or any endpoint metadata key. - values: required(array of string)
Values that the key must be tested against.
- operator: (one of IN, NOT_IN, IN_REGEX, NOT_IN_REGEX - default: IN)
IN - matches if the key is equal to one of the value.
NOT_IN - matches if the key is NOT equal to all the values.
IN_REGEX - matches if the key matches one of the regex value.
NOT_IN_REGEX - matches if the key does NOT match all the regex values.
- key: required(string)
- and: required(array of endpoint-types.KeyValueFilter)
Example:
{
"multiFilter": {
"and": [
{
"key": "OS",
"operator": "IN",
"values": [
"Linux"
]
},
{
"key": "endpointId",
"operator": "NOT_IN",
"values": [
"33b29787-d738-41e3-8252-5b9ddd51c65c"
]
}
]
}
}
HTTP status code 204
Endpoints are successfully deleted.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Create a task to register a batch of endpoints within a specified application version.
post /endpoints/batch
Create a task to register a batch of endpoints within a specified application version.
- application:endpoint:create
EPR supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: object
Properties- appVersion: required(object)
- name: required(string)
Name of the application version.
- name: required(string)
- endpoints: required(array of epr-api-types.EndpointRegistrationItem)
Items: EndpointRegistrationItem
- endpointToken: required(string - pattern: ^[^+#/.]+$)
Endpoint token.
Must be application-scope unique. Must not contain plus signs (+
), number signs (#
), forward slashes (/
), or periods (.
). - metadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- endpointToken: required(string - pattern: ^[^+#/.]+$)
Example:
{
"appVersion": {
"name":"example_app_v1"
},
"endpoints": [
{
"endpointToken": "02226466-e744-48ac-8f0c-a57fe4e77de4",
"metadata": {
"level": 3,
"room": 234
}
},
{
"endpointToken": "02226466-e744-48ac-8f0c-a57fe4e35db2",
"metadata": {
"level": 2,
"room": 125
}
},
{
"endpointToken": "02226466-e744-48ac-8f0c-a57fe4f48d5f"
}
]
}
HTTP status code 202
Batch endpoint registration task is accepted.
Body
Media type: application/json
Type: object
Properties- taskId: required(string)
Batch endpoints registration task ID.
Example:
{
"taskId":"79c717d9-eedd-4f71-b9f8-86caf69809e4"
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns batch endpoints registration task status.
get /endpoints/batch/status
Returns batch endpoints registration task status.
- application:endpoint:create
EPR supports OAuth 2.0 for authenticating all API requests.
Query Parameters
- appName: required(string)
Application name.
Example:
smart-kettle
- taskId: required(string)
Batch endpoint registration task ID.
Example:
79c717d9-eedd-4f71-b9f8-86caf69809e4
HTTP status code 200
Batch endpoint registration task's status is successfully retrieved.
Body
Media type: application/json
Type: object
Properties- createdCount: required(integer)
Count of endpoints with successful registration.
- failedCount: required(integer)
Count of endpoints with failed registration.
- created: required(array of epr-api-types.CreatedBatchEndpointRegistrationItem)
Array of endpoints with successful registration.
Items: CreatedBatchEndpointRegistrationItem
- endpointId: (string)
Endpoint ID.
- endpointToken: required(string)
Endpoint token.
- endpointId: (string)
- failed: required(array of epr-api-types.FailedBatchEndpointRegistrationItem)
Array of endpoints with failed registration.
Items: FailedBatchEndpointRegistrationItem
- endpointToken: required(string)
Endpoint token.
- statusReason: (string)
Cause of failing endpoint registration.
- endpointToken: required(string)
Example:
{
"createdCount": 2,
"failedCount": 1,
"created": [
{
"endpointId": "56726466-e454-23ac-340c-f34fefda7de4",
"endpointToken": "02226466-e744-48ac-8f0c-a57fe4e77de4"
},
{
"endpointId": "56726466-e454-23ac-340c-f34fefda7df2",
"endpointToken": "02226466-e744-48ac-8f0c-a57fe4e35db2"
}
],
"failed": [
{
"endpointToken": "02226466-e744-48ac-8f0c-a57fe4f48d5f",
"statusReason": "Endpoint token already exists."
}
]
}
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Operations on a specific endpoint identified by endpointId
.
Returns endpoint information.
Deletes endpoint.
get /endpoints/{endpointId}
Returns endpoint information.
- endpoint:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Headers
- If-None-Match: (string)
Makes the request conditional.
The server will send the requested endpoint with200
status only if currentETag
value doesn't match the specified one.
Otherwise,304 Not Modified
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
- If-Modified-Since: (datetime)
Makes the request conditional.
The server will send the requested endpoint with200
status only if currentLast-Modified
value doesn't match the specified one.
Otherwise,304 Not Modified
status will be returned.Example:
Tue, 05 Sep 2017 08:21:44 GMT
Query Parameters
- tenantId: (string)
ID of the tenant the endpoint belong to.
Example:
5b39397d-1be2-49a1-ad8b-f641a97e4ce3
- include: (one of metadata, filters)
- `metadata` – include `metadata` fields and `metadataUpdatedDate` fields in response.
- `filters` – include `matching_filters` fields in response.
By default, no metadata and filters are returned.
HTTP status code 200
Object successfully retrieved.
Headers
- ETag: required(string)
Represents the current endpoint state.
The value can be used inIf-Match
andIf-None-Match
headers.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
- Last-Modified: required(datetime)
The last modifcation date of endpoint.
Example:
Tue, 05 Sep 2017 08:21:44 GMT
Body
Media type: application/json
Type: object
Properties- endpointId: required(string)
Unique identifier of endpoint.
- createdDate: required(datetime)
Endpoint registration data in ISO 8601 format (UTC timezone).
- appName: required(string)
Application name that endpoint belongs to.
- appVersion: required(object)
Information about endpoint registration wthin specific application version.
- name: required(string)
Name of the application version.
- registeredDate: required(datetime)
Date when endpoint registration data was created within specific application version.
- name: required(string)
- metadata: (object)
Endpoint metadata consists of multiple key-value pairs (called fields) where keys are strings, and the values are of any JSON type.
- metadataUpdatedDate: (datetime)
Timestamp in ISO 8601 format (UTC timezone) showing when the endpoint metadata was last updated.
- filters: required(array of string)
List of filters that matches to the endpoint.
Example:
{
"endpointId": "69c4c970-94ce-4608-bf36-736d16fdab82",
"createdDate": "2017-04-20T11:19:57.848Z",
"appName": "bqa46oeg14m0thoh7g0l",
"appVersion": {
"name": "example_app_v1",
"registeredDate": "2017-04-20T11:19:57.848Z"
},
"metadata": {
"OS": {
"type": "Linux",
"version": "4.10.6"
},
"tag": {
"id": "1"
},
"anyJsonType": [
11
]
},
"metadataUpdatedDate": "2017-04-20T15:01:12.144Z",
"filters": [
"58229325-8444-4394-a4c2-1ef2b44160f5"
]
}
HTTP status code 304
Resource(s) not modified.
HTTP status code 400
Invalid include
query parameter.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /endpoints/{endpointId}
Deletes endpoint.
- endpoint:delete
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
HTTP status code 204
Endpoint is successfully deleted.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns all available relations for the given endpoint ID.
get /endpoints/{endpointId}/relations
Returns all available relations for the given endpoint ID.
- endpoint:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Query Parameters
- relation: required(one of contains, )
Filters endpoints by relation type and its direction.
contains
will return all endpoints with the inbound direction coming from the querying endpont - e.g., if quering endpoint represents a room, this type of query will return all sensors in that room.!contains
will return all endpoints with the outbound direction coming to the querying endpoint - e.g., if quering endpoint represents a sensor, this type of query will return a room that contains it.Example:
!contains
HTTP status code 200
Endpoint relations successfully retrieved.
Body
Media type: application/json
Type: array of string
Example:
[
"69c4c970-94ce-4608-bf36-7b8236d16fda",
"f359de38-6763-11ed-9022-0242ac120002"
]
HTTP status code 403
User does not have permissions to perform this operation.
HTTP status code 404
Endpoint not found.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns endpoint registration data within application version.
Updates endpoint registration data with the application version.
get /endpoints/{endpointId}/app-version
Returns endpoint registration data within application version.
- endpoint:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
HTTP status code 200
Endpoint registration data retrieved successfully.
Body
Media type: application/json
Type: object
Properties- name: required(string)
Name of the application version.
- registeredDate: required(datetime)
Date when endpoint registration data was created within specific application version.
Example:
{
"name": "example_app_v1",
"registeredDate": "2017-04-20T11:19:57.848Z"
}
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /endpoints/{endpointId}/app-version
Updates endpoint registration data with the application version.
- endpoint:update
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Body
Media type: application/json
Type: object
Properties- name: required(string)
Name of the application version.
Example:
{
"name":"example_app_v2"
}
HTTP status code 204
Endpoint registration data updated successfully.
HTTP status code 400
Invalid application version name.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns all metadata or requested metadata keys (must be a non-empty string containing Latin letters, digits, and underscores only) for a specific endpoint.
Updates an endpoint metadata.
Endpoint metadata consists of multiple key-value pairs (called fields) where keys must be non-empty strings containing Latin letters, digits, and underscores only, while the values can be of any JSON type.
Applies JSON Patch to the endpoint metadata. If no metadata exists, it is created. Metadata keys must be non-empty strings containing Latin letters, digits, and underscores only.
get /endpoints/{endpointId}/metadata
Returns all metadata or requested metadata keys (must be a non-empty string containing Latin letters, digits, and underscores only) for a specific endpoint.
- endpoint:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Headers
- If-None-Match: (string)
Makes the request conditional.
The server will send the requested endpoint's metadata with200
status only if currentETag
value doesn't match the specified one.
Otherwise,304 Not Modified
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
- If-Modified-Since: (datetime)
Makes the request conditional.
The server will send the requested endpoint's metadata with200
status only if currentLast-Modified
value doesn't match the specified one.
Otherwise,304 Not Modified
status will be returned.Example:
Tue, 05 Sep 2017 08:21:44 GMT
Query Parameters
- include: (string)
Only fields that match any of the
include
parameters are returned.
If not specified, all fields are returned.Example:
/endpoints/{endpointId}/metadata?include=key1&include=key2
HTTP status code 200
Endpoint metadata of the specified endpoint.
Headers
- ETag: required(string)
Represents the current endpoint's metadata state.
The value can be used inIf-Match
andIf-None-Match
headers.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
- Last-Modified: required(datetime)
The last modifcation date of endpoint's metadata.
Example:
Tue, 05 Sep 2017 08:21:44 GMT
Body
Media type: application/json
Type: object
Example:
{
"OS":{
"type":"Linux",
"version":"4.10.6"
},
"tag":{
"id":"1"
},
"anyJsonType":[
11
]
}
HTTP status code 304
Resource(s) not modified.
HTTP status code 400
Metadata keys are not valid.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /endpoints/{endpointId}/metadata
Updates an endpoint metadata.
Endpoint metadata consists of multiple key-value pairs (called fields) where keys must be non-empty strings containing Latin letters, digits, and underscores only, while the values can be of any JSON type.
- endpoint:update
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Headers
- If-Match: (string)
Makes the request conditional.
The server will execute operation only if currentETag
value matches the specified one.
Otherwise,412 Precondition Failed
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
- If-Unmodified-Since: (datetime)
Makes the request conditional.
The server will execute operation only if currentLast-Modified
value matches the specified one.
Otherwise,412 Precondition Failed
status will be returned.Example:
Tue, 05 Sep 2017 08:21:44 GMT
Body
Media type: application/json
Type: object
Example:
{
"OS":{
"type":"Linux",
"version":"4.10.6"
},
"tag":{
"id":"1"
},
"anyJsonType":[
11
]
}
HTTP status code 204
Endpoint metadata successfully updated.
HTTP status code 400
Payload is not a JSON object or metadata keys are not valid.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
HTTP status code 412
At least one of the preconditions specified in If-Match
or If-Unmodified-Since
headers failed.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
patch /endpoints/{endpointId}/metadata
Applies JSON Patch to the endpoint metadata. If no metadata exists, it is created. Metadata keys must be non-empty strings containing Latin letters, digits, and underscores only.
- endpoint:update
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Headers
- If-Match: (string)
Makes the request conditional.
The server will execute operation only if currentETag
value matches the specified one.
Otherwise,412 Precondition Failed
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
- If-Unmodified-Since: (datetime)
Makes the request conditional.
The server will execute operation only if currentLast-Modified
value matches the specified one.
Otherwise,412 Precondition Failed
status will be returned.Example:
Tue, 05 Sep 2017 08:21:44 GMT
Body
Media type: application/json-patch+json
Type: array
Example:
[
{ "op": "add", "path": "/location", "value": {"city":"Kiev", "street":"Nyzhnoiurkivska"} },
{ "op": "remove", "path": "/anyJsonType/0"},
{ "op": "move", "from": "/OS", "path": "/tag" }
]
HTTP status code 200
Endpoint metadata successfully patched.
Body
Media type: application/json
Type: object
Example:
{
"OS":{
"type":"Linux",
"version":"4.10.6"
},
"tag":{
"id":"1"
},
"anyJsonType":[
11
]
}
HTTP status code 400
Invalid JSON Patch format or metadata keys are not valid.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
HTTP status code 412
At least one of the preconditions specified in If-Match
or If-Unmodified-Since
headers failed.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns metadata value for the specified key.
Creates and updates single endpoint metadata field.
Deletes single endpoint metadata field for a specific endpoint.
get /endpoints/{endpointId}/metadata/{metadataKey}
Returns metadata value for the specified key.
- endpoint:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
- metadataKey: required(string)
Metadata key must be a non-empty string containing Latin letters, digits, and underscores only.
Example:
OS
HTTP status code 200
Metadata value for the specified key.
Body
Media type: application/json
Type: any
Examples:
A JSON object.:
{
"kernel": "Linux",
"version": 5
}
A string value.:
"value1"
A boolean value.:
false
A JSON array value.:
[
1,
2.3,
4
]
A number value.:
2
HTTP status code 400
Bad request.
HTTP status code 404
Endpoint or metadata key not found or user is not authorized for the endpoint.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Examples:
Endpoint not found.:
{
"message": "No endpoint found."
}
Metadata key not found.:
{
"message": "No metadata key found."
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
put /endpoints/{endpointId}/metadata/{metadataKey}
Creates and updates single endpoint metadata field.
- endpoint:update
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
- metadataKey: required(string)
Metadata key must be a non-empty string containing Latin letters, digits, and underscores only.
Example:
OS
Body
Media type: application/json
Type: any
Examples:
A JSON object.:
{
"kernel": "Linux",
"version": 5
}
A string value.:
"value1"
A boolean value.:
false
A JSON array value.:
[
1,
2.3,
4
]
A number value.:
2
HTTP status code 200
Single endpoint metadata key-value pair successfully updated.
Body
Media type: application/json
Type: any
Examples:
A JSON object.:
{
"kernel": "Linux",
"version": 5
}
A string value.:
"value1"
A boolean value.:
false
A JSON array value.:
[
1,
2.3,
4
]
A number value.:
2
HTTP status code 201
Single endpoint metadata key-value pair successfully created.
Headers
- Location: required(string)
Location of the newly created endpoint metadata key-value pair. The format is as follows: {schema}://{host}:{port}/api/{version}/endpoints/{endpointId}/metadata/{metadataKey}
Example:
http://example.com/api/v1/endpoints/79c717d9-eedd-4f71-b9f8-86caf7e309e4/metadata/OS
Body
Media type: application/json
Type: any
Examples:
A JSON object.:
{
"kernel": "Linux",
"version": 5
}
A string value.:
"value1"
A boolean value.:
false
A JSON array value.:
[
1,
2.3,
4
]
A number value.:
2
HTTP status code 400
Invalid JSON value or metadata key is not valid.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /endpoints/{endpointId}/metadata/{metadataKey}
Deletes single endpoint metadata field for a specific endpoint.
- endpoint:update
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
- metadataKey: required(string)
Metadata key must be a non-empty string containing Latin letters, digits, and underscores only.
Example:
OS
HTTP status code 204
Endpoint metadata key successfully deleted.
HTTP status code 400
Invalid metadata key.
HTTP status code 404
Endpoint or metadata key not found or user is not authorized for the endpoint.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Examples:
Endpoint not found.:
{
"message": "No endpoint found."
}
Metadata key not found.:
{
"message": "No metadata key found."
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Returns all endpoint metadata keys for the specified endpoint.
get /endpoints/{endpointId}/metadata-keys
Returns all endpoint metadata keys for the specified endpoint.
- endpoint:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- endpointId: required(string)
Identifier of the endpoint to operate on.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Headers
- If-None-Match: (string)
Makes the request conditional.
The server will send the requested metadata keys with200
status only if currentETag
value doesn't match the specified one.
Otherwise,304 Not Modified
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
HTTP status code 200
Array that contains all metadata fields.
Headers
- ETag: required(string)
Represents the current metadata keys state.
The value can be used inIf-Match
andIf-None-Match
headers.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
Body
Media type: application/json
Type: array of string
Example:
[
"OS",
"country",
"level"
]
HTTP status code 304
Resource(s) not modified.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Filters
Operations on endpoint filters.
Returns endpoint filters for a specific application.
Creates an endpoint filter in specific application.
get /applications/{applicationName}/filters
Returns endpoint filters for a specific application.
- application:endpoint-filter:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- applicationName: required(string)
Application name
Example:
smart_kettle
Headers
- If-None-Match: (string)
Makes the request conditional.
The server will send the requested endpoint's filters with200
status only if currentETag
value doesn't match the specified one.
Otherwise,304 Not Modified
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
Query Parameters
- name: (string)
Filter name
- offset: (integer)
Start index that the server should return data from.
Example:
0
- limit: (integer - default: 1000)
Maximum number of items to return. To get all items limit must be 0.
Example:
100
HTTP status code 200
Endpoint filters retrieved successfully.
Headers
- ETag: required(string)
Represents the current filters state.
The value can be used inIf-Match
andIf-None-Match
headers.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
Body
Media type: application/json
Type: object
Properties- totalElements: required(integer)
Total number of elements available for retrieval. Current response may return only a part of all available elements.
- content: required(array of epr-api-types.EndpointFilter)
Items: EndpointFilter
- id: required(string)
Endpoint filter ID.
- name: required(string)
Endpoint filter name, unique in scope of application.
- description: required(string)
Endpoint filter description.
- mongoQuery: required(object)
Mongo query used for filtering endpoins by application version and metadata keys.
- createdDate: required(datetime)
Endpoint filter creation timestamp in ISO 8601 format (UTC timezone).
- updatedDate: required(datetime)
Endpoint filter last update timstamp in ISO 8601 format (UTC timezone).
- matchedEndpointsCount: required(integer)
Amount of endpoints that matches the filter criteria.
- status: required(one of pending, active)
Endpoint filter status.
- `pending` - endpoint filter matching to endpoints is in progress
- `active` - endpoint filter matching to endpoints is finished
- id: required(string)
Example:
{
"totalElements": 2,
"content": [
{
"id": "79c717d9-eedd-4f71-b9f8-86caf7e309e4",
"createdDate": "2017-04-21T12:09:57.848Z",
"updatedDate": "2017-04-22T19:45:00.112Z",
"name": "app1-1_key1GreaterThanZero",
"description": "Some description.",
"mongoQuery": {
"$and": [
{
"application_version_name": "app1-1"
},
{
"metadata": {
"$elemMatch": {
"key": "key1",
"value": {
"$gt": 0
}
}
}
}
]
},
"status": "active"
},
{
"id": "1dc01725-b9d9-41a7-aa28-75a110b89d90",
"createdDate": "2017-05-03T05:17:59.789Z",
"updatedDate": "2017-06-17T07:18:14.431Z",
"description": "Some description.",
"mongoQuery": {
"metadata": {
"$elemMatch": {
"key": "key2",
"value": 2
}
}
},
"status": "pending"
}
]
}
HTTP status code 304
Resource(s) not modified.
HTTP status code 404
Resource not found.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
post /applications/{applicationName}/filters
Creates an endpoint filter in specific application.
- application:endpoint-filter:create
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- applicationName: required(string)
Application name
Example:
smart_kettle
Body
Media type: application/json
Type: object
Properties- name: required(string)
Endpoint filter name, unique in scope of application.
- description: (string)
Endpoint filter description.
- mongoQuery: required(object)
Mongo query used for filtering endpoins by application version and metadata keys.
Example:
{
"name":"app1-1_key1GreaterThanZero",
"description": "Filters all endpoints with the 'key1' greater than '0'",
"mongoQuery":{
"$and":[
{
"application_version":"app1-1"
},
{
"metadata":{
"$elemMatch":{
"key":"key1",
"value":{
"$gt":0
}
}
}
}
]
}
}
HTTP status code 201
Endpoint filter successfully created.
Headers
- ETag: required(string)
Represents the current filter state.
The value can be used inIf-Match
andIf-None-Match
headers.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
- Location: required(string)
URI in format
{schema}://{host}:{port}/api/v1/applications/{applicationName}/filters/{filterId}
Example:
http://example.com/api/v1/applications/smart-kettle/filters/79c717d9-eedd-4f71-b9f8-86caf7e309e4
HTTP status code 400
Invalid or missing query
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Resource not found.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 409
Endpoint filter with such name already exists in specified application.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Example:
{
"message": "Endpoint filter with such name already exists in specified application."
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Updates an endpoint filter.
Returns an endpoint filter.
Deletes an endpoint filter.
patch /applications/{applicationName}/filters/{filterId}
Updates an endpoint filter.
- application:endpoint-filter:update
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- applicationName: required(string)
Application name
Example:
smart_kettle
- filterId: required(string)
Endpoint filter ID, unique in scope of application.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Headers
- If-Match: (string)
Makes the request conditional.
The server will execute operation only if currentETag
value matches the specified one.
Otherwise,412 Precondition Failed
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
Body
Media type: application/json
Type: object
Properties- name: (string)
Endpoint filter name, unique in scope of application.
- description: (string)
Endpoint filter description.
- mongoQuery: (object)
Mongo query used for filtering endpoins by application version and metadata keys.
Example:
{
"name":"app1-1_key1GreaterThanZero",
"description": "Filters all endpoints with the 'key1' greater than '0'",
"mongoQuery":{
"$and":[
{
"application_version":"app1-1"
},
{
"metadata":{
"$elemMatch":{
"key":"key1",
"value":{
"$gt":0
}
}
}
}
]
}
}
HTTP status code 204
Endpoint filter successfully updated.
HTTP status code 400
Invalid request.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 404
Application or endpoint filter not found.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Examples:
Application is not found.:
{
"message": "Unknown application name!"
}
Endpoint filter not found.:
{
"message": "Endpoint filter not found."
}
HTTP status code 409
Endpoint filter with such name already exists in specified application.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Example:
{
"message": "Endpoint filter with such name already exists in specified application."
}
HTTP status code 412
Precondition specified in If-Match
header failed.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
get /applications/{applicationName}/filters/{filterId}
Returns an endpoint filter.
- application:endpoint-filter:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- applicationName: required(string)
Application name
Example:
smart_kettle
- filterId: required(string)
Endpoint filter ID, unique in scope of application.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Headers
- If-None-Match: (string)
Makes the request conditional.
The server will send the requested filter with200
status only if currentETag
value doesn't match the specified one.
Otherwise,304 Not Modified
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
HTTP status code 200
Endpoint filter retrieved successfully.
Headers
- ETag: required(string)
Represents the current filter state.
The value can be used inIf-Match
andIf-None-Match
headers.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
Body
Media type: application/json
Type: object
Properties- id: required(string)
Endpoint filter ID.
- name: required(string)
Endpoint filter name, unique in scope of application.
- description: required(string)
Endpoint filter description.
- mongoQuery: required(object)
Mongo query used for filtering endpoins by application version and metadata keys.
- createdDate: required(datetime)
Endpoint filter creation timestamp in ISO 8601 format (UTC timezone).
- updatedDate: required(datetime)
Endpoint filter last update timstamp in ISO 8601 format (UTC timezone).
- matchedEndpointsCount: required(integer)
Amount of endpoints that matches the filter criteria.
- status: required(one of pending, active)
Endpoint filter status.
- `pending` - endpoint filter matching to endpoints is in progress
- `active` - endpoint filter matching to endpoints is finished
Example:
{
"id": "79c717d9-eedd-4f71-b9f8-86caf7e309e4",
"createdDate": "2017-04-21T12:09:57.848Z",
"updatedDate": "2017-04-22T19:45:00.112Z",
"name": "app1-1_key1GreaterThanZero",
"description": "Some description.",
"mongoQuery": {
"$and": [
{
"application_version_name": "app1-1"
},
{
"metadata": {
"$elemMatch": {
"key": "key1",
"value": {
"$gt": 0
}
}
}
}
]
},
"status": "active",
"matchedEndpointsCount":0
}
HTTP status code 304
Resource(s) not modified.
HTTP status code 404
Application or endpoint filter not found.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Examples:
Application is not found.:
{
"message": "Unknown application name!"
}
Endpoint filter not found.:
{
"message": "Endpoint filter not found."
}
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
delete /applications/{applicationName}/filters/{filterId}
Deletes an endpoint filter.
- application:endpoint-filter:delete
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- applicationName: required(string)
Application name
Example:
smart_kettle
- filterId: required(string)
Endpoint filter ID, unique in scope of application.
Example:
79c717d9-eedd-4f71-b9f8-86caf7e309e4
Headers
- If-Match: (string)
Makes the request conditional.
The server will execute operation only if currentETag
value matches the specified one.
Otherwise,412 Precondition Failed
status will be returned.Example:
"33a64df551425fcc55e4d42a148795d9f25f89d4"
HTTP status code 204
Endpoint filter successfully deleted.
HTTP status code 404
Application or endpoint filter not found.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
Examples:
Application is not found.:
{
"message": "Unknown application name!"
}
Endpoint filter not found.:
{
"message": "Endpoint filter not found."
}
HTTP status code 412
Precondition specified in If-Match
header failed.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Applications
Operations on applications.
Returns all endpoint metadata keys set for endpoints in a given application.
get /applications/{applicationName}/metadata-keys
Returns all endpoint metadata keys set for endpoints in a given application.
- application:endpoints-metadata-keys:read
EPR supports OAuth 2.0 for authenticating all API requests.
URI Parameters
- applicationName: required(string)
Application name to operate on.
Example:
c4f5gl2d4ks1slmoepa0
HTTP status code 200
Metadata keys is successfully retrieved.
Body
Media type: application/json
Type: object
Properties- appName: required(object)
Application name.
- appVersionName: required(array of string)
Application version name.
- appVersionName: required(array of string)
Example:
{
"smart_kettle_v1": [
"fwVersion",
"serial",
"powerType"
],
"smart_kettle_v2": [
"sensingCapabilities",
"description"
]
}
HTTP status code 404
Given application doesn't exist or user is not authorized for it
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Relations
Operations on relations between endpoints.
Creates a directed relation type between endpoints.
put /relations/link
Creates a directed relation type between endpoints.
- endpoint:update
EPR supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: array of object
Items: EndpointRelation
- type: required(contains)
Relation type.
- from: required(string)
Endpoint ID with the outbound direction of the relation type coming to the endpoint referenced by the
to
key. - to: required(string)
Endpoint ID with the inbound direction of the relation type coming from the endpoint referenced by the
from
key.
Example:
[
{
"type": "contains",
"from": "34e04cd1-f13d-49ca-adca-a8290c44fb30",
"to": "47243977-4eea-423b-818e-ac67f91106d6"
},
{
"type": "contains",
"from": "aaa6f08f-d839-4089-baca-380e7365953f",
"to": "59f52930-7aec-43a3-b8d2-0dd8538afb81"
}
]
HTTP status code 204
Endpoints are successfully linked.
HTTP status code 400
An error occurred during linking.
Body
Media type: application/json
Type: epr-api-types.FailedRelationResponse
Example:
{
"successful": [
{
"type": "contains",
"from": "aaa6f08f-d839-4089-baca-380e7365953f",
"to": "59f52930-7aec-43a3-b8d2-0dd8538afb81"
}
],
"failed": [
{
"type": "contains",
"from": "79c717d9-eedd-4f71-b9f8-86caf7e309e4",
"to": "34e04cd1-f13d-49ca-adca-a8290c44fb30",
"reason": "Relation already exists"
}
]
}
HTTP status code 403
User does not have permissions to perform this operation.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.
Deletes a directed relation type between endpoints.
put /relations/unlink
Deletes a directed relation type between endpoints.
- endpoint:update
EPR supports OAuth 2.0 for authenticating all API requests.
Body
Media type: application/json
Type: array of object
Items: EndpointRelation
- type: required(contains)
Relation type.
- from: required(string)
Endpoint ID with the outbound direction of the relation type coming to the endpoint referenced by the
to
key. - to: required(string)
Endpoint ID with the inbound direction of the relation type coming from the endpoint referenced by the
from
key.
Example:
[
{
"type": "contains",
"from": "34e04cd1-f13d-49ca-adca-a8290c44fb30",
"to": "47243977-4eea-423b-818e-ac67f91106d6"
},
{
"type": "contains",
"from": "aaa6f08f-d839-4089-baca-380e7365953f",
"to": "59f52930-7aec-43a3-b8d2-0dd8538afb81"
}
]
HTTP status code 204
Endpoints are successfully unlinked.
HTTP status code 400
An error occurred during unlinking.
Body
Media type: application/json
Type: object
Properties- message: required(string)
Detailed error description.
HTTP status code 403
User does not have permissions to perform this operation.
HTTP status code 404
Endpoint not found or querying user is not authorized for it.
Secured by oauth_2_0
Headers
- Authorization: (string)
Used to send a valid OAuth 2 access token. Example: "Authorization: Bearer 'access_token'" where 'access_token' must be replaced by a valid OAuth access token. This header is needed only if API authentication is enabled for the service.