How can I get the status of a rabbitmq-shovel by the http api - rabbitmq

Using "rabbitmqctl eval 'rabbit_shovel_status:status().'" I can get the shovels status in my rabbitmq server.
I activated the modules 'rabbitmq_shovel' and 'rabbitmq_shovel_management'.
I created some dynamic shovels with the HTTP API, the problem I have is that, I want to be able to GET the status of the shovels using the HTTP API, but I can't find a way to do that.
Is there any way to do this using the HTTP API? Or should I use 'rabbitmqctl eval ...'?
I don't want to use the rabbitmqctl, as I want to expose this data in my own API, so my application should be able to access it, without having to make an 'exec'.

Yes you can using:
http://localhost:15672/api/shovels
you have to install:
rabbitmq_shovel_management
The result is a json like:
[
{
"node":"rabbit#gabrieleMacBook",
"timestamp":"2015-06-02 15:34:27",
"name":"test",
"vhost":"/",
"type":"dynamic",
"state":"running",
"definition":{
"src-queue":"test",
"dest-queue":"test2"
},
"src_uri":"amqp://xxxxxxx",
"dest_uri":"amqp://xxxxxxx"
}
]

If you are using C#, you can use HareDu like this:
var result = await _services.GetService<IBrokerObjectFactory>()
.GetAllShovels();
https://github.com/ahives/HareDu2/blob/master/docs/shovel-get.md

Related

UPDATE and REVISE rest api is not working in vTiger CRM cloud service

So basically I need to use the update/revise Rest API to update the fields in the vTiger CRM.
But when I am using the rest API (link : https://help.vtiger.com/article/147111249-Rest-API-Manual) to update the fields, I am getting the error as "400 Unsupported operations: The request cannot be fulfilled due to bad syntax."
My api : endpoint/reviseelement=convert_into_json_string({id:5x369, potentialname:'demo2'})
Also apart from this, I had used the SQL query Rest API, to update the record in the modules, but it is also giving me the same error as: "400 Unsupported operations: The request cannot be fulfilled due to bad syntax."
My Api query : endpoint/query?query=UPDATE Potentials SET potentialname = 'demo2 where id = 5x369;
Also by using the webservice(https://community.vtiger.com/help/vtigercrm/developers/third-party-app-integration.html) rest api I am getting error like : "Permission to perform the operations is denied for id: ".
So how can I use the update api. Can anyone please help?
For web services API (https://community.vtiger.com/help/vtigercrm/developers/third-party-app-integration.html),
When you pass the payload data, make sure you're passing the x-www-form-urlencoded form of data.
Also, make sure you're passing 'element' argument with value like this:
{"id": "10x11471458", "leadsource": "Facebook"}.
if you're still facing this issue, you can share more details and I'll be happy to help you.
If you still need to do this the following should work.
Method: POST
End Point: /revise
Headers: "Authorization: Basic YOUR_TOKEN"
Body:
{
"element": {
"id":"5x369",
"potentialname": "demo2"
}
}
reference: https://www.vtiger.com/docs/rest-api-for-vtiger#/Revise

How do we filter the entities which is not start with "msdn" using MSDynamics Web API

I want to get all entities which are the name not start the prefix as 'msdn' from ms dynamics.
I tried the below APIs, got the error.
GET /api/data/v9.1/EntityDefinitions?$select=LogicalName&$filter=not startswith(LogicalName,%27msdn%27)
Response :
{
"error":
{"code":"0x0",
"message":"The \"startswith\" function isn't supported for Metadata Entities."
}
}
I referred https://learn.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/query-data-web-api#standard-query-functions
I have checked that in one of my environment as well. What you require is not possible.
You will have to go 2 steps.
Retrieve all entities and then filter them out in your local program may it be JavaScript/C# or Json filtering/Power automate or something.

dynamic shovels fail in Rabbitmq

I am trying to create dynamic shovels in my RabbitMQ instance both via code and using the UI. In both the cases, I am able to create the shovel. However , it's failing later on and is not able to move messages as desired.
Via Postman
PUT -- http://rabbitinstance011:15672/api/parameters/shovel/dev_test/test01
{"value": {"src-protocol": "amqp091", "src-uri": "amqp://naxi#example.com#/dev_test",
"src-queue": "dlq1", "dest-protocol": "amqp091",
"dest-uri": "amqp://naxi#example.com#/dev_test",
"dest-queue": "q1", "src-delete-after": "queue-length"}}
Response : 201
On the UI -> admin -> Shovel Status
{failed_to_connect_using_provided_uris,
[{rabbit_amqp091_shovel,make_conn_and_chan,2,
[{file,"src/rabbit_amqp091_shovel.erl"},{line,324}]},
{rabbit_amqp091_shovel,connect_source,1,
[{file,"src/rabbit_amqp091_shovel.erl"},{line,78}]},
{rabbit_shovel_worker,handle_cast,2,
[{file,"src/rabbit_shovel_worker.erl"},{line,64}]},
{gen_server2,handle_msg,2,[{file,"src/gen_server2.erl"},{line,1050}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
I receive the same errors when I try to do all of this using code as well as from the UI instead of postman.
Not sure where I am going wrong.
It was very simple. Had to create a new user without '#' in the username.

Wso2 scim/Users endpoint brings less attributes

Using the wso2/scim/Users endpoint as described in doc i am supposed to get a response like this one
{
"schemas":[
"urn:scim:schemas:core:1.0"
],
"totalResults":2,
"Resources":[
{
"id":"0032fd29-55a9-4fb9-be82-b1c97c073f02",
"userName":"hasinitg",
"meta":{
"lastModified":"2016-01-26T16:46:53",
"created":"2016-01-26T16:46:53",
"location":"https://localhost:9443/wso2/scim/Users/0032fd29-55a9-4fb9-be82-b1c97c073f02"
}
},
{
"id":"b228b59d-db19-4064-b637-d33c31209fae",
"userName":"pulasthim",
"meta":{
"lastModified":"2016-01-26T17:00:33",
"created":"2016-01-26T17:00:33",
"location":"https://localhost:9443/wso2/scim/Users/b228b59d-db19-4064-b637-d33c31209fae"
}
}
]
}
But i need some extra info for every user and doing subsequent requests for every user using the id to get the extra information (like an email) is too bad.
Is it possible to configure the endpoint response so that i get the information needed for the users in one request ?
You should be able to do this with SCIM extensions.
This blog post has more details.
In WSO2 Identity server 5.3.0, you can achieve this by using the attributes query parameter.
eg. Following request will list all users along with their given names in a single call.
curl -k --user admin:admin 'https://localhost:9443/wso2/scim/Users?attributes=givenname'
Please refer the post here for more details.

IBM Worklight filter HTTP Adapter response

I was checking out IBM worklight and used HTTP Adapters. In my Rest response I get so many details. I want to filter the records like send the specific nodes to the app as response.
For example
Google distance API URL
It returns so many data which I don't need and I want to send filtered records to app like,
distance: {
"value": 1734542,
"text": "1 735 km"
}
Is it possible anyway in the Worklight HTTP Adapters
sure, you can use JavaScript to filter data and create only response that you need. In case you use XML based web-service you can even use XSLT transformation.
In case your webservice returns JSON like the one you've provided, use something like:
var backendResponse = WL.Server.invokeHttp(....);
var adapterResponse = {
distanceValue : backendResponse.somePropertyDescribingDistanceValue,
distanceText : backendResponse.someOtherPropertyDescribingDistanceText
};
return adapterResponse;
You can use xsl filter in adapter for filtering the contents of the response as well.