-
Task
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
-
False
-
-
Currently, the API returns an 'id' property for each host instance found. This 'id' currently represents the 'instance_id' as defined by an external service such as HBI which is often used by the GUI to link back to the instance in this service. Using the name 'id' for this property can be a little misleading since it is generally reserved for the ID of the internal swatch record.
The instances API ( GET /instances/products/{product_id} ) response data should be updated to define the following ID properties per instance and describe them as follows:
- id – The ID of the Swatch Host record.
- instance_id – The ID of the host/system instance according to some external service such as HBI.
DONE:
- Instance API spec is updated to add an instance_id property to the InstanceData response.
- While we are in there, update/clean up the examples listed under the affected sections of the API spec. Some of these look like they are carry over from the old Hosts API.
- Update descriptive text on the object property in the openapi spec.
- Required code changes are made to set the id property of InstanceData to the Host record id (via the view table).
- Required code changes are made to set the instance_id property of InstanceData to the instance_id of the Host record.
- Note: The instance_id property on the Host is already being set to the correct value when coming from HBI and prometheus metrics and just needs to be set to the new property on the response.
QE: swap references to id with instance_id, add appropriate tests to validate these values.
- is related to
-
SWATCH-865 Port the Hosts API's hypervisor-guests mapping endpoint to the Instances API
- Closed