Skip to content

Commit

Permalink
0.81
Browse files Browse the repository at this point in the history
  • Loading branch information
wbouvy committed Jul 5, 2021
1 parent f684080 commit 538d100
Show file tree
Hide file tree
Showing 14 changed files with 149 additions and 99 deletions.
3 changes: 2 additions & 1 deletion event-json-examples/modem-alarm.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"healthLevel": {
"level": "Warning",
"color": "Yellow",
"colorData": { "fill": "DarkYellow", "text": "Yellow" }
"colorData": { "fill": "DarkYellow", "text": "Yellow" },
"severity": "2"
},
"tags": [
{
Expand Down
3 changes: 2 additions & 1 deletion event-json-examples/modem-message-cannot-be-parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"fill": "red",
"text": "red"
},
"catchAll": true
"catchAll": true,
"severity": "3"
},
"tags": [
{
Expand Down
3 changes: 2 additions & 1 deletion event-json-examples/modem-message-delayed.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"colorData": {
"fill": "orange",
"text": "orange"
}
},
"severity": "2"
},
"modemExternalDeviceId": "00 11 22 33 AA BB CC DD"
}
Expand Down
3 changes: 2 additions & 1 deletion event-json-examples/modem-message-dropped.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"colorData": {
"fill": "orange",
"text": "orange"
}
},
"severity": "2"
},
"modemExternalDeviceId": "00 11 22 33 AA BB CC DD"
}
Expand Down
3 changes: 2 additions & 1 deletion event-json-examples/modem-stale.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"fill": "red",
"text": "red"
},
"catchAll": true
"catchAll": true,
"severity": "3"
},
"tags": [
{
Expand Down
3 changes: 2 additions & 1 deletion event-json-examples/modem-transfer-not-received.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"fill": "red",
"text": "red"
},
"catchAll": true
"catchAll": true,
"severity": "3"
},
"tags": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"colorData": {
"fill": "orange",
"text": "orange"
}
},
"severity": "2"
},
"tags": [
{
Expand Down
3 changes: 2 additions & 1 deletion event-json-examples/publisher-auto-disabled.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"fill": "red",
"text": "red"
},
"catchAll": true
"catchAll": true,
"severity": "3"
}
}
}
3 changes: 2 additions & 1 deletion event-json-examples/publisher-failed.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"colorData": {
"fill": "orange",
"text": "orange"
}
},
"severity": "2"
},
"tags": [
{
Expand Down
3 changes: 2 additions & 1 deletion event-json-examples/token-expiry-warning.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"colorData": {
"fill": "orange",
"text": "orange"
}
},
"severity": "2"
}
}
}
23 changes: 23 additions & 0 deletions health.proto
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,29 @@ message HealthLevel {
*/
map<string, string> color_data = 4;

/**
* A numeric representation of the severity of this health level.
* Higher numbers denote a more severe health.
* Note that severity numbers are specific per organization and can change in time.
* For example, some organization might have:
* - Ok, severity 1
* - Warning, severity 2
* - Error, severity 3
*
* That organization could then add a new health level in between Ok and Warning,
* meaning the severity of Warning and Error will change:
* - Ok, severity 1
* - ItsComplicated, severity 2
* - Warning, severity 3
* - Error, severity 4
*
* Long story short:
* - don't cache these levels
* - don't compare levels between organizations
* - only compare these levels when you get them in the same call
*/
int64 severity = 5;

/* Precisely one health level can be assigned as a catch-all for any unknown health levels from alarms (or Hiber systems),
* which can happen when a device manufacturer has provided alarms for your device (e.g. a low battery alarm).
* By default, unknown health levels map to the level of the highest severity,
Expand Down
102 changes: 13 additions & 89 deletions map.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package hiber.map;

import "base.proto";
import "health.proto";
import "modem.proto";

option java_multiple_files = false;
Expand All @@ -14,18 +15,6 @@ option go_package = "hiber";
*/
service MapService {
rpc TileMap (TileMapRequest) returns (TileMapRequest.Response);

/* This call has been deprecated in favour of the Path (ListSatellitesPathRequest) call in SatelliteService.
* It will be removed in a future version.
*/
rpc Satellites (SatellitesRequest) returns (SatellitesRequest.Response) {
option deprecated = true;
};

/* This is the old map request. It has been deprecated and will be removed in a future version. */
rpc Map (MapRequest) returns (MapRequest.Response) {
option deprecated = true;
};
}

/* The location of ground stations that receive the data sent from the satellite(s).
Expand All @@ -45,11 +34,16 @@ message MapTileItem {
message Modem {
string number = 1;
Location location = 2;
health.HealthLevel health_level = 3;
}
message Group {
int32 count = 1;

/* Area that the group covers. Modems are somewhere in this area. More details can be requested from the modem list or by zooming in, */
Area area = 2;

/* The most severe health for the modems in this group. */
health.HealthLevel most_severe_health_level = 3;
}

/* Google maps tile coordinates, counted from the top left of the map. */
Expand Down Expand Up @@ -103,19 +97,16 @@ message TileMapRequest {
/* The icon density on the map. */
Density density = 7;

/* Whether to include any modems from child organizations. */
Filter.ChildOrganizations child_organizations = 8;
}

oneof expanded {
/* Whether to include any modems from child organizations. */
Filter.ChildOrganizations child_organizations = 8;

//// ----- The messages below are deprecated and will be removed in a future version ---- ////
/* Whether to include the health for groups. */
bool include_health = 9;
}
}

/* This call has been deprecated in favour of the Path (ListSatellitesPathRequest) call in SatelliteService.
* It will be removed in a future version.
*/
message Satellite {
option deprecated = true;

message Position {
Timestamp time = 1;
Location location = 2;
Expand All @@ -125,70 +116,3 @@ message Satellite {
string name = 2;
repeated Position positions = 3;
}

/* This call has been deprecated in favour of the Path (ListSatellitesPathRequest) call in SatelliteService.
* It will be removed in a future version.
*/
message SatellitesRequest {
option deprecated = true;

message Response {
repeated Satellite satellites = 1;
}
}

/* Selection object for map data. Filter modems on the map by id, (child)organization.
* Also, filter the map data by level and area restriction, to only display a small area at a detailed map level.
*
* This message has been deprecated in favour of the LocationSelection, to separate the location filtering from level
* and data filtering.
*/
message MapSelection {
option deprecated = true;

message AreaRestriction {
Location bottom_left = 1;
Location top_right = 2;
}

message ShapeRestriction {
repeated Location path = 1;
}

Filter.Modems modems = 1;
reserved 2;
int32 level = 3;
AreaRestriction area = 4;
ShapeRestriction shape = 5;
}

/* Map block that specifies a modem count in a specific area, bounded by a latitude / longitude 'square' (not really a
* square, since the earth is not flat).
*
* This message has been deprecated in favour of the MapTileItem.
*/
message MapBlock {
option deprecated = true;

Area area = 1;
int32 modem_count = 2;
int32 error_count = 3;
float error_percentage = 4;
}

/* This message has been deprecated in favour of the TileMapRequest, which is significantly faster. */
message MapRequest {
option deprecated = true;

message Response {
repeated GroundStation ground_stations = 1;
repeated MapBlock map_blocks = 2;
MapRequest request = 4;
repeated Satellite satellites = 5;
}

/* Pick the organization to use (/impersonate). If unset, your default organization is used. */
string organization = 1;
MapSelection selection = 2;
reserved 3;
}
56 changes: 56 additions & 0 deletions modem.proto
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,55 @@ message ModemSelection {
repeated string transfers_identifiers = 1;
reserved 2, 3;
}
/* Filter to (de)select modems based on their peripherals. */
message Peripherals {
message OneOfValues {
repeated string value = 1;
}

/* Filter to only include modems with all of the given set of peripherals.
* Peripherals are stored as a name-value pair (e.g. bluetooth, 4.0 / bluetooth, BLE).
* To select for multiple versions of a peripheral,
* add the name of the peripheral as a map-key and add a repeated list of versions as the map-value.
*
* For example:
* - include { 'bluetooth' -> [ ] }
* returns all modems that have any version of bluetooth,
* - include { 'bluetooth' -> [ '4.0', '5.0' ] }
* will only return modems that have bluetooth version 4.0 _or_ 5.0,
* - include { 'bluetooth' -> [ '' ] }
* would only select bluetooth peripherals that don't have any version set,
* - include { 'bluetooth' -> [ ], 'LoRaWAN' -> [ ] }
* will only select modems that have both bluetooth (any version) _and_ LoRaWAN (any version),
* - include { 'bluetooth' -> [ ] }, exclude { 'bluetooth' -> [ ] }
* will return an empty list since exclude will take precedence, and
* - include { 'bluetooth' -> [ ] }, exclude { 'bluetooth' -> [ '3.0' ] }
* returns modems that have bluetooth, but not version 3.0.
*/
map<string, OneOfValues> include_and = 1;

/* Filter to exclude modems with any of the given set of peripherals.
* Peripherals are stored as a name-value pair (e.g. bluetooth, 4.0 / bluetooth, BLE).
* To select for multiple versions of a peripheral,
* add the name of the peripheral as a map-key and add a repeated list of versions as the map-value.
*
* For example:
* - exclude { 'bluetooth' -> [ ] }
* returns only modems that do not have any version of bluetooth,
* - exclude { 'bluetooth' -> [ '4.0', '5.0' ] }
* returns modems that might have bluetooth as long as it's not versions 4.0 or 5.0,
* - exclude { 'bluetooth' -> [ '' ] }
* returns modems that might have bluetooth as long as it's version is set to a specific value,
* - exclude { 'bluetooth' -> [ ], 'LoRaWAN' -> [ ] }
* returns modems that don't have bluetooth and/or LoRaWAN.
* - include { 'bluetooth' -> [ ] }, exclude { bluetooth' -> [ ] }
* will return an empty list, since exclusion takes precedence, and
* - include { 'bluetooth' -> [ ] }, exclude { bluetooth' -> [ '3.0' ] }
* returns only modems that have bluetooth, but not version 3.0
*/
map<string, OneOfValues> exclude = 2;
}


Filter.Modems modems = 1;
string free_text_search = 8;
Expand Down Expand Up @@ -302,6 +351,13 @@ message ModemSelection {

hiber.tag.TagSelection filter_by_tags = 2;

/* Filter modem result on specific peripherals. */
oneof peripheral_selection {
Peripherals peripherals = 20;
/* When set to true, only modems that do not have any peripheral will be included in the result. */
bool only_without_peripheral = 21;
}

reserved 3, 17;
}

Expand Down
Loading

0 comments on commit 538d100

Please sign in to comment.