deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ronelle Landy (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DTACLOUD-356) GET using "Accept: */*" returns 406 for the CIMI frontend and 200 (but with HTML output) for the Deltacloud API
Date Thu, 01 Nov 2012 21:50:14 GMT
Ronelle Landy created DTACLOUD-356:
--------------------------------------

             Summary: GET using "Accept: */*" returns 406 for the CIMI frontend and 200 (but
with HTML output) for the Deltacloud API
                 Key: DTACLOUD-356
                 URL: https://issues.apache.org/jira/browse/DTACLOUD-356
             Project: DeltaCloud
          Issue Type: Bug
          Components: CIMI/Frontend
         Environment: Deltacloud 1.0.4 
mock driver
            Reporter: Ronelle Landy


According to the Test Plan for CIMI:

A GET request is sent to the CEP to query the list of resources supported ... the consumer
does not ask for the CEP to returned in any particular format (JSON vs XML). Meaning, the
HTTP Accept header is either missing or includes "*/*" - but it must not include "application/json"
or "application/xml". 

A number of success criteria are listed including: HTTP response code must be "200 OK" .

Checking the CIMI frontend for Deltacloud:

 curl -v -X GET -H "Accept: */*" --user "un:pw" "localhost:3001/cimi/cloudEntryPoint"
