wiki:GEC17Agenda/GettingStartedWithGENI_III_GIMI/Procedure/TrackIssues/ExpServiceNew

Version 1 (modified by divyashri.bhat@gmail.com, 6 years ago) (diff)

--

When I do a POST to the experiment service, I can see that the user has been added to a project
But When I do

 curl http://emmy9.casa.umass.edu:8002/users/geni-dbhat/

It does not list the project that I just added it to.

If I do

curl http://emmy9.casa.umass.edu:8002/projects/GIMITesting/users/

I can see geni-dbhat in the list

Here is the code in which I am creating the JSON:

 def postUser(self):
        data = [{'name': "geni-" + self.user_name}]
        headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
        #data=json.dumps(data)
        json_filename = self.workdirectory + "/user.json"
        print ("Saving JSON to file: " + json_filename)
        jsonf = open(json_filename,'w')
        data = json.dumps(data)
        jsonf.write(data)
        jsonf.close()
        os.system('curl -X POST -H "Content-Type: application/json" --data-binary @'+ json_filename +' ' + self.restURL + ':' + str(self.restPort) + '/projects/' + self.proj_name + '/users')

The contents of my json file are:

[{"name": "geni-dbhat"}]