Bug 801705 - Call REST API can't create an application successfully by specified template name
Call REST API can't create an application successfully by specified template ...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Pod (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Krishna Raman
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-09 03:33 EST by bzhao
Modified: 2015-05-14 21:47 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-19 14:23:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description bzhao 2012-03-09 03:33:51 EST
Description of problem:
Can't create an app and add the template to the app successfully after creating a template by REST API

Version-Release number of selected component (if applicable):
rhc-0.88.2-1.git.0.e1a8823.el6.noarch
rhc-broker-0.88.1-1.git.188.452fd82.el6.noarch

rubygem-cloud-sdk-controller-0.6.1-1.git.198.c411b64.el6.noarch
ruby-cloud-sdk-common-0.6.1-1.git.0.9e4dcac.el6.noarch
rubygem-cloud-sdk-node-0.6.1-1.git.20.a7ae185.el6.noarch
ruby-cloud-sdk-controller-0.6.1-1.git.198.c411b64.el6.noarch
ruby-cloud-sdk-node-0.6.1-1.git.20.a7ae185.el6.noarch
rubygem-cloud-sdk-common-0.6.1-1.git.0.9e4dcac.el6.noarch

How reproducible:
Always

Steps to Reproduce:
Precondition:
Create a quickstart template  - /tmp/foo.yaml

---
Vendor: unknown
Requires:
- php-5.3

- mysql-5.1
Architecture: noarch
Description:
License: unknown
Subscribes:
  doc-root:
    Required: false
    Type: FILESYSTEM:doc-root
Version: 0.0

1.Add a template
# rhc-admin-add-template -n wordpress -d /tmp/foo.yaml -g git://github.com/openshift/wordpress-example.git -t wordpress  -c 1  -m '{"a":"b"}'

2.Create an application and add the template to the application
# curl -k -X POST -H "Accept: application/xml" -H "Content-type: application/json" -d '{name:"<application name>", template:<your template name>}' --user <userName>:<passWD> https://<your instance>/broker/rest/domains/<domain Name>/applications

  
Actual results:
Can't create the application with php type by specified template

Expected results:
The application with php type could be created successfully

Additional info:
# cat /var/www/libra/broker/log/development.log

Log content as follows:

Started POST "/broker/rest/domains/bzhao105/applications" for 203.114.244.88 at Fri Mar 09 03:10:58 -0500 2012
  Processing by ApplicationsController#create as XML
  Parameters: {"name"=>"test", "domain_id"=>"bzhao105", "template"=>"3806ff37b600428699c0a4104b16cbc6"}
MongoDataStore.find(CloudUser, bzhao105, bzhao105)

Checking to see if user limit for number of apps has been reached
MongoDataStore.find(ApplicationTemplate, , 3806ff37b600428699c0a4104b16cbc6)

Completed 500 Internal Server Error in 199ms

TypeError (instance of IO needed):
  

Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.8ms)
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (174.2ms)
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (181.1ms)


Started GET "/broker/rest/domains.json" for 127.0.0.1 at Fri Mar 09 03:13:35 -0500 2012
  Processing by DomainsController#index as JSON
MongoDataStore.find(CloudUser, xtian+t19@redhat.com, xtian+t19@redhat.com)

Completed 200 OK in 239ms (Views: 18.5ms)


Started GET "/broker/rest//domains/domx13/applications.json" for 127.0.0.1 at Fri Mar 09 03:13:35 -0500 2012
  Processing by ApplicationsController#index as JSON
  Parameters: {"domain_id"=>"domx13"}
MongoDataStore.find(CloudUser, xtian+t19@redhat.com, xtian+t19@redhat.com)

Completed 200 OK in 289ms (Views: 50.8ms)


Started POST "/broker/cartlist" for 66.187.233.202 at Fri Mar 09 03:17:03 -0500 2012
  Processing by LegacyBrokerController#cart_list_post as 
  Parameters: {"password"=>"[FILTERED]", "json_data"=>"{\"api\":\"1.1.2\",\"cart_type\":\"standalone\"}"}
User-Agent = ''
Completed 200 OK in 5ms (Views: 2.6ms)
Comment 1 Krishna Raman 2012-03-09 15:46:05 EST
Fixed on branch dev/kraman/US1972. Will be merged into master soon.
Comment 2 bzhao 2012-03-12 05:40:47 EDT
Passed verified on devenv 1658

Note You need to log in before you can comment on or make changes to this bug.