V2 api documentation for organizations

Would like some up-votes on Bug #3923 organzation relations not documented through apipie[1]. The online docs are a fantastic resource, except when they don't reflect what params are available.

[1] Bug #3923: organzation relations not documented through apipie - Foreman

··· -- @thomasmckay


“The leader must aim high, see big, judge widely, thus setting himself apart form the ordinary people who debate in narrow confines.” ~ Charles De Gaulle

“Leadership is about making others better as a result of your presence and making sure that impact lasts in your absence.” ~ Harvard Business School

And how are locations and organizations nested? Again, no apipie docs and I don't see any hammer commands. Am I missing something obvious? How is everyone else figuring out how to do this?

··· ----- Original Message ----- > > Would like some up-votes on Bug #3923 organzation relations not documented > through apipie[1]. The online docs are a fantastic resource, except when > they don't reflect what params are available. > > > [1] http://projects.theforeman.org/issues/3923 > > -- > @thomasmckay > > -- > "The leader must aim high, see big, judge widely, thus setting himself apart > form the ordinary people who debate in narrow confines." ~ Charles De Gaulle > > "Leadership is about making others better as a result of your presence and > making sure that impact lasts in your absence." ~ Harvard Business School > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

Hi Tom,

You're right. The documentation is currently lagging, but the plan is to have it up-to-date before 1.5 is released. The latest Foreman release 1.4.1 doesn't have nested locations and organizations.

Btw, I plan to work on issue #4628 to disable Org nesting if Katello is enabled.

Regarding adding/removeing many-to-many relationships, we there have been several threads in the past how to best do this (not just for locs/orgs, but for all many-to-many). At some

Currently, this is the general documentation, but it's explicitly defined on every object with examples of many-to-many associations such as "add smart proxy to organization"

http://theforeman.org/manuals/1.4/index.html#5.1.7HandlingAssociations

Regards,

Joseph

··· ----- Original Message ----- > From: "Tom McKay" > To: foreman-dev@googlegroups.com > Sent: Wednesday, March 19, 2014 2:30:15 AM > Subject: Re: [foreman-dev] v2 api documentation for organizations > > > > ----- Original Message ----- > > > > Would like some up-votes on Bug #3923 organzation relations not documented > > through apipie[1]. The online docs are a fantastic resource, except when > > they don't reflect what params are available. > > > > > > [1] http://projects.theforeman.org/issues/3923 > > > > -- > > @thomasmckay > > > > -- > > "The leader must aim high, see big, judge widely, thus setting himself > > apart > > form the ordinary people who debate in narrow confines." ~ Charles De > > Gaulle > > > > "Leadership is about making others better as a result of your presence and > > making sure that impact lasts in your absence." ~ Harvard Business School > > > > -- > > You received this message because you are subscribed to the Google Groups > > "foreman-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to foreman-dev+unsubscribe@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > > And how are locations and organizations nested? Again, no apipie docs and I > don't see any hammer commands. Am I missing something obvious? How is > everyone else figuring out how to do this? > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

Is this api call incorrect?

Processing by Api::V2::LocationsController#create as JSON
Parameters: {"name"=>"Asia Pacific (Singapore) Region", "parent_ids"=>[15], "apiv"=>"v2", "location"=>{"name"=>"Asia Pacific (Singapore) Region"}}

