Am trying to push using JGit. However my PushResults never has the messages assosiated with Push. For example how do I get the message "Everything-up-to-date" when my push has nohing new.
Basically I want to get the result messages from JGit.
Any help would be greatly appreciated.
I kind of figured from the code that those messages are written by Push.java under the option that Verbose is set to true. But I couldn't find a way to set verbose on.
PushResult#getMessages() returns additional messages sent from the remote. Gerrit for example would send a message that explains why a push was rejected.
In order to obtain the result of a push operation you can call PushResult#getRemoteUpdates(). It returns a RemoteRefUpdate that holds the status for each ref that was to be updated.
Does that answer your question?
Related
I want to schedule a telegram bot message to be sent at a specific unixtime.
As from telegrams official api (https://core.telegram.org/api/scheduled-messages) that should be possible by setting the schedule_date flag.
To schedule a message, simply provide a future unixtime in the schedule_date flag of messages.sendMessage or messages.sendMedia.
However I was not able to set that flag. To be more precisely, I do not even know how to set a flag, or if I am using the correct api.
What I have tried is to use the api directly via the browser (could use curl as well) like so: https://api.telegram.org/botBOT:TOKEN/sendMessage?chat_id=ID&text=Test&schedule_date=1653503351
I also did not find any way to access this flag via https://pypi.org/project/pyTelegramBotAPI/#description https://telepot.readthedocs.io/en/latest/#send-a-message, nor https://github.com/nickoala/telepot.
I want to implement this feature in a python environment, but any working suggestion would be much appreciated.
EDIT:
I decided to save the intention to send a telegram bot message at a certain unixtime in a database. I then create an infinite loop that checks if there are any unsent messages before the current timestamp. If the loop detects such a message it sends the message and sets a flag, that that message has been sent.
And as promised, here is a fully dockerized example of that behaviour in action: https://github.com/Sokrates1989/nameTheCountDown-lightweight
It creates a bot that you can pass a name and the duration. Once the duration has passed it sends a message with the passed name. Basically a simple countdown that you can give several names, that run simltaniously. As it is a telegram chat, you can modify the way you are informed about the end of a countdown by modifying the notificaiton of that chat.
And here is the Bot in action: http://t.me/NameTheCountdownBot
We can't do this by bot API itself, and there's no schedule_date parameter in sendMessage method:
https://core.telegram.org/bots/api#sendmessage
And what you've read is for Telegram clients, not bot API consumers.
If you don't really need unixtime, you can simply create a table for scheduled messages with a text, chat_id and a publish_time column (like 22:15), and run a command every minute to look if there's a message for current time to send. Then send the message and delete the record.
Note that the python-telegram-bot library has a built-in solution for scheduling tasks: The JobQueue. This feature is based on the APScheduler library, which you can ofc also use without python-telegram-bot.
Disclaimer: I'm currently the maintainer of python-telegram-bot.
https://core.telegram.org/method/messages.sendScheduledMessages
Now you can send scheduled messages right away
I'm try to publish my data to ThingsBoard server i use this types of AT commands
AT+QIACT=1
OK
AT+QMTOPEN=1,"demo.thingsboard.io",1883
OK
AT+QMTCONN=1,"demo.thingsboard.io","MY_ACCESS_TOKEN",""
OK
AT+QMTPUB=1,0,0,0,"v1/devices/me/telemetry"
>{"temperature":35.00,"humidity":80.00} // MY_POST_DATA This line hanging my module
All AT commands response is ok But i finally enter MY_POST_DATA the module doesn't provide no response hanging the previous command.. and i check my ThinksBoard data never post telemetry..
Please help any one how can i fix this problem and publish MQTT server.
Step 1: Get hold of the official AT command documentation for the modem (Quectel BG96 I assume?). It should document how the AT+QMTPUB command behaves and what it expects. Everything else is just guessing. The manufacturer should provide this, and if not you should demand to get one.
...
Step 873, when you have exhausted absolutely all possible ways of getting hold of the official AT command documentation for the modem: You can try my guess that the command behaves similar to other commands that read arbitrary length user data, most notably AT+CMGS which sends SMS messages, which expect a Ctrl-Z (ascii value 26) as an end of data indicator.
+QMTPUB: 1,0,0 simply mean that BG96 has successfully published and your broker (thingsboard) have also acknowledged publication of message.
If you can't see data on broker, then please check if the topic you are publishing is correct or not.
It may happen you are publishing to another topic (or to a different PATH).
Ask 'thingsboard' for help regarding proper topic.
I'm a new Robot Framework user, and I've added the MQTTLibrary.
I can set up a subscription as per the documentation, and successfully receive messages. It's also possible to subscribe to wildcards, e.g.
${message}= Subscribe topic=test/mqtt_test/+ qos=1 timeout=2
The above will successfully pick up messages published to test/mqtt_test/apples, test/mqtt_test/oranges, test/mqtt_test/pears etc.
However, ${message} appears to only contain the content of the message payload, and I've been unable to work out if it's possible to determine the exact topic of the received message.
Can this be done with MQTTLibrary?
=============
Additional details (to provide an answer to ILostMySpoons's comment):
Sure - it's basically just the message content. So if I use...
mosquitto_pub -h 127.0.0.1 -t test/mqtt_test/apples -m "Hello to you"
...and my robot framework script does...
Log to console ${message}
...I see...
['Hello to you']
The debug output from the mosquitto broker (mosquitto -v) doesn't show message payloads but it does show the full topic path of test/mqtt_test/apples.
I've taken a deeper look into the MQTTLibrary and have come up with a solution. I'm both a Robot Framework and Python noob, so this may not be the best/most appropriate implementation, but it seems to work.
On my installation, the MQTTLibrary source is contained in C:\Python27\Lib\site-packages\MQTTLibrary. Everything of interest is in the MQTTKeywords.py file.
In the _on_message_list() function, change...
self._messages.append(message.payload)
...to...
self._messages.append([message.topic, message.payload])
Use the Subscribe keyword in your Robot Framework script as before, but you'll now have a list of lists; specifically each entry in the list will be a list of [topic, payload]. E.g.
${messages}= Subscribe topic=test/mqtt_test/+ qos=1 timeout=20 limit=0
${third_message}= Get From List ${messages} 2
${topic}= Get From List ${third_message} 0
${payload}= Get From List ${third_message} 1
Log to console \nTopic:\n${topic}
Log to console \nPayload:\n${payload}
The above example assumes that at least 3 messages were received during the 20 second timeout window.
Note that this change would break existing scripts, so a more complete solution would perhaps need to add new keywords (e.g. Subscribe And Get Topics), with additional work to ensure Subscribe still returns just the payloads.
We need to push Push Pop up notifications for ex: “urgent message to warn users” and also generate a report on the success rate as to how many users in the network received it and read it, how many users did not receive it or did not read it.
Microsoft has suggested to use SCCM Power Schell scripting to send Client notifications with close button to confirm receive.
Is there any other way of accomplishing it through SCCM without any customization?
Have you considered pushing a VBScript to all clients which displays the message? If the user clicks "OK" to say they've read and understood the message then it could exit with a return code of 0, otherwise it could return a 1. It's then trivial to report each computer's success result in SCCM.
here's my situation:
We are using Facsimile/400 on a IBM System i and sometimes it just stops sending faxes. Everything seems in order but the faxes just pile up with a "Sending" status.
This is an intermittent problem that cannot be provoked manually so I want to come up with a program that checks that the fax is still running.
Here are the problem's symptoms when it happens:
In CHKFAXSTS, all the faxes have the "Sending" status
The QFFSNDFAX output queue is empty
The QFFSNDERR output queue is filled with the currently sending faxes and the previous faxes in error
Now how can I know that the fax is still sending faxes?
I can get the list of the spooled files in QFFSNDERR and check if a spooled file is lingering there too long, but how can I know it's status is "Sending"? - I don't want to catch the faxes that have a wrong fax number etc.
If you are still looking for a solution try asking on the MIDRANGE-L mailing list
Here's the approach I used:
I found the table QUSRSYS/QAFQSND, which contains the complete list of faxes as they can be seen in CHKFAXSTS.
With a SQL query, I can now check if there are faxes on the "Sending" status for too long.