Rest HTTP API
By default the swagger UI is available at this URL : https://localhost:8181/swagger-ui/index.html
- GET /Olog/help/{what}
Get help
Locates the (static) help resource and returns it as a string.
- Parameters:
what (string)
- Query Parameters:
lang (string)
- Status Codes:
200 OK – The contents of the help resource, or
nullif the requested resource could not be found.
- GET /Olog
Get information
Get information about the Olog service
- Status Codes:
200 OK – Information about the Olog service
- GET /Olog/configuration
Get configuration
Get levels, logbooks and tags configuration
- Status Codes:
200 OK – successful operation
- GET /Olog/levels
Get all levels
GET method for retrieving the list of `null <null>`_s in the database.
- PUT /Olog/levels
Create a list of levels
PUT method for the null resource to support the creation of a list of `null <null>`_s
- GET /Olog/levels/{levelName}
Get a level by name
Get method for retrieving the null with name matching levelName
- PUT /Olog/levels/{levelName}
Create a level
If the specified level is marked as default, checks are made to make sure no existing level in the database is marked as default. This is needed to ensure that only one level is defined to be the default.
- Parameters:
levelName (string)
- Status Codes:
200 OK – successful operation
- DELETE /Olog/levels/{levelName}
Delete a level by name
- Parameters:
levelName (string)
- Status Codes:
200 OK – successful operation
- GET /Olog/logbooks/{logbookName}
Get a logbook by name
- Parameters:
logbookName (string)
- Status Codes:
200 OK – successful operation
- PUT /Olog/logbooks/{logbookName}
Create a logbook
- Parameters:
logbookName (string)
- Status Codes:
200 OK – successful operation
- DELETE /Olog/logbooks/{logbookName}
Delete a logbook by name
- Parameters:
logbookName (string)
- Status Codes:
200 OK – successful operation
- GET /Olog/attachment/{attachmentId}
Get an attachment by Id
- GET /Olog/logs
Finds matching log entries
See /Ologs/logs/search (alias) for parameter details.
- Query Parameters:
text (string) – A list of keywords which are present in the log entry description
fuzzy (string) – Allow fuzzy searches
phrase (string) – Finds log entries with the exact same word/s
owner (string) – Finds log entries with the given owner
start (string) – Search for log entries created after given time instant
end (string) – Search for log entries created before the given time instant
includeevents (string) – A flag to include log event times when
tags (string) – Search for log entries with at least one of the given tags
logbooks (string) – Search for log entries with at least one of the given logbooks
attachments (string) – To search for entries with at least one attachment
size (string) – The number of log entries to be returned within each page
attachments – The page number, i.e page 1 is the 1 to 1+size log. entries matching the search
sort (string) – Order the search results based on create time
- Status Codes:
- PUT /Olog/logs
Create a new log entry
Creates a new log entry. If the
inReplyToparameters identifies an existing log entry, this method will treat the new log entry as a reply.This may return a HTTP 400 if for instance
inReplyTodoes not identify an existing log entry, or if the logbooks listed in the {@link Log} object contains invalid (i.e. non-existing) logbooks.Primary use case is upload of log entry without attachments as this type of request is easier to construct, i.e. client need not create a request with multipart items.
- GET /Olog/logs/archived/{logId}
Get an archived log by Id
- Parameters:
logId (string)
- Status Codes:
200 OK – successful operation
- GET /Olog/logs/attachments/{logId}/{attachmentName}
Get an attachment of a determined log
- Parameters:
logId (string)
attachmentName (string)
- Status Codes:
200 OK – successful operation
- PUT /Olog/logs/multipart
Create a new log entry (multipart)
{ "owner":"log", "description":"Beam Dump due to Major power dip Current Alarms Booster transmitter switched back to lower state.", "level":"Info", "title":"Some title", "logbooks":[ { "name":"Operations" } ], "attachments":[ {"id": "82dd67fa-09df-11ee-be56-0242ac120002", "filename":"MyScreenShot.png"}, {"id": "c02948ad-4bbd-432f-aa4d-a687a54f8d40", "filename":"MySpreadsheet.xlsx"} ] }
NOTE Attachment ids must be unique, e.g. UUID. When creating a log entry - optionally with attachments - client must:
Use a multipart request and set the Content-Type to “multipart/form-data”, even if no attachments are present.
#. If attachments are present: add one request part per attachment file, in the order they appear in the log entry. Each file must be added using “files” as the name for the part. #. Add the log entry as a request part with content type “application/json”. The name of the part must be “logEntry”.
This may return a HTTP 400 if for instance
inReplyTodoes not identify an existing log entry, or if the logbooks listed in the {@link Log} object contains invalid (i.e. non-existing) logbooks.Client must also be prepared to handle a HTTP 413 (payload too large) response in case the attached files exceed file and request size limits configured in the service.
- GET /Olog/logs/rss
Get RSS feed
GET method for retrieving an RSS feed of channels
- Query Parameters:
text (string) – A list of keywords which are present in the log entry description
fuzzy (string) – Allow fuzzy searches
phrase (string) – Finds log entries with the exact same word/s
owner (string) – Finds log entries with the given owner
start (string) – Search for log entries created after given time instant
end (string) – Search for log entries created before the given time instant
includeevents (string) – A flag to include log event times when
tags (string) – Search for log entries with at least one of the given tags
logbooks (string) – Search for log entries with at least one of the given logbooks
attachments (string) – To search for entries with at least one attachment
size (string) – The number of log entries to be returned within each page
attachments – The page number, i.e page 1 is the 1 to 1+size log. entries matching the search
sort (string) – Order the search results based on create time
- Status Codes:
200 OK – the name of the RSS feed view, which will be resolved to render the feed
- GET /Olog/logs/search
Finds matching log entries
Finds matching log entries For time based search requests the client may specify a tz parameter indicating the client’s time zone. The format must be recognized as a valid zone identifier, see for instance https://docs.oracle.com/javase/8/docs/api/java/time/ZoneId.html. If the client does not specify the time zone, the time zone of the service is used to compute start end end timestamps. An invalid time zone specifier will result in a HTTP 400 (bad request) response.
Example:
GET https://localhost:8181/Olog/logs/search?desc=dump&logbooks=Operations
The above search request will return all log entires with the term “dump” in their descriptions and which are part of the Operations logbook.
Retrieving an attachment of a log entry
GET https://localhost:8181/Olog/logs/attachments/{logId}/{filename}
Find entries with at least one attachment of type ‘image’
GET https://localhost:8181/Olog/logs/search?attachments=image
- Query Parameters:
text (string) – A list of keywords which are present in the log entry description
fuzzy (string) – Allow fuzzy searches
phrase (string) – Finds log entries with the exact same word/s
owner (string) – Finds log entries with the given owner
start (string) – Search for log entries created after given time instant
end (string) – Search for log entries created before the given time instant
includeevents (string) – A flag to include log event times when
tags (string) – Search for log entries with at least one of the given tags
logbooks (string) – Search for log entries with at least one of the given logbooks
attachments (string) – To search for entries with at least one attachment
size (string) – The number of log entries to be returned within each page
attachments – The page number, i.e page 1 is the 1 to 1+size log. entries matching the search
sort (string) – Order the search results based on create time
- Status Codes:
- GET /Olog/logs/{logId}
Get a log by Id
- Parameters:
logId (string)
- Status Codes:
200 OK – successful operation
- POST /Olog/logs/{logId}
Update a log entry
Updates existing log record. Data sent by client is saved, i.e. if client specifies a shorter list of logbooks or tags, the updated log record will reflect that. However, the following data is NOT updated:
- Attachments
- Created date
- Events
- Parameters:
logId (string)
- Query Parameters:
markup (string)
- Status Codes:
200 OK – The updated log record, or HTTP status 404 if the log record does not exist. If the path variable does not match the id in the log record, HTTP status 400 (bad request) is returned.
- GET /Olog/properties
Get all properties
GET method to retrieve the list of all active properties. If the inactive flag is set true
- PUT /Olog/properties
Create a list of properties
PUT method for creating multiple properties.
- Status Codes:
200 OK – The list of successfully created properties
- GET /Olog/properties/{propertyName}
Get a property by name
- Parameters:
propertyName (string)
- Status Codes:
200 OK – successful operation
- PUT /Olog/properties/{propertyName}
Create a property
- Parameters:
propertyName (string)
- Status Codes:
200 OK – successful operation
- DELETE /Olog/properties/{propertyName}
Delete a property by name
- Parameters:
propertyName (string)
- Status Codes:
200 OK – successful operation
- GET /Olog/tags
Get all tags
GET method for retrieving the list of tags in the database.
- Status Codes:
200 OK – list of tags
- PUT /Olog/tags
Create a list of tags
PUT method for the tags resource to support the creation of a list of tags
- Status Codes:
200 OK – the list of tags created
- GET /Olog/tags/{tagName}
Get a tag by name
Get method for retrieving the tag with name matching tagName
- Parameters:
tagName (string)
- Status Codes:
200 OK – the matching tag, or null
- PUT /Olog/tags/{tagName}
Create a tag
PUT method for creating a tag.
- Parameters:
tagName (string)
- Status Codes:
200 OK – the created tag
- DELETE /Olog/tags/{tagName}
Delete a tag by name
- Parameters:
tagName (string)
- Status Codes:
200 OK – successful operation
- GET /Olog/templates
Get all templates
- PUT /Olog/templates
Create a new template
Log entry templates can be added to the storage to support use cases when the same type of log entries need to be created on a regular basis. Templates have the same structure a regular log entries, except for attachments. In the client UI (currently only CS Studio/Phoebus) users may select from a list of templates, if available. Upon selection of a template, the client will populate the editor’s input controls based on the template content.