Azure IoT cloud-to-device messaging via Rails? - python

I'm currently building an API in Rails to control devices registered with an Azure IoT Hub.
Now, in the Azure documentation, I only see Python/Node/.Net guides to control the end devices.
I require Rails for certain libraries, and hence used it to build my API. But now I've hit this road block.
Is there no way I can send cloud-to-device messages? I don't see any official Rails support. I only require c2d messaging.
Edit : The only other way I can think of with my limited knowledge is to deploy a small Python/Flask app on the same server and have my Rails code make HTTP requests to it. Is this a bad approach?

I do recommend to use the Azure HttpTrigger Function for your solutions as an API integrator/mediator.

Related

Can we use flask-pyctuator to monitor Flask App with out using spring boot

I want to determine whether if python packages can be used to implement monitoring actuator /health endpoint . Our services are deployed on to Kubernetes and logs are logged in splunk and Kubernetes is monitores using splunk observability
If you are asking about using the actuator/health endpoint for k8s readiness-probe, or are you asking if there's an admin tool written in python that can monitor your application via the Pyctuator API.
Will try to answer both:
Pyctuator is adding APIs to your Flask app (and other popular frameworks). These APIs are providing many details about your application in a way that's compatible with Codecentric's "Spring Boot Admin". I'm not familiar with other admin-tools that can consume the actuator/pyctuator API. Also, Spring Boot Admin is great for monitoring Python services that use Pyctuator.
If you are looking for endpoint for k8s readiness probe, this can be cool if you have dependencies such as DB connection that you don't want your pod to be ready until the connection is up.

How to use Firebase with a linux based client app for bidirectional messages communication with server

I've seen Google's documentation and a lot of examples over the internet about how to use Firebase within Android / iOS applications, but I want to develop a client Firebase application which runs on a linux machine.
My requirements are:
Client runs on linux environment (either writtern in C++ or python).
Server is written in Javascript (NodeJS).
Server and client should have bi-directional communication between them using firebase realtime database.
I've seen also the firebase REST api, but I assume that is not good enough for me since I haven't seen a client listener api that listens on a something like onValueChanged.
Question:
How can I implement a linux-based app in C++ or python that listens to messages from server (data changes) using a listener, without having to call some get function each and every few seconds (just like NodeJS have the ref.on("child_changed",...) or ref.on("value",...)?
Help is much appreciated!
Unfortunately there is not official library for Realtime Database in Python but there are some third party wrappers around REST API.
Specifically I would look at Pyrebase library which also supports listening to live changes https://github.com/thisbejim/Pyrebase#streaming
For more information, libraries or other languages look at this page https://firebase.google.com/docs/database/rest/start
Google offers a C++ SDK you can download it here.
There is also a tutorial on the bottom of the page, but if you really want to dig into some code, here is the quickstart code on github from google with examples for each category on Firebase.
Google has also implemented a Game for demonstration purposes in C++ for Desktop OSs. here There you can find more advanced features and code samples.
I have only tried it with an XCode project on Mac OS X, and it works fine. I have no code for real time database but you should find the sample project in the github repo. https://github.com/firebase/quickstart-cpp
I hope this helps!
Greetings.
Haven't you try to use a Realtime Database triggers for C++ (that's is currently on beta) that allows you to simulate the same workflow as on JS?
From my point of view, it is the best way to get it to work as you want.
https://firebase.google.com/docs/functions/database-events

Push notifications for mobile application

I am a beginner with mobile app development. I need to build a push notification for our existing mobile app.
The current mobile app is built with HTML, backbone.js and jQuery for both Android and iOS. The backend is in Python.
I found that there are applications like firebase communication messages, parser etc for the transport layer.
I would like to know if I can use FCM with Python as backend.
Also as I do not use the native mobile app, I also like to know if I can achieve push notifications using FCM in my app.
I would like to know if I can use FCM with Python as backend.
You may want to check Python documentation which discussed regarding the use of pyfcm 1.2.2. Furthermore, this related SO post might also help.
Also as I do not use the native mobile app , I also like to know if I can achieve push notifications using FCM in my app.
Actually, Google Cloud Messaging (GCM) is used to implement push notifications for mobile devices and as mentioned, Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! Based from that statement, it's should be clear that it is possible to achieve push notifications using FCM.
I suggest that you please check Firebase Notifications and Firebase - FAQ for more detailed information on the things that you can do with Firebase.

Python - Intranet Web Service

About to embark on a Java project using Spring Security to create a Restful Web Service (JSON) that will use Kerberos authentication to authenticate users in Active Directory.
I'm not locked into using Java and am considering the use of Python to gain new skills and look at potential alternative platforms.
So far I have looked at Twisted and Web2Py but they don't seem to have support for Kerberos nor could I find information around implementing Kerberos support.
Does anyone know of frameworks supporting the above deployment or pointers to get me started?
Python Eve is a restful api written in Python that uses mongo as its backend.
It provides a simple class that you can use to implement your own authentication which would allow you to use the python kerberos module
I use this setup but with ldap instead of kerb.
The underlying web framwork behind eve is Flask.

Developing a RIA with Django - what technology stack?

I need to develop a web application with the following requirements:
Desktop like UI on the client side
Application deployment
Scalability (i.e. distributing the service on multiple servers)
What I thought of so far (as I love Python but haven't done much web development yet):
Django
Fabric (think I've read somewhere it's suited for this)
What I'm missing is:
How to create rich clients (probably need some javascript libraries for that)?
How to distribute the service?
For RIA you need to use some client technology in your templates.
See at Dojo or ExtJs.
ExtJs docs have example of Web Desktop app, but this library is not free for commercial project. I like more Dojo, and it is free.
Rich Internet Application: Javascript to do stuff asynchronously (AJAX). If you want a desktop-like interface on the web, it seems currently CoffeeScript is the way to go. It's a language that compiles into Javascript and adapted for rich interfaces.
Deployment: fabric (I think it's used to deploy Python apps).
Distribution: you deploy the code to one server.If you need to scale it up, you just need some additional servers (of course if you have specific usages like very high load on a database, you'll also need to add more database servers etc. But you get the idea).
using web browser as your client platform?

Categories