Project

General

Profile

Bug #1774

show features that the smart proxy has in json output

Added by Corey Osman about 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

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 d076d573 (diff)
Added by Joseph Magen over 9 years 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

#1 Updated by Joseph Magen over 9 years ago

  • Status changed from New to Ready For Testing

#2 Updated by Joseph Magen over 9 years ago

  • Target version set to Bug scrub

#3 Updated by Anonymous over 9 years ago

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

Also available in: Atom PDF