Create users in batch issue: {"status":400,"error":"Bad Request"}


#1

Hi

I am trying to follow http://manageiq.org/docs/reference/latest/api/reference/users to create users in batch.

List out existing users is ok

[root@miqfine1 miq]# ./list-users.bash
{"name":"users","count":1,"subcount":1,"resources":[{"href":"https://localhost/api/users/1"}],"actions":[{"name":"query","method":"post","href":"https://localhost/api/users"},{"name":"create","method":"post","href":"https://localhost/api/users"},{"name":"edit","method":"post","href":"https://localhost/api/users"},{"name":"delete","method":"post","href":"https://localhost/api/users"}]}
[root@miqfine1 miq]# cat list-users.bash
#!/bin/bash
# json data file is in openstack_provider.json
curl -k -l --user admin:smartvm \
     -H "Content-Type: application/json" \
     https://localhost/api/users/
echo
[root@miqfine1 miq]#

Trying to create users in batch but with following error message

[root@miqfine1 miq]# cat users.json
{
  "action" : "create",
  "resources" : [
    {"userid"    : "testuser01", "password  : "testo", "name" : "test User",  "group" : { "id" : 11 }}
    {"userid"    : "testuser02", "password  : "testo", "name" : "test User",  "group" : { "id" : 11 }}
  ]
}
[root@miqfine1 miq]# cat create-user.bash
#!/bin/bash
# json data file is in openstack_provider.json
curl -k -l --user admin:smartvm -v \
     -H "Content-Type: application/json" \
     -d @users.json \
     --trace t.txt \
     https://localhost/api/users/
echo
[root@miqfine1 miq]# bash  create-user.bash
Warning: --trace overrides an earlier trace/verbose option
{"status":400,"error":"Bad Request"}
[root@miqfine1 miq]#

Please help me correct the syntax error somewhere.

Thanks