Using Google Cloud Functions with Python, I want to publish a message to MQTT topic.
I use pubsub_v1 PublisherClient, and after invoking cloud function and looking into logs it looks like an "google.api_core.exceptions.InvalidArgument: 400 Invalid resource name given". I understand that happens because my topic_name contains "/", because I want to use more levels/subtopics, something like this : "devices/raspberrypi/events/msg/device/3/status". I have "msg" topic created, but can't create or publish to any subtopics.
I didn't find any information about subtopics in official documentation or anywhere else. Thanks in advance.
The Cloud Pub/Sub client library is only for interacting with Google Cloud Pub/Sub directly. If you are using MQTT topics, it sounds like you are trying to use the Cloud IoT Core MQTT bridge. In that case, you need to use an MQTT client that is configured to authenticate the device with Cloud IoT Core and use it to publish the telemetry events. See the Cloud IoT guide to publishing.
The subtopics for events should have their own topics associated with them, but they are not going to be accessible using the subtopic name via the Cloud Pub/Sub library. To use the Cloud Pub/Sub library, you will have to use the name of the Cloud Pub/Sub topic. The topic would be the one you associated with the MQTT subtopic in the Cloud Console in the "Additional topic" section:
Related
Problem statement: Need to transcript the speech to text in real-time and distinguish the user
as speaker 1 and speaker 2 using azure cognitive speech service.
Until now I explore the documentation of azure regarding conversation transcription which provides the sample code for Javascript and C#link for the documentationbut I was not able to find the sample code in python so does that means azure's this service is not available in python?
Does azure conversation transcription service is available in "python"?
No, at present Conversation Transcription SDK does not support Python language.
Conversation Transcription SDK supports only c# and javascript and is only available in few regions like centralus, eastasia, eastus, westeurope.
You can reach Microsoft here for support.
I want to develop an app that sends me an email when pricing offers for specific listings change using the AnyOfferChanged MWS notifications. However, I can't find any good documentation on how to go about receiving the notifications. Is it a must to have AWS SQS, or can I use Django? how do I go about subscribing to a notification?
I already have a developers account and I'm using the python mws library
You need to subscribe to the AnyOfferChangedNotification through the Subscriptions API and yes, it must use SQS. I found it easiest to use the scratchpad to create the subscription, since it's usually a one-time event.
Once your price change notifications start flowing into your queue, write an app that reads the queue and you can respond to your messages, including sending an email if that's what you want to do.
See if these code samples for SQS help you: https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-python-example_code-sqs.html
I am testing out a very basic Pub/Sub subscription. I have the push endpoint set to an App I have deployed through a Python Flex service in App Engine. The service is in a project with Identity-Aware Proxy enabled. The IAP is configured to allow through users authenticated with our domain.
I do not see any of the push requests being processed by my app.
I turned off the IAP protection and then I see that the requests are processed. I turn it back on and they are no longer processed.
I had similar issues with IAP when trying to get a Cron service running; that issue resolved itself after I deployed a new test app in the same project.
Has anyone had success with configuring a push subscription through IAP? I also experimented with putting different service accounts on the IAP access list and none of them worked.
I'm not aware of a way to get Pub/Sub push subscriptions + Flex + IAP working. I wonder... it might work if the subscriber is on Standard.
Some other potential workarounds:
- Switch to a Pull subscriber.
- Set up a Cloud Functions function as your Pub/Sub subscriber -- https://cloud.google.com/functions/docs/writing/background -- and then in that function pass the request on to the GAE app, using https://cloud.google.com/iap/docs/authentication-howto to authenticate as a service account.
Sorry, I wish I had a better answer for you, but AFAIK those are the options that work today.
--Matthew, IAP engineering lead
I had a pretty similar issue - a GAE 2nd G standard application in project A, which is wired under IAP, that cannot receive the pushed pub/sub message from project B.
My workaround is:
Setup Cloud Function (HTTP triggered) in project A;
Setup the subscription of project B Pub/Sub topic to push the message to above Cloud Function endpoint;
The above Cloud Function works like a proxy to filter (needed based on my case, ymmv) and forwards the Pub/Sub message in a http request to the GAE app;
Since the Cloud Function is within same project with the GAE app, there is only needed to add the IAP authentication for above http request (which fetches the token assigned from the specific SA).
There should be a project A's SA setup in Project B IAM, which may have at least Pub/Sub Subscriber and Pub/Sub Viewer roles.
Hope this could be an option for your case.
I am trying to fetch metric values for a vm using below rest API :
https://management.azure.com/subscriptions/aac11d2f-f03b-454e-9f65-4eb00795f964/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/ubuntu/metrics?api-version=2014-04-01&$filter=%28name.value%20eq%20%27\Memory\Availableand%20timeGrain%20eq%20duration%27PT1M%27%20and%20startTime%20eq%202016-02-18T20%3A26%3A00.0000000Z%20and%20endTime%20eq%202016-03-23T21%3A26%3A00.0000000Z
But it is giving me an bad request URL. can any one help me out from this.
Finally got API's to list the azure resource metrics sharing link of rest API's:
https://msdn.microsoft.com/en-us/library/azure/mt743622.aspx
If you want to get the VM metrics from Azure Platform, you could follow these document.
Using Azure Storage service to storage your metrics and get metrics using storage SDK or Rest API whatever you used the classic mode or Resource Group Mode.
Please refer to official document about how to enable the diagnostics settings on Azure Portal :
https://azure.microsoft.com/en-in/blog/windows-azure-virtual-machine-monitoring-with-wad-extension/
and how to use Azure storage REST API (https://msdn.microsoft.com/en-us/library/azure/dd179355.aspx) and SDK (https://github.com/Azure?utf8=%E2%9C%93&query=storage )
From your description, it seems that you used the Application Insight service to show your metrics on Azure. Actually, base on my experience, Application Insight service is in preview and it is design for your live App on Azure platform such as Web App, Android App and soon on.
I'm trying to implement pubsub messaging with Google App Engine. I want to be able to store callbacks to other servers and then send them new data when it becomes available.
I've had a good look around but can't seem to come up with anything apart from implementing it myself. I've seen pubsubhubbub:
https://code.google.com/p/pubsubhubbub/wiki/DeveloperGettingStartedGuide
but I want to be able to store query parameters. Xmpp xep 60 for example includes capabilities to configure subscriptions with additional data (called options).
The XMPP service in App Engine doesn't seem to have the pubsub extension.
Is managing our own recipient list as:
https://groups.google.com/forum/#!topic/google-appengine/CaBcX0EWO00
seems to suggest the only option?
App Engine seems to have implementations with devices in mind using:
Channels for javascript:
https://developers.google.com/appengine/docs/python/channel/
CloudBackendMessaging for devices:
https://developers.google.com/cloud/samples/mbs/pubsub_messaging
There is a Limited Preview for Google Cloud Pub/Sub which will be something to watch out for as it matures.
Google Cloud Pub/Sub is designed to provide reliable, many-to-many,
asynchronous messaging between applications. Publisher applications
can send messages to a “topic” and other applications can subscribe to
that topic to receive the messages. By decoupling senders and
receivers, Google Cloud Pub/Sub allows developers to communicate
between independently written applications.
There are no client-originated persistent connections (i.e. a listening socket) on AppEngine, so it's quite impossible to implement a real-time push system on it.
As you already know, you can get close with Channels API (solving push to browsers) and mobile device-specific push systems (GCM and APNS).
If you want a universal system, I'd recommend a socket based system, much like PubNub. You should look into Compute Engine which allows for such functionality.