gateway | WebThings Gateway - Web of Things gateway | Networking library
kandi X-RAY | gateway Summary
kandi X-RAY | gateway Summary
Web of Things gateway.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gateway
gateway Key Features
gateway Examples and Code Snippets
public static void main(String[] args) throws UnknownHostException {
SpringApplication app = new SpringApplication(GatewayApp.class);
DefaultProfileUtil.addDefaultProfile(app);
Environment env = app.run(args).getEnvironment();
@Override
public List get() {
List resources = new ArrayList<>();
//Add the default swagger resource that correspond to the gateway's own swagger doc
resources.add(swaggerResource("default", "/v2/api-docs"));
protected APIGatewayProxyResponseEvent apiGatewayProxyResponseEvent(Integer statusCode, T body) {
var apiGatewayProxyResponseEvent = new APIGatewayProxyResponseEvent().withHeaders(headers());
try {
apiGatewayProxyResponseEvent
Community Discussions
Trending Discussions on gateway
QUESTION
i am currently building a Client to communicate with a Gateway of a Charge Point.
The communication is build with OcppV1.5 over Soap & Http.
The Server doesn't accept my request. I get a Http Response 500 with the Error Reason:
"XML Request is not well formed, Action does not exist."
I looked into the wsdl files but I just don't understand why it doesn't accept my action.
My Request looks something like this:
...ANSWER
Answered 2021-Jun-13 at 09:11It's hard to tell from what you posted why you are getting an error, so I can only add some information that can hopefully allow you to troubleshoot the issue.
Your message has WS-Addressing headers, being one of them. The value of this field should be specified in the WSDL if your WSDL also includes WS-Addressing Metadata information, or should be specified in the documentation of the web service you are invoking. Your error message "XML Request is not well formed, Action does not exist" seems to indicate that there might be an issue with this field, but there is another action that SOAP services have which is a SOAP action. I asked about it in the comment above to make sure it's eliminated as a source of problems. In SOAP 1.1 it's called
SOAPAction
and is a separate HTTP header, while in SOAP 1.2 it's an action
parameter on the HTTP Content-Type
header. Based on the http://www.w3.org/2003/05/soap-envelope
namespace, you have a SOAP 1.2 message.
With these explanations layed out, I suggest you take the WSDL and feed it to SoapUI who can generate sample requests that you can use to invoke the web service. If the WSDL also contains WS-Addressing Metadata, SoapUI should be able to pick it up and help you fill in the values you need. If not, look again through the WSDL for Action
elements (make sure you differentiate between the SOAP Action and the WS-Addressing Action using their XML namespaces) or through the service documentation.
Once you get a succesfull call using SoapUI, then try to duplicate it with your code. At that point you can again use SoapUI to troubleshoot things and inspect your code built message to see it resembles the one you can successfully send with SoapUI.
Hope this helps get you closer to a resolution.
QUESTION
I would like to display all my traces like in the examples from the moleculer-jaeger package:
But what i get is something like this: All spans you can see in this picture should be within the main trace (gateway).
Here is my moleculer.config:
...ANSWER
Answered 2021-Jun-14 at 21:33- This version already has a built-in jager tracer, see the documentation.
- In order for the events to be nested, it is necessary to transfer the context inside the actions, use
ctx.call
calls instead ofbroker.call
, so they will be nested. - To quickly receive support for the moleculer, join us in discord!
QUESTION
I have a REST API which receives a POST request from a client application.
...ANSWER
Answered 2021-Jun-14 at 14:28Your current flow does not return a value, you are simply logging the message.
A terminating .log()
ends the flow.
Delete the .log()
element so the result of the transform will automatically be routed back to the gateway.
Or add a .bridge()
(a bridge to nowhere) after the log and it will bridge the output to the reply channel.
QUESTION
How to remove first line with names level_0
and all and convert index 0
as columns.
ANSWER
Answered 2021-Jun-14 at 08:42I suggest first create MultiIndex in columns
by header=[0,1]
by convert first 2 headers rows:
QUESTION
Started to develop a wiresless 'cable' solution (with websockets) between two ESPs, a wireless serial 'cable' between computer and a serial device to mimick a direct wired connection. Was working great however just accidentally fried one of the ESPs (short a serial cable connection to higher voltage - sigh) when testing. Replaced one of the ESP32s with an ESP8266. Suspect this should work however it did not.
The problem is the ESP8266 (client) cannot find the network of the ESP32 (server). Why it doesn't work? My computer can see the server and can connect. Fried ESP32 the same, no problem.
Tried the WiFiScan demo on the ESP8266 and can detect all other WiFi SSIDs/MACs in neighborhood however cannot detect the ESP32 server it's SSID/MAC.
Why it doesn't work? What is the difference and how can I solve this?
ESP32 - code of the server
...ANSWER
Answered 2021-Jun-14 at 07:45WiFi channels 12-14 are not used in some countries (e.g. US). Perhaps the ESP32 AP picked one of those channels, and ESP8266 is configured by default with settings from a country which doesn't allow them. Set the AP channel to some reasonably safe value in range 1-11.
I can see that the default channel should be 1, but I'd suggest experimenting with it, perhaps setting it to 6:
QUESTION
I need to set up the circuit break policy so that it would break the circuit only for some specific requests.
I have a sort of a gateway A calling API B which in turn calls C or D. I'm setting up a circuit breaker policy in A. Initial request arriving on A has a parameter that is later used to decide whether to call C or D, lets say http://gateway.A.com?usageParam=C
. I'd like to have circuit breaker configured in such a way, that circuit could be open separately for C and D. I mean that if D is failing, calls with usageParam=D
should fail immediately but usageParam=C
should still go fine and vice versa.
ANSWER
Answered 2021-Jun-14 at 06:57To put it simple a Circuit Breaker can have only just a single state. One of these: Closed
, Open
, Half-Open
.
You should consider the CB as a proxy. It allows each request to go trough it if the downstream system is considered health. If CB detects transient failure (by examining the responses if any) then it will shortcut the execution by denying all requests.
So, if you want to differentiate the healthiness of C
and D
downstream systems then you would need two CBs (one for each). That allows you to separately allow or deny outgoing requests against different subsystems.
You can place the two CBs inside service A
. Here you can register two named HttpClients which are decorated with different Circuit Breakers:
QUESTION
I'm stuck to get data from gathered fact, using calculated data as part of query.
I am using 2.9 ansible and here is my task
...ANSWER
Answered 2021-Jun-13 at 20:44Remove the dot if you use the indirect addressing
QUESTION
In my GCP project, I have a python API running in a docker container (using connexion). I want to expose the API (with an API key) using API Gateway.
When I deploy the docker container with --ingress internal
, I get Access is forbidden.
on API calls over the Gateway. So the API gateway cannot access the Google Run container.
When I use --ingress all
, all works as expected, but then my internal API is accessible from the web, which is not what I want.
I created a service account for this:
...ANSWER
Answered 2021-Jun-13 at 12:12Ingress internal means "Accept only the requests coming from the project's VPC or VPC SC perimeter".
When you use API Gateway, you aren't in your VPC, it's serverless, it's in Google Cloud managed VPC. Therefore, your query are forbidden.
And because API Gateway can't be plugged to a VPC Connector (for now) and thus can't route the request to your VPC, you can't use this ingress=internal mode.
Thus, the solution is to set an ingress to all, which is not a concern is you authorize only the legit accounts to access it.
For that, check in Cloud Run service is there is allUsers granted with the roles/run.invoker in your project.
- If yes, remove it
Then, create a service account and grant it the roles/run.invoker on the Cloud Run service.
Follow this documentation
- Step 4: update the x-google-backend in your OpenAPI spec file to add the correct authentication audience when you call your Cloud Run (it's the base service URL)
- Step 5: create a gateway with a backend service account; set the service account that you created previously
At the end, only the account authenticated and authorized will be able to reach your Cloud Run service
All the unauthorized access are filtered by Google Front End and discarded before reaching your service. Therefore, your service isn't invoked for nothing and therefore your pay nothing!
Only API Gateway (and the potential other accounts that you let on the Cloud Run service) can invoke to the Cloud Run service.
So, OK, your URL is public, reachable from the wild internet, but protected with Google Front End and IAM.
QUESTION
I am working on setting up a three node Docker swarm for a web application I support. Initially, we have Traefik setup as a reverse proxy. Traefik and the web app both run on the same web server and the web server is in a single node docker swarm. We are trying to add two additional nodes for application stability.
At the moment, I'm simply trying to understand Traefik load balancing along with Docker Swarm. I am deploying a Traefik v1.7 stack and including the whoami application. The docker-compose file for this first past looks like:
...ANSWER
Answered 2021-Jun-13 at 03:53Apparently Traefik can't drain the connections during update (maybe it doesn't have access to healthchecks and swarm info?).
To achieve a zero-downtime rolling update you should delegate the load-balancing to docker swarm itself:
QUESTION
I have written terraform code which:
- Creates IAM Role
- Creates lambda functions and attaches the above created role
- Dynamo DB table creation
- Creates API gateway, resources and adds POST method with lambda integration.
The first 3 steps works well. However while creating and configuring the API gateway, I am encountering below error in resource aws_api_gateway_integration & aws_lambda_permission, where I am trying to attach the lambda function "save_course" to the POST method under "courses" resource
...ANSWER
Answered 2021-Jun-12 at 22:21Change your locals from
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gateway
If you prefer to use Docker, we have a prebuilt Docker image available here, for both ARM and amd64. You can also build your own image from this repository.
On Fedora, Debian, Raspberry Pi OS, or Ubuntu, you can install the relevant .rpm or .deb package from the releases page.
On Arch Linux, you can install the webthings-gateway AUR package. The PKGBUILD for this package can also be seen here.
Otherwise, you can build it from source yourself (see below).
(If you're just installing on your PC, you can skip this step). If you're installing on a Raspberry Pi then you may need to set up the OS on the Raspberry Pi first. See here for instructions.
nvm allows you to easily install different versions of node. To install nvm:. Reinitialize your terminal session. (If you already installed node via nvm you can skip this step). Follow the directions from NodeJS to install on your platform.
The following is required in order to let node and python3 use the Bluetooth adapter.
Clone the GitHub repository (or fork it first):.
Clone the GitHub repository (or fork it first): $ git clone https://github.com/WebThingsIO/gateway.git
Change into the gateway directory: $ cd gateway
If you have chosen to install nvm above, install and use an LTS version of node and then set the default version. The .nvmrc file will be used by nvm to determine which version of node to install. $ nvm install $ nvm use $ nvm alias default $(node -v)
Verify that node and npm have been installed: $ node --version v12.19.0 $ npm --version 6.14.8 Note: these versions might differ from the LTS version installed locally.
Install dependencies: $ npm ci
Add Firewall exceptions (Fedora Linux Only) $ sudo firewall-cmd --zone=public --add-port=4443/tcp --permanent $ sudo firewall-cmd --zone=public --add-port=8080/tcp --permanent $ sudo firewall-cmd --zone=public --add-port=5353/udp --permanent
Set up domain: If you plan to use the provided tunneling service to set up a _.webthings.io domain: Start the web server: $ npm start Load http://localhost:8080 in your web browser (or use the server's IP address if loading remotely). Then follow the instructions on the web page to set up domain and register. Once this is done you can load https://localhost:4443 in your web browser (or use the server's IP address if loading remotely). If you plan to use your own SSL certificate: The HTTPS server looks for privatekey.pem and certificate.pem in the ssl sub-directory of the userProfile directory specified in your config. You can use a real certificate or generate a self-signed one by following the steps below. $ WEBTHINGS_HOME="${WEBTHINGS_HOME:=${HOME}/.webthings}" $ SSL_DIR="${WEBTHINGS_HOME}/ssl" $ [ ! -d "${SSL_DIR}" ] && mkdir -p "${SSL_DIR}" $ openssl genrsa -out "${SSL_DIR}/privatekey.pem" 2048 $ openssl req -new -sha256 -key "${SSL_DIR}/privatekey.pem" -out "${SSL_DIR}/csr.pem" $ openssl x509 -req -in "${SSL_DIR}/csr.pem" -signkey "${SSL_DIR}/privatekey.pem" -out "${SSL_DIR}/certificate.pem" Start the web server: $ npm start Load https://localhost:4443 in your web browser (or use the server's IP address if loading remotely). Since you're using a self-signed certificate, you'll need to add a security exception in the browser.
In order to run the browser tests, you'll need to install Google Chrome and a JDK (e.g. OpenJDK).
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page