Jouko API (0.0.4)

Download OpenAPI specification:Download

Jouko API spec

Authentication

bearer

Security scheme type: API Key
header parameter name: Authorization

Interruption Groups

List interruption groups

Authorizations:
query Parameters
firstResult
required
integer

The offset of the first result

maxResults
required
integer

The maximum number of results

Responses

200

Success

401

Unauthorized

500

Internal server error

get /admin/interruptiongroups/
/v1/admin/interruptiongroups/

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]

Create interruption group

Authorizations:
Request Body schema: application/json;charset=utf-8
id
required
integer <int64>

Interruption id

startTime
required
string <date-time>

Start time of the interruption, inclusive

endTime
required
string <date-time>

End time of the interruption, exclusive

overbookingFactor
number <double>

Overbooking factor

powerSavingGoalInWatts
integer <int64>

The amount of power this interruption is supposed to save, in watts

Responses

200

Success

401

Unauthorized

500

Internal server error

post /admin/interruptiongroups/
/v1/admin/interruptiongroups/

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "startTime": "2018-11-22T07:09:34Z",
  • "endTime": "2018-11-22T07:09:34Z",
  • "overbookingFactor": 0,
  • "powerSavingGoalInWatts": 0
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "startTime": "2018-11-22T07:09:34Z",
  • "endTime": "2018-11-22T07:09:34Z",
  • "overbookingFactor": 0,
  • "powerSavingGoalInWatts": 0
}

Delete interruption

Deletes an interruption

Authorizations:
path Parameters
groupId
required
integer <int64>

The id of the interruption being deleted

Responses

204

Success

401

Unauthorized

500

Internal server error

delete /admin/interruptiongroups/{groupId}
/v1/admin/interruptiongroups/{groupId}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "message": "string"
}

Interruptions

Retreive interruption group

Authorizations:
path Parameters
groupId
required
integer <int64>

The id of the interruption group

Responses

200

Success

401

Unauthorized

500

Internal server error

get /admin/interruptiongroups/{groupId}
/v1/admin/interruptiongroups/{groupId}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "startTime": "2018-11-22T07:09:34Z",
  • "endTime": "2018-11-22T07:09:34Z",
  • "overbookingFactor": 0,
  • "powerSavingGoalInWatts": 0
}

Update interruption group

Authorizations:
path Parameters
groupId
required
integer <int64>

The id of the interruption group

Request Body schema: application/json;charset=utf-8
id
required
integer <int64>

Interruption id

startTime
required
string <date-time>

Start time of the interruption, inclusive

endTime
required
string <date-time>

End time of the interruption, exclusive

overbookingFactor
number <double>

Overbooking factor

powerSavingGoalInWatts
integer <int64>

The amount of power this interruption is supposed to save, in watts

Responses

200

Success

401

Unauthorized

500

Internal server error

put /admin/interruptiongroups/{groupId}
/v1/admin/interruptiongroups/{groupId}

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "startTime": "2018-11-22T07:09:34Z",
  • "endTime": "2018-11-22T07:09:34Z",
  • "overbookingFactor": 0,
  • "powerSavingGoalInWatts": 0
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "startTime": "2018-11-22T07:09:34Z",
  • "endTime": "2018-11-22T07:09:34Z",
  • "overbookingFactor": 0,
  • "powerSavingGoalInWatts": 0
}

List interruptions

Authorizations:
path Parameters
userId
required
integer <int64>

The user whose interruptions we list

query Parameters
fromTime
required
string <date-time>

List interruptions that start after this point of time, inclusive

toTime
required
string <date-time>

List interruptions that end before this point of time, exclusive

deviceId
integer <int64>

The device id whose interruptions we list, list all if omitted

Responses

200

Success

401

Unauthorized

500

Internal server error

get /users/{userId}/interruptions
/v1/users/{userId}/interruptions

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]

Set interruption's cancellation status

Authorizations:
path Parameters
userId
required
integer <int64>

The user who owns the interruption

interruptionId
required
integer <int64>

The id of the interruption to set cancellation status of

Request Body schema: application/json;charset=utf-8
cancelled
required
boolean

True if the interruption has been cancelled

Responses

200

Success

401

