Bug #1774

show features that the smart proxy has in json output

Added by Corey Osman 10 months ago. Updated 6 months ago.

Status:Closed Start:07/23/2012
Priority:Normal Due date:
Assigned to:Corey Osman % Done:

100%

Category:API
Target version:1.1
Backlog:No Difficulity:
Votes: 0

Description

I want to see what features the smart proxy has in the json output like the following:

[{"smart_proxy":{"url":"http://172.16.220.140:8443","features":[{"feature_id":5,"name":"Puppet","smart_proxy_id":1},{"feature_id":4,"name":"Puppet CA","smart_proxy_id":1},{"feature_id":1,"name":"TFTP","smart_proxy_id":1}],"name":"test","id":1}}]

Below is the follow code need to make this happen:

 format.json {render :json => SmartProxy.all.to_json(:except => [:created_at, :updated_at],:include => {:features => {:only => [:name,:feature_id, :smart_proxy_id]}})} 

Associated revisions

Revision d076d5731d733bbc6210c81d3b11ed7d2ba8b9d7
Added by Joseph Magen 6 months ago

This commit adds most of the functionality required for API v1

The overall goal was to extract the existing JSON response
overall controllers, and to move them to a seperate name space.

  • documentation was added to all requests (available under /apidoc)
    this include same request and response generated using
    APIPIE_RECORD=examples rake test:api
  • Also Fixes #1800, fixes #1419, fixes #981 and fixes #1774

whats missing:

1. Permissions checks for all new controllers
2. Nested routes (e.g. /hosts/id/reports)
3. running tests with oauth/basic_auth (instead of as_admin {get /})

History

Updated by Joseph Magen 6 months ago

  • Status changed from New to Ready For Testing

Updated by Joseph Magen 6 months ago

  • Target version set to Bug scrub

Updated by Anonymous 6 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF