Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
grafnu committed Oct 6, 2024
1 parent 33fa166 commit 96d85fb
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 44 deletions.
6 changes: 3 additions & 3 deletions .gencode_hash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
fb876b8f7bfdccf156d751efddf2660a7a7ab5585e89be0f82c59f7a61e68d4c gencode/docs/config.html
22bfb3fd7c0e73dac4cbd830aa7983714917ec6da813f6bf5768ce3aa9786fb2 gencode/docs/config_mapping.html
1ce30b7c554a0be09a9124707cb5602dce78753304cca17c06268ecb3337da51 gencode/docs/configuration_endpoint.html
136eeb98d4db5c2427498b0483e0fb8e73bc3dcb962f0ab942f7b98115b1b71f gencode/docs/configuration_execution.html
f4937abf377ef27e18e2dba77589fa08f2d955cf85a905f360ddaf4ad0bea0c3 gencode/docs/configuration_pod.html
17313ca8d3e85d6a337affcb3de4411c5ff4ba18fc5485d95b4954b2e7992257 gencode/docs/configuration_execution.html
000dbd5e7ca6b9f08b9a6cfc1844486af1e0a2f4622ca0f2774122600ed3ea1d gencode/docs/configuration_pod.html
4d327975ae4d48a5dd920f298931fc5056a7239d677e61a9f4d129068316dd0a gencode/docs/configuration_pubber.html
f24d15e549f1b143b50d6011f2f7fd03286e1cd128a3e25591195b25f8efc472 gencode/docs/data_template.html
45d39c61ce39afc0d14f3dc99a93947587d63999cd373cb44b63ce8f576c6e7e gencode/docs/events.html
Expand Down Expand Up @@ -81,7 +81,7 @@ e256275d840d94c6e61316e756b0dad6d823db8900e35e785f6ef5001fdb5fc9 gencode/java/u
a773f8271a99f96a3fb09ceb79bc4022a8b7ab941f5e6246e073703d33022b99 gencode/java/udmi/schema/GatewayConfig.java
0f176bbd9748ac357ebcb7cf9ba66fca4f4768ce40a2a1436bb6d14093ee8101 gencode/java/udmi/schema/GatewayModel.java
1f7f6809e143e9e3e13e6fa73776a893b62b0c05f8802087b1e276dc0ab83e19 gencode/java/udmi/schema/GatewayState.java
6ffcc0820c02c9f83787f3102389380b5d4da20c4d813219964151bdfebf335e gencode/java/udmi/schema/IotAccess.java
175bdf9cc0b376b7f6c6b21174cb0ec568c49a1026e99bbdbc264b3cea7e7702 gencode/java/udmi/schema/IotAccess.java
d0858bd7ba306176f4e3c19eeb69ef2467afec0832b6917b72d3ab87469e4974 gencode/java/udmi/schema/Jwt.java
5a0cc53317592a868f7f23a67a7493bd571054bb25d9e28de51000ad6473dfeb gencode/java/udmi/schema/Level.java
6b4c29a682d0697d5420efb9e7788ec7358d94435da288938007205b8669e180 gencode/java/udmi/schema/LocalnetConfig.java
Expand Down
72 changes: 38 additions & 34 deletions docs/tools/project_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,46 @@

`//provider/project[/namespace][+user]`

* `provider`
* `provider`: Primary providers supported by the tools
* `gbos`
* `pref`
* `gref`
* `mqtt`
* `pubsub`
* `project`
* GCP project
* IoT Core project
* `namespace`
* default
* k8s namespace
* pubsub namespace
* `user`
* canonical users
* individual users
* `pubsub` (only works with `validator`)
* `project`: Meaning depends on the provider
* `gbos`: IoT Core project id
* `gref`, `pubsub`: GCP project id
* `mqtt`: Broker hostname (currently only `localhost` fully supported)
* `namespace`: Allows multiple parallel instances for a given project
* Automatically prefixed to necessary resources
* Defaults to an _empty_ prefix
* `user`: Allows multiple concurrent users on the same project
* `gbos`, `mqtt`: Not supported, will cause runtime error
* `gref`, `pubsub`: Defaults to `debug` if not speificed

* Examples

`//gbos/bos-platform-dev`
`//gbos/bos-platform-dev/peringknife`
`//mqtt/localhost`
`//pubsub/bos-platform-dev/peringknife+debug`
`//pref/bos-platform-dev`

* Tool Support

* registrar
* not `pubsub`
* validator
* allows `pubsub`
* sequencer
*
* pull_messages
* `mqtt`
* `pubsub`




