Skip to content

API Development Example

Adam Price edited this page Oct 30, 2013 · 3 revisions

Server Side

Routes

# example routes
# including nested routes

Views

small response rabl view (fifth)

# 1. object fields
# 2. no associations or nested resources

full response rabl view (handle)

# 1. object fields
# 2. include associations and nested resources

How to Handle Nested Resources

  • creation
  • deletion
  • listing
  • updating

How to Handle Non-Nested Associations

with or without join attributes???

  • create
  • update
  • show
  • index
  • delete
  • add_association
  • remove_association

Expected JSON output

{
    'json': true
}

Testing

def example_new_test_to_write
  do.stuff()
  assert(true == true)
end

Client Side

hammer-cli-katello

# steps to add your new command(s) to hammer-cli-katello

Testing

# how to test the super-nice hammer-cli-katello commands you just added