It looks like parent_ids (I've tried singular parent_id as well) is not making it into the wrapped params. Am I misunderstanding how to call the API?

··· ----- Original Message ----- > Hi Tom, > > You're right. The documentation is currently lagging, but the plan is to > have it up-to-date before 1.5 is released. The latest Foreman release 1.4.1 > doesn't have nested locations and organizations. > > Btw, I plan to work on issue #4628 to disable Org nesting if Katello is > enabled. > > Regarding adding/removeing many-to-many relationships, we there have been > several threads in the past how to best do this (not just for locs/orgs, but > for all many-to-many). At some > > Currently, this is the general documentation, but it's explicitly defined on > every object with examples of many-to-many associations such as "add smart > proxy to organization" > > http://theforeman.org/manuals/1.4/index.html#5.1.7HandlingAssociations > > Regards, > > Joseph > > > > > > > > ----- Original Message ----- > > From: "Tom McKay" > > To: foreman-dev@googlegroups.com > > Sent: Wednesday, March 19, 2014 2:30:15 AM > > Subject: Re: [foreman-dev] v2 api documentation for organizations > > > > > > > > ----- Original Message ----- > > > > > > Would like some up-votes on Bug #3923 organzation relations not > > > documented > > > through apipie[1]. The online docs are a fantastic resource, except when > > > they don't reflect what params are available. > > > > > > > > > [1] http://projects.theforeman.org/issues/3923 > > > > > > -- > > > @thomasmckay > > > > > > -- > > > "The leader must aim high, see big, judge widely, thus setting himself > > > apart > > > form the ordinary people who debate in narrow confines." ~ Charles De > > > Gaulle > > > > > > "Leadership is about making others better as a result of your presence > > > and > > > making sure that impact lasts in your absence." ~ Harvard Business School > > > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "foreman-dev" group. > > > To unsubscribe from this group and stop receiving emails from it, send an > > > email to foreman-dev+unsubscribe@googlegroups.com. > > > For more options, visit https://groups.google.com/d/optout. > > > > > > > And how are locations and organizations nested? Again, no apipie docs and I > > don't see any hammer commands. Am I missing something obvious? How is > > everyone else figuring out how to do this? > > > > -- > > You received this message because you are subscribed to the Google Groups > > "foreman-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to foreman-dev+unsubscribe@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to foreman-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

I modified the call to the api (apipie bindings) and it worked:

      @api.resource(:locations).call(:create, {
                                       'location' => {
                                         'name' => name,
                                         'parent_id' => foreman_location(:name => line[PARENT])
                                       }
                                     })

This does not seem to match the documentation, but again perhaps I'm misunderstanding how wrapped params work.

··· ----- Original Message ----- > > Is this api call incorrect? > > Processing by Api::V2::LocationsController#create as JSON > Parameters: {"name"=>"Asia Pacific (Singapore) Region", "parent_ids"=>[15], > "apiv"=>"v2", "location"=>{"name"=>"Asia Pacific (Singapore) Region"}} > > It looks like parent_ids (I've tried singular parent_id as well) is not > making it into the wrapped params. Am I misunderstanding how to call the > API? > > > ----- Original Message ----- > > Hi Tom, > > > > You're right. The documentation is currently lagging, but the plan is to > > have it up-to-date before 1.5 is released. The latest Foreman release 1.4.1 > > doesn't have nested locations and organizations. > > > > Btw, I plan to work on issue #4628 to disable Org nesting if Katello is > > enabled. > > > > Regarding adding/removeing many-to-many relationships, we there have been > > several threads in the past how to best do this (not just for locs/orgs, > > but > > for all many-to-many). At some > > > > Currently, this is the general documentation, but it's explicitly defined > > on > > every object with examples of many-to-many associations such as "add smart > > proxy to organization" > > > > http://theforeman.org/manuals/1.4/index.html#5.1.7HandlingAssociations > > > > Regards, > > > > Joseph > > > > > > > > > > > > > > > > ----- Original Message ----- > > > From: "Tom McKay" > > > To: foreman-dev@googlegroups.com > > > Sent: Wednesday, March 19, 2014 2:30:15 AM > > > Subject: Re: [foreman-dev] v2 api documentation for organizations > > > > > > > > > > > > ----- Original Message ----- > > > > > > > > Would like some up-votes on Bug #3923 organzation relations not > > > > documented > > > > through apipie[1]. The online docs are a fantastic resource, except > > > > when > > > > they don't reflect what params are available. > > > > > > > > > > > > [1] http://projects.theforeman.org/issues/3923 > > > > > > > > -- > > > > @thomasmckay > > > > > > > > -- > > > > "The leader must aim high, see big, judge widely, thus setting himself > > > > apart > > > > form the ordinary people who debate in narrow confines." ~ Charles De > > > > Gaulle > > > > > > > > "Leadership is about making others better as a result of your presence > > > > and > > > > making sure that impact lasts in your absence." ~ Harvard Business > > > > School > > > > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups > > > > "foreman-dev" group. > > > > To unsubscribe from this group and stop receiving emails from it, send > > > > an > > > > email to foreman-dev+unsubscribe@googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. > > > > > > > > > > And how are locations and organizations nested? Again, no apipie docs and > > > I > > > don't see any hammer commands. Am I missing something obvious? How is > > > everyone else figuring out how to do this? > > > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "foreman-dev" group. > > > To unsubscribe from this group and stop receiving emails from it, send an > > > email to foreman-dev+unsubscribe@googlegroups.com. > > > For more options, visit https://groups.google.com/d/optout. > > > > > > > -- > > You received this message because you are subscribed to the Google Groups > > "foreman-dev" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to foreman-dev+unsubscribe@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > >