Description of problem: I expect the api /consumers/<consumerid>/guests to return a list of the consumer's guestIds, but it is not. My test scenario is: 1. register a consumer 2. update the consumer by PUTting {"guestIds":["1","2","3"]} 3. GET the /consumers/<uuid>/guests Version-Release number of selected component (if applicable): [root@jsefler-onprem-62candlepin candlepin]# git show | head -1 commit 7cb7dbe8d5e2892dcbcbf3d77a61541ca221c18f [root@jsefler-onprem-62candlepin candlepin]# curl -k -u admin:admin https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/status {"version":"0.4.25","result":true,"standalone":true,"release":"1"}[root@jsefler-onprem-62candlepin candlepin]# How reproducible: Steps to Reproduce: [root@hp-dl580g5-01 ~]# subscription-manager register --username testuser1 --password password --org admin The system has been registered with id: 46efe36f-25c8-4b1a-a3e6-e98fd80153bc [root@hp-dl580g5-01 ~]# curl --insecure --user testuser1:password --request PUT --data '{"guestIds":["1","2","3"]}' --header 'accept: application/json' --header 'content-type: application/json' https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/consumers/46efe36f-25c8-4b1a-a3e6-e98fd80153bc [root@hp-dl580g5-01 ~]# curl -k -u testuser1:password https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/consumers/46efe36f-25c8-4b1a-a3e6-e98fd80153bc/ | python -mjson.tool | grep guestId % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 9213 0 9213 0 0 51646 0 --:--:-- --:--:-- --:--:-- 80113 "guestIds": [ "guestId": "3", "guestId": "2", "guestId": "1", [root@hp-dl580g5-01 ~]# curl -k -u testuser1:password https://jsefler-onprem-62candlepin.usersys.redhat.com:8443/candlepin/consumers/46efe36f-25c8-4b1a-a3e6-e98fd80153bc/guests | python -mjson.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 2 0 2 0 0 11 0 --:--:-- --:--:-- --:--:-- 21 [] [root@hp-dl580g5-01 ~]# ^^ I EXPECTED THAT LAST CALL TO /consumers/46efe36f-25c8-4b1a-a3e6-e98fd80153bc/guests TO RETURN A LIST OF THREE guestIds, BUT IT WAS EMPTY. Additional info:
This is confusion around the concept of a guestId, which is a unique identifier from whatever virt solution you are using, and actual registered guest consumers. Hosts report guestIds they have running, guests report their guestId in their virt.uuid fact. GET /consumers/UUID/guests returns actual guest consumers, so if the above guestIds do not match up (no consumer reporting that guestId is registered yet, or another host has more recently reported that guestId as running on it), then the results from this API call will be empty. So to test this API you would need an additional consumer registered with a virt.uuid fact matching one of the guestIds you set for the host.