https://www.home-assistant.io/integrations/rest_command/
rest_command:
hellstorm_stream_request:
url: http://192.168.10.148/api/v1/replaceAndPlay
method: POST
headers:| server: | |
| port: 8080 | |
| tls.private-key.keystore: | |
| resource.resource-path: server.p12 | |
| passphrase: password |
| @ServerEndpoint("/ws/echo") | |
| public class EchoEndpoint { | |
| @OnMessage | |
| public void onMessage(Session session, String message) throws Exception { | |
| session.getBasicRemote().sendText("Did you send " + message + "?"); | |
| } | |
| } |
| public static void main(String[] args) { | |
| WebServer.builder( | |
| Routing.builder() | |
| .register("/ws", TyrusSupport.builder() | |
| .register(ServerEndpointConfig.Builder.create(WsEndpoint.class, "/echo").build()) | |
| .build() | |
| ) | |
| ) | |
| .port(8080) | |
| .tls(WebServerTls.builder() |
| @Path("/example") | |
| @ApplicationScoped | |
| public class LRAExampleResource { | |
| @PUT | |
| @LRA(value = LRA.Type.REQUIRES_NEW, timeLimit = 500, timeUnit = ChronoUnit.MILLIS) | |
| @Path("start-example") | |
| public Response startExample(@HeaderParam(LRA_HTTP_CONTEXT_HEADER) URI lraId, String data){ | |
| // Executed in the scope of new LRA transaction | |
| return Response.ok().build(); |
https://www.home-assistant.io/integrations/rest_command/
rest_command:
hellstorm_stream_request:
url: http://192.168.10.148/api/v1/replaceAndPlay
method: POST
headers:kec@romulus:~$ cat /etc/NetworkManager/dispatcher.d/10-vpnupdown
#!/bin/bash
session_user="kec"
session_bus=unix:path=/run/user/$(id -u $session_user)/bus
session_display=$(who | grep $session_user | awk '{print $2}')
as_user="sudo -Hu kec DISPLAY=${session_display} DBUS_SESSION_BUS_ADDRESS=${session_bus}"
if [ "$2" = "vpn-up" ]; then| <dependency> | |
| <groupId>io.helidon.microprofile.messaging</groupId> | |
| <artifactId>helidon-microprofile-messaging</artifactId> | |
| </dependency> | |
| <dependency> | |
| <groupId>io.helidon.messaging.kafka</groupId> | |
| <artifactId>helidon-messaging-kafka</artifactId> | |
| </dependency> | |
| <dependency> | |
| <groupId>io.cloudevents</groupId> |
| connector: | |
| helidon-kafka: | |
| bootstrap.servers: ${oci.test-stream.endpoint}:${oci.test-stream.port} | |
| ... | |
| key.serializer: org.apache.kafka.common.serialization.StringSerializer | |
| key.deserializer: org.apache.kafka.common.serialization.StringDeserializer | |
| value.serializer: io.cloudevents.kafka.CloudEventSerializer | |
| value.deserializer: io.cloudevents.kafka.CloudEventDeserializer |
| final SubmissionPublisher<CloudEvent> emitter = new SubmissionPublisher<>(); | |
| @Outgoing("to-stream") | |
| public PublisherBuilder<CloudEvent> registerEmitter() { | |
| return ReactiveStreams.fromPublisher(FlowAdapters.toPublisher(emitter)); | |
| } | |
| @POST | |
| @Path("/send/{msg}") | |
| public void send(@PathParam("msg") String payload) { |