* About to connect() to localhost port 3001 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3001 (#0)
* Server auth using Basic with user 'mockuser'
> GET /cimi/cloudEntryPoint HTTP/1.1
> Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
> User-Agent: curl/7.21.7 (x86_64-redhat-linux-gnu) libcurl/7.21.7 NSS/3.13.1.0 zlib/1.2.5
libidn/1.22 libssh2/1.2.7
> Host: localhost:3001
> Accept: */*
> 
< HTTP/1.1 406 Not Acceptable
< CIMI-Specification-Version: 1.0.4
< X-Frame-Options: sameorigin
< X-XSS-Protection: 1; mode=block
< Date: Thu, 01 Nov 2012 20:54:21 GMT
< Content-Length: 0
< Content-Type: text/html;charset=utf-8
< Connection: keep-alive
< Server: thin 1.5.0 codename Knife
< 
* Connection #0 to host localhost left intact
* Closing connection #0

--------------------------------------------------------------

Checking the Deltacloud API (as per David's comments included below the output - this should
return XML):

curl -v -X GET -H "Accept: */*" --user "un:pw" "localhost:3001/api"
* About to connect() to localhost port 3001 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3001 (#0)
* Server auth using Basic with user 'mockuser'
> GET /api HTTP/1.1
> Authorization: Basic bW9ja3VzZXI6bW9ja3Bhc3N3b3Jk
> User-Agent: curl/7.21.7 (x86_64-redhat-linux-gnu) libcurl/7.21.7 NSS/3.13.1.0 zlib/1.2.5
libidn/1.22 libssh2/1.2.7
> Host: localhost:3001
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: Apache-Deltacloud/1.0.4
< Cache-Control: max-age=0, private, must-revalidate
< X-XSS-Protection: 1; mode=block
< Date: Thu, 01 Nov 2012 21:28:33 GMT
< Content-Length: 4951
< X-Deltacloud-Driver: mock
< Content-Type: text/html
< X-Frame-Options: sameorigin
< ETag: 4787210e65f6db5044568ee996c9f199
< Connection: keep-alive
< 
<!DOCTYPE html>
<html>
  <head>
    <title>Deltacloud API 1.0.4</title>
    <link charset='utf-8' href='/stylesheets/jquery.mobile-1.0.1.min.css' media='screen'
rel='stylesheet' type='text/css' />
    <link charset='utf-8' href='/stylesheets/new.css' media='screen' rel='stylesheet' type='text/css'
/>
    <script src='/javascripts/jquery.min.js' type='text/javascript'></script>
    <script src='/javascripts/application.js' type='text/javascript'></script>
    <script src='/javascripts/jquery.mobile-1.0.1.min.js' type='text/javascript'></script>
    <script type='text/javascript'>
      //<![CDATA[
        $(document).bind("mobileinit", function(){
            $.mobile.hashListeningEnabled = false;
        })
      //]]>
    </script>
  </head>
  <body>
    <div data-role='page'>
      <div data-add-back-btn='false' data-role='header' data-theme='b'>
        <h1>
          Deltacloud API 1.0.4
        </h1>
      </div>
      <div data-role='header' data-theme='a'>
        <p class='inner-right'>
          mock@default
        </p>
      </div>
      <div data-role='content' data-theme='c'>
        <ul data-inset='true' data-role='listview'>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/storage_snapshots'>Storage
Snapshots</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/images'>Images</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/instances'>Instances</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/storage_volumes'>Storage
Volumes</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/metrics'>Metrics</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/instance_states'>Instance
States</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/drivers'>Drivers</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/realms'>Realms</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/hardware_profiles'>Hardware
Profiles</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/buckets'>Buckets</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/addresses'>Addresses</a>
          </li>
          <li>
            <a data-icon='arrow-r' href='http://localhost:3001/api/keys'>Keys</a>
          </li>
        </ul>
      </div>
      <div data-role='footer' data-theme='a'>
        <form action='/api' data-ajax='false' method='post'>
          <fieldset data-role='controlgroup' data-type='horizontal' id='providers'>
            <select data-inline='true' data-native-menu='false' name='driver'>
              <option value='mock'>mock</option>
              <option value='google'>google</option>
              <option value='condor'>condor</option>
              <option value='rimuhosting'>rimuhosting</option>
              <option value='opennebula'>opennebula</option>
              <option value='aruba'>aruba</option>
              <option value='eucalyptus'>eucalyptus</option>
              <option value='ec2'>ec2</option>
              <option value='openstack'>openstack</option>
              <option value='vsphere'>vsphere</option>
              <option value='rackspace'>rackspace</option>
              <option value='sbc'>sbc</option>
              <option value='rhevm'>rhevm</option>
              <option value='gogrid'>gogrid</option>
              <option value='mock'>mock</option>
              <option value='azure'>azure</option>
              <option value='terremark'>terremark</option>
              <option value='fgcp'>fgcp</option>
            </select>
            <button data-inline='true' type='submit'>Change Driver</button>
          </fieldset>
        </form>
      </div>
      <div data-role='footer' data-theme='a'>
        <div data-role='navbar'>
          <ul>
            <li>
              <a data-ajax='false' data-icon='home' href='http://localhost:3001/api'>Home</a>
            </li>
            <li>
              <a data-ajax='false' data-icon='grid' href='/api?format=xml'>
                XML
              </a>
            </li>
            <li>
              <a data-ajax='false' data-icon='grid' href='/api?format=json'>
                JSON
              </a>
            </li>
          </ul>
        </div>
        <div data-role='header' data-theme='a'>
          <div id='copyright'>
            Copyright 2009-2011
            <a href='http://incubator.apache.org/deltacloud/'>The Apache Software Foundation</a>
            and individual contributors.
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
* Connection #0 to host localhost left intact
* Closing connection #0

-------------------------------------------------------------------------

Copying relevant chat comments below:

<rlandy> lutter: ping re: http:/<dmtf doc>/cimiTest.html test case 1.1 
<rlandy> lutter: we return "HTTP/1.1 406 Not Acceptable" ... is no xml/json format something
deltacloud's cimi implementation should support?
<lutter> rlandy: yes, our behavior is a bug 
<lutter> rlandy: btw, the DC API should behave in the same way (the behavior is dictated
by HTTP content negotiation)
<rlandy> lutter: well , dc API returns a 200 but the rest looks like the html required
for the GUI, maybe
<lutter> rlandy: that's a bug, too .. we should respond with XML if Accept is */*


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message