Project

General

Profile

Actions

Bug #6347

closed

activation_keys.add_host_collections API removes host collections from the activation key

Added by dustin tsang almost 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
easy
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Description of problem:

Calling
@api.resource(:activation_keys).call(
:add_host_collections, {
:id => ak_id,
:host_collection_ids => hc_ids
})
does not associate host_collections with the activation key

Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140521.0-Satellite-x86_64

How reproducible:
always

Steps to Reproduce:
  1. bundle exec irb
    irb> require 'apipie-bindings'
    irb> api = ApipieBindings::API.new({:uri => 'http://localhost:3000/', :username => 'admin', :password => 'changeme', :api_version=> '2', :aggressive_cache_checking => true})
    irb> api.resource(:activation_keys).call(
    :add_host_collections, {
    :id => ak_id,
    :host_collection_ids => hc_ids
    })
Actual results:
  • API call runs without issues, but does not associate host collections with the activation key
  • according to config/routes/api/v2.rb it looks like :remove_host_collections is called instead

Expected results:
associate host collections with the activation key

Additional info:
  • <sat6>/apidoc/v2/activation_keys/add_host_collections
    does not have complete apidoc
  • Ivan's patch:

diff --git a/config/routes/api/v2.rb b/config/routes/api/v2.rb
index ad7cb9a..3456d10 100644
--- a/config/routes/api/v2.rb
++ b/config/routes/api/v2.rb
27,8 +27,8 @@ Katello::Engine.routes.draw do
match '/releases' => 'activation_keys#available_releases', :via => :get, :on => :member
api_resources :host_collections, :only => [:index]
member do
match '/host_collections' => 'activation_keys#add_host_collections', :via => :post
- match '/host_collections' => 'activation_keys#remove_host_collections', :via => :put
match '/host_collections' => 'activation_keys#add_host_collections', :via => :put
+ match '/host_collections' => 'activation_keys#remove_host_collections', :via => :delete
match '/host_collections/available' => 'activation_keys#available_host_collections', :via => :get
end
api_resources :products, :only => [:index]

Actions #1

Updated by dustin tsang almost 10 years ago

  • Category set to API
  • Status changed from New to Assigned
  • Assignee set to dustin tsang
  • Target version set to 48
  • Difficulty set to trivial
Actions #2

Updated by dustin tsang almost 10 years ago

  • Difficulty changed from trivial to easy
Actions #3

Updated by dustin tsang almost 10 years ago

  • Bugzilla link set to https://bugzilla.redhat.com/show_bug.cgi?id=1101537
Actions #4

Updated by dustin tsang almost 10 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset katello|commit:7da5149483f9e704134eb3e46658538833cd814c.

Actions #5

Updated by Eric Helms almost 10 years ago

  • Triaged changed from No to Yes
Actions #6

Updated by Eric Helms over 9 years ago

  • translation missing: en.field_release set to 13
Actions

Also available in: Atom PDF