* `//gbos/bos-platform-dev`
* MQTT client: `projects/bos-platform-dev/locations/us-central1/registries/UDMI-REFLECT/devices/ZZ-TRI-FECTA`
* `//gbos/bos-platform-dev+debug` (only one _client_ is currently allowed using `gbos`)
* Error: `user name not supported for provider gbos`
* `//gbos/bos-platform-dev/faucetsdn`
* MQTT client: `projects/bos-platform-dev/locations/us-central1/registries/faucetsdn~UDMI-REFLECT/devices/faucetsdn~ZZ-TRI-FECTA`
* `//gref/bos-platform-dev` (if no _user_ is supplied, it defaults to `debug`)
* PubSub topic: `projects/bos-platform-dev/topics/udmi_reflect`
* PubSub subscription: `projects/bos-platform-dev/subscriptions/udmi_reply+debug`
* `//gref/bos-platform-dev+username`
* PubSub topic: `projects/bos-platform-dev/topics/udmi_reflect`
* PubSub subscription: `projects/bos-platform-dev/subscriptions/udmi_reply+username`
* `//gref/bos-platform-dev/faucetsdn+username`
* PubSub topic: `projects/bos-platform-dev/topics/faucetsdn~udmi_reflect`
* PubSub subscription: `projects/bos-platform-dev/subscriptions/faucetsdn~udmi_reply+username`
* `//mqtt/localhost`
* MQTT client: `/r/UDMI-REFLECT/d/ZZ-TRI-FECTA`
* `//mqtt/localhost+debug` (only one _client_ is currently allowed using `mqtt`)
* Error: `user name not supported for provider mqtt`
* `//pubsub/bos-platform-dev` (only works for `validator`)
* PubSub subscription: `projects/bos-platform-dev/subscriptions/udmi_target+debug`
* PubSub topic: `projects/bos-platform-dev/topics/udmi_target`
* `//pubsub/bos-platform-dev/faucetsdn+username` (only works for `validator`)
* PubSub subscription: `projects/bos-platform-dev/subscriptions/faucetsdn~udmi_target+username`
* PubSub topic: `projects/bos-platform-dev/topics/faucetsdn~udmi_target`
2 changes: 1 addition & 1 deletion gencode/docs/configuration_execution.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gencode/docs/configuration_pod.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion gencode/java/udmi/schema/IotAccess.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion schema/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"dynamic",
"implicit",
"pubsub",
"pref",
"mqtt",
"gbos",
"gref",
"etcd",
"jwt",
"clearblade"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static com.google.udmi.util.GeneralUtils.catchOrElse;
import static com.google.udmi.util.GeneralUtils.catchToNull;
import static com.google.udmi.util.GeneralUtils.ifNotNullThen;
import static com.google.udmi.util.GeneralUtils.ifNotNullThrow;
import static com.google.udmi.util.GeneralUtils.ifTrueGet;
import static com.google.udmi.util.GeneralUtils.sha256;
import static com.google.udmi.util.SiteModel.DEFAULT_CLEARBLADE_HOSTNAME;
Expand Down Expand Up @@ -181,6 +182,7 @@ public static MqttPublisher from(ExecutionConfiguration iotConfig,
BiConsumer<String, String> messageHandler, Consumer<Throwable> errorHandler) {
final byte[] keyBytes;
checkNotNull(iotConfig.key_file, "missing key file in config");
ifNotNullThrow(iotConfig.user_name, "user name not supported for provider " + iotConfig.iot_provider);
try {
keyBytes = getFileBytes(iotConfig.key_file);
LOG.info(format("Loaded key %s as sha256 %s", iotConfig.key_file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public class SequenceBase {
private static final long EVENT_WAIT_DELAY_MS = 1000;
private static final Duration STATE_TIMESTAMP_ERROR_THRESHOLD = Duration.ofMinutes(20);
private static final Set<IotAccess.IotProvider> SEQUENCER_PROVIDERS = ImmutableSet.of(
IotProvider.GBOS, IotProvider.MQTT, IotProvider.PREF);
IotProvider.GBOS, IotProvider.MQTT, IotProvider.GREF);
protected static Metadata deviceMetadata;
protected static String projectId;
protected static String cloudRegion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static MessagePublisher from(ExecutionConfiguration iotConfig,
iotConfig.reflector_endpoint = null;
}
return switch (iotProvider) {
case PREF -> PubSubReflector.from(iotConfig, messageHandler, errorHandler);
case GREF -> PubSubReflector.from(iotConfig, messageHandler, errorHandler);
case MQTT, JWT, GBOS -> MqttPublisher.from(iotConfig, messageHandler, errorHandler);
case PUBSUB -> PubSubClient.from(iotConfig, messageHandler, errorHandler);
default -> throw new RuntimeException("Unsupported iot provider " + iotProvider);
Expand Down

0 comments on commit 96d85fb

Please sign in to comment.