Bug #7091
closedissues with associating a content host with host collection(s)
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1129375
Description of problem:
I'm unable to associate a content host with a host collection via API - POST won't make the association, PUT does not expect appropriate parameter
Version-Release number of selected component (if applicable):
Satellite-6.0.4-RHEL-6-20140806.0-Satellite-x86_64 + applied https://github.com/Katello/katello/pull/4508
How reproducible:
always
Steps to Reproduce:
1. create host collecition:
curl -s -H "Content-Type:application/json" -H "Accept:application/json,version=2" -k -u admin:changeme -d '{"organization_id":1, "name":"group1"}' $(hostname)/katello/api/host_collections
{"created_at":"2014-08-12T14:51:15Z","updated_at":"2014-08-12T14:51:15Z","name":"group1","organization_id":1,"max_content_hosts":null,"description":null,"total_content_hosts":0,"unlimited_content_hosts":true,"system_ids":[],"id":4,"permissions":{"deletable":true,"editable":true}}
2. try to register a content host associated with the host collection:
curl -s -H "Content-Type:application/json" -H "Accept:application/json,version=2" -k -u admin:changeme -d '{"type":"system", "facts":{"release":"6Server", "architecture":"x86_64"}, "host_colletion_id":"4", "organization_id":1, "description":"not relevant", "name":"mysystem-123.example.com"}' $(hostname)/katello/api/systems
{"id":7,"uuid":"9c507ad1-482f-47bc-8ddd-aaf196e836dd","name":"mysystem-123.example.com","description":"not relevant","location":"None","content_view":{"id":1,"name":"Default Organization View","label":"Default_Organization_View","description":null,"organization_id":1,"default":true,"created_at":"2014-08-08T15:11:41Z","updated_at":"2014-08-08T15:11:41Z","composite":null,"next_version":1,"organization":"Default_Organization","environments":["Library"],"versions":[1],"versions_details":[{"version":1,"published":"2014-08-08 15:11:41 UTC","environments":["Library"]}]},"content_view_id":1,"distribution":" ","content_overrides":[],"entitlementStatus":"valid","autoheal":true,"href":"/consumers/9c507ad1-482f-47bc-8ddd-aaf196e836dd","release":null,"checkin_time":null,"created":"2014-08-12T14:57:19.092+0000","installedProducts":[],"service_level":"","release_ver":null,"permissions":{"editable":true},"products":[],"host":null,"hostCollections":[],"customInfo":[],"environment":{"id":1,"name":"Library","label":"Library","description":null,"organization":{"name":"Default_Organization","label":"Default_Organization"},"created_at":"2014-08-08T15:11:39Z","updated_at":"2014-08-08T15:11:39Z","library":true,"prior":null,"permissions":{"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":true,"promote_or_remove_content_views_to_environments":true}},"activation_keys":[]}
Actual results:
1) content host wasn't associated with the host collection ("hostCollections":[])
- it isn't associated, even if I pass host_collection_id as integer or - as an array as I would expect
2) apidoc/v2/systems/create says the value of "host_collection_id" is "Value: String"
3) "host_collection_id" is missing among the /apidoc/v2/systems/update parameters
Expected results:
1) content host created with host collection association
2) expect an array (not a string) for the host_collection_id parameter, as a content host may be associated with multiple host collections
3) content host update shall make it possible to update host collection association
Additional info:
transition tooling is dependent on these APIs
Updated by Walden Raines over 10 years ago
- Status changed from New to Assigned
- Assignee changed from Adam Price to Walden Raines
Updated by Eric Helms over 10 years ago
- Target version set to 54
- Difficulty set to easy
- Triaged changed from No to Yes
Updated by Walden Raines over 10 years ago
- Status changed from Assigned to Closed
This JSON is incorrect. It should be "host_collection_ids":[2] not "host_colletion_id":"4" (not the misspelling and the string instead of an array).
Updated by Walden Raines over 10 years ago
- Status changed from Closed to Assigned
- Target version changed from 54 to 55
Updated by The Foreman Bot over 10 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/4594 added
- Pull request deleted (
)
Updated by Walden Raines over 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset katello|a239724dc797eda404ab45c99a068f10ff6b1100.
Updated by Eric Helms over 10 years ago
- Translation missing: en.field_release set to 13