Unauthorized

500

Internal server error

put /users/{userId}/interruptions/{interruptionId}/cancelled
/v1/users/{userId}/interruptions/{interruptionId}/cancelled

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "cancelled": true
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "cancelled": true
}

ControllerDevices

List all controller devices

Authorizations:
query Parameters
firstResult
required
integer

The offset of the first result

maxResults
required
integer

The maximum number of results

Responses

200

Success

401

Unauthorized

500

Internal server error

get /admin/controllerDevices
/v1/admin/controllerDevices

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]

Create controller device

Authorizations:
Request Body schema: application/json;charset=utf-8
id
integer <int64>

Controller device id

eui
required
string

The EUI of the controller device

key
required
string

The key of the controller device

communicationChannel
string

The communication channel of the controller device

Responses

200

Success

401

Unauthorized

500

Internal server error

post /admin/controllerDevices
/v1/admin/controllerDevices

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "eui": "string",
  • "key": "string",
  • "communicationChannel": "string"
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "eui": "string",
  • "key": "string",
  • "communicationChannel": "string"
}

Retreive controller device

Authorizations:
path Parameters
controllerDeviceId
required
integer <int64>

The id of the controller device

Responses

200

Success

401

Unauthorized

500

Internal server error

get /admin/controllerDevices/{controllerDeviceId}
/v1/admin/controllerDevices/{controllerDeviceId}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "eui": "string",
  • "key": "string",
  • "communicationChannel": "string"
}

Update controller device

Authorizations:
path Parameters
controllerDeviceId
required
integer <int64>

The id of the controller device

Request Body schema: application/json;charset=utf-8
id
integer <int64>

Controller device id

eui
required
string

The EUI of the controller device

key
required
string

The key of the controller device

communicationChannel
string

The communication channel of the controller device

Responses

200

Success

401

Unauthorized

500

Internal server error

put /admin/controllerDevices/{controllerDeviceId}
/v1/admin/controllerDevices/{controllerDeviceId}

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "eui": "string",
  • "key": "string",
  • "communicationChannel": "string"
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "eui": "string",
  • "key": "string",
  • "communicationChannel": "string"
}

Delete controller

Deletes an controller

Authorizations:
path Parameters
controllerDeviceId
required
integer <int64>

The id of the controller

Responses

204

Success

401

Unauthorized

500

Internal server error

delete /admin/controllerDevices/{controllerDeviceId}
/v1/admin/controllerDevices/{controllerDeviceId}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "message": "string"
}

Devices

List all measurements

Authorizations:
path Parameters
userId
required
integer <int64>

The id of the user

query Parameters
fromTime
required
string <date-time>

List measurements that start after this point of time, inclusive

toTime
required
string <date-time>

List measurements that end before this point of time, exclusive

Responses

200

Success

401

Unauthorized

500

Internal server error

get /users/{userId}/powerMeasurements
/v1/users/{userId}/powerMeasurements

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]

List all measurements by device

Authorizations:
path Parameters
userId
required
integer <int64>

The id of the user

deviceId
required
integer <int64>

The id of the device

query Parameters
fromTime
required
string <date-time>

List measurements that start after this point of time, inclusive

toTime
required
string <date-time>

List measurements that end before this point of time, exclusive

Responses

200

Success

401

Unauthorized

500

Internal server error

get /users/{userId}/devices/{deviceId}/powerMeasurements
/v1/users/{userId}/devices/{deviceId}/powerMeasurements

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]

List all devices

Authorizations:
query Parameters
firstResult
required
integer

The offset of the first result

maxResults
required
integer

The maximum number of results

Responses

200

Success

401

Unauthorized

500

Internal server error

get /admin/devices
/v1/admin/devices

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]

Create device

Authorizations:
Request Body schema: application/json;charset=utf-8
id
integer <int64>

Device id

name
required
string

The name of the device

userId
integer <int64>

Device user id

controllerId
integer <int64>

Device controller id

Responses

200

Success

401

Unauthorized

500

Internal server error

post /admin/devices
/v1/admin/devices

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "name": "string",
  • "userId": 0,
  • "controllerId": 0
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "name": "string",
  • "userId": 0,
  • "controllerId": 0
}

