during the process of discontinuing our node we need to retrieve the user emails in order to notify them to migrate their VM's.
We have tried using keystone user-list after sourcing our openrc config file but to no avail.
Is there a command sequence we should use in order to retrieve what we need?
There is an way to get the information about the users that can be using your node. The steps that you should follow are the following:
Get the id of your region from the GET to http://cloud.lab.fiware.org:4730/v3/OS-EP-FILTER/endpoint_groups
Get the complete list of projects in your region: GET to http://cloud.lab.fiware.org:4730/v3/OS-EP-FILTER/endpoint_groups/{{Region-Id}}/projects where Region-id comes from endpoints_groups[i].id in the previous JSON response.
Get the user of those project, for each project: GET to http://cloud.lab.fiware.org:4730/v3/role_assignments?scope.project.id={{project_id}}, where project_id comes from projects[i].id in the previous JSON response.
Get detailed information of the user: GET to http://cloud.lab.fiware.org:4730/v3/users/{{user-id} where user-id comes from role_assignments[i].user.id in the previous JSON response.
Keep in mind that all the operations have to be done with the corresponding X-Auth-Token.
I hope that it can help you.
Related
I am trying to use the jenkins API to retrieve a list of running jobs buildURLs and this works with this the query
https://jenkins.server.com/computer/api/xml?tree=computer[executors[currentExecutable[url]]]&depth=1&xpath=//url&wrapper=buildUrls
By searching for all executors on given jenkins server and then grabbing the urls and wrapping them in a xml buildUrls object
(what I actually want is a count of total running jobs but I can filter in api then get a .size of this once client side)
However the application I am uses only accepts json, although I could convert to json I am wondering if there is a way I can have this return a json object which contains just the buildUrls. Currently if I change return to json the xpath modification is removed (since its xml only)
And I instead get returned the list of all executors and their status
I think my answer lies within Tree but i cant seem to get the result I want
To return a JSON object you can modify the URL as below
http://jenkins.server.com/computer/api/json?tree=computer[executors[currentExecutable[url]]]&depth=1&pretty=true
It will not be possible to get only the build urls you need to iterate through all the executables to get the total running jobs. The reason is that build urls alone cannot give you information where it is running. Hence, unfortunately we need to iterate through each executor.
The output you will get is something like below.
Another way of doing this same thing is parsing via jobs
http://jenkins.server.com/api/json?tree=jobs[name,url,lastBuild[building,timestamp]]&pretty=true
You can check for building parameter. But here too you will not be able to filter output from url diretly in jenkins. Iteration would be required through each and every job.
I send JSON's to my app via Postman in a list with a type of mapping(CRUD) to send it to my database.
I want my controller to put all this data, from multiple senders, in a list that will send the information to my DB. The problem is that i don't know how to store in the same list the Json and the Mapping, so when my threads do their work to know if that json must be inserted, updated, deleted and so on.
Do you guys have any ideea ?
PS: It is a spring-boot app that need to be able to send 12000 objects ( made from that jsons ) to the db.
I don't see a reason for putting all data in one list and sharing it later, each HTTP request receives own thread.
On decent server you can handle couple thousands of requests/sec which perform simple CRUD operations.
My requirement is,
I have an exam schedule data for a class of students, And I want to create a Chat bot Teaching Assistant(TA) with this data source and to respond to the students, Example - Student asks, when is my next exam , Then TA has to respond the date time of his/her next exam.
So what is the recommended solution?
So my assumption is to upload the exam schedule as json document in a preferred format and take use accordingly.
Am I correct or not? If not, can you help me suggesting the best option to do this?
Note - Exam schedule is dynamic which can be updated by the admin whenever he wants.
I understand that you need to send the correct data, but, Watson Conversation will give you the possibility for built one awesome Assistant with his Natural Language power. And you need to add some custom codes for integrates APIs, get database data, use Webservices, etc. Watson in your application will be one endpoint, and you can do a lot of thins with code.
Example:
After create your chatbot, when you user asks about "When is my next exam" in the Child node, you'll create one ACTION VARIABLE for call another service with some custom code... and in your backend when you post some message, this value from this action variable will return in your response parameter, and you'll can doSomething(), like get the exam data. You can click in my link above for understand how these action variable and context variables work.
So, like you said, the data can update, what you can do so is use Webservices, if you Univeristy have some Web application, so in the function doSomething() you'll POST and use the webservice to return the correct exam data, and return for your user like my example here.
Example for Integrate some API using Conversation: Weather API.
I'm trying to write a messaging app using PhoneGap, AngularJS and Firebase. I'm trying to work out what the correct the correct database structure should be given Firebase unusual query methods (1, 2).
I need a messages 'table' where all messages are stored, however the issue is that this is a NoSQL table, so it's quite hard to retrieve data if it's not formatted specifically.
For example, I originally considered something like /messages/{userId} to get all messages for a user, and /messages/{userId}/{partnerId} to get a specific message chain, but I can't do that because it would mean that data has to be duplicated, once for the person sending the message and once for the person receiving.
Can anyone suggest a layout which would work well with Firebase's query structure, and allows:
Retrieval of all messages to/from a user
Retrieval of a specific thread from one user to another
look in this post about data denormalizing . I faced a similar challenge and the solution which worked for me was storing all data under auto ID in specific object and if needed I stored a reference to that data in as many places as required.
Applying this to your problem, if simplified, I would go for something like this:
root/messages/{message_by_auto_id}/{message_body}
root/users/{user_id}/messages_this_user_can_see/{ref_to_message}
so If a user posts a message the app needs to save the message in messages and save the reference to that message to each friend as above.
I'm new with Canvas lms and just wondering if anyone know how to get the user info and course id. need some examples
Below is the link I found, but still can't figure out how to use this in my php to grab the user info.
https://canvas.instructure.com/doc/api/file.object_ids.html
Thanks in advance.
Suppose you have the OAuth2 ACCESS-TOKEN and your USER-ID, you can simply use HTTP GET requests to obtain this information.
In order to get your user info, you need to perform a GET request to the following URL:
https://canvas.instructure.com/api/v1/users/<USER-ID>/profile?access_token=<ACCESS-TOKEN>
In order to get course id for the list of courses you belong to, you need to perform a GET request to the following URL: https://canvas.instructure.com/api/v1/courses?access_token=<ACCESS-TOKEN>
For more capabilities you can use the following API documentation:
https://canvas.instructure.com/doc/api/index.html