Ask Your Question
0

Create User using an API call [closed]

asked 2014-02-25 01:23:57 -0500

Lokesh gravatar image

updated 2014-02-25 04:26:03 -0500

Hi , May i know how to create the Openstack User using the api call .

Regards , Lokesh.S

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Lokesh
close date 2014-04-14 08:55:53.240776

2 answers

Sort by » oldest newest most voted
1

answered 2014-02-25 09:33:54 -0500

KeithJ gravatar image

updated 2014-02-26 06:17:48 -0500

Apologies; It seemed I misunderstood the question.    But from teh manuals I found this:

http://api.openstack.org/api-ref-identity.html

and if you look under users you will find this when you click on the detail button

POSTv3/users
Adds a user.


Normal Response Codes201
Error Response CodesidentityFault (400, 500, …), badRequest (400), unauthorized (401), forbidden (403), badMethod (405), overLimit (413), serviceUnavailable (503), itemNotFound (404)
{
   "user":{
      "default_project_id":"...",
      "description":"...",
      "domain_id":"--optional--",
      "email":"...",
      "enabled":"...",
      "name":"...",
      "password":"--optional--"
   }
}
{
    "user": {
        "default_project_id": "--default-project-id--",
        "description": "a user",
        "domain_id": "1789d1",
        "email": "...",
        "enabled":true,
        "id": "--user-id--",
        "links": {
            "self": "http://identity:35357/v3/users/--user-id--"
        },
        "name": "admin"
    }
}
edit flag offensive delete link more
0

answered 2014-02-25 23:04:09 -0500

Lokesh gravatar image

Helo KeithJ ,

That worked fine ,Thanks for the reply

I have used the code as shown below , here is the post data that i have sent along with the curl

$post='{"user":{"name":"guru", "email":"guru@guru.com", "enabled":true, "OS-KSADM:password":"password123"}}';

Regards , Lokesh.S

edit flag offensive delete link more

Comments

Hello Keith ,

                   A small issue am facing here in relating the project_id to a user . If i use "default_project_id":"...", this parameter while creating the user , will this creates a user along with the project that relates the project & user ? or is there any other way of mapping ???
Lokesh gravatar imageLokesh ( 2014-03-24 09:13:47 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2014-02-25 01:23:57 -0500

Seen: 60 times

Last updated: Feb 26 '14