Retreive device

Authorizations:
path Parameters
deviceId
required
integer <int64>

The id of the device

Responses

200

Success

401

Unauthorized

500

Internal server error

get /admin/devices/{deviceId}
/v1/admin/devices/{deviceId}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "name": "string",
  • "userId": 0,
  • "controllerId": 0
}

Update device

Authorizations:
path Parameters
deviceId
required
integer <int64>

The id of the device

Request Body schema: application/json;charset=utf-8
id
integer <int64>

Device id

name
required
string

The name of the device

userId
integer <int64>

Device user id

controllerId
integer <int64>

Device controller id

Responses

200

Success

401

Unauthorized

500

Internal server error

put /admin/devices/{deviceId}
/v1/admin/devices/{deviceId}

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "name": "string",
  • "userId": 0,
  • "controllerId": 0
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "name": "string",
  • "userId": 0,
  • "controllerId": 0
}

List devices

Authorizations:
path Parameters
userId
required
integer <int64>

The user who owns the interruption

query Parameters
firstResult
required
integer

The offset of the first result

maxResults
required
integer

The maximum number of results

Responses

200

Success

401

Unauthorized

500

Internal server error

get /users/{userId}/devices
/v1/users/{userId}/devices

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]

Get the power consumption of the given device in a time period

Authorizations:
path Parameters
userId
required
integer <int64>

The user that owns the device

deviceId
required
integer <int64>

The device whose power consumption we measure

query Parameters
fromTime
required
string <date-time>

The start of the time period that we measure the consumption in, inclusive

toTime
required
string <date-time>

The end of the time period that we measure the consumption in, exclusive

Responses

200

Success

401

Unauthorized

500

Internal server error

get /users/{userId}/devices/{deviceId}/powerConsumption
/v1/users/{userId}/devices/{deviceId}/powerConsumption

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "averageConsumptionInWatts": 0
}

Users

List all users

Authorizations:
query Parameters
firstResult
required
integer

The offset of the first result

maxResults
required
integer

The maximum number of results

Responses

200

Success

401

Unauthorized

500

Internal server error

get /admin/users
/v1/admin/users

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]

Create user

Authorizations:
query Parameters
token
string

Keycloak token

Request Body schema: application/json;charset=utf-8
id
integer <int64>

User id

keycloakId
string <uuid>

The keycloak id of the user

firstName
string

The firstname id of the user

lastName
string

The lastname id of the user

email
string

The email id of the user

username
string

The username id of the user

Responses

200

Success

401

Unauthorized

500

Internal server error

post /admin/users
/v1/admin/users

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "keycloakId": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "username": "string"
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "keycloakId": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "username": "string"
}

Retreive user

Authorizations:
path Parameters
userId
required
integer <int64>

The id of the user

Responses

200

Success

401

Unauthorized

500

Internal server error

get /admin/users/{userId}
/v1/admin/users/{userId}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "keycloakId": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "username": "string"
}

Update user

Authorizations:
path Parameters
userId
required
integer <int64>

The id of the user

Request Body schema: application/json;charset=utf-8
id
integer <int64>

User id

keycloakId
string <uuid>

The keycloak id of the user

firstName
string

The firstname id of the user

lastName
string

The lastname id of the user

email
string

The email id of the user

username
string

The username id of the user

Responses

200

Success

401

Unauthorized

500

Internal server error

put /admin/users/{userId}
/v1/admin/users/{userId}

Request samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "keycloakId": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "username": "string"
}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "keycloakId": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "username": "string"
}

Get an user by keycloak id

Authorizations:
path Parameters
keycloakId
required
string <uuid>

The keycloak id of the user to look up

Responses

200

Success

401

Unauthorized

500

Internal server error

get /keycloakUsers/{keycloakId}
/v1/keycloakUsers/{keycloakId}

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
{
  • "id": 0,
  • "keycloakId": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "username": "string"
}

List users

Authorizations:
query Parameters
token
string

Keycloak token

Responses

200

Success

401

Unauthorized

500

Internal server error

get /keycloakUsers
/v1/keycloakUsers

Response samples

application/json;charset=utf-8
Copy
Expand all Collapse all
[
  • {
    }
]