Add Endpoint to tenant method not working for json

Bug #897719 reported by Jenny Vo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Low
Yogeshwar

Bug Description

Add Endpoint to tenant is not working for json form as example below:

POST http://localhost:35357/v2.0/tenants/4/OS-KSCATALOG/endpoints HTTP/1.1
Accept-Encoding: gzip,deflate
X-Auth-Token: 9da3dca9-a378-4234-8525-4b9d61b7684b
Accept: application/xml
Content-Type: application/json;charset=UTF-8
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:35357
Content-Length: 49

{
"OS-KSCATALOG:endpointTemplate":{
"id":12,
}
}

response:
{"badRequest": {
   "message": "Cannot parse endpointTemplate",
   "code": "400",
   "details": "Expecting property name: line 4 column 1 (char 45)"
}}

Note, the xml is working.
GET - endpoint for tenant seem not yet implemented.

Changed in keystone:
assignee: nobody → Yogeshwar (yogesh-srikrishnan)
Revision history for this message
Yogeshwar (yogesh-srikrishnan) wrote :

Hi Jenny

I tried the call and it works.This is my curl.Could you check again?

curl -X POST http://localhost:35357/v2.0/tenants/1/OS-KSCATALOG/endpoints -d "{\"OS-KSCATALOG:endpointTemplate\": {\"id\": \"12\"}}" -H "content-type: application/json" -H "X-Auth-Token: 5a385f5f-1f24-466a-a879-0f8a515c94f2"

Changed in keystone:
status: New → Invalid
Revision history for this message
Jenny Vo (jenny-vo) wrote : RE: [Bug 897719] Re: Add Endpoint to tenant method not working for json

Hi Yogi,

It seem to me OS-KSCATALOG-admin.pdf need to be updated...the json I got different from you have in curl call bellow, as from .pdf doc:

{
"OS-KSCATALOG:endpointTemplate":{
"id":12,
}
}

thanks,
Jenny
________________________________________
From: <email address hidden> [<email address hidden>] on behalf of Yogeshwar [<email address hidden>]
Sent: Tuesday, November 29, 2011 11:44 AM
To: Jenny Vo
Subject: [Bug 897719] Re: Add Endpoint to tenant method not working for json

Hi Jenny

I tried the call and it works.This is my curl.Could you check again?

curl -X POST http://localhost:35357/v2.0/tenants/1/OS-
KSCATALOG/endpoints -d "{\"OS-KSCATALOG:endpointTemplate\": {\"id\":
\"12\"}}" -H "content-type: application/json" -H "X-Auth-Token:
5a385f5f-1f24-466a-a879-0f8a515c94f2"

** Changed in: keystone
       Status: New => Invalid

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/897719

Title:
  Add Endpoint to tenant method not working for json

Status in OpenStack Identity (Keystone):
  Invalid

Bug description:
  Add Endpoint to tenant is not working for json form as example below:

  POST http://localhost:35357/v2.0/tenants/4/OS-KSCATALOG/endpoints HTTP/1.1
  Accept-Encoding: gzip,deflate
  X-Auth-Token: 9da3dca9-a378-4234-8525-4b9d61b7684b
  Accept: application/xml
  Content-Type: application/json;charset=UTF-8
  User-Agent: Jakarta Commons-HttpClient/3.1
  Host: localhost:35357
  Content-Length: 49

  {
  "OS-KSCATALOG:endpointTemplate":{
  "id":12,
  }
  }

  response:
  {"badRequest": {
     "message": "Cannot parse endpointTemplate",
     "code": "400",
     "details": "Expecting property name: line 4 column 1 (char 45)"
  }}

  Note, the xml is working.
  GET - endpoint for tenant seem not yet implemented.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/897719/+subscriptions

Revision history for this message
Yogeshwar (yogesh-srikrishnan) wrote :

Thanks Jenny.
This looks like a document update.I shall update the example json file.

Changed in keystone:
importance: Undecided → Low
status: Invalid → Confirmed
Revision history for this message
Yogeshwar (yogesh-srikrishnan) wrote :

I have removed the extra comma from the samples.Could

{
"OS-KSCATALOG:endpointTemplate":{
"id":12,=> additional comma
}
}

Could you try and let me know?
Thanks

Revision history for this message
Jenny Vo (jenny-vo) wrote :

yes, tried without comma and 12 have to be in "12" it worked...so, document (.pdf) should be updated.

Thanks,
Jenny
________________________________________
From: <email address hidden> [<email address hidden>] on behalf of Yogeshwar [<email address hidden>]
Sent: Tuesday, November 29, 2011 3:12 PM
To: Jenny Vo
Subject: [Bug 897719] Re: Add Endpoint to tenant method not working for json

I have removed the extra comma from the samples.Could

{
"OS-KSCATALOG:endpointTemplate":{
"id":12,=> additional comma
}
}

Could you try and let me know?
Thanks

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/897719

Title:
  Add Endpoint to tenant method not working for json

Status in OpenStack Identity (Keystone):
  Confirmed

Bug description:
  Add Endpoint to tenant is not working for json form as example below:

  POST http://localhost:35357/v2.0/tenants/4/OS-KSCATALOG/endpoints HTTP/1.1
  Accept-Encoding: gzip,deflate
  X-Auth-Token: 9da3dca9-a378-4234-8525-4b9d61b7684b
  Accept: application/xml
  Content-Type: application/json;charset=UTF-8
  User-Agent: Jakarta Commons-HttpClient/3.1
  Host: localhost:35357
  Content-Length: 49

  {
  "OS-KSCATALOG:endpointTemplate":{
  "id":12,
  }
  }

  response:
  {"badRequest": {
     "message": "Cannot parse endpointTemplate",
     "code": "400",
     "details": "Expecting property name: line 4 column 1 (char 45)"
  }}

  Note, the xml is working.
  GET - endpoint for tenant seem not yet implemented.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/897719/+subscriptions

Revision history for this message
Jenny Vo (jenny-vo) wrote :

From OS-KSCATALOG-admin.pdf:
json:
{
"OS-KSCATALOG:endpointTemplate":{
"id":12,
}
}

This should consider document defect...and it needs to be updated

Revision history for this message
Yogeshwar (yogesh-srikrishnan) wrote :

yes working on it! Thanks for finding!

Changed in keystone:
status: Confirmed → In Progress
Changed in keystone:
milestone: none → essex-2
Revision history for this message
Ziad Sawalha (ziad-sawalha) wrote :
Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.