Skip to content

Instantly share code, notes, and snippets.

@lorthirk
Last active November 7, 2019 20:40
Show Gist options
  • Save lorthirk/68180d1d2162f369d6ebbdb04733475a to your computer and use it in GitHub Desktop.
Save lorthirk/68180d1d2162f369d6ebbdb04733475a to your computer and use it in GitHub Desktop.
openapi: 3.0.2
info:
title: Eclipse Kapua REST API
version: '1.0'
contact:
name: Eclipse Kapua Dev Team
url: 'https://eclipse.org/kapua'
email: kapua-dev@eclipse.org
license:
name: Eclipse Public License 2.0
url: 'https://www.eclipse.org/legal/epl-2.0'
description: |
# Introduction
Eclipse Kapua exposes a comprehensive set of Web Service APIs for application integration purposes. The Eclipse Kapua REST API allows you to build applications that use Representational State Transfer HTTP calls to retrieve, modify, or publish platform data. For example through the APIs, you are able to access all the functionality of the Console or to control a device from your application built on top of Eclipse Kapua.
The Eclipse Kapua platform conforms to standard REpresentational State Transfer (REST) protocol to expose its Application Programming Interfaces (API). REST has emerged over the past few years as a predominant Web service design model. REST-style architectures consist of clients and servers. Clients initiate requests to servers, while servers process requests and return appropriate responses. Requests and responses are built around the transfer of representations of resources. A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource
Eclipse Kapua RESTful APIs expose the standard action types (create, read, update, delete) over the platform objects. They are capable of retrieving a resource representation in XML or JSON format. You can use the REST HTTP Accept Header to specify the representation requested using the "application/xml" and "application/json" Media Types. As an alternative to the Accept header, you can specify the requested data representation by appending an ".xml" or ".json" suffix to the path part of your request URLs
For more details on the Eclipse Kapua REST APIs, please refer to:
- [The Eclipse Kapua Documentation](https://www.eclipse.org/kapua/documentation.php)
- [The Eclipse Kapua Code on github](https://github.com/eclipse/kapua)
# Authentication
All Eclipse Kapua REST API, except the Authentication endpoints that performs an Authentication, need an Authentication Token to be executed. You will retrieve such token as a response of one of the Authentication calls, in the form of a [JWT](https://jwt.io) as the value of the property `tokenId`. For every subsequent call, you need to pass such token in the `Authorization` HTTP Header, with the `Bearer` type
# Scopes
In Kapua, every resource is always assigned to one and only one Scope, and can be accessed only by Users with Permissions on that Scope. Hence, a Scope represents a single Tenant, and in Kapua corresponds to an `Account`
servers:
- description: Localhost Docker Compose
url: 'http://localhost:8081/v1'
paths:
'/{scopeId}/accessinfos':
get:
tags:
- Access Info
summary: Get all the AccessInfo
operationId: accessInfoList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
responses:
'200':
description: The list of the AccessInfo objects available in the Scope
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessInfo objects
type: object
properties:
items:
type: array
items:
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An AccessInfo represents all the security objects (Roles and Permissions) that can be attached to a User. There will be exactly one AccessInfo object for every User
type: object
properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the User to which this AccessInfo is attached to
example:
type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
example:
type: accessInfoListResult
limitExceeded: false
size: 2
items:
- type: accessInfo
id: Ag
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: Ag
- type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
post:
tags:
- Access Info
summary: Create an AccessInfo
operationId: accessInfoCreate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: The AccessInfoCreator object to create the new AccessInfo
content:
application/json:
schema:
allOf:
- description: An object that contains the informations needed to create an Entity
type: object
description: An object that contains the informations needed to create an AccessInfo
type: object
properties:
permissions:
description: An Array of Permission objects to attach to the new AccessInfo
type: array
items:
description: The representation of a Permission
type: object
properties:
domain:
description: The domain name in which the Permission acts. `*` means "Any Domains"
type: string
action:
description: The action that is permitted. `*` means "Any Action in the given Domain"
type: string
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Group to which the Permission applies. A `null` value means "Any group in the Scope"
targetScopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The Scope ID to which the Permission applies. A `null` value means "Any scope in the system"
forwardable:
description: 'When `true`, this permission is also active descending the entire Accounts hierarchy'
type: boolean
required:
- domain
- action
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the User to which the AcessInfo will be assigned
roleIds:
description: An Array of IDs whose Roles will be attached to the new AccessInfo
type: array
items:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The AccessInfo that has just been created
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessInfo objects
type: object
properties:
items:
type: array
items:
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An AccessInfo represents all the security objects (Roles and Permissions) that can be attached to a User. There will be exactly one AccessInfo object for every User
type: object
properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the User to which this AccessInfo is attached to
example:
type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
example:
type: accessInfoListResult
limitExceeded: false
size: 2
items:
- type: accessInfo
id: Ag
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: Ag
- type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}':
get:
tags:
- Access Info
summary: Get a single AccessInfo
operationId: accessInfoGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The details of the desired AccessInfo
content:
application/json:
schema:
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An AccessInfo represents all the security objects (Roles and Permissions) that can be attached to a User. There will be exactly one AccessInfo object for every User
type: object
properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the User to which this AccessInfo is attached to
example:
type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
delete:
tags:
- Access Info
summary: Delete a single AccessInfo
operationId: accessInfoDelete
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The AccessInfo has been deleted
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/_count':
post:
tags:
- Access Info
summary: Count the AccessInfos
operationId: accessInfoCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/_query':
post:
tags:
- Access Info
summary: Query the AccessInfos
operationId: accessInfoQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The result of the query
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessInfo objects
type: object
properties:
items:
type: array
items:
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An AccessInfo represents all the security objects (Roles and Permissions) that can be attached to a User. There will be exactly one AccessInfo object for every User
type: object
properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the User to which this AccessInfo is attached to
example:
type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
example:
type: accessInfoListResult
limitExceeded: false
size: 2
items:
- type: accessInfo
id: Ag
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: Ag
- type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}/permissions':
get:
tags:
- Access Permission
summary: Get all the AccessPermissions
operationId: accessPermissionList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The list of the AccessPermission objects available in the Scope
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessPermission objects
type: object
properties:
items:
type: array
items:
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An object that represents the link between an AccessInfo and a Permission
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
permission:
description: The representation of a Permission
type: object
properties:
domain:
description: The domain name in which the Permission acts. `*` means "Any Domains"
type: string
action:
description: The action that is permitted. `*` means "Any Action in the given Domain"
type: string
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Group to which the Permission applies. A `null` value means "Any group in the Scope"
targetScopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The Scope ID to which the Permission applies. A `null` value means "Any scope in the system"
forwardable:
description: 'When `true`, this permission is also active descending the entire Accounts hierarchy'
type: boolean
required:
- domain
- action
example:
type: accessPermissionListResult
limitExceeded: false
size: 1
items:
- type: accessPermission
id: Io4dVUnrBtE
scopeId: AQ
createdOn: 2019-09-11T14:14:15.786Z
createdBy: AQ
accessInfoId: FPRcCYjzgqs
permission:
domain: broker
action: connect
forwardable: false
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
post:
tags:
- Access Permission
summary: Create an AccessPermission
operationId: accessPermissionCreate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
content:
application/json:
schema:
allOf:
- description: An object that contains the informations needed to create an Entity
type: object
description: An object that contains the informations needed to create an AccessPermission
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo to which attach the Permission
permission:
description: The representation of a Permission
type: object
properties:
domain:
description: The domain name in which the Permission acts. `*` means "Any Domains"
type: string
action:
description: The action that is permitted. `*` means "Any Action in the given Domain"
type: string
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Group to which the Permission applies. A `null` value means "Any group in the Scope"
targetScopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The Scope ID to which the Permission applies. A `null` value means "Any scope in the system"
forwardable:
description: 'When `true`, this permission is also active descending the entire Accounts hierarchy'
type: boolean
required:
- domain
- action
required:
- accessInfoId
- permission
responses:
'200':
description: The AccessPermission that has just been created
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessPermission objects
type: object
properties:
items:
type: array
items:
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An object that represents the link between an AccessInfo and a Permission
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
permission:
description: The representation of a Permission
type: object
properties:
domain:
description: The domain name in which the Permission acts. `*` means "Any Domains"
type: string
action:
description: The action that is permitted. `*` means "Any Action in the given Domain"
type: string
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Group to which the Permission applies. A `null` value means "Any group in the Scope"
targetScopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The Scope ID to which the Permission applies. A `null` value means "Any scope in the system"
forwardable:
description: 'When `true`, this permission is also active descending the entire Accounts hierarchy'
type: boolean
required:
- domain
- action
example:
type: accessPermissionListResult
limitExceeded: false
size: 1
items:
- type: accessPermission
id: Io4dVUnrBtE
scopeId: AQ
createdOn: 2019-09-11T14:14:15.786Z
createdBy: AQ
accessInfoId: FPRcCYjzgqs
permission:
domain: broker
action: connect
forwardable: false
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}/permissions/{accessPermissionId}':
get:
tags:
- Access Permission
summary: Get a single AccessPermission
operationId: accessPermissionGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: accessPermissionId
in: path
description: The ID of the AccessPermission on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The details of the desired AccessPermission
content:
application/json:
schema:
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An object that represents the link between an AccessInfo and a Permission
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
permission:
description: The representation of a Permission
type: object
properties:
domain:
description: The domain name in which the Permission acts. `*` means "Any Domains"
type: string
action:
description: The action that is permitted. `*` means "Any Action in the given Domain"
type: string
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Group to which the Permission applies. A `null` value means "Any group in the Scope"
targetScopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The Scope ID to which the Permission applies. A `null` value means "Any scope in the system"
forwardable:
description: 'When `true`, this permission is also active descending the entire Accounts hierarchy'
type: boolean
required:
- domain
- action
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
delete:
tags:
- Access Permission
summary: Delete a single AccessPermission
operationId: accessPermissionDelete
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: accessPermissionId
in: path
description: The ID of the AccessPermission on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The AccessPermission has been deleted
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}/permissions/_count':
post:
tags:
- Access Permission
summary: Count the AccessPermissions
operationId: accessPermissionCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}/permissions/_query':
post:
tags:
- Access Permission
summary: Query the AccessPermissions
operationId: accessPermissionQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The result of the query
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessPermission objects
type: object
properties:
items:
type: array
items:
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An object that represents the link between an AccessInfo and a Permission
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
permission:
description: The representation of a Permission
type: object
properties:
domain:
description: The domain name in which the Permission acts. `*` means "Any Domains"
type: string
action:
description: The action that is permitted. `*` means "Any Action in the given Domain"
type: string
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Group to which the Permission applies. A `null` value means "Any group in the Scope"
targetScopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The Scope ID to which the Permission applies. A `null` value means "Any scope in the system"
forwardable:
description: 'When `true`, this permission is also active descending the entire Accounts hierarchy'
type: boolean
required:
- domain
- action
example:
type: accessPermissionListResult
limitExceeded: false
size: 1
items:
- type: accessPermission
id: Io4dVUnrBtE
scopeId: AQ
createdOn: 2019-09-11T14:14:15.786Z
createdBy: AQ
accessInfoId: FPRcCYjzgqs
permission:
domain: broker
action: connect
forwardable: false
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}/roles':
get:
tags:
- Access Role
summary: Get all the AccessRoles
operationId: accessRolesList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The list of the AccessRole objects available in the Scope
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessRole objects
type: object
properties:
items:
type: array
items:
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An object that represents the link between an AccessInfo and a Role
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
roleId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Role attached to the AccessInfo
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
post:
tags:
- Access Role
summary: Create an AccessRole
operationId: accessRoleCreate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
content:
application/json:
schema:
allOf:
- description: An object that contains the informations needed to create an Entity
type: object
description: An object that contains the informations needed to create an AccessRole
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo to which attach the Permission
roleId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
required:
- accessInfoId
- roleId
responses:
'200':
description: The AccessRole that has just been created
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessRole objects
type: object
properties:
items:
type: array
items:
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An object that represents the link between an AccessInfo and a Role
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
roleId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Role attached to the AccessInfo
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}/roles/{accessRoleId}':
get:
tags:
- Access Role
summary: Get a single AccessRole
operationId: accessRoleGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: accessRoleId
in: path
description: The ID of the AccessRole on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The details of the desired AccessRole
content:
application/json:
schema:
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An object that represents the link between an AccessInfo and a Role
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
roleId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Role attached to the AccessInfo
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
delete:
tags:
- Access Role
summary: Delete a single AccessRole
operationId: accessRoleDelete
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: accessRoleId
in: path
description: The ID of the AccessRole on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The AccessRole has been deleted
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}/roles/_count':
post:
tags:
- Access Role
summary: Count the AccessRoles
operationId: accessRoleCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accessinfos/{accessInfoId}/roles/_query':
post:
tags:
- Access Role
summary: Query the AccessRoles
operationId: accessRoleQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The result of the query
content:
application/json:
schema:
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
description: A container for a list of AccessRole objects
type: object
properties:
items:
type: array
items:
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An object that represents the link between an AccessInfo and a Role
type: object
properties:
accessInfoId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the AccessInfo
roleId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Role attached to the AccessInfo
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accounts':
get:
tags:
- Account
summary: Get all the Accounts
operationId: accountList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: name
in: query
description: An optional string to filter Accounts according to their name
schema:
type: string
- name: limit
in: query
description: A Limit on the result size. The result set will not contain more items than this number
schema:
type: integer
default: 50
- name: offset
in: query
description: 'An Offset on the result size. Used to skip the first `n` items of a result set, with `n` equal to the value of `offset`'
schema:
type: integer
default: 0
responses:
'200':
description: The list of the Accounts available in the Scope
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
allOf:
- allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An UpdatableEntity that also has a name and a description
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
- properties:
organization:
type: object
properties:
name:
type: string
description: The Name of the Organization
addressLine1:
type: string
description: First line of the Address for the Organization
addressLine2:
type: string
description: Second line of the Address for the Organization
addressLine3:
type: string
description: Third line of the Address for the Organization
zipPostCode:
type: string
description: The Zip / Postcode for the Organization
city:
type: string
description: The City of the Organization
stateProvinceCounty:
type: string
description: The State / Province / County of the Organization
country:
type: string
description: The Country of the Organization
personName:
type: string
description: The Name of the Person listed as a Contact for the Organization
email:
type: string
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
description: An object containing all the informations related to the Organization who holds the account
expirationDate:
type: string
format: date-time
description: 'The Expiration date and time for the Account. If empty, the Account has no expiration'
parentAccountPath:
type: string
description: The full Scope ID Hierarchy for the Account
description: |
An object that holds all the informations pertaining an Account, including the details about the Contacts of that account.\
In Kapua an Account is the container of all other resources (Users, Devices, etc.), and is the equivalent of the concept of Tenant.\
Every entity in Kapua will have a `scopeId` property, that holds the ID of the Account who holds that entity.
example:
type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
description: A list container for Account objects
example:
type: accountListResult
size: 1
limitExceeded: false
items:
- type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
description: Get all the Accounts in the given Scope
post:
tags:
- Account
summary: Create a new Account
operationId: accountCreate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object containing the properties for the new Account to be created
content:
application/json:
schema:
type: object
allOf:
- allOf:
- allOf:
- description: An object that contains the informations needed to create an Entity
type: object
description: An object that contains the informations needed to create an Updatable Entity
type: object
description: An object that contains the informations needed to create a Named Entity
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
required:
- name
- properties:
organizationName:
type: string
description: The Name of the Organization
organizationAddressLine1:
type: string
description: First line of the Address for the Organization
organizationAddressLine2:
type: string
description: Second line of the Address for the Organization
organizationAddressLine3:
type: string
description: Third line of the Address for the Organization
organizationZipPostCode:
type: string
description: The Zip / Postcode for the Organization
organizationCity:
type: string
description: The City of the Organization
organizationStateProvinceCounty:
type: string
description: The State / Province / County of the Organization
organizationCountry:
type: string
description: The Country of the Organization
organizatioPpersonName:
type: string
description: The Name of the Person listed as a Contact for the Organization
organizationEmail:
type: string
format: email
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
expirationDate:
type: string
format: date-time
description: The Expiration date and time for the Account
required:
- organizationName
- organizationEmail
description: An object with all the information needed to create a new Account
example:
name: acme-inc
organizationName: ACME Inc.
organizationEmail: wile.coyote@acme.inc
organizationAddressLine1: 123 Looney Tunes Drive
organizationAddressLine2: Block 1
organizationAddressLine3: Apartment 25
organizationZipPostCode: '00100'
organizationCity: Somewhere City
organizationStateProvinceCounty: 'Green County, GC'
organizationCountry: United States
organizationPersonName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
expirationDate: '2019-31-12T00:00:00.000Z'
required: true
responses:
'200':
description: The Account that has just been created
content:
application/json:
schema:
type: object
allOf:
- allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An UpdatableEntity that also has a name and a description
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
- properties:
organization:
type: object
properties:
name:
type: string
description: The Name of the Organization
addressLine1:
type: string
description: First line of the Address for the Organization
addressLine2:
type: string
description: Second line of the Address for the Organization
addressLine3:
type: string
description: Third line of the Address for the Organization
zipPostCode:
type: string
description: The Zip / Postcode for the Organization
city:
type: string
description: The City of the Organization
stateProvinceCounty:
type: string
description: The State / Province / County of the Organization
country:
type: string
description: The Country of the Organization
personName:
type: string
description: The Name of the Person listed as a Contact for the Organization
email:
type: string
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
description: An object containing all the informations related to the Organization who holds the account
expirationDate:
type: string
format: date-time
description: 'The Expiration date and time for the Account. If empty, the Account has no expiration'
parentAccountPath:
type: string
description: The full Scope ID Hierarchy for the Account
description: |
An object that holds all the informations pertaining an Account, including the details about the Contacts of that account.\
In Kapua an Account is the container of all other resources (Users, Devices, etc.), and is the equivalent of the concept of Tenant.\
Every entity in Kapua will have a `scopeId` property, that holds the ID of the Account who holds that entity.
example:
type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/accounts/{accountId}':
get:
tags:
- Account
summary: Get a single Account
operationId: accountGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: accountId
in: path
description: The ID of the Account on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The details of the desired Account
content:
application/json:
schema:
type: object
allOf:
- allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An UpdatableEntity that also has a name and a description
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
- properties:
organization:
type: object
properties:
name:
type: string
description: The Name of the Organization
addressLine1:
type: string
description: First line of the Address for the Organization
addressLine2:
type: string
description: Second line of the Address for the Organization
addressLine3:
type: string
description: Third line of the Address for the Organization
zipPostCode:
type: string
description: The Zip / Postcode for the Organization
city:
type: string
description: The City of the Organization
stateProvinceCounty:
type: string
description: The State / Province / County of the Organization
country:
type: string
description: The Country of the Organization
personName:
type: string
description: The Name of the Person listed as a Contact for the Organization
email:
type: string
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
description: An object containing all the informations related to the Organization who holds the account
expirationDate:
type: string
format: date-time
description: 'The Expiration date and time for the Account. If empty, the Account has no expiration'
parentAccountPath:
type: string
description: The full Scope ID Hierarchy for the Account
description: |
An object that holds all the informations pertaining an Account, including the details about the Contacts of that account.\
In Kapua an Account is the container of all other resources (Users, Devices, etc.), and is the equivalent of the concept of Tenant.\
Every entity in Kapua will have a `scopeId` property, that holds the ID of the Account who holds that entity.
example:
type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
description: 'Get the details of a given Account, according to the `accountId` path parameter.'
put:
tags:
- Account
summary: Update a single Account
operationId: accountUpdate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: accountId
in: path
description: The ID of the Account on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
description: An object containing the new properties for the Account to update
content:
application/json:
schema:
type: object
allOf:
- allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An UpdatableEntity that also has a name and a description
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
- properties:
organization:
type: object
properties:
name:
type: string
description: The Name of the Organization
addressLine1:
type: string
description: First line of the Address for the Organization
addressLine2:
type: string
description: Second line of the Address for the Organization
addressLine3:
type: string
description: Third line of the Address for the Organization
zipPostCode:
type: string
description: The Zip / Postcode for the Organization
city:
type: string
description: The City of the Organization
stateProvinceCounty:
type: string
description: The State / Province / County of the Organization
country:
type: string
description: The Country of the Organization
personName:
type: string
description: The Name of the Person listed as a Contact for the Organization
email:
type: string
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
description: An object containing all the informations related to the Organization who holds the account
expirationDate:
type: string
format: date-time
description: 'The Expiration date and time for the Account. If empty, the Account has no expiration'
parentAccountPath:
type: string
description: The full Scope ID Hierarchy for the Account
description: |
An object that holds all the informations pertaining an Account, including the details about the Contacts of that account.\
In Kapua an Account is the container of all other resources (Users, Devices, etc.), and is the equivalent of the concept of Tenant.\
Every entity in Kapua will have a `scopeId` property, that holds the ID of the Account who holds that entity.
example:
type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
example:
type: account
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: Green County GC
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
required: true
responses:
'200':
description: The details of the updated Account
content:
application/json:
schema:
type: object
allOf:
- allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An UpdatableEntity that also has a name and a description
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
- properties:
organization:
type: object
properties:
name:
type: string
description: The Name of the Organization
addressLine1:
type: string
description: First line of the Address for the Organization
addressLine2:
type: string
description: Second line of the Address for the Organization
addressLine3:
type: string
description: Third line of the Address for the Organization
zipPostCode:
type: string
description: The Zip / Postcode for the Organization
city:
type: string
description: The City of the Organization
stateProvinceCounty:
type: string
description: The State / Province / County of the Organization
country:
type: string
description: The Country of the Organization
personName:
type: string
description: The Name of the Person listed as a Contact for the Organization
email:
type: string
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
description: An object containing all the informations related to the Organization who holds the account
expirationDate:
type: string
format: date-time
description: 'The Expiration date and time for the Account. If empty, the Account has no expiration'
parentAccountPath:
type: string
description: The full Scope ID Hierarchy for the Account
description: |
An object that holds all the informations pertaining an Account, including the details about the Contacts of that account.\
In Kapua an Account is the container of all other resources (Users, Devices, etc.), and is the equivalent of the concept of Tenant.\
Every entity in Kapua will have a `scopeId` property, that holds the ID of the Account who holds that entity.
example:
type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
description: 'Update the details of a given Account, according to the `accountId` path parameter. Please note that some fields may be readonly for integrity purposes.'
delete:
tags:
- Account
summary: Delete a single Account
operationId: accountDelete
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: accountId
in: path
description: The ID of the Account on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The Account has been deleted
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
description: 'Delete the given account, according to the `accountId` path parameter.'
'/{scopeId}/accounts/_count':
post:
tags:
- Account
summary: Count the Accounts
operationId: accountCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
description: Returns the count of how many Accounts are present in the given Scope
'/{scopeId}/accounts/_query':
post:
tags:
- Account
summary: Query the Accounts
operationId: accountQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
allOf:
- allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
description: An UpdatableEntity that also has a name and a description
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
- properties:
organization:
type: object
properties:
name:
type: string
description: The Name of the Organization
addressLine1:
type: string
description: First line of the Address for the Organization
addressLine2:
type: string
description: Second line of the Address for the Organization
addressLine3:
type: string
description: Third line of the Address for the Organization
zipPostCode:
type: string
description: The Zip / Postcode for the Organization
city:
type: string
description: The City of the Organization
stateProvinceCounty:
type: string
description: The State / Province / County of the Organization
country:
type: string
description: The Country of the Organization
personName:
type: string
description: The Name of the Person listed as a Contact for the Organization
email:
type: string
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
description: An object containing all the informations related to the Organization who holds the account
expirationDate:
type: string
format: date-time
description: 'The Expiration date and time for the Account. If empty, the Account has no expiration'
parentAccountPath:
type: string
description: The full Scope ID Hierarchy for the Account
description: |
An object that holds all the informations pertaining an Account, including the details about the Contacts of that account.\
In Kapua an Account is the container of all other resources (Users, Devices, etc.), and is the equivalent of the concept of Tenant.\
Every entity in Kapua will have a `scopeId` property, that holds the ID of the Account who holds that entity.
example:
type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
description: A list container for Account objects
example:
type: accountListResult
size: 1
limitExceeded: false
items:
- type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
description: Returns a list of the Accounts matching the given query in the Scope. Predicates are not currently supported.
/authentication/user:
post:
tags:
- Authentication
summary: Login - User and Password
operationId: authenticationUser
requestBody:
content:
application/json:
schema:
type: object
properties:
username:
allOf:
- type: string
pattern: '^[a-zA-Z0-9\_\-]{3,}$'
password:
allOf:
- type: string
pattern: '^.*(?=.{12,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!\"\#$%&''()*+,\-./:;<=>?@\[\]\\^_`{|}~]).*$'
required:
- username
- password
examples:
kapua-sys:
description: Default kapua-sys login credentials
value:
username: kapua-sys
password: kapua-password
responses:
'200':
description: The new AccessToken
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
tokenId:
allOf:
- type: string
pattern: '^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$'
expiresOn:
type: string
format: date-time
invalidatedOn:
type: string
format: date-time
refreshToken:
type: string
format: uuid
refreshExpiresOn:
type: string
format: date-time
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
security: []
/authentication/apikey:
post:
tags:
- Authentication
summary: Login - API Key
operationId: authenticationApiKey
requestBody:
content:
application/json:
schema:
type: object
properties:
apiKey:
type: string
format: base64
required:
- apiKey
responses:
'200':
description: The new AccessToken
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
tokenId:
allOf:
- type: string
pattern: '^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$'
expiresOn:
type: string
format: date-time
invalidatedOn:
type: string
format: date-time
refreshToken:
type: string
format: uuid
refreshExpiresOn:
type: string
format: date-time
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
security: []
/authentication/refresh:
post:
tags:
- Authentication
summary: Refresh an AccessToken
operationId: authenticationRefresh
requestBody:
content:
application/json:
schema:
type: object
properties:
refreshToken:
type: string
format: uuid
tokenId:
type: string
pattern: '^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$'
required:
- refreshToken
- tokenId
responses:
'200':
description: The new AccessToken
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
tokenId:
allOf:
- type: string
pattern: '^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$'
expiresOn:
type: string
format: date-time
invalidatedOn:
type: string
format: date-time
refreshToken:
type: string
format: uuid
refreshExpiresOn:
type: string
format: date-time
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
security: []
/authentication/jwt:
post:
tags:
- Authentication
summary: Login - JWT
operationId: authenticationJwt
requestBody:
content:
application/json:
schema:
type: object
properties:
jwt:
type: string
pattern: '^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$'
required:
- jwt
responses:
'200':
description: The new AccessToken
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
tokenId:
allOf:
- type: string
pattern: '^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$'
expiresOn:
type: string
format: date-time
invalidatedOn:
type: string
format: date-time
refreshToken:
type: string
format: uuid
refreshExpiresOn:
type: string
format: date-time
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
security: []
/authentication/logout:
post:
tags:
- Authentication
summary: Logout
operationId: authenticationLogout
responses:
'200':
description: Logout Successful
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
tokenId:
allOf:
- type: string
pattern: '^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$'
expiresOn:
type: string
format: date-time
invalidatedOn:
type: string
format: date-time
refreshToken:
type: string
format: uuid
refreshExpiresOn:
type: string
format: date-time
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/credentials':
get:
tags:
- Credential
summary: Get all the Credentials
operationId: credentialList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
responses:
'200':
description: The list of the Credentials available in the Scope
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
description: An object containing all the information for a single Credential
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
loginFailures:
type: integer
firstLoginFailure:
type: string
format: date-time
loginFailuresReset:
type: string
format: date-time
lockoutReset:
type: string
format: date-time
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
post:
tags:
- Credential
summary: Create a new Credential
operationId: credentialCreate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object containing the properties for the new Credential to be created
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: An object that contains the informations needed to create an Entity
type: object
description: An object that contains the informations needed to create an Updatable Entity
type: object
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
credentialStatus:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
example:
userId: AQ
credentialType: PASSWORD
credentialKey: new-password-123!
credentialStatus: ENABLED
expirationDate: '2019-12-31T00:00:00.000Z'
examples:
password:
description: Password
value:
userId: AQ
credentialType: PASSWORD
credentialKey: new-password-123!
credentialStatus: ENABLED
expirationDate: '2019-12-31T00:00:00.000Z'
apikey:
description: API Key
value:
userId: AQ
credentialType: API_KEY
credentialStatus: ENABLED
expirationDate: '2019-12-31T00:00:00.000Z'
required: true
responses:
'200':
description: The Credential that has just been created
content:
application/json:
schema:
type: object
description: An object containing all the information for a single Credential
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
loginFailures:
type: integer
firstLoginFailure:
type: string
format: date-time
loginFailuresReset:
type: string
format: date-time
lockoutReset:
type: string
format: date-time
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/credentials/{credentialId}':
get:
tags:
- Credential
summary: Get a single Credential
operationId: credentialGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: credentialId
in: path
description: The ID of the Credential on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The details of the desired Credential
content:
application/json:
schema:
type: object
description: An object containing all the information for a single Credential
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
loginFailures:
type: integer
firstLoginFailure:
type: string
format: date-time
loginFailuresReset:
type: string
format: date-time
lockoutReset:
type: string
format: date-time
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
put:
tags:
- Credential
summary: Update a single Credential
operationId: credentialUpdate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: credentialId
in: path
description: The ID of the Credential on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
description: An object containing the new properties for the Credential to update
content:
application/json:
schema:
type: object
description: An object containing all the information for a single Credential
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
loginFailures:
type: integer
firstLoginFailure:
type: string
format: date-time
loginFailuresReset:
type: string
format: date-time
lockoutReset:
type: string
format: date-time
required: true
responses:
'200':
description: The details of the updated Credential
content:
application/json:
schema:
type: object
description: An object containing all the information for a single Credential
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
loginFailures:
type: integer
firstLoginFailure:
type: string
format: date-time
loginFailuresReset:
type: string
format: date-time
lockoutReset:
type: string
format: date-time
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
delete:
tags:
- Credential
summary: Delete a single Credential
operationId: credentialDelete
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: credentialId
in: path
description: The ID of the Credential on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The Credential has been deleted
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/credentials/_count':
post:
tags:
- Credential
summary: Count the Credentials
operationId: credentialCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/credentials/_query':
post:
tags:
- Credential
summary: Query the Credentials
operationId: credentialQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
description: An object containing all the information for a single Credential
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
loginFailures:
type: integer
firstLoginFailure:
type: string
format: date-time
loginFailuresReset:
type: string
format: date-time
lockoutReset:
type: string
format: date-time
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/credentials/{credentialId}/unlock':
post:
tags:
- Credential
summary: Unlock a Credential
operationId: credentialUnlock
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: credentialId
in: path
description: The ID of the Credential on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The Credential has been unlocked
content:
application/json:
schema:
type: object
description: An object containing all the information for a single Credential
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
loginFailures:
type: integer
firstLoginFailure:
type: string
format: date-time
loginFailuresReset:
type: string
format: date-time
lockoutReset:
type: string
format: date-time
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/channels':
get:
tags:
- Data Channel
summary: Query the Data Channels
operationId: dataChannelQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: clientId
in: query
schema:
type: string
description: The ClientID to filter results
- name: name
in: query
schema:
type: string
description: 'The channel name to filter results. It allows ''#'' wildcard in last channel level'
- name: limit
in: query
description: A Limit on the result size. The result set will not contain more items than this number
schema:
type: integer
default: 50
- name: offset
in: query
description: 'An Offset on the result size. Used to skip the first `n` items of a result set, with `n` equal to the value of `offset`'
schema:
type: integer
default: 0
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
properties:
id:
type: string
format: base64
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
clientId:
type: string
name:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: channelInfo
id: xny9A7OkTUcSYxJIGf3oMZHyZIvi4AcsFqJJbY1N2yg=
scopeId: AQ
clientId: Client-Id-1
name: ALERT
firstMessageId: 18739b9f-6d8b-42c2-a536-507b37dd5f2a
firstMessageOn: '2019-09-12T08:04:13.920Z'
lastMessageId: a3e69394-1c20-4446-b596-6fcc4a2028fe
lastMessageOn: '2019-09-12T08:14:13.230Z'
totalCount:
type: integer
example:
type: channelInfoListResult
limitExceeded: false
size: 3
totalCount: 3
items:
- type: channelInfo
id: xny9A7OkTUcSYxJIGf3oMZHyZIvi4AcsFqJJbY1N2yg=
scopeId: AQ
clientId: Client-Id-1
name: ALERT
firstMessageId: 18739b9f-6d8b-42c2-a536-507b37dd5f2a
firstMessageOn: '2019-09-12T08:04:13.920Z'
lastMessageId: a3e69394-1c20-4446-b596-6fcc4a2028fe
lastMessageOn: '2019-09-12T08:14:13.230Z'
- type: channelInfo
id: vkyqKinEY2/UhxHHz2XRsmz02NtRK5KCsA7Fa1ot6CI=
scopeId: AQ
clientId: Client-Id-1
name: DIAG
firstMessageId: 308b0c38-76fa-4530-bb68-8c4c285c1f17
firstMessageOn: '2019-09-12T08:04:13.887Z'
lastMessageId: 8c59cd10-f23e-435e-a523-0aa8e952da1e
lastMessageOn: '2019-09-12T09:04:49.710Z'
- type: channelInfo
id: X0BcZAV6FfD+Wi9n4x5VOdHmSV/E6UpOTetaqpXAb+w=
scopeId: AQ
clientId: Client-Id-1
name: heater/data
firstMessageId: 3cec54f7-9633-4a68-ad5b-48f57ea7f0f3
firstMessageOn: '2019-09-12T09:03:20.959Z'
lastMessageId: a8597968-d785-42dd-9e04-1f15d42df774
lastMessageOn: '2019-09-12T09:05:06.527Z'
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/channels/_count':
post:
tags:
- Data Channel
summary: Count the ChannelInfos
operationId: dataChannelCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/channels/{channelInfoId}':
get:
tags:
- Data Channel
summary: Get a single ChannelInfo
operationId: channelInfoGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: channelInfoId
in: path
description: The ID of the ChannelInfo on which to perform the operation
schema:
type: string
format: base64
required: true
responses:
'200':
description: The desired ChannelInfo
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: base64
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
clientId:
type: string
name:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: channelInfo
id: xny9A7OkTUcSYxJIGf3oMZHyZIvi4AcsFqJJbY1N2yg=
scopeId: AQ
clientId: Client-Id-1
name: ALERT
firstMessageId: 18739b9f-6d8b-42c2-a536-507b37dd5f2a
firstMessageOn: '2019-09-12T08:04:13.920Z'
lastMessageId: a3e69394-1c20-4446-b596-6fcc4a2028fe
lastMessageOn: '2019-09-12T08:14:13.230Z'
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/clients':
get:
tags:
- Data Client
summary: Query the Data Clients
operationId: dataClientQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: clientId
in: query
schema:
type: string
description: The ClientID to filter results
- name: limit
in: query
description: A Limit on the result size. The result set will not contain more items than this number
schema:
type: integer
default: 50
- name: offset
in: query
description: 'An Offset on the result size. Used to skip the first `n` items of a result set, with `n` equal to the value of `offset`'
schema:
type: integer
default: 0
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
properties:
id:
type: string
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
clientId:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: clientInfo
id: JOyqK0XfNrKYD5qcAe6MJyl3TMd6AjwzKnqQofb8USg=
scopeId: AQ
clientId: Client-Id-1
firstMessageId: a2320c45-6791-4525-a552-adb163928303
firstMessageOn: 2019-09-12T08:14:13.228Z
lastMessageId: bb07d7fc-dc62-492f-b8da-7e28df69e112
lastMessageOn: 2019-09-12T09:25:05.096Z
totalCount:
type: integer
example:
type: clientInfoListResult
limitExceeded: false
size: 1
items:
type: clientInfo
id: JOyqK0XfNrKYD5qcAe6MJyl3TMd6AjwzKnqQofb8USg=
scopeId: AQ
clientId: Client-Id-1
firstMessageId: a2320c45-6791-4525-a552-adb163928303
firstMessageOn: 2019-09-12T08:14:13.228Z
lastMessageId: bb07d7fc-dc62-492f-b8da-7e28df69e112
lastMessageOn: 2019-09-12T09:25:05.096Z
totalCount: 1
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/clients/_count':
post:
tags:
- Data Client
summary: Count the ClientInfos
operationId: dataClientCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/clients/{clientInfoId}':
get:
tags:
- Data Client
summary: Get a single ClientInfo
operationId: clientInfoGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: clientInfoId
in: path
description: The ID of the ClientInfo on which to perform the operation
schema:
type: string
required: true
responses:
'200':
description: The desired ClientInfo
content:
application/json:
schema:
type: object
properties:
id:
type: string
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
clientId:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: clientInfo
id: JOyqK0XfNrKYD5qcAe6MJyl3TMd6AjwzKnqQofb8USg=
scopeId: AQ
clientId: Client-Id-1
firstMessageId: a2320c45-6791-4525-a552-adb163928303
firstMessageOn: 2019-09-12T08:14:13.228Z
lastMessageId: bb07d7fc-dc62-492f-b8da-7e28df69e112
lastMessageOn: 2019-09-12T09:25:05.096Z
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/messages':
get:
tags:
- Data Message
summary: Query the Data Messages
operationId: dataMessageQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: clientId
in: query
schema:
type: string
- name: channel
in: query
schema:
type: string
- name: strictChannel
in: query
schema:
type: boolean
- name: startDate
in: query
schema:
type: string
format: date-time
- name: endDate
in: query
schema:
type: string
format: date-time
- name: metricName
in: query
schema:
type: string
- name: metricType
in: query
schema:
type: string
- name: metricMin
in: query
schema:
type: string
- name: metricMax
in: query
schema:
type: string
- name: limit
in: query
description: A Limit on the result size. The result set will not contain more items than this number
schema:
type: integer
default: 50
- name: offset
in: query
description: 'An Offset on the result size. Used to skip the first `n` items of a result set, with `n` equal to the value of `offset`'
schema:
type: integer
default: 0
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
properties:
datastoreId:
type: string
format: uuid
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
timestamp:
type: string
format: date-time
deviceId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
receivedOn:
type: string
format: date-time
sentOn:
type: string
format: date-time
capturedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
channel:
type: object
properties:
semanticParts:
type: array
items:
type: string
payload:
type: object
properties:
metrics:
type: array
items:
type: object
properties:
valueType:
type: string
value:
type: string
name:
type: string
body:
type: string
format: base64
required:
- clientId
- deviceId
example:
type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
scopeId: AQ
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
example:
type: storableListResult
limitExceeded: true
size: 2
items:
- type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:35:04.383Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20.25
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: -441478528
name: errorCode
receivedOn: '2019-09-12T09:35:04.389Z'
scopeId: AQ
sentOn: '2019-09-12T09:35:04.383Z'
datastoreId: 6349cec8-396b-4aac-bc2f-8fca9fe0c67c
timestamp: '2019-09-12T09:35:04.383Z'
- type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
scopeId: AQ
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
totalCount: 61
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
post:
tags:
- Data Message
summary: Store a new Message
operationId: dataMessageStore
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
content:
application/json:
schema:
type: object
properties:
datastoreId:
type: string
format: uuid
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
timestamp:
type: string
format: date-time
deviceId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
receivedOn:
type: string
format: date-time
sentOn:
type: string
format: date-time
capturedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
channel:
type: object
properties:
semanticParts:
type: array
items:
type: string
payload:
type: object
properties:
metrics:
type: array
items:
type: object
properties:
valueType:
type: string
value:
type: string
name:
type: string
body:
type: string
format: base64
required:
- clientId
- deviceId
example:
type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
scopeId: AQ
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
example:
type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
responses:
'200':
description: The ID of the new DataMessage
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
readOnly: true
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/messages/_count':
post:
tags:
- Data Message
summary: Count the MessageInfos
operationId: dataMessageCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/messages/{datastoreMessageId}':
get:
tags:
- Data Message
summary: Get a single DataMessage
operationId: dataMessageGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: datastoreMessageId
in: path
description: The ID of the MetricInfo on which to perform the operation
schema:
type: string
required: true
responses:
'200':
description: The desired DataMessage
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
properties:
datastoreId:
type: string
format: uuid
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
timestamp:
type: string
format: date-time
deviceId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
receivedOn:
type: string
format: date-time
sentOn:
type: string
format: date-time
capturedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
channel:
type: object
properties:
semanticParts:
type: array
items:
type: string
payload:
type: object
properties:
metrics:
type: array
items:
type: object
properties:
valueType:
type: string
value:
type: string
name:
type: string
body:
type: string
format: base64
required:
- clientId
- deviceId
example:
type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
scopeId: AQ
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
example:
type: storableListResult
limitExceeded: true
size: 2
items:
- type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:35:04.383Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20.25
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: -441478528
name: errorCode
receivedOn: '2019-09-12T09:35:04.389Z'
scopeId: AQ
sentOn: '2019-09-12T09:35:04.383Z'
datastoreId: 6349cec8-396b-4aac-bc2f-8fca9fe0c67c
timestamp: '2019-09-12T09:35:04.383Z'
- type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
scopeId: AQ
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
totalCount: 61
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/metrics':
get:
tags:
- Data Metric
summary: Query the Data Metrics
operationId: dataMetricQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: metricId
in: query
schema:
type: string
description: The MetricID to filter results
- name: limit
in: query
description: A Limit on the result size. The result set will not contain more items than this number
schema:
type: integer
default: 50
- name: offset
in: query
description: 'An Offset on the result size. Used to skip the first `n` items of a result set, with `n` equal to the value of `offset`'
schema:
type: integer
default: 0
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
properties:
id:
type: string
format: base64
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
clientId:
type: string
channel:
type: string
name:
type: string
metricType:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: metricInfo
id: oLVtE7wK67wO5Lxx4nZGsTEwbVjeo0xcFcnTvmhCxLU=
scopeId: AQ
clientId: Client-Id-1
channel: ALERT
name: alert_category
metricType: string
firstMessageId: c623d131-6f47-49af-9ba0-1474a90dd9ed
firstMessageOn: '2019-09-12T08:04:13.918Z'
lastMessageId: 653b4aee-e0d5-4af6-b120-ffc7c26057b9
lastMessageOn: '2019-09-12T09:24:48.352Z'
example:
type: metricInfoListResult
limitExceeded: false
size: 2
items:
- type: metricInfo
id: oLVtE7wK67wO5Lxx4nZGsTEwbVjeo0xcFcnTvmhCxLU=
scopeId: AQ
clientId: Client-Id-1
channel: ALERT
name: alert_category
metricType: string
firstMessageId: c623d131-6f47-49af-9ba0-1474a90dd9ed
firstMessageOn: '2019-09-12T08:04:13.918Z'
lastMessageId: 653b4aee-e0d5-4af6-b120-ffc7c26057b9
lastMessageOn: '2019-09-12T09:24:48.352Z'
- type: metricInfo
id: q2vErAArLQ2rs/4m3eGZf5p6gqrCT+qZKxbeNPQrc+Q=
scopeId: AQ
clientId: Client-Id-1
channel: ALERT
name: alert_code
metricType: string
firstMessageId: c623d131-6f47-49af-9ba0-1474a90dd9ed
firstMessageOn: '2019-09-12T08:04:13.918Z'
lastMessageId: 653b4aee-e0d5-4af6-b120-ffc7c26057b9
lastMessageOn: '2019-09-12T09:24:48.352Z'
totalCount: 35
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/metrics/_count':
post:
tags:
- Data Metric
summary: Count the MetricInfos
operationId: dataMetricCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/data/metrics/{metricInfoId}':
get:
tags:
- Data Metric
summary: Get a single MetricInfo
operationId: metricInfoGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: metricInfoId
in: path
description: The ID of the MetricInfo on which to perform the operation
schema:
type: string
required: true
responses:
'200':
description: The desired MetricInfo
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: base64
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
clientId:
type: string
channel:
type: string
name:
type: string
metricType:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: metricInfo
id: oLVtE7wK67wO5Lxx4nZGsTEwbVjeo0xcFcnTvmhCxLU=
scopeId: AQ
clientId: Client-Id-1
channel: ALERT
name: alert_category
metricType: string
firstMessageId: c623d131-6f47-49af-9ba0-1474a90dd9ed
firstMessageOn: '2019-09-12T08:04:13.918Z'
lastMessageId: 653b4aee-e0d5-4af6-b120-ffc7c26057b9
lastMessageOn: '2019-09-12T09:24:48.352Z'
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices':
get:
tags:
- Device
summary: Get all the Devices
operationId: deviceList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: fetchAttributes
in: query
schema:
type: array
items:
type: string
enum:
- connection
- lastEvent
responses:
'200':
description: The list of the Devices available in the Scope
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
description: A Device
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
readOnly: true
connectionId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
connection:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
status:
type: string
enum:
- ENABLED
- DISABLED
displayName:
type: string
lastEventId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
lastEvent:
type: object
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
- properties:
sentOn:
type: string
format: date-time
receivedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
resource:
type: string
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
tagIds:
type: array
items:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: device
id: dIVxI5QpFUI
scopeId: AQ
createdOn: '2019-09-12T12:08:12.179Z'
createdBy: AQ
modifiedOn: '2019-09-12T12:08:12.179Z'
modifiedBy: AQ
optlock: 1
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
examples:
standard:
value:
type: deviceListResult
limitExceeded: false
size: 1
items:
- type: device
id: WyczTs_GuDM
scopeId: AQ
createdOn: 2019-09-12T09:04:37.315Z
createdBy: Ag
modifiedOn: 2019-09-12T09:04:37.603Z
modifiedBy: Ag
optlock: 2
clientId: Client-Id-1
connectionId: Gd1BfeWwh3s
status: ENABLED
displayName: null
lastEventId: YYHQ2i1S-P0
serialNumber: ESF-Docker-RHEL
modelId: ESF-Docker-RHEL
modelName: ESF-Docker-RHEL
biosVersion: N/A
firmwareVersion: N/A
osVersion: 4.9.184-linuxkit
jvmVersion: 25.161-b12 mixed mode
osgiFrameworkVersion: 1.8.0
applicationFrameworkVersion: ESF_6.0.0
connectionInterface: 'lo (00:00:00:00:00:00)'
connectionIp: 127.0.0.1
applicationIdentifiers: heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1
acceptEncoding: gzip
tagIds: []
with-fetch-attributes:
value:
type: deviceListResult
limitExceeded: false
size: 1
items:
- type: device
id: WyczTs_GuDM
scopeId: AQ
createdOn: 2019-09-12T09:04:37.315Z
createdBy: Ag
modifiedOn: 2019-09-12T09:04:37.603Z
modifiedBy: Ag
optlock: 2
clientId: Client-Id-1
connectionId: Gd1BfeWwh3s
connection:
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: 2019-09-12T09:04:32.101Z
createdBy: Ag
modifiedOn: 2019-09-12T09:04:32.101Z
modifiedBy: Ag
optlock: 1
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:59596'
serverIp: broker
status: ENABLED
displayName: null
lastEventId: YYHQ2i1S-P0
lastEvent:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: 2019-09-12T09:04:37.392Z
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: 2019-09-12T09:04:32.646Z
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit'
serialNumber: ESF-Docker-RHEL
modelId: ESF-Docker-RHEL
modelName: ESF-Docker-RHEL
biosVersion: N/A
firmwareVersion: N/A
osVersion: 4.9.184-linuxkit
jvmVersion: 25.161-b12 mixed mode
osgiFrameworkVersion: 1.8.0
applicationFrameworkVersion: ESF_6.0.0
connectionInterface: 'lo (00:00:00:00:00:00)'
connectionIp: 127.0.0.1
applicationIdentifiers: heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1
acceptEncoding: gzip
tagIds: []
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
post:
tags:
- Device
summary: Create a new Device
operationId: deviceCreate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object containing the properties for the new Device to be created
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: An object that contains the informations needed to create an Entity
type: object
description: An object that contains the informations needed to create an Updatable Entity
type: object
- properties:
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
lastEventId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
displayName:
type: string
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
required:
- clientId
example:
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
deviceCredentialsMode: LOOSE
required: true
responses:
'200':
description: The Device that has just been created
content:
application/json:
schema:
type: object
description: A Device
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
readOnly: true
connectionId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
connection:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
status:
type: string
enum:
- ENABLED
- DISABLED
displayName:
type: string
lastEventId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
lastEvent:
type: object
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
- properties:
sentOn:
type: string
format: date-time
receivedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
resource:
type: string
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
tagIds:
type: array
items:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: device
id: dIVxI5QpFUI
scopeId: AQ
createdOn: '2019-09-12T12:08:12.179Z'
createdBy: AQ
modifiedOn: '2019-09-12T12:08:12.179Z'
modifiedBy: AQ
optlock: 1
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}':
get:
tags:
- Device
summary: Get a single Device
operationId: deviceGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The details of the desired Device
content:
application/json:
schema:
type: object
description: A Device
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
readOnly: true
connectionId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
connection:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
status:
type: string
enum:
- ENABLED
- DISABLED
displayName:
type: string
lastEventId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
lastEvent:
type: object
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
- properties:
sentOn:
type: string
format: date-time
receivedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
resource:
type: string
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
tagIds:
type: array
items:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: device
id: dIVxI5QpFUI
scopeId: AQ
createdOn: '2019-09-12T12:08:12.179Z'
createdBy: AQ
modifiedOn: '2019-09-12T12:08:12.179Z'
modifiedBy: AQ
optlock: 1
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
put:
tags:
- Device
summary: Update a single Device
operationId: deviceUpdate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
description: An object containing the new properties for the Device to update
content:
application/json:
schema:
type: object
description: A Device
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
readOnly: true
connectionId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
connection:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
status:
type: string
enum:
- ENABLED
- DISABLED
displayName:
type: string
lastEventId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
lastEvent:
type: object
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
- properties:
sentOn:
type: string
format: date-time
receivedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
resource:
type: string
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
tagIds:
type: array
items:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: device
id: dIVxI5QpFUI
scopeId: AQ
createdOn: '2019-09-12T12:08:12.179Z'
createdBy: AQ
modifiedOn: '2019-09-12T12:08:12.179Z'
modifiedBy: AQ
optlock: 1
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
example:
type: device
optlock: 1
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
required: true
responses:
'200':
description: The details of the updated Device
content:
application/json:
schema:
type: object
description: A Device
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
readOnly: true
connectionId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
connection:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
status:
type: string
enum:
- ENABLED
- DISABLED
displayName:
type: string
lastEventId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
lastEvent:
type: object
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
- properties:
sentOn:
type: string
format: date-time
receivedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
resource:
type: string
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
tagIds:
type: array
items:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: device
id: dIVxI5QpFUI
scopeId: AQ
createdOn: '2019-09-12T12:08:12.179Z'
createdBy: AQ
modifiedOn: '2019-09-12T12:08:12.179Z'
modifiedBy: AQ
optlock: 1
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
delete:
tags:
- Device
summary: Delete a single Device
operationId: deviceDelete
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The Device has been deleted
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/_query':
post:
tags:
- Device
summary: Query the Devices
operationId: deviceQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
description: A Device
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
groupId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
clientId:
type: string
readOnly: true
connectionId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
connection:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
status:
type: string
enum:
- ENABLED
- DISABLED
displayName:
type: string
lastEventId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
- readOnly: true
lastEvent:
type: object
allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
- properties:
sentOn:
type: string
format: date-time
receivedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
resource:
type: string
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
tagIds:
type: array
items:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: device
id: dIVxI5QpFUI
scopeId: AQ
createdOn: '2019-09-12T12:08:12.179Z'
createdBy: AQ
modifiedOn: '2019-09-12T12:08:12.179Z'
modifiedBy: AQ
optlock: 1
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/_count':
post:
tags:
- Device
summary: Count the Devices
operationId: deviceCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/assets':
get:
tags:
- Device Asset
summary: Get the Assets Definitions of a single Device
operationId: deviceAssetList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
responses:
'200':
description: The list of Assets definition of a single Device
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
mode:
type: string
enum:
- READ
- WRITE
- READ_WRITE
name:
type: string
valueType:
type: string
example:
valueType: integer
name: Channel-1
mode: READ
name:
type: string
example:
name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
type: deviceAssets
deviceAsset:
- name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
- name: asset2
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
post:
tags:
- Device Asset
summary: Get the Assets Definitions of a single Device
operationId: deviceAssetListFiltered
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
requestBody:
description: An object containing the list of Assets to use as a filter
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
mode:
type: string
enum:
- READ
- WRITE
- READ_WRITE
name:
type: string
valueType:
type: string
example:
valueType: integer
name: Channel-1
mode: READ
name:
type: string
example:
name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
type: deviceAssets
deviceAsset:
- name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
- name: asset2
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
deviceAsset:
- name: asset2
responses:
'200':
description: The list of Assets definition of a single Device according to the filter
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
mode:
type: string
enum:
- READ
- WRITE
- READ_WRITE
name:
type: string
valueType:
type: string
example:
valueType: integer
name: Channel-1
mode: READ
name:
type: string
example:
name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
type: deviceAssets
deviceAsset:
- name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
- name: asset2
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
type: deviceAssets
deviceAsset:
- name: asset2
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/assets/_read':
post:
tags:
- Device Asset
summary: Read the values for the Assets of a single Device
operationId: deviceAssetRead
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
requestBody:
description: An object containing the list of Assets to use as a filter
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
mode:
type: string
enum:
- READ
- WRITE
- READ_WRITE
name:
type: string
valueType:
type: string
example:
valueType: integer
name: Channel-1
mode: READ
name:
type: string
example:
name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
type: deviceAssets
deviceAsset:
- name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
- name: asset2
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
deviceAsset:
- name: asset2
required: true
responses:
'200':
description: The Asset list for the desired Device complete with values
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
name:
type: string
valueType:
type: string
value:
type: string
timestamp:
type: string
format: date-time
example:
valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
name:
type: string
example:
name: asset2
channels:
- valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
- valueType: integer
value: 8
name: Channel-3
timestamp: '2019-09-12T14:50:24.446Z'
example:
type: deviceAssets
deviceAsset:
- name: asset2
channels:
- valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
- valueType: integer
value: 8
name: Channel-3
timestamp: '2019-09-12T14:50:24.446Z'
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/assets/_write':
post:
tags:
- Device Asset
summary: Write the values for the Assets of a single Device
operationId: deviceAssetWrite
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
requestBody:
description: An Asset list to be updated on the desired Devica
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
name:
type: string
valueType:
type: string
value:
type: string
timestamp:
type: string
format: date-time
example:
valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
name:
type: string
example:
name: asset2
channels:
- valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
- valueType: integer
value: 8
name: Channel-3
timestamp: '2019-09-12T14:50:24.446Z'
example:
type: deviceAssets
deviceAsset:
- name: asset2
channels:
- valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
- valueType: integer
value: 8
name: Channel-3
timestamp: '2019-09-12T14:50:24.446Z'
example:
type: deviceAssets
deviceAsset:
name: asset2
channels:
- valueType: integer
value: 12
name: Channel-2
- valueType: integer
value: 80
name: Channel-3
required: true
responses:
'200':
description: The updated Asset list for the desired Device with updated values
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
name:
type: string
valueType:
type: string
value:
type: string
timestamp:
type: string
format: date-time
example:
valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
name:
type: string
example:
name: asset2
channels:
- valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
- valueType: integer
value: 8
name: Channel-3
timestamp: '2019-09-12T14:50:24.446Z'
example:
type: deviceAssets
deviceAsset:
- name: asset2
channels:
- valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
- valueType: integer
value: 8
name: Channel-3
timestamp: '2019-09-12T14:50:24.446Z'
example:
type: deviceAssets
deviceAsset: null
name: asset2
channels:
- valueType: integer
value: 12
name: Channel-2
timestamp: '2019-09-12T15:40:18.278Z'
- valueType: integer
value: 80
name: Channel-3
timestamp: '2019-09-12T15:40:18.278Z'
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/bundles':
get:
tags:
- Device Bundle
summary: Get the Bundles installed on a single Device
operationId: deviceBundleList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
responses:
'200':
description: The list of Bundles installed on a single Device
content:
application/json:
schema:
type: object
properties:
bundle:
type: array
items:
type: object
description: A Device Bundle
properties:
id:
type: integer
name:
type: string
state:
type: string
version:
type: string
example:
id: 0
name: org.eclipse.osgi
state: ACTIVE
version: 3.12.50.v20170928-1321
example:
type: deviceBundles
bundle:
- id: 0
name: org.eclipse.osgi
state: ACTIVE
version: 3.12.50.v20170928-1321
- id: 1
name: org.eclipse.equinox.cm
state: ACTIVE
version: 1.2.0.v20170105-1446
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/bundles/{bundleId}/_start':
post:
tags:
- Device Bundle
summary: Start the desired Bundle on a single Device
operationId: deviceBundleStart
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: bundleId
in: path
description: The ID of the Bundle on which to perform the operation
schema:
type: string
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
responses:
'200':
description: The Bundle has been successfully started
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/bundles/{bundleId}/_stop':
post:
tags:
- Device Bundle
summary: Stop the desired Bundle on a single Device
operationId: deviceBundleStop
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: bundleId
in: path
description: The ID of the Bundle on which to perform the operation
schema:
type: string
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
responses:
'200':
description: The Bundle has been successfully stopped
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/commands/_execute':
post:
tags:
- Device Command
summary: Execute a Command
operationId: deviceCommandExecute
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
requestBody:
content:
application/json:
schema:
type: object
description: A Device Command
properties:
command:
type: string
password:
type: string
format: password
arguments:
type: array
items:
type: string
timeout:
type: integer
workingDir:
type: string
body:
type: string
format: base64
environment:
type: array
items:
type: string
runAsynch:
type: boolean
stdin:
type: string
example:
command: ls
arguments:
argument: '-lisa'
timeout: 60000
required: true
responses:
'200':
description: The output of the Command executed on a single Device
content:
application/json:
schema:
type: object
properties:
stderr:
type: string
stdout:
type: string
exceptionMessage:
type: string
exceptionStack:
type: string
exitCode:
type: integer
hasTimedout:
type: boolean
example:
type: deviceCommandOutput
stderr: ''
stdout: |
total 40
12503707 4 drwxrwxrwt 1 root root 4096 Sep 13 07:44 .
12507178 4 drwxr-xr-x 1 root root 4096 Sep 12 08:03 ..
61409843 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .ICE-unix
61409845 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .Test-unix
61409838 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .X11-unix
61409844 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .XIM-unix
61409846 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .font-unix
12503708 4 drwxr-xr-x 3 root root 4096 Sep 12 08:03 .kura
12507353 4 drwxr-xr-x 2 root root 4096 Sep 12 08:03 hsperfdata_root
12507385 4 drwxr-xr-x 3 root root 4096 Sep 12 08:03 kura
exitCode: 0
hasTimedout: false
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/configurations':
get:
tags:
- Device Configuration
summary: Read multiple Configurations
operationId: deviceConfigurationsRead
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
responses:
'200':
description: The list of the Configurations on a single Device
content:
application/json:
schema:
type: object
properties:
configuration:
type: array
items:
type: object
properties:
id:
type: string
definition:
type: object
properties:
id:
type: string
AD:
type: array
items:
type: object
properties:
Option:
type: array
items:
type: object
properties:
label:
type: string
value:
type: string
default:
type: string
type:
type: object
cardinality:
type: integer
min:
type: string
max:
type: string
description:
type: string
id:
type: string
required:
type: boolean
name:
type: string
example:
cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon:
type: array
items:
type: object
properties:
resource:
type: string
size:
type: integer
name:
type: string
description:
type: string
properties:
type: object
properties:
property:
type: array
items:
type: object
properties:
name:
type: string
array:
type: boolean
encrypted:
type: boolean
type:
type: string
value:
type: array
items:
type: string
example:
name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
example:
id: org.eclipse.kura.wire.graph.WireGraphService
definition:
description: WireGraphService metatype
id: org.eclipse.kura.wire.graph.WireGraphService
name: WireGraphService
AD:
- cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon: []
properties:
property:
- name: WireGraph
array: false
encrypted: false
type: String
value:
- '{"components":[{"pid":"asset1","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-580,"y":-120},"inputPortNames":{},"outputPortNames":{}}},{"pid":"asset2","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-1100,"y":-100},"inputPortNames":{},"outputPortNames":{}}}],"wires":[]}'
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
- name: service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
example:
type: deviceConfiguration
configuration:
- id: org.eclipse.kura.wire.graph.WireGraphService
definition:
description: WireGraphService metatype
id: org.eclipse.kura.wire.graph.WireGraphService
name: WireGraphService
AD:
- cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon: []
properties:
property:
- name: WireGraph
array: false
encrypted: false
type: String
value:
- '{"components":[{"pid":"asset1","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-580,"y":-120},"inputPortNames":{},"outputPortNames":{}}},{"pid":"asset2","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-1100,"y":-100},"inputPortNames":{},"outputPortNames":{}}}],"wires":[]}'
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
- name: service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
put:
tags:
- Device Configuration
summary: Update multiple Configurations
operationId: deviceConfigurationsWrite
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
requestBody:
content:
application/json:
schema:
type: object
properties:
configuration:
type: array
items:
type: object
properties:
id:
type: string
properties:
type: object
properties:
property:
type: array
items:
type: object
properties:
name:
type: string
array:
type: boolean
encrypted:
type: boolean
type:
type: string
value:
type: array
items:
type: string
example:
name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
example:
configuration:
- id: org.eclipse.kura.wire.graph.WireGraphService
properties:
property:
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
required: true
responses:
'200':
description: The list of the Configurations on a single Device
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/devices/{deviceId}/configurations/{componentId}':
get:
tags:
- Device Configuration
summary: Read a single Configuration
operationId: deviceConfigurationRead
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: componentId
in: path
description: The ID of the Component on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
responses:
'200':
description: The Configuration details of a single Service on a single Device
content:
application/json:
schema:
type: object
properties:
configuration:
type: array
items:
type: object
properties:
id:
type: string
definition:
type: object
properties:
id:
type: string
AD:
type: array
items:
type: object
properties:
Option:
type: array
items:
type: object
properties:
label:
type: string
value:
type: string
default:
type: string
type:
type: object
cardinality:
type: integer
min:
type: string
max:
type: string
description:
type: string
id:
type: string
required:
type: boolean
name:
type: string
example:
cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon:
type: array
items:
type: object
properties:
resource:
type: string
size:
type: integer
name:
type: string
description:
type: string
properties:
type: object
properties:
property:
type: array
items:
type: object
properties:
name:
type: string
array:
type: boolean
encrypted:
type: boolean
type:
type: string
value:
type: array
items:
type: string
example:
name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
example:
id: org.eclipse.kura.wire.graph.WireGraphService
definition:
description: WireGraphService metatype
id: org.eclipse.kura.wire.graph.WireGraphService
name: WireGraphService
AD:
- cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon: []
properties:
property:
- name: WireGraph
array: false
encrypted: false
type: String
value:
- '{"components":[{"pid":"asset1","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-580,"y":-120},"inputPortNames":{},"outputPortNames":{}}},{"pid":"asset2","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-1100,"y":-100},"inputPortNames":{},"outputPortNames":{}}}],"wires":[]}'
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
- name: service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
example:
type: deviceConfiguration
configuration:
- id: org.eclipse.kura.wire.graph.WireGraphService
definition:
description: WireGraphService metatype
id: org.eclipse.kura.wire.graph.WireGraphService
name: WireGraphService
AD:
- cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon: []
properties:
property:
- name: WireGraph
array: false
encrypted: false
type: String
value:
- '{"components":[{"pid":"asset1","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-580,"y":-120},"inputPortNames":{},"outputPortNames":{}}},{"pid":"asset2","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-1100,"y":-100},"inputPortNames":{},"outputPortNames":{}}}],"wires":[]}'
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
- name: service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
put:
tags:
- Device Configuration
summary: Update a single Configuration
operationId: deviceConfigurationWrite
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: componentId
in: path
description: The ID of the Component on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
requestBody:
content:
application/json:
schema:
type: object
properties:
id:
type: string
properties:
type: object
properties:
property:
type: array
items:
type: object
properties:
name:
type: string
array:
type: boolean
encrypted:
type: boolean
type:
type: string
value:
type: array
items:
type: string
example:
name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
required: true
responses:
'200':
description: Updates the Configuration details of a single Service on a single Device
content:
application/json:
schema:
type: object
properties:
id:
type: string
definition:
type: object
properties:
id:
type: string
AD:
type: array
items:
type: object
properties:
Option:
type: array
items:
type: object
properties:
label:
type: string
value:
type: string
default:
type: string
type:
type: object
cardinality:
type: integer
min:
type: string
max:
type: string
description:
type: string
id:
type: string
required:
type: boolean
name:
type: string
example:
cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon:
type: array
items:
type: object
properties:
resource:
type: string
size:
type: integer
name:
type: string
description:
type: string
properties:
type: object
properties:
property:
type: array
items:
type: object
properties:
name:
type: string
array:
type: boolean
encrypted:
type: boolean
type:
type: string
value:
type: array
items:
type: string
example:
name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
example:
id: org.eclipse.kura.wire.graph.WireGraphService
definition:
description: WireGraphService metatype
id: org.eclipse.kura.wire.graph.WireGraphService
name: WireGraphService
AD:
- cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon: []
properties:
property:
- name: WireGraph
array: false
encrypted: false
type: String
value:
- '{"components":[{"pid":"asset1","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-580,"y":-120},"inputPortNames":{},"outputPortNames":{}}},{"pid":"asset2","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-1100,"y":-100},"inputPortNames":{},"outputPortNames":{}}}],"wires":[]}'
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
- name: service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/deviceconnections':
get:
tags:
- Device Connection
summary: Get all the Connections
operationId: connectionList
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
responses:
'200':
description: The list of the Connections available in the Scope
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
example:
type: deviceConnectionListResult
limitExceeded: false
size: 1
items:
- type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/deviceconnections/{connectionId}':
get:
tags:
- Device Connection
summary: Get a single Connection
operationId: connectionGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: connectionId
in: path
description: The ID of the Connection on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The details of the desired Connection
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/deviceconnections/{connectionId}/options':
get:
tags:
- Device Connection
summary: Get the option for a Connection
operationId: connectionOptionGet
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: connectionId
in: path
description: The ID of the Connection on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
responses:
'200':
description: The Options of the desired Connection
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: deviceConnectionOption
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
allowUserChange: false
userCouplingMode: INHERITED
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
put:
tags:
- Device Connection
summary: Update the option for a Connection
operationId: connectionOptionUpdate
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
- name: connectionId
in: path
description: The ID of the Connection on which to perform the operation
schema:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
required: true
requestBody:
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: deviceConnectionOption
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
allowUserChange: false
userCouplingMode: INHERITED
responses:
'200':
description: The updated Options of the desired Connection
content:
application/json:
schema:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
- properties:
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
example:
type: deviceConnectionOption
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
allowUserChange: false
userCouplingMode: INHERITED
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'404':
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/deviceconnections/_count':
post:
tags:
- Device Connection
summary: Count the Connections
operationId: connectionCount
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The count of the available Entities
content:
application/json:
schema:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
'403':
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
'500':
description: An error occurred while performing the request
content:
application/json:
schema:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
'/{scopeId}/deviceconnections/_query':
post:
tags:
- Device Connection
summary: Query the Connections
operationId: connectionQuery
parameters:
- name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
default: _
required: true
requestBody:
description: An object to specify Query options
content:
application/json:
schema:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
- properties:
items:
type: array
items:
type: object
allOf:
- allOf:
- description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who created this Entity
readOnly: true
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
openapi: 3.0.2
info:
title: Eclipse Kapua REST API
version: '1.0'
contact:
name: Eclipse Kapua Dev Team
url: 'https://eclipse.org/kapua'
email: kapua-dev@eclipse.org
license:
name: Eclipse Public License 2.0
url: 'https://www.eclipse.org/legal/epl-2.0'
description: |
# Introduction
Eclipse Kapua exposes a comprehensive set of Web Service APIs for application integration purposes. The Eclipse Kapua REST API allows you to build applications that use Representational State Transfer HTTP calls to retrieve, modify, or publish platform data. For example through the APIs, you are able to access all the functionality of the Console or to control a device from your application built on top of Eclipse Kapua.
The Eclipse Kapua platform conforms to standard REpresentational State Transfer (REST) protocol to expose its Application Programming Interfaces (API). REST has emerged over the past few years as a predominant Web service design model. REST-style architectures consist of clients and servers. Clients initiate requests to servers, while servers process requests and return appropriate responses. Requests and responses are built around the transfer of representations of resources. A resource can be essentially any coherent and meaningful concept that may be addressed. A representation of a resource is typically a document that captures the current or intended state of a resource
Eclipse Kapua RESTful APIs expose the standard action types (create, read, update, delete) over the platform objects. They are capable of retrieving a resource representation in XML or JSON format. You can use the REST HTTP Accept Header to specify the representation requested using the "application/xml" and "application/json" Media Types. As an alternative to the Accept header, you can specify the requested data representation by appending an ".xml" or ".json" suffix to the path part of your request URLs
For more details on the Eclipse Kapua REST APIs, please refer to:
- [The Eclipse Kapua Documentation](https://www.eclipse.org/kapua/documentation.php)
- [The Eclipse Kapua Code on github](https://github.com/eclipse/kapua)
# Authentication
All Eclipse Kapua REST API, except the Authentication endpoints that performs an Authentication, need an Authentication Token to be executed. You will retrieve such token as a response of one of the Authentication calls, in the form of a [JWT](https://jwt.io) as the value of the property `tokenId`. For every subsequent call, you need to pass such token in the `Authorization` HTTP Header, with the `Bearer` type
# Scopes
In Kapua, every resource is always assigned to one and only one Scope, and can be accessed only by Users with Permissions on that Scope. Hence, a Scope represents a single Tenant, and in Kapua corresponds to an `Account`
servers:
- description: Localhost Docker Compose
url: 'http://localhost:8081/v1'
paths:
'/{scopeId}/accessinfos':
get:
tags:
- Access Info
summary: Get all the AccessInfo
operationId: accessInfoList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the AccessInfo objects available in the Scope
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaListResult'
description: A container for a list of AccessInfo objects
type: object
properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/responses/200/content/application~1json/schema'
example:
type: accessInfoListResult
limitExceeded: false
size: 2
items:
- type: accessInfo
id: Ag
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: Ag
- type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Access Info
summary: Create an AccessInfo
operationId: accessInfoCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: The AccessInfoCreator object to create the new AccessInfo
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaEntityCreator'
description: An object that contains the informations needed to create an AccessInfo
type: object
properties:
permissions:
description: An Array of Permission objects to attach to the new AccessInfo
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions/post/requestBody/content/application~1json/schema/properties/permission'
userId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the User to which the AcessInfo will be assigned
roleIds:
description: An Array of IDs whose Roles will be attached to the new AccessInfo
type: array
items:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The AccessInfo that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}':
get:
tags:
- Access Info
summary: Get a single AccessInfo
operationId: accessInfoGet
parameters:
- $ref: '#/components/parameters/scopeId'
- description: The ID of the AccessInfo on which to perform the operation
name: accessInfoId
in: path
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired AccessInfo
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntity'
description: An AccessInfo represents all the security objects (Roles and Permissions) that can be attached to a User. There will be exactly one AccessInfo object for every User
type: object
properties:
userId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the User to which this AccessInfo is attached to
example:
type: accessInfo
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.799Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.799Z'
modifiedBy: AQ
optlock: 0
userId: AQ
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Access Info
summary: Delete a single AccessInfo
operationId: accessInfoDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
responses:
'200':
description: The AccessInfo has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/_count':
post:
tags:
- Access Info
summary: Count the AccessInfos
operationId: accessInfoCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/_query':
post:
tags:
- Access Info
summary: Query the AccessInfos
operationId: accessInfoQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}/permissions':
get:
tags:
- Access Permission
summary: Get all the AccessPermissions
operationId: accessPermissionList
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
responses:
'200':
description: The list of the AccessPermission objects available in the Scope
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaListResult'
description: A container for a list of AccessPermission objects
type: object
properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions~1%7BaccessPermissionId%7D/get/responses/200/content/application~1json/schema'
example:
type: accessPermissionListResult
limitExceeded: false
size: 1
items:
- type: accessPermission
id: Io4dVUnrBtE
scopeId: AQ
createdOn: 2019-09-11T14:14:15.786Z
createdBy: AQ
accessInfoId: FPRcCYjzgqs
permission:
domain: broker
action: connect
forwardable: false
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Access Permission
summary: Create an AccessPermission
operationId: accessPermissionCreate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
requestBody:
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaEntityCreator'
description: An object that contains the informations needed to create an AccessPermission
type: object
properties:
accessInfoId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the AccessInfo to which attach the Permission
permission:
description: The representation of a Permission
type: object
properties:
domain:
description: The domain name in which the Permission acts. `*` means "Any Domains"
type: string
action:
description: The action that is permitted. `*` means "Any Action in the given Domain"
type: string
groupId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the Group to which the Permission applies. A `null` value means "Any group in the Scope"
targetScopeId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The Scope ID to which the Permission applies. A `null` value means "Any scope in the system"
forwardable:
description: 'When `true`, this permission is also active descending the entire Accounts hierarchy'
type: boolean
required:
- domain
- action
required:
- accessInfoId
- permission
responses:
'200':
description: The AccessPermission that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}/permissions/{accessPermissionId}':
get:
tags:
- Access Permission
summary: Get a single AccessPermission
operationId: accessPermissionGet
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
- name: accessPermissionId
in: path
description: The ID of the AccessPermission on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired AccessPermission
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaEntity'
description: An object that represents the link between an AccessInfo and a Permission
type: object
properties:
accessInfoId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the AccessInfo
permission:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions/post/requestBody/content/application~1json/schema/properties/permission'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Access Permission
summary: Delete a single AccessPermission
operationId: accessPermissionDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions~1%7BaccessPermissionId%7D/get/parameters/2'
responses:
'200':
description: The AccessPermission has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}/permissions/_count':
post:
tags:
- Access Permission
summary: Count the AccessPermissions
operationId: accessPermissionCount
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}/permissions/_query':
post:
tags:
- Access Permission
summary: Query the AccessPermissions
operationId: accessPermissionQuery
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}/roles':
get:
tags:
- Access Role
summary: Get all the AccessRoles
operationId: accessRolesList
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
responses:
'200':
description: The list of the AccessRole objects available in the Scope
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaListResult'
description: A container for a list of AccessRole objects
type: object
properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1roles~1%7BaccessRoleId%7D/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Access Role
summary: Create an AccessRole
operationId: accessRoleCreate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
requestBody:
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaEntityCreator'
description: An object that contains the informations needed to create an AccessRole
type: object
properties:
accessInfoId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the AccessInfo to which attach the Permission
roleId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the AccessInfo
required:
- accessInfoId
- roleId
responses:
'200':
description: The AccessRole that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1roles/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}/roles/{accessRoleId}':
get:
tags:
- Access Role
summary: Get a single AccessRole
operationId: accessRoleGet
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
- name: accessRoleId
in: path
description: The ID of the AccessRole on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired AccessRole
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaEntity'
description: An object that represents the link between an AccessInfo and a Role
type: object
properties:
accessInfoId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the AccessInfo
roleId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the Role attached to the AccessInfo
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Access Role
summary: Delete a single AccessRole
operationId: accessRoleDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1roles~1%7BaccessRoleId%7D/get/parameters/2'
responses:
'200':
description: The AccessRole has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}/roles/_count':
post:
tags:
- Access Role
summary: Count the AccessRoles
operationId: accessRoleCount
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accessinfos/{accessInfoId}/roles/_query':
post:
tags:
- Access Role
summary: Query the AccessRoles
operationId: accessRoleQuery
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D/get/parameters/1'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1roles/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accounts':
get:
tags:
- Account
summary: Get all the Accounts
operationId: accountList
parameters:
- $ref: '#/components/parameters/scopeId'
- name: name
in: query
description: An optional string to filter Accounts according to their name
schema:
type: string
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
responses:
'200':
description: The list of the Accounts available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1accounts~1%7BaccountId%7D/put/requestBody/content/application~1json/schema'
description: A list container for Account objects
example:
type: accountListResult
size: 1
limitExceeded: false
items:
- type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
description: Get all the Accounts in the given Scope
post:
tags:
- Account
summary: Create a new Account
operationId: accountCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: An object containing the properties for the new Account to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntityCreator'
- properties:
organizationName:
type: string
description: The Name of the Organization
organizationAddressLine1:
type: string
description: First line of the Address for the Organization
organizationAddressLine2:
type: string
description: Second line of the Address for the Organization
organizationAddressLine3:
type: string
description: Third line of the Address for the Organization
organizationZipPostCode:
type: string
description: The Zip / Postcode for the Organization
organizationCity:
type: string
description: The City of the Organization
organizationStateProvinceCounty:
type: string
description: The State / Province / County of the Organization
organizationCountry:
type: string
description: The Country of the Organization
organizatioPpersonName:
type: string
description: The Name of the Person listed as a Contact for the Organization
organizationEmail:
type: string
format: email
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
expirationDate:
type: string
format: date-time
description: The Expiration date and time for the Account
required:
- organizationName
- organizationEmail
description: An object with all the information needed to create a new Account
example:
name: acme-inc
organizationName: ACME Inc.
organizationEmail: wile.coyote@acme.inc
organizationAddressLine1: 123 Looney Tunes Drive
organizationAddressLine2: Block 1
organizationAddressLine3: Apartment 25
organizationZipPostCode: '00100'
organizationCity: Somewhere City
organizationStateProvinceCounty: 'Green County, GC'
organizationCountry: United States
organizationPersonName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
expirationDate: '2019-31-12T00:00:00.000Z'
required: true
responses:
'200':
description: The Account that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accounts~1%7BaccountId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/accounts/{accountId}':
get:
tags:
- Account
summary: Get a single Account
operationId: accountGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: accountId
in: path
description: The ID of the Account on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Account
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accounts~1%7BaccountId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
description: 'Get the details of a given Account, according to the `accountId` path parameter.'
put:
tags:
- Account
summary: Update a single Account
operationId: accountUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accounts~1%7BaccountId%7D/get/parameters/1'
requestBody:
description: An object containing the new properties for the Account to update
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntity'
- properties:
organization:
type: object
properties:
name:
type: string
description: The Name of the Organization
addressLine1:
type: string
description: First line of the Address for the Organization
addressLine2:
type: string
description: Second line of the Address for the Organization
addressLine3:
type: string
description: Third line of the Address for the Organization
zipPostCode:
type: string
description: The Zip / Postcode for the Organization
city:
type: string
description: The City of the Organization
stateProvinceCounty:
type: string
description: The State / Province / County of the Organization
country:
type: string
description: The Country of the Organization
personName:
type: string
description: The Name of the Person listed as a Contact for the Organization
email:
type: string
description: The Email Address of the Person listed as a Contact for the Organization
phoneNumber:
type: string
description: The Phone Number of the Person listed as a Contact for the Organization
description: An object containing all the informations related to the Organization who holds the account
expirationDate:
type: string
format: date-time
description: 'The Expiration date and time for the Account. If empty, the Account has no expiration'
parentAccountPath:
type: string
description: The full Scope ID Hierarchy for the Account
description: |
An object that holds all the informations pertaining an Account, including the details about the Contacts of that account.\
In Kapua an Account is the container of all other resources (Users, Devices, etc.), and is the equivalent of the concept of Tenant.\
Every entity in Kapua will have a `scopeId` property, that holds the ID of the Account who holds that entity.
example:
type: account
id: LgJHjS2jvdE
scopeId: AQ
createdOn: '2019-09-09T10:21:03.775Z'
createdBy: AQ
modifiedOn: '2019-09-09T10:21:03.789Z'
modifiedBy: AQ
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: 'Green County, GC'
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
example:
type: account
optlock: 2
name: acme-inc
expirationDate: '2019-31-12T00:00:00.000Z'
organization:
addressLine1: 123 Looney Tunes Drive
addressLine2: Block 1
addressLine3: Apartment 25
city: Somewhere City
country: United States
email: wile.coyote@acme.inc
name: ACME Inc.
personName: Wile Ethelbert Coyote
phoneNumber: +1 (555) 123 4567
stateProvinceCounty: Green County GC
zipPostCode: '00100'
parentAccountPath: /1/3315290947379772881
required: true
responses:
'200':
description: The details of the updated Account
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accounts~1%7BaccountId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
description: 'Update the details of a given Account, according to the `accountId` path parameter. Please note that some fields may be readonly for integrity purposes.'
delete:
tags:
- Account
summary: Delete a single Account
operationId: accountDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1accounts~1%7BaccountId%7D/get/parameters/1'
responses:
'200':
description: The Account has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
description: 'Delete the given account, according to the `accountId` path parameter.'
'/{scopeId}/accounts/_count':
post:
tags:
- Account
summary: Count the Accounts
operationId: accountCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
description: Returns the count of how many Accounts are present in the given Scope
'/{scopeId}/accounts/_query':
post:
tags:
- Account
summary: Query the Accounts
operationId: accountQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1accounts/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
description: Returns a list of the Accounts matching the given query in the Scope. Predicates are not currently supported.
/authentication/user:
post:
tags:
- Authentication
summary: Login - User and Password
operationId: authenticationUser
requestBody:
content:
application/json:
schema:
type: object
properties:
username:
allOf:
- type: string
pattern: '^[a-zA-Z0-9\_\-]{3,}$'
password:
allOf:
- type: string
pattern: '^.*(?=.{12,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!\"\#$%&''()*+,\-./:;<=>?@\[\]\\^_`{|}~]).*$'
required:
- username
- password
examples:
kapua-sys:
description: Default kapua-sys login credentials
value:
username: kapua-sys
password: kapua-password
responses:
'200':
description: The new AccessToken
content:
application/json:
schema:
$ref: '#/paths/~1authentication~1jwt/post/responses/200/content/application~1json/schema'
'500':
$ref: '#/components/responses/kapuaError'
security: []
/authentication/apikey:
post:
tags:
- Authentication
summary: Login - API Key
operationId: authenticationApiKey
requestBody:
content:
application/json:
schema:
type: object
properties:
apiKey:
type: string
format: base64
required:
- apiKey
responses:
'200':
description: The new AccessToken
content:
application/json:
schema:
$ref: '#/paths/~1authentication~1jwt/post/responses/200/content/application~1json/schema'
'500':
$ref: '#/components/responses/kapuaError'
security: []
/authentication/refresh:
post:
tags:
- Authentication
summary: Refresh an AccessToken
operationId: authenticationRefresh
requestBody:
content:
application/json:
schema:
type: object
properties:
refreshToken:
type: string
format: uuid
tokenId:
$ref: '#/paths/~1authentication~1jwt/post/requestBody/content/application~1json/schema/properties/jwt'
required:
- refreshToken
- tokenId
responses:
'200':
description: The new AccessToken
content:
application/json:
schema:
$ref: '#/paths/~1authentication~1jwt/post/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
security: []
/authentication/jwt:
post:
tags:
- Authentication
summary: Login - JWT
operationId: authenticationJwt
requestBody:
content:
application/json:
schema:
type: object
properties:
jwt:
type: string
pattern: '^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.?[A-Za-z0-9-_.+/=]*$'
required:
- jwt
responses:
'200':
description: The new AccessToken
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntity'
- properties:
userId:
allOf:
- $ref: '#/components/schemas/kapuaId'
tokenId:
allOf:
- $ref: '#/paths/~1authentication~1jwt/post/requestBody/content/application~1json/schema/properties/jwt'
expiresOn:
type: string
format: date-time
invalidatedOn:
type: string
format: date-time
refreshToken:
type: string
format: uuid
refreshExpiresOn:
type: string
format: date-time
'500':
$ref: '#/components/responses/kapuaError'
security: []
/authentication/logout:
post:
tags:
- Authentication
summary: Logout
operationId: authenticationLogout
responses:
'200':
description: Logout Successful
content:
application/json:
schema:
$ref: '#/paths/~1authentication~1jwt/post/responses/200/content/application~1json/schema'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/credentials':
get:
tags:
- Credential
summary: Get all the Credentials
operationId: credentialList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the Credentials available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1credentials~1%7BcredentialId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Credential
summary: Create a new Credential
operationId: credentialCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: An object containing the properties for the new Credential to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntityCreator'
- properties:
userId:
allOf:
- $ref: '#/components/schemas/kapuaId'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
credentialStatus:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
example:
userId: AQ
credentialType: PASSWORD
credentialKey: new-password-123!
credentialStatus: ENABLED
expirationDate: '2019-12-31T00:00:00.000Z'
examples:
password:
description: Password
value:
userId: AQ
credentialType: PASSWORD
credentialKey: new-password-123!
credentialStatus: ENABLED
expirationDate: '2019-12-31T00:00:00.000Z'
apikey:
description: API Key
value:
userId: AQ
credentialType: API_KEY
credentialStatus: ENABLED
expirationDate: '2019-12-31T00:00:00.000Z'
required: true
responses:
'200':
description: The Credential that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1credentials~1%7BcredentialId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/credentials/{credentialId}':
get:
tags:
- Credential
summary: Get a single Credential
operationId: credentialGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: credentialId
in: path
description: The ID of the Credential on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Credential
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1credentials~1%7BcredentialId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- Credential
summary: Update a single Credential
operationId: credentialUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1credentials~1%7BcredentialId%7D/get/parameters/1'
requestBody:
description: An object containing the new properties for the Credential to update
content:
application/json:
schema:
type: object
description: An object containing all the information for a single Credential
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntity'
- properties:
userId:
allOf:
- $ref: '#/components/schemas/kapuaId'
credentialType:
type: string
enum:
- PASSWORD
- API_KEY
- JWT
credentialKey:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
expirationDate:
type: string
format: date-time
loginFailures:
type: integer
firstLoginFailure:
type: string
format: date-time
loginFailuresReset:
type: string
format: date-time
lockoutReset:
type: string
format: date-time
required: true
responses:
'200':
description: The details of the updated Credential
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1credentials~1%7BcredentialId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Credential
summary: Delete a single Credential
operationId: credentialDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1credentials~1%7BcredentialId%7D/get/parameters/1'
responses:
'200':
description: The Credential has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/credentials/_count':
post:
tags:
- Credential
summary: Count the Credentials
operationId: credentialCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/credentials/_query':
post:
tags:
- Credential
summary: Query the Credentials
operationId: credentialQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1credentials/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/credentials/{credentialId}/unlock':
post:
tags:
- Credential
summary: Unlock a Credential
operationId: credentialUnlock
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1credentials~1%7BcredentialId%7D/get/parameters/1'
responses:
'200':
description: The Credential has been unlocked
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1credentials~1%7BcredentialId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/channels':
get:
tags:
- Data Channel
summary: Query the Data Channels
operationId: dataChannelQuery
parameters:
- $ref: '#/components/parameters/scopeId'
- name: clientId
in: query
schema:
type: string
description: The ClientID to filter results
- name: name
in: query
schema:
type: string
description: 'The channel name to filter results. It allows ''#'' wildcard in last channel level'
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1data~1channels~1%7BchannelInfoId%7D/get/responses/200/content/application~1json/schema'
totalCount:
type: integer
example:
type: channelInfoListResult
limitExceeded: false
size: 3
totalCount: 3
items:
- type: channelInfo
id: xny9A7OkTUcSYxJIGf3oMZHyZIvi4AcsFqJJbY1N2yg=
scopeId: AQ
clientId: Client-Id-1
name: ALERT
firstMessageId: 18739b9f-6d8b-42c2-a536-507b37dd5f2a
firstMessageOn: '2019-09-12T08:04:13.920Z'
lastMessageId: a3e69394-1c20-4446-b596-6fcc4a2028fe
lastMessageOn: '2019-09-12T08:14:13.230Z'
- type: channelInfo
id: vkyqKinEY2/UhxHHz2XRsmz02NtRK5KCsA7Fa1ot6CI=
scopeId: AQ
clientId: Client-Id-1
name: DIAG
firstMessageId: 308b0c38-76fa-4530-bb68-8c4c285c1f17
firstMessageOn: '2019-09-12T08:04:13.887Z'
lastMessageId: 8c59cd10-f23e-435e-a523-0aa8e952da1e
lastMessageOn: '2019-09-12T09:04:49.710Z'
- type: channelInfo
id: X0BcZAV6FfD+Wi9n4x5VOdHmSV/E6UpOTetaqpXAb+w=
scopeId: AQ
clientId: Client-Id-1
name: heater/data
firstMessageId: 3cec54f7-9633-4a68-ad5b-48f57ea7f0f3
firstMessageOn: '2019-09-12T09:03:20.959Z'
lastMessageId: a8597968-d785-42dd-9e04-1f15d42df774
lastMessageOn: '2019-09-12T09:05:06.527Z'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/channels/_count':
post:
tags:
- Data Channel
summary: Count the ChannelInfos
operationId: dataChannelCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/channels/{channelInfoId}':
get:
tags:
- Data Channel
summary: Get a single ChannelInfo
operationId: channelInfoGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: channelInfoId
in: path
description: The ID of the ChannelInfo on which to perform the operation
schema:
type: string
format: base64
required: true
responses:
'200':
description: The desired ChannelInfo
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: base64
scopeId:
allOf:
- $ref: '#/components/schemas/kapuaId'
- readOnly: true
clientId:
type: string
name:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: channelInfo
id: xny9A7OkTUcSYxJIGf3oMZHyZIvi4AcsFqJJbY1N2yg=
scopeId: AQ
clientId: Client-Id-1
name: ALERT
firstMessageId: 18739b9f-6d8b-42c2-a536-507b37dd5f2a
firstMessageOn: '2019-09-12T08:04:13.920Z'
lastMessageId: a3e69394-1c20-4446-b596-6fcc4a2028fe
lastMessageOn: '2019-09-12T08:14:13.230Z'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/clients':
get:
tags:
- Data Client
summary: Query the Data Clients
operationId: dataClientQuery
parameters:
- $ref: '#/components/parameters/scopeId'
- name: clientId
in: query
schema:
type: string
description: The ClientID to filter results
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1data~1clients~1%7BclientInfoId%7D/get/responses/200/content/application~1json/schema'
totalCount:
type: integer
example:
type: clientInfoListResult
limitExceeded: false
size: 1
items:
type: clientInfo
id: JOyqK0XfNrKYD5qcAe6MJyl3TMd6AjwzKnqQofb8USg=
scopeId: AQ
clientId: Client-Id-1
firstMessageId: a2320c45-6791-4525-a552-adb163928303
firstMessageOn: 2019-09-12T08:14:13.228Z
lastMessageId: bb07d7fc-dc62-492f-b8da-7e28df69e112
lastMessageOn: 2019-09-12T09:25:05.096Z
totalCount: 1
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/clients/_count':
post:
tags:
- Data Client
summary: Count the ClientInfos
operationId: dataClientCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/clients/{clientInfoId}':
get:
tags:
- Data Client
summary: Get a single ClientInfo
operationId: clientInfoGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: clientInfoId
in: path
description: The ID of the ClientInfo on which to perform the operation
schema:
type: string
required: true
responses:
'200':
description: The desired ClientInfo
content:
application/json:
schema:
type: object
properties:
id:
type: string
scopeId:
allOf:
- $ref: '#/components/schemas/kapuaId'
- readOnly: true
clientId:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: clientInfo
id: JOyqK0XfNrKYD5qcAe6MJyl3TMd6AjwzKnqQofb8USg=
scopeId: AQ
clientId: Client-Id-1
firstMessageId: a2320c45-6791-4525-a552-adb163928303
firstMessageOn: 2019-09-12T08:14:13.228Z
lastMessageId: bb07d7fc-dc62-492f-b8da-7e28df69e112
lastMessageOn: 2019-09-12T09:25:05.096Z
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/messages':
get:
tags:
- Data Message
summary: Query the Data Messages
operationId: dataMessageQuery
parameters:
- $ref: '#/components/parameters/scopeId'
- name: clientId
in: query
schema:
type: string
- name: channel
in: query
schema:
type: string
- name: strictChannel
in: query
schema:
type: boolean
- name: startDate
in: query
schema:
type: string
format: date-time
- name: endDate
in: query
schema:
type: string
format: date-time
- name: metricName
in: query
schema:
type: string
- name: metricType
in: query
schema:
type: string
- name: metricMin
in: query
schema:
type: string
- name: metricMax
in: query
schema:
type: string
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1data~1messages/post/requestBody/content/application~1json/schema'
example:
type: storableListResult
limitExceeded: true
size: 2
items:
- type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:35:04.383Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20.25
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: -441478528
name: errorCode
receivedOn: '2019-09-12T09:35:04.389Z'
scopeId: AQ
sentOn: '2019-09-12T09:35:04.383Z'
datastoreId: 6349cec8-396b-4aac-bc2f-8fca9fe0c67c
timestamp: '2019-09-12T09:35:04.383Z'
- type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
scopeId: AQ
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
totalCount: 61
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Data Message
summary: Store a new Message
operationId: dataMessageStore
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
content:
application/json:
schema:
type: object
properties:
datastoreId:
type: string
format: uuid
readOnly: true
scopeId:
allOf:
- $ref: '#/components/schemas/kapuaId'
- readOnly: true
timestamp:
type: string
format: date-time
deviceId:
allOf:
- $ref: '#/components/schemas/kapuaId'
clientId:
type: string
receivedOn:
type: string
format: date-time
sentOn:
type: string
format: date-time
capturedOn:
type: string
format: date-time
position:
type: object
properties:
latitude:
type: number
format: double
longitude:
type: number
format: double
altitude:
type: number
format: double
precision:
type: number
format: double
heading:
type: number
format: double
speed:
type: number
format: double
timestamp:
type: string
format: date-time
satellites:
type: integer
format: int32
status:
type: integer
format: int32
channel:
type: object
properties:
semanticParts:
type: array
items:
type: string
payload:
type: object
properties:
metrics:
type: array
items:
type: object
properties:
valueType:
type: string
value:
type: string
name:
type: string
body:
type: string
format: base64
required:
- clientId
- deviceId
example:
type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
scopeId: AQ
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
example:
type: jsonDatastoreMessage
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: WyczTs_GuDM
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
sentOn: '2019-09-12T09:25:05.096Z'
datastoreId: bb07d7fc-dc62-492f-b8da-7e28df69e112
timestamp: '2019-09-12T09:25:05.096Z'
responses:
'200':
description: The ID of the new DataMessage
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
readOnly: true
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/messages/_count':
post:
tags:
- Data Message
summary: Count the MessageInfos
operationId: dataMessageCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/messages/{datastoreMessageId}':
get:
tags:
- Data Message
summary: Get a single DataMessage
operationId: dataMessageGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: datastoreMessageId
in: path
description: The ID of the MetricInfo on which to perform the operation
schema:
type: string
required: true
responses:
'200':
description: The desired DataMessage
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1data~1messages/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/metrics':
get:
tags:
- Data Metric
summary: Query the Data Metrics
operationId: dataMetricQuery
parameters:
- $ref: '#/components/parameters/scopeId'
- name: metricId
in: query
schema:
type: string
description: The MetricID to filter results
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1data~1metrics~1%7BmetricInfoId%7D/get/responses/200/content/application~1json/schema'
example:
type: metricInfoListResult
limitExceeded: false
size: 2
items:
- type: metricInfo
id: oLVtE7wK67wO5Lxx4nZGsTEwbVjeo0xcFcnTvmhCxLU=
scopeId: AQ
clientId: Client-Id-1
channel: ALERT
name: alert_category
metricType: string
firstMessageId: c623d131-6f47-49af-9ba0-1474a90dd9ed
firstMessageOn: '2019-09-12T08:04:13.918Z'
lastMessageId: 653b4aee-e0d5-4af6-b120-ffc7c26057b9
lastMessageOn: '2019-09-12T09:24:48.352Z'
- type: metricInfo
id: q2vErAArLQ2rs/4m3eGZf5p6gqrCT+qZKxbeNPQrc+Q=
scopeId: AQ
clientId: Client-Id-1
channel: ALERT
name: alert_code
metricType: string
firstMessageId: c623d131-6f47-49af-9ba0-1474a90dd9ed
firstMessageOn: '2019-09-12T08:04:13.918Z'
lastMessageId: 653b4aee-e0d5-4af6-b120-ffc7c26057b9
lastMessageOn: '2019-09-12T09:24:48.352Z'
totalCount: 35
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/metrics/_count':
post:
tags:
- Data Metric
summary: Count the MetricInfos
operationId: dataMetricCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/data/metrics/{metricInfoId}':
get:
tags:
- Data Metric
summary: Get a single MetricInfo
operationId: metricInfoGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: metricInfoId
in: path
description: The ID of the MetricInfo on which to perform the operation
schema:
type: string
required: true
responses:
'200':
description: The desired MetricInfo
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: base64
scopeId:
allOf:
- $ref: '#/components/schemas/kapuaId'
- readOnly: true
clientId:
type: string
channel:
type: string
name:
type: string
metricType:
type: string
firstMessageId:
type: string
format: uuid
firstMessageOn:
type: string
format: date-time
lastMessageId:
type: string
format: uuid
lastMessageOn:
type: string
format: date-time
example:
type: metricInfo
id: oLVtE7wK67wO5Lxx4nZGsTEwbVjeo0xcFcnTvmhCxLU=
scopeId: AQ
clientId: Client-Id-1
channel: ALERT
name: alert_category
metricType: string
firstMessageId: c623d131-6f47-49af-9ba0-1474a90dd9ed
firstMessageOn: '2019-09-12T08:04:13.918Z'
lastMessageId: 653b4aee-e0d5-4af6-b120-ffc7c26057b9
lastMessageOn: '2019-09-12T09:24:48.352Z'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices':
get:
tags:
- Device
summary: Get all the Devices
operationId: deviceList
parameters:
- $ref: '#/components/parameters/scopeId'
- name: fetchAttributes
in: query
schema:
type: array
items:
type: string
enum:
- connection
- lastEvent
responses:
'200':
description: The list of the Devices available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/put/requestBody/content/application~1json/schema'
examples:
standard:
value:
type: deviceListResult
limitExceeded: false
size: 1
items:
- type: device
id: WyczTs_GuDM
scopeId: AQ
createdOn: 2019-09-12T09:04:37.315Z
createdBy: Ag
modifiedOn: 2019-09-12T09:04:37.603Z
modifiedBy: Ag
optlock: 2
clientId: Client-Id-1
connectionId: Gd1BfeWwh3s
status: ENABLED
displayName: null
lastEventId: YYHQ2i1S-P0
serialNumber: ESF-Docker-RHEL
modelId: ESF-Docker-RHEL
modelName: ESF-Docker-RHEL
biosVersion: N/A
firmwareVersion: N/A
osVersion: 4.9.184-linuxkit
jvmVersion: 25.161-b12 mixed mode
osgiFrameworkVersion: 1.8.0
applicationFrameworkVersion: ESF_6.0.0
connectionInterface: 'lo (00:00:00:00:00:00)'
connectionIp: 127.0.0.1
applicationIdentifiers: heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1
acceptEncoding: gzip
tagIds: []
with-fetch-attributes:
value:
type: deviceListResult
limitExceeded: false
size: 1
items:
- type: device
id: WyczTs_GuDM
scopeId: AQ
createdOn: 2019-09-12T09:04:37.315Z
createdBy: Ag
modifiedOn: 2019-09-12T09:04:37.603Z
modifiedBy: Ag
optlock: 2
clientId: Client-Id-1
connectionId: Gd1BfeWwh3s
connection:
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: 2019-09-12T09:04:32.101Z
createdBy: Ag
modifiedOn: 2019-09-12T09:04:32.101Z
modifiedBy: Ag
optlock: 1
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:59596'
serverIp: broker
status: ENABLED
displayName: null
lastEventId: YYHQ2i1S-P0
lastEvent:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: 2019-09-12T09:04:37.392Z
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: 2019-09-12T09:04:32.646Z
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit'
serialNumber: ESF-Docker-RHEL
modelId: ESF-Docker-RHEL
modelName: ESF-Docker-RHEL
biosVersion: N/A
firmwareVersion: N/A
osVersion: 4.9.184-linuxkit
jvmVersion: 25.161-b12 mixed mode
osgiFrameworkVersion: 1.8.0
applicationFrameworkVersion: ESF_6.0.0
connectionInterface: 'lo (00:00:00:00:00:00)'
connectionIp: 127.0.0.1
applicationIdentifiers: heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1
acceptEncoding: gzip
tagIds: []
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Device
summary: Create a new Device
operationId: deviceCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: An object containing the properties for the new Device to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntityCreator'
- properties:
groupId:
allOf:
- $ref: '#/components/schemas/kapuaId'
clientId:
type: string
status:
type: string
enum:
- ENABLED
- DISABLED
lastEventId:
allOf:
- $ref: '#/components/schemas/kapuaId'
displayName:
type: string
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
required:
- clientId
example:
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
deviceCredentialsMode: LOOSE
required: true
responses:
'200':
description: The Device that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}':
get:
tags:
- Device
summary: Get a single Device
operationId: deviceGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: deviceId
in: path
description: The ID of the Device on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Device
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- Device
summary: Update a single Device
operationId: deviceUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
requestBody:
description: An object containing the new properties for the Device to update
content:
application/json:
schema:
type: object
description: A Device
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntity'
- properties:
groupId:
allOf:
- $ref: '#/components/schemas/kapuaId'
clientId:
type: string
readOnly: true
connectionId:
allOf:
- $ref: '#/components/schemas/kapuaId'
- readOnly: true
connection:
$ref: '#/paths/~1%7BscopeId%7D~1deviceconnections~1%7BconnectionId%7D/get/responses/200/content/application~1json/schema'
status:
$ref: '#/paths/~1%7BscopeId%7D~1devices/post/requestBody/content/application~1json/schema/allOf/1/properties/status'
displayName:
type: string
lastEventId:
allOf:
- $ref: '#/components/schemas/kapuaId'
- readOnly: true
lastEvent:
type: object
allOf:
- $ref: '#/components/schemas/kapuaEntity'
- properties:
sentOn:
type: string
format: date-time
receivedOn:
type: string
format: date-time
position:
$ref: '#/paths/~1%7BscopeId%7D~1data~1messages/post/requestBody/content/application~1json/schema/properties/position'
resource:
type: string
action:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
id: YYHQ2i1S-P0
scopeId: AQ
createdOn: '2019-09-12T09:04:37.392Z'
createdBy: Ag
deviceId: WyczTs_GuDM
receivedOn: '2019-09-12T09:04:32.646Z'
position:
altitude: 0
latitude: 0
longitude: 0
resource: BIRTH
action: CREATE
responseCode: ACCEPTED
eventMessage: 'acceptEncoding=gzip~~applicationFramework=Kura~~applicationFrameworkVersion=ESF_6.0.0~~applicationIdentifiers=heaterPROV-V2DEPLOY-V2VPNCLIENT-V2CONF-V1CERT-V1ASSET-V1CMD-V1~~availableProcessors=4~~bios=N/A~~biosVersion=N/A~~connectionInterface=lo (00:00:00:00:00:00)~~connectionIp=127.0.0.1~~containerFramework=Eclipse~~containerFrameworkVersion=1.8.0~~displayName=~~firmware=N/A~~firmwareVersion=N/A~~jvm=Java HotSpot(TM) 64-Bit Server VM~~jvmProfile=Java(TM) SE Runtime Environment 1.8.0_161-b12~~jvmVersion=25.161-b12 mixed mode~~modelId=ESF-Docker-RHEL~~modelName=ESF-Docker-RHEL~~os=Linux~~osArch=amd64~~osVersion=4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019~~partNumber=ESF-Docker-RHEL~~serialNumber=ESF-Docker-RHEL~~totalMemory=1023488~~uptime=187894320'
serialNumber:
type: string
modelId:
type: string
modelName:
type: string
imei:
type: string
imsi:
type: string
iccid:
type: string
biosVersion:
type: string
firmwareVersion:
type: string
osVersion:
type: string
jvmVersion:
type: string
osgiFrameworkVersion:
type: string
applicationFrameworkVersion:
type: string
connectionInterface:
type: string
connectionIp:
type: string
applicationIdentifiers:
type: string
acceptEncoding:
type: string
customAttribute1:
type: string
customAttribute2:
type: string
customAttribute3:
type: string
customAttribute4:
type: string
customAttribute5:
type: string
tagIds:
type: array
items:
allOf:
- $ref: '#/components/schemas/kapuaId'
example:
type: device
id: dIVxI5QpFUI
scopeId: AQ
createdOn: '2019-09-12T12:08:12.179Z'
createdBy: AQ
modifiedOn: '2019-09-12T12:08:12.179Z'
modifiedBy: AQ
optlock: 1
clientId: testDevice
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
example:
type: device
optlock: 1
status: ENABLED
displayName: Test Device
serialNumber: 1234567890
modelId: Test Model
biosVersion: N/A
firmwareVersion: N/A
osVersion: 3.13.0-93-generic
jvmVersion: 24.111-b01 mixed mode
osgiFrameworkVersion: 1.7.0
acceptEncoding: gzip
tagIds: []
required: true
responses:
'200':
description: The details of the updated Device
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Device
summary: Delete a single Device
operationId: deviceDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
responses:
'200':
description: The Device has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/_query':
post:
tags:
- Device
summary: Query the Devices
operationId: deviceQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/_count':
post:
tags:
- Device
summary: Count the Devices
operationId: deviceCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/assets':
get:
tags:
- Device Asset
summary: Get the Assets Definitions of a single Device
operationId: deviceAssetList
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- name: timeout
in: query
description: The timeout for the request in milliseconds
schema:
type: integer
default: 10000
responses:
'200':
description: The list of Assets definition of a single Device
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/post/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Device Asset
summary: Get the Assets Definitions of a single Device
operationId: deviceAssetListFiltered
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
description: An object containing the list of Assets to use as a filter
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
mode:
type: string
enum:
- READ
- WRITE
- READ_WRITE
name:
type: string
valueType:
type: string
example:
valueType: integer
name: Channel-1
mode: READ
name:
type: string
example:
name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
type: deviceAssets
deviceAsset:
- name: asset1
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
- name: asset2
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
example:
deviceAsset:
- name: asset2
responses:
'200':
description: The list of Assets definition of a single Device according to the filter
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/post/requestBody/content/application~1json/schema'
example:
type: deviceAssets
deviceAsset:
- name: asset2
channels:
- valueType: integer
name: Channel-1
mode: READ
- valueType: integer
name: Channel-2
mode: WRITE
- valueType: integer
name: Channel-3
mode: READ_WRITE
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/assets/_read':
post:
tags:
- Device Asset
summary: Read the values for the Assets of a single Device
operationId: deviceAssetRead
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
description: An object containing the list of Assets to use as a filter
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/post/requestBody/content/application~1json/schema'
example:
deviceAsset:
- name: asset2
required: true
responses:
'200':
description: The Asset list for the desired Device complete with values
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets~1_write/post/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/assets/_write':
post:
tags:
- Device Asset
summary: Write the values for the Assets of a single Device
operationId: deviceAssetWrite
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
description: An Asset list to be updated on the desired Devica
content:
application/json:
schema:
type: object
properties:
deviceAsset:
items:
type: array
items:
type: object
description: A Device Asset Definition
properties:
channels:
type: array
items:
type: object
properties:
name:
type: string
valueType:
type: string
value:
type: string
timestamp:
type: string
format: date-time
example:
valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
name:
type: string
example:
name: asset2
channels:
- valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
- valueType: integer
value: 8
name: Channel-3
timestamp: '2019-09-12T14:50:24.446Z'
example:
type: deviceAssets
deviceAsset:
- name: asset2
channels:
- valueType: integer
value: 5
name: Channel-1
timestamp: '2019-09-12T14:50:24.446Z'
- valueType: integer
value: 8
name: Channel-3
timestamp: '2019-09-12T14:50:24.446Z'
example:
type: deviceAssets
deviceAsset:
name: asset2
channels:
- valueType: integer
value: 12
name: Channel-2
- valueType: integer
value: 80
name: Channel-3
required: true
responses:
'200':
description: The updated Asset list for the desired Device with updated values
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets~1_write/post/requestBody/content/application~1json/schema'
example:
type: deviceAssets
deviceAsset: null
name: asset2
channels:
- valueType: integer
value: 12
name: Channel-2
timestamp: '2019-09-12T15:40:18.278Z'
- valueType: integer
value: 80
name: Channel-3
timestamp: '2019-09-12T15:40:18.278Z'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/bundles':
get:
tags:
- Device Bundle
summary: Get the Bundles installed on a single Device
operationId: deviceBundleList
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
responses:
'200':
description: The list of Bundles installed on a single Device
content:
application/json:
schema:
type: object
properties:
bundle:
type: array
items:
type: object
description: A Device Bundle
properties:
id:
type: integer
name:
type: string
state:
type: string
version:
type: string
example:
id: 0
name: org.eclipse.osgi
state: ACTIVE
version: 3.12.50.v20170928-1321
example:
type: deviceBundles
bundle:
- id: 0
name: org.eclipse.osgi
state: ACTIVE
version: 3.12.50.v20170928-1321
- id: 1
name: org.eclipse.equinox.cm
state: ACTIVE
version: 1.2.0.v20170105-1446
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/bundles/{bundleId}/_start':
post:
tags:
- Device Bundle
summary: Start the desired Bundle on a single Device
operationId: deviceBundleStart
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1bundles~1%7BbundleId%7D~1_stop/post/parameters/2'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
responses:
'200':
description: The Bundle has been successfully started
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/bundles/{bundleId}/_stop':
post:
tags:
- Device Bundle
summary: Stop the desired Bundle on a single Device
operationId: deviceBundleStop
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- name: bundleId
in: path
description: The ID of the Bundle on which to perform the operation
schema:
type: string
required: true
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
responses:
'200':
description: The Bundle has been successfully stopped
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/commands/_execute':
post:
tags:
- Device Command
summary: Execute a Command
operationId: deviceCommandExecute
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
content:
application/json:
schema:
type: object
description: A Device Command
properties:
command:
type: string
password:
type: string
format: password
arguments:
type: array
items:
type: string
timeout:
type: integer
workingDir:
type: string
body:
type: string
format: base64
environment:
type: array
items:
type: string
runAsynch:
type: boolean
stdin:
type: string
example:
command: ls
arguments:
argument: '-lisa'
timeout: 60000
required: true
responses:
'200':
description: The output of the Command executed on a single Device
content:
application/json:
schema:
type: object
properties:
stderr:
type: string
stdout:
type: string
exceptionMessage:
type: string
exceptionStack:
type: string
exitCode:
type: integer
hasTimedout:
type: boolean
example:
type: deviceCommandOutput
stderr: ''
stdout: |
total 40
12503707 4 drwxrwxrwt 1 root root 4096 Sep 13 07:44 .
12507178 4 drwxr-xr-x 1 root root 4096 Sep 12 08:03 ..
61409843 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .ICE-unix
61409845 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .Test-unix
61409838 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .X11-unix
61409844 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .XIM-unix
61409846 4 drwxrwxrwt 2 root root 4096 Feb 28 2018 .font-unix
12503708 4 drwxr-xr-x 3 root root 4096 Sep 12 08:03 .kura
12507353 4 drwxr-xr-x 2 root root 4096 Sep 12 08:03 hsperfdata_root
12507385 4 drwxr-xr-x 3 root root 4096 Sep 12 08:03 kura
exitCode: 0
hasTimedout: false
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/configurations':
get:
tags:
- Device Configuration
summary: Read multiple Configurations
operationId: deviceConfigurationsRead
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
responses:
'200':
description: The list of the Configurations on a single Device
content:
application/json:
schema:
type: object
properties:
configuration:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1configurations~1%7BcomponentId%7D/put/responses/200/content/application~1json/schema'
example:
type: deviceConfiguration
configuration:
- id: org.eclipse.kura.wire.graph.WireGraphService
definition:
description: WireGraphService metatype
id: org.eclipse.kura.wire.graph.WireGraphService
name: WireGraphService
AD:
- cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon: []
properties:
property:
- name: WireGraph
array: false
encrypted: false
type: String
value:
- '{"components":[{"pid":"asset1","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-580,"y":-120},"inputPortNames":{},"outputPortNames":{}}},{"pid":"asset2","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-1100,"y":-100},"inputPortNames":{},"outputPortNames":{}}}],"wires":[]}'
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
- name: service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- Device Configuration
summary: Update multiple Configurations
operationId: deviceConfigurationsWrite
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
content:
application/json:
schema:
type: object
properties:
configuration:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1configurations~1%7BcomponentId%7D/put/requestBody/content/application~1json/schema'
example:
configuration:
- id: org.eclipse.kura.wire.graph.WireGraphService
properties:
property:
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
required: true
responses:
'200':
description: The list of the Configurations on a single Device
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/configurations/{componentId}':
get:
tags:
- Device Configuration
summary: Read a single Configuration
operationId: deviceConfigurationRead
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- name: componentId
in: path
description: The ID of the Component on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
responses:
'200':
description: The Configuration details of a single Service on a single Device
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1configurations/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- Device Configuration
summary: Update a single Configuration
operationId: deviceConfigurationWrite
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1configurations~1%7BcomponentId%7D/get/parameters/2'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
content:
application/json:
schema:
type: object
properties:
id:
type: string
properties:
type: object
properties:
property:
type: array
items:
type: object
properties:
name:
type: string
array:
type: boolean
encrypted:
type: boolean
type:
type: string
value:
type: array
items:
type: string
example:
name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
required: true
responses:
'200':
description: Updates the Configuration details of a single Service on a single Device
content:
application/json:
schema:
type: object
properties:
id:
type: string
definition:
type: object
properties:
id:
type: string
AD:
type: array
items:
type: object
properties:
Option:
type: array
items:
type: object
properties:
label:
type: string
value:
type: string
default:
type: string
type:
type: object
cardinality:
type: integer
min:
type: string
max:
type: string
description:
type: string
id:
type: string
required:
type: boolean
name:
type: string
example:
cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon:
type: array
items:
type: object
properties:
resource:
type: string
size:
type: integer
name:
type: string
description:
type: string
properties:
type: object
properties:
property:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1configurations~1%7BcomponentId%7D/put/requestBody/content/application~1json/schema/properties/properties/properties/property/items'
example:
id: org.eclipse.kura.wire.graph.WireGraphService
definition:
description: WireGraphService metatype
id: org.eclipse.kura.wire.graph.WireGraphService
name: WireGraphService
AD:
- cardinality: 0
description: The default wire graph JSON
id: WireGraph
name: WireGraph
required: true
type: String
Option: []
Icon: []
properties:
property:
- name: WireGraph
array: false
encrypted: false
type: String
value:
- '{"components":[{"pid":"asset1","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-580,"y":-120},"inputPortNames":{},"outputPortNames":{}}},{"pid":"asset2","inputPortCount":1,"outputPortCount":1,"renderingProperties":{"position":{"x":-1100,"y":-100},"inputPortNames":{},"outputPortNames":{}}}],"wires":[]}'
- name: kura.service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
- name: service.pid
array: false
encrypted: false
type: String
value:
- org.eclipse.kura.wire.graph.WireGraphService
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/deviceconnections':
get:
tags:
- Device Connection
summary: Get all the Connections
operationId: connectionList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the Connections available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1deviceconnections~1%7BconnectionId%7D/get/responses/200/content/application~1json/schema'
example:
type: deviceConnectionListResult
limitExceeded: false
size: 1
items:
- type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/deviceconnections/{connectionId}':
get:
tags:
- Device Connection
summary: Get a single Connection
operationId: connectionGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: connectionId
in: path
description: The ID of the Connection on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Connection
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntity'
- properties:
status:
type: string
enum:
- CONNECTED
- DISCONNECTED
- MISSING
- 'NULL'
clientId:
type: string
userId:
allOf:
- $ref: '#/components/schemas/kapuaId'
allowUserChange:
type: boolean
userCouplingMode:
$ref: '#/paths/~1%7BscopeId%7D~1deviceconnections~1%7BconnectionId%7D~1options/put/requestBody/content/application~1json/schema/allOf/1/properties/userCouplingMode'
reservedUserId:
allOf:
- $ref: '#/components/schemas/kapuaId'
protocol:
type: string
clientIp:
type: string
serverIp:
type: string
readOnly: true
example:
type: deviceConnection
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
status: CONNECTED
clientId: Client-Id-1
userId: Ag
allowUserChange: false
userCouplingMode: INHERITED
protocol: MQTT
clientIp: 'tcp://172.21.0.1:44400'
serverIp: broker
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/deviceconnections/{connectionId}/options':
get:
tags:
- Device Connection
summary: Get the option for a Connection
operationId: connectionOptionGet
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1deviceconnections~1%7BconnectionId%7D/get/parameters/1'
responses:
'200':
description: The Options of the desired Connection
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1deviceconnections~1%7BconnectionId%7D~1options/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- Device Connection
summary: Update the option for a Connection
operationId: connectionOptionUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1deviceconnections~1%7BconnectionId%7D/get/parameters/1'
requestBody:
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntity'
- properties:
allowUserChange:
type: boolean
userCouplingMode:
type: string
enum:
- INHERITED
- LOOSE
- STRICT
reservedUserId:
allOf:
- $ref: '#/components/schemas/kapuaId'
example:
type: deviceConnectionOption
id: Gd1BfeWwh3s
scopeId: AQ
createdOn: '2019-09-12T09:04:32.101Z'
createdBy: Ag
modifiedOn: '2019-09-13T08:04:49.927Z'
modifiedBy: Ag
optlock: 17
allowUserChange: false
userCouplingMode: INHERITED
responses:
'200':
description: The updated Options of the desired Connection
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1deviceconnections~1%7BconnectionId%7D~1options/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/deviceconnections/_count':
post:
tags:
- Device Connection
summary: Count the Connections
operationId: connectionCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/deviceconnections/_query':
post:
tags:
- Device Connection
summary: Query the Connections
operationId: connectionQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1deviceconnections/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/events':
get:
tags:
- Device Event
summary: Get all the DeviceEvents
operationId: deviceEventList
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
responses:
'200':
description: The list of the Device Events available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1events~1%7BdeviceEventId%7D/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/events/{deviceEventId}':
get:
tags:
- Device Event
summary: Get a single DeviceEvent
operationId: deviceEventGet
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- name: deviceEventId
in: path
description: The ID of the Device Event on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Device Event
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaEntity'
- properties:
deviceId:
allOf:
- $ref: '#/components/schemas/kapuaId'
sentOn:
type: string
format: date-time
receivedOn:
type: string
format: date-time
position:
$ref: '#/paths/~1%7BscopeId%7D~1data~1messages/post/requestBody/content/application~1json/schema/properties/position'
resource:
type: string
action:
type: string
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
eventMessage:
type: string
example:
type: deviceEvent
id: JYINy4IMGK4
scopeId: AQ
createdOn: '2019-09-13T12:00:31.738Z'
createdBy: AQ
deviceId: IaIA6xbNR7E
sentOn: '2019-09-13T12:00:31.687Z'
receivedOn: '2019-09-13T12:00:31.718Z'
resource: CONFIGURATION
action: READ
responseCode: ACCEPTED
eventMessage: null
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Device Event
summary: Delete a single DeviceEvent
operationId: deviceEventDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1events~1%7BdeviceEventId%7D/get/parameters/2'
responses:
'200':
description: The Device Event has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/events/_count':
post:
tags:
- Device Event
summary: Count the Device Events
operationId: deviceEventCount
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/events/_query':
post:
tags:
- Device Event
summary: Query the Device Event
operationId: deviceEventQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1events/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/packages':
get:
tags:
- Device Package
summary: Get the Packages installed on a single Device
operationId: devicePackageList
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
responses:
'200':
description: The list of Packages installed on a single Device
content:
application/json:
schema:
type: object
properties:
devicePackage:
type: array
items:
type: object
description: A Device Package
properties:
name:
type: string
version:
type: string
bundleInfos:
type: object
properties:
bundleInfo:
type: array
items:
type: object
properties:
name:
type: string
version:
type: string
installDate:
type: string
format: date-time
example:
name: org.eclipse.kura.demo.heater
version: 1.0.300
bundleInfos:
bundleInfo:
- name: org.eclipse.kura.demo.heater
version: 1.0.300
example:
type: devicePackages
devicePackage:
- name: org.eclipse.kura.demo.heater
version: 1.0.300
bundleInfos:
bundleInfo:
- name: org.eclipse.kura.demo.heater
version: 1.0.300
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/packages/_download':
post:
tags:
- Device Package
summary: Download and install a Package
operationId: devicePackageDownload
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
content:
application/json:
schema:
type: object
properties:
uri:
type: string
name:
type: string
version:
type: string
install:
type: boolean
reboot:
type: boolean
rebootDelay:
type: integer
required:
- uri
- name
- version
example:
uri: 'http://download.eclipse.org/kura/releases/4.1.0/org.eclipse.kura.demo.heater_1.0.500.dp'
name: heater
version: 1.0.500
install: true
reboot: false
rebootDelay: 0
required: true
responses:
'200':
description: The Package has been successfully stopped
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/packages/_uninstall':
post:
tags:
- Device Package
summary: Uninstall a Package
operationId: devicePackageUninstall
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
content:
application/json:
schema:
type: object
properties:
name:
type: string
version:
type: string
reboot:
type: boolean
rebootDelay:
type: integer
required:
- name
- version
example:
name: org.eclipse.kura.demo.heater
version: 1.0.500
required: true
responses:
'200':
description: The Package has been successfully stopped
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/requests':
post:
tags:
- Device Request
summary: Perform a Request
operationId: deviceRequestExec
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
requestBody:
content:
application/json:
schema:
type: object
description: A Device Request
properties:
position:
$ref: '#/paths/~1%7BscopeId%7D~1data~1messages/post/requestBody/content/application~1json/schema/properties/position'
channel:
type: object
properties:
semanticParts:
type: array
items:
type: string
appName:
type: string
version:
type: string
method:
type: string
enum:
- READ
- CREATE
- WRITE
- DELETE
- OPTIONS
- EXECUTE
resources:
type: array
items:
type: string
example:
channel:
type: genericRequestChannel
method: EXECUTE
appName: CMD
version: V1
resources:
- command
payload:
metrics:
- valueType: string
value: sleep
name: command.command
- valueType: string
value: '180'
name: command.argument
required: true
responses:
'200':
description: The list of Requests installed on a single Device
content:
application/json:
schema:
type: object
properties:
id:
type: string
format: uuid
scopeId:
allOf:
- $ref: '#/components/schemas/kapuaId'
deviceId:
allOf:
- $ref: '#/components/schemas/kapuaId'
clientId:
type: string
receivedOn:
type: string
format: date-time
sentOn:
type: string
format: date-time
capturedOn:
type: string
format: date-time
position:
$ref: '#/paths/~1%7BscopeId%7D~1data~1messages/post/requestBody/content/application~1json/schema/properties/position'
channel:
type: object
properties:
appName:
type: string
version:
type: string
semanticParts:
type: array
items:
type: string
payload:
type: object
properties:
exceptionMessage:
type: string
exceptionStack:
type: string
metrics:
type: array
items:
type: object
body:
type: string
format: base64
responseCode:
type: string
enum:
- ACCEPTED
- BAD_REQUEST
- NOT_FOUND
- INTERNAL_ERROR
example:
capturedOn: '2019-09-13T13:53:09.447Z'
channel:
appName: CMD
version: V1
payload:
metrics:
- valueType: string
value: 'false'
name: command.timedout
- valueType: string
value: |
sleep: missing operand
Try 'sleep --help' for more information.
name: command.stderr
- valueType: string
name: kapua.response.exception.stack
- valueType: string
name: kapua.response.exception.message
- valueType: string
value: '1'
name: command.exit.code
- valueType: string
value: ''
name: command.stdout
- valueType: string
value: '200'
name: response.code
receivedOn: '2019-09-13T13:53:09.466Z'
scopeId: AQ
sentOn: '2019-09-13T13:53:09.447Z'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/snapshots':
get:
tags:
- Device Snapshot
summary: Get all Snapshots
operationId: deviceSnapshotList
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
responses:
'200':
description: The list of Snapshots available on a single Device
content:
application/json:
schema:
type: object
properties:
snapshotId:
type: array
items:
type: object
properties:
id:
type: string
timestamp:
type: integer
example:
type: deviceSnapshots
snapshotId:
- id: '0'
timestamp: 0
- id: '1568300687500'
timestamp: 1568300687500
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/devices/{deviceId}/snapshots/{snapshotId}/_rollback':
post:
tags:
- Device Snapshot
summary: Rollback to Snapshot
operationId: deviceSnapshotRollback
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D/get/parameters/1'
- name: snapshotId
in: path
required: true
schema:
type: string
- $ref: '#/paths/~1%7BscopeId%7D~1devices~1%7BdeviceId%7D~1assets/get/parameters/2'
responses:
'200':
description: The Snapshot has been applied
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/domains':
get:
tags:
- Domain
summary: Get all the Domains
operationId: domainList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the Domains available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1domains~1%7BdomainId%7D/get/responses/200/content/application~1json/schema'
example:
type: domainListResult
limitExceeded: false
size: 1
items:
- type: domain
id: AQ
createdOn: 2019-09-10T15:08:47.851Z
createdBy: AQ
name: account
actions:
- delete
- write
- read
groupable: false
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/domains/{domainId}':
get:
tags:
- Domain
summary: Get a single Domain
operationId: domainGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: domainId
in: path
description: The ID of the Domain on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Domain
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaEntity'
- properties:
groupable:
type: boolean
actions:
type: array
items:
type: string
name:
type: string
example:
type: domain
id: AQ
createdOn: 2019-09-10T15:08:47.851Z
createdBy: AQ
name: account
actions:
- delete
- write
- read
groupable: false
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/domains/_count':
post:
tags:
- Domain
summary: Count the Domains
operationId: domainCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/domains/_query':
post:
tags:
- Domain
summary: Query the Domains
operationId: domainQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1domains/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/endpointInfos':
get:
tags:
- EndpointInfo
summary: Get all the EndpointInfos
operationId: endpointInfoList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the EndpointInfos available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1endpointInfos~1%7BendpointInfoId%7D/put/requestBody/content/application~1json/schema'
example:
type: endpointInfoListResult
limitExceeded: false
size: 1
items:
- type: endpointInfo
id: PEMf9sotlls
scopeId: AQ
createdOn: '2019-09-13T14:52:19.850Z'
createdBy: AQ
modifiedOn: '2019-09-13T14:52:19.850Z'
modifiedBy: AQ
optlock: 1
dns: 10.200.12.148
port: 1883
schema: mqtt
secure: false
usages:
- name: MESSAGE_BROKER
- name: PROVISION
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- EndpointInfo
summary: Create a new EndpointInfo
operationId: endpointInfoCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: An object containing the properties for the new EndpointInfo to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntityCreator'
- properties:
schema:
type: string
dns:
type: string
port:
type: integer
secure:
type: boolean
usages:
type: array
items:
type: object
properties:
name:
type: string
example:
schema: mqtt
dns: 10.200.12.148
port: '1883'
secure: false
usages:
- name: MESSAGE_BROKER
- name: PROVISION
required: true
responses:
'200':
description: The EndpointInfo that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1endpointInfos~1%7BendpointInfoId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/endpointInfos/{endpointInfoId}':
get:
tags:
- EndpointInfo
summary: Get a single EndpointInfo
operationId: endpointInfoGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: endpointInfoId
in: path
description: The ID of the EndpointInfo on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired EndpointInfo
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1endpointInfos~1%7BendpointInfoId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- EndpointInfo
summary: Update a single EndpointInfo
operationId: endpointInfoUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1endpointInfos~1%7BendpointInfoId%7D/get/parameters/1'
requestBody:
description: An object containing the new properties for the EndpointInfo to update
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntity'
- $ref: '#/paths/~1%7BscopeId%7D~1endpointInfos/post/requestBody/content/application~1json/schema'
example:
type: endpointInfo
id: PEMf9sotlls
scopeId: AQ
createdOn: '2019-09-13T14:52:19.850Z'
createdBy: AQ
modifiedOn: '2019-09-13T14:52:19.850Z'
modifiedBy: AQ
optlock: 1
dns: 10.200.12.144
port: 1883
schema: mqtt
secure: false
usages:
- name: MESSAGE_BROKER
- name: PROVISION
example:
type: endpointInfo
optlock: 1
dns: 10.200.12.144
port: 1883
schema: mqtt
secure: false
usages:
- name: MESSAGE_BROKER
- name: PROVISION
required: true
responses:
'200':
description: The details of the updated EndpointInfo
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1endpointInfos~1%7BendpointInfoId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- EndpointInfo
summary: Delete a single EndpointInfo
operationId: endpointInfoDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1endpointInfos~1%7BendpointInfoId%7D/get/parameters/1'
responses:
'200':
description: The EndpointInfo has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/endpointInfos/_count':
post:
tags:
- EndpointInfo
summary: Count the EndpointInfos
operationId: endpointInfoCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/endpointInfos/_query':
post:
tags:
- EndpointInfo
summary: Query the EndpointInfos
operationId: endpointInfoQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1endpointInfos/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/groups':
get:
tags:
- Group
summary: Get all the Groups
operationId: groupList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the Groups available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1groups~1%7BgroupId%7D/put/requestBody/content/application~1json/schema'
example:
type: groupListResult
limitExceeded: false
size: 1
items:
- type: group
id: Skm7PvmgOh0
scopeId: AQ
createdOn: '2019-09-13T15:16:09.174Z'
createdBy: AQ
modifiedOn: '2019-09-13T15:16:09.174Z'
modifiedBy: AQ
optlock: 1
name: group-1
description: An Access Group
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Group
summary: Create a new Group
operationId: groupCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: An object containing the properties for the new Group to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntityCreator'
example:
name: group-1
description: An Access Group
required: true
responses:
'200':
description: The Group that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1groups~1%7BgroupId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/groups/{groupId}':
get:
tags:
- Group
summary: Get a single Group
operationId: groupGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: groupId
in: path
description: The ID of the Group on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Group
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1groups~1%7BgroupId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- Group
summary: Update a single Group
operationId: groupUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1groups~1%7BgroupId%7D/get/parameters/1'
requestBody:
description: An object containing the new properties for the Group to update
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntity'
example:
type: group
id: Skm7PvmgOh0
scopeId: AQ
createdOn: '2019-09-13T15:16:09.174Z'
createdBy: AQ
modifiedOn: '2019-09-13T15:16:09.174Z'
modifiedBy: AQ
optlock: 1
name: group-1
description: An Access Group
example:
type: group
optlock: 1
name: group-1
description: An Access Group
required: true
responses:
'200':
description: The details of the updated Group
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1groups~1%7BgroupId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Group
summary: Delete a single Group
operationId: groupDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1groups~1%7BgroupId%7D/get/parameters/1'
responses:
'200':
description: The Group has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/groups/_count':
post:
tags:
- Group
summary: Count the Groups
operationId: groupCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/groups/_query':
post:
tags:
- Group
summary: Query the Groups
operationId: groupQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1groups/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/roles':
get:
tags:
- Role
summary: Get all the roles
operationId: roleList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the Roles available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/put/requestBody/content/application~1json/schema'
example:
type: roleListResult
limitExceeded: false
size: 2
items:
- type: role
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:50.701Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:50.701Z'
modifiedBy: AQ
optlock: 0
name: admin
- type: role
id: OYLRT30Z9sA
scopeId: AQ
createdOn: '2019-09-11T14:48:33.531Z'
createdBy: AQ
modifiedOn: '2019-09-11T14:48:33.531Z'
modifiedBy: AQ
optlock: 1
name: role
description: desc
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Role
summary: Create a new Role
operationId: roleCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: An object containing the properties for the new Role to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntityCreator'
- properties:
permissions:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions/post/requestBody/content/application~1json/schema/properties/permission'
example:
name: new-role
description: A new role
permissions:
- domain: broker
action: connect
forwardable: true
required: true
responses:
'200':
description: The Role that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/roles/{roleId}':
get:
tags:
- Role
summary: Get a single Role
operationId: roleGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: roleId
in: path
description: The ID of the Role on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Role
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- Role
summary: Update a single Role
operationId: roleUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/get/parameters/1'
requestBody:
description: An object containing the new properties for the Role to update
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntity'
example:
type: role
id: KmhOD4JHfwk
scopeId: AQ
createdOn: '2019-09-16T07:33:26.719Z'
createdBy: AQ
modifiedOn: '2019-09-16T07:33:26.719Z'
modifiedBy: AQ
optlock: 1
name: new-role
description: A new role
example:
optlock: 1
name: new-role-2
description: A new Description for a new Role
required: true
responses:
'200':
description: The details of the updated Role
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/put/requestBody/content/application~1json/schema'
example:
type: role
id: KmhOD4JHfwk
scopeId: AQ
createdOn: '2019-09-16T07:33:26.719Z'
createdBy: AQ
modifiedOn: '2019-09-16T07:41:37.001Z'
modifiedBy: AQ
optlock: 2
name: new-role-2
description: A new Description for a new Role
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Role
summary: Delete a single Role
operationId: roleDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/get/parameters/1'
responses:
'200':
description: The Role has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/roles/_count':
post:
tags:
- Role
summary: Count the Roles
operationId: roleCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/roles/_query':
post:
tags:
- Role
summary: Query the Roles
operationId: roleQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1roles/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/roles/{roleId}/permissions':
get:
tags:
- Role
summary: Get all the Role Permissions
operationId: rolePermissionList
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/get/parameters/1'
responses:
'200':
description: The list of the RolePermissions available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D~1permissions/post/responses/200/content/application~1json/schema'
example:
type: rolePermissionListResult
limitExceeded: false
size: 2
items:
- type: rolePermission
id: BPJyd1ObUK8
scopeId: AQ
createdOn: '2019-09-16T07:46:06.191Z'
createdBy: AQ
roleId: OYLRT30Z9sA
permission:
domain: broker
action: connect
forwardable: true
- type: rolePermission
id: Zi4XYBuG7Xw
scopeId: AQ
createdOn: '2019-09-16T07:46:14.082Z'
createdBy: AQ
roleId: OYLRT30Z9sA
permission:
domain: device
action: read
forwardable: true
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Role
summary: Create a new RolePermission
operationId: rolePermissionCreate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/get/parameters/1'
requestBody:
description: An object containing the properties for the new RolePermission to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaEntityCreator'
- properties:
permission:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions/post/requestBody/content/application~1json/schema/properties/permission'
example:
permission:
domain: account
action: read
forwardable: true
example:
permission:
domain: account
action: read
forwardable: true
required: true
responses:
'200':
description: The Role Permissionthat has just been created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaEntity'
- properties:
roleId:
allOf:
- $ref: '#/components/schemas/kapuaId'
permission:
$ref: '#/paths/~1%7BscopeId%7D~1accessinfos~1%7BaccessInfoId%7D~1permissions/post/requestBody/content/application~1json/schema/properties/permission'
example:
type: rolePermission
id: BpbQqk31GLc
scopeId: AQ
createdOn: '2019-09-16T07:49:51.117Z'
createdBy: AQ
roleId: OYLRT30Z9sA
permission:
domain: domain
action: read
forwardable: true
example:
type: rolePermission
id: BpbQqk31GLc
scopeId: AQ
createdOn: '2019-09-16T07:49:51.117Z'
createdBy: AQ
roleId: OYLRT30Z9sA
permission:
domain: domain
action: read
forwardable: true
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/roles/{roleId}/permissions/{rolePermissionId}':
get:
tags:
- Role
summary: Get a single RolePermission
operationId: rolePermissionGet
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/get/parameters/1'
- name: rolePermissionId
in: path
description: The ID of the RolePermission on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired RolePermission
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D~1permissions/post/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Role
summary: Delete a single RolePermission
operationId: rolePermissionDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/get/parameters/1'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D~1permissions~1%7BrolePermissionId%7D/get/parameters/2'
responses:
'200':
description: The RolePermission has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/roles/{roleId}/permissions/_count':
post:
tags:
- Role
summary: Count the RolePermissions
operationId: rolePermissionCount
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/get/parameters/1'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/roles/{roleId}/permissions/_query':
post:
tags:
- Role
summary: Query the RolePermissions
operationId: rolePermissionQuery
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D/get/parameters/1'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1roles~1%7BroleId%7D~1permissions/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/streams/messages':
post:
tags:
- Stream
summary: Publish a message
operationId: streamMessage
description: 'Publishes a fire-and-forget message to a topic composed of [account-name] / [client-id] / [semtantic-parts]'
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1data~1messages/post/requestBody/content/application~1json/schema'
example:
capturedOn: '2019-09-12T09:25:05.096Z'
channel:
type: kapuaDataChannel
semanticParts:
- heater
- data
clientId: Client-Id-1
deviceId: IaIA6xbNR7E
payload:
metrics:
- valueType: string
value: 5
name: temperatureExternal
- valueType: string
value: 20
name: temperatureInternal
- valueType: string
value: 30
name: temperatureExhaust
- valueType: string
value: 0
name: errorCode
receivedOn: '2019-09-12T09:25:05.102Z'
sentOn: '2019-09-12T09:25:05.096Z'
timestamp: '2019-09-12T09:25:05.096Z'
responses:
'200':
description: The message has been sent successfully
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/tags':
get:
tags:
- Tag
summary: Get all the Tags
operationId: tagList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the Tags available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1tags~1%7BtagId%7D/put/requestBody/content/application~1json/schema'
example:
type: tagListResult
limitExceeded: false
size: 1
items:
- type: tag
id: FJ6-FLuIcok
scopeId: AQ
createdOn: '2019-09-16T08:52:32.562Z'
createdBy: AQ
modifiedOn: '2019-09-16T08:52:32.562Z'
modifiedBy: AQ
optlock: 1
name: tag-1
description: A new Tag
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- Tag
summary: Create a new Tag
operationId: tagCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: An object containing the properties for the new Tag to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntityCreator'
example:
name: tag-1
description: A new Tag
required: true
responses:
'200':
description: The Tag that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1tags~1%7BtagId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/tags/{tagId}':
get:
tags:
- Tag
summary: Get a single Tag
operationId: tagGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: tagId
in: path
description: The ID of the Tag on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired Tag
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1tags~1%7BtagId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- Tag
summary: Update a single Tag
operationId: tagUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1tags~1%7BtagId%7D/get/parameters/1'
requestBody:
description: An object containing the new properties for the Tag to update
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntity'
example:
type: tag
id: FJ6-FLuIcok
scopeId: AQ
createdOn: '2019-09-16T08:52:32.562Z'
createdBy: AQ
modifiedOn: '2019-09-16T08:52:32.562Z'
modifiedBy: AQ
optlock: 1
name: tag-1
description: A new Tag
example:
optlock: 1
name: new-tag
description: A new Description for a new Tag
required: true
responses:
'200':
description: The details of the updated Tag
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1tags~1%7BtagId%7D/put/requestBody/content/application~1json/schema'
example:
type: tag
id: FJ6-FLuIcok
scopeId: AQ
createdOn: '2019-09-16T08:52:32.562Z'
createdBy: AQ
modifiedOn: '2019-09-16T08:55:43.719Z'
modifiedBy: AQ
optlock: 2
name: new-tag
description: A new Description for a new Tag
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- Tag
summary: Delete a single Tag
operationId: tagDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1tags~1%7BtagId%7D/get/parameters/1'
responses:
'200':
description: The Tag has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/tags/_count':
post:
tags:
- Tag
summary: Count the Tags
operationId: tagCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/tags/_query':
post:
tags:
- Tag
summary: Query the Tags
operationId: tagQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1tags/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/users':
get:
tags:
- User
summary: Get all the Users
operationId: userList
parameters:
- $ref: '#/components/parameters/scopeId'
responses:
'200':
description: The list of the Users available in the Scope
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaListResult'
- properties:
items:
type: array
items:
$ref: '#/paths/~1%7BscopeId%7D~1users~1%7BuserId%7D/put/requestBody/content/application~1json/schema'
example:
type: userListResult
limitExceeded: false
size: 2
users:
- type: user
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:54.781Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:54.781Z'
modifiedBy: AQ
optlock: 0
name: kapua-sys
displayName: Kapua Sysadmin
email: kapua-sys@eclipse.org
phoneNumber: +1 555 123 4567
status: ENABLED
userType: INTERNAL
- type: user
id: Ag
scopeId: AQ
createdOn: '2019-09-10T15:08:54.781Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:54.781Z'
modifiedBy: AQ
optlock: 0
name: kapua-broker
displayName: Kapua Broker
email: kapua-broker@eclipse.org
phoneNumber: +1 555 123 4567
status: ENABLED
userType: INTERNAL
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
post:
tags:
- User
summary: Create a new User
operationId: userCreate
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
description: An object containing the properties for the new User to be created
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntityCreator'
- properties:
status:
type: string
enum:
- ENABLED
- DISABLED
displayName:
type: string
email:
type: string
format: email
phoneNumber:
type: string
userType:
type: string
enum:
- DEVICE
- INTERNAL
- EXTERNAL
externalId:
type: string
expirationDate:
type: string
format: date-time
example:
name: donald-duck
status: ENABLED
displayName: Donald Duck
email: donald.duck@duckburg.org
phoneNumber: +1 (555) 816 1851
userType: INTERNAL
expirationDate: '2019-31-12T00:00:00.000Z'
examples:
minimal:
description: Create an User providing only the required information (name)
value:
name: new-user
complete:
description: Create an User providing all the information
value:
$ref: '#/paths/~1%7BscopeId%7D~1users/post/requestBody/content/application~1json/schema/example'
required: true
responses:
'200':
description: The User that has just been created
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1users~1%7BuserId%7D/put/requestBody/content/application~1json/schema'
examples:
minimal:
description: An User created with only the required information (username)
value:
type: user
id: TvnAZL6Zzu0
scopeId: AQ
createdOn: '2019-09-11T09:07:09.853Z'
createdBy: AQ
modifiedOn: '2019-09-11T09:07:09.853Z'
modifiedBy: AQ
optlock: 1
name: new-user
status: ENABLED
userType: INTERNAL
complete:
description: An User created providing all the information
value:
$ref: '#/paths/~1%7BscopeId%7D~1users~1%7BuserId%7D/put/requestBody/content/application~1json/schema/example'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/users/{userId}':
get:
tags:
- User
summary: Get a single User
operationId: userGet
parameters:
- $ref: '#/components/parameters/scopeId'
- name: userId
in: path
description: The ID of the User on which to perform the operation
schema:
$ref: '#/components/schemas/kapuaId'
required: true
responses:
'200':
description: The details of the desired User
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1users~1%7BuserId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
put:
tags:
- User
summary: Update a single User
operationId: userUpdate
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1users~1%7BuserId%7D/get/parameters/1'
requestBody:
description: An object containing the new properties for the User to update
content:
application/json:
schema:
type: object
allOf:
- $ref: '#/components/schemas/kapuaNamedEntity'
- $ref: '#/paths/~1%7BscopeId%7D~1users/post/requestBody/content/application~1json/schema'
example:
type: user
id: AQ
scopeId: AQ
createdOn: '2019-09-10T15:08:54.781Z'
createdBy: AQ
modifiedOn: '2019-09-10T15:08:54.781Z'
modifiedBy: AQ
optlock: 0
name: kapua-sys
displayName: Kapua Sysadmin
email: kapua-sys@eclipse.org
phoneNumber: +1 555 123 4567
status: ENABLED
userType: INTERNAL
example:
type: user
optlock: 2
name: donald-duck
displayName: Donald Duck
email: donald.duck@duckburg.org
phoneNumber: +1 (555) 816 1851
status: ENABLED
userType: INTERNAL
required: true
responses:
'200':
description: The details of the updated User
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1users~1%7BuserId%7D/put/requestBody/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
delete:
tags:
- User
summary: Delete a single User
operationId: userDelete
parameters:
- $ref: '#/components/parameters/scopeId'
- $ref: '#/paths/~1%7BscopeId%7D~1users~1%7BuserId%7D/get/parameters/1'
responses:
'200':
description: The User has been deleted
'403':
$ref: '#/components/responses/subjectUnauthorized'
'404':
$ref: '#/components/responses/entityNotFound'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/users/_count':
post:
tags:
- User
summary: Count the Users
operationId: userCount
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
$ref: '#/components/responses/countResult'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
'/{scopeId}/users/_query':
post:
tags:
- User
summary: Query the Users
operationId: userQuery
parameters:
- $ref: '#/components/parameters/scopeId'
requestBody:
$ref: '#/components/requestBodies/kapuaQuery'
responses:
'200':
description: The result of the query
content:
application/json:
schema:
$ref: '#/paths/~1%7BscopeId%7D~1users/get/responses/200/content/application~1json/schema'
'403':
$ref: '#/components/responses/subjectUnauthorized'
'500':
$ref: '#/components/responses/kapuaError'
components:
parameters:
scopeId:
name: scopeId
in: path
description: |
The ID of the Scope where to perform the operation.
schema:
allOf:
- $ref: '#/components/schemas/kapuaId'
default: _
required: true
limit:
name: limit
in: query
description: A Limit on the result size. The result set will not contain more items than this number
schema:
type: integer
default: 50
offset:
name: offset
in: query
description: 'An Offset on the result size. Used to skip the first `n` items of a result set, with `n` equal to the value of `offset`'
schema:
type: integer
default: 0
schemas:
kapuaId:
type: string
pattern: '[A-Za-z0-9-_=]+'
description: 'The standard format for any ID in Kapua. It''s encoded as a [base64url URL- and filename-safe (RFC 4648 §5)](https://tools.ietf.org/html/rfc4648#section-5)'
kapuaEntity:
description: 'A standard Entity, that doesn''t support edits and versioning. All the objects (except for Datastore objects) in Kapua are Entities'
type: object
properties:
id:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the Entity
readOnly: true
scopeId:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the Scope containing the Entity
readOnly: true
createdOn:
description: The date and time when this entity was created
type: string
format: date-time
readOnly: true
createdBy:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the Entity who created this Entity
readOnly: true
kapuaUpdatableEntity:
allOf:
- $ref: '#/components/schemas/kapuaEntity'
description: An Entity that also supports edits and versioning
type: object
properties:
modifiedOn:
description: The date and time when this entity was modified
type: string
format: date-time
readOnly: true
modifiedBy:
allOf:
- $ref: '#/components/schemas/kapuaId'
description: The ID of the Entity who modified this Entity
readOnly: true
optlock:
description: |
The optlock field is used to detect that this entity has not been modified by someone else. When updating an entity, first do a find to get the latest version of the entity and note the value of the optlock. Then in the update operation, set the optlock value to match the value that you found. If someone else has updated the entity between your find and update operations, the update will fail and the db/server will return an error.\
See this [StackOverflow question](http://stackoverflow.com/questions/129329/optimistic-vs-pessimistic-locking) for more information on optimistic locking
type: integer
kapuaNamedEntity:
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntity'
description: An UpdatableEntity that also has a name and a description
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
kapuaQuery:
description: A base object for all Queries
type: object
properties:
limit:
type: integer
default: 50
offset:
type: integer
default: 0
example:
offset: 0
limit: 50
kapuaEntityCreator:
description: An object that contains the informations needed to create an Entity
type: object
kapuaUpdatableEntityCreator:
allOf:
- $ref: '#/components/schemas/kapuaEntityCreator'
description: An object that contains the informations needed to create an Updatable Entity
type: object
kapuaNamedEntityCreator:
allOf:
- $ref: '#/components/schemas/kapuaUpdatableEntityCreator'
description: An object that contains the informations needed to create a Named Entity
type: object
properties:
name:
description: The name of the Entity
type: string
description:
description: The description of the Entity
type: string
required:
- name
kapuaError:
description: The base object to represent an Error
properties:
message:
type: string
description: An extended description of the error that occurred when performing the operation
kapuaErrorCode:
type: string
description: An human readable error code that can be used to
kapuaListResult:
description: A container for all the Entities List
type: object
properties:
limitExceeded:
description: A flag indicating if more results are available but were not returned because of the limit imposed in the query
type: boolean
size:
description: The size of the list containing the items
type: integer
kapuaCountResult:
type: object
properties:
count:
type: integer
description: The total count of the Entities available in the Scope
requestBodies:
kapuaQuery:
description: An object to specify Query options
content:
application/json:
schema:
$ref: '#/components/schemas/kapuaQuery'
responses:
countResult:
description: The count of the available Entities
content:
application/json:
schema:
$ref: '#/components/schemas/kapuaCountResult'
kapuaError:
description: An error occurred while performing the request
content:
application/json:
schema:
$ref: '#/components/schemas/kapuaError'
entityNotFound:
description: The desired entity could not be found
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaError'
properties:
entityType:
description: The type of the entity that could not be found
type: string
entityId:
description: The ID of the entity that could not be found
type: string
illegalArgument:
description: An illegal value has been passes to the operation
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaError'
properties:
argumentName:
description: The name of the argument who holds an illegal value
type: string
argumentValue:
description: The illegal value passed to the operation
type: string
illegalNullArgument:
description: An illegal null argument has been passed to the operation
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaError'
properties:
argumentName:
type: string
description: The name of the argument who holds an illegal null value
subjectUnauthorized:
description: The user performing the operation does not have the required permissions
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/kapuaError'
properties:
permission:
description: 'The permission that is required to perform the operation, and that the current user is missing'
type: string
securitySchemes:
kapuaToken:
description: 'The default AccessToken Security Scheme. A [JWT](https://jwt.io) is used to represent the claims of a user'
type: http
scheme: bearer
bearerFormat: JWT
security:
- kapuaToken: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment