Bug #7332
closedHost Create API documentation missing required parameters
Description
Steps to Reproduce:
1. Navigate to host API doc of sat6 installation -> Host Create - https://$host/apidoc/v2/hosts/create.html
2. Notice that "name" is the only required parameter
3.. Try one of these curl commands to create the host
#curl -X POST -H "Accept:application/json" -H "Content-Type: application/json" -u admin:changeme --insecure -d '{"host":{"name":"testhost1"}}' https://cloud-qe-14.idm.lab.bos.redhat.com/api/v2/hosts
- curl -X POST -H "Accept:application/json" -H "Content-Type: application/json" -u admin:changeme --insecure -d '{"name":"testhost1"}' https://cloud-qe-14.idm.lab.bos.redhat.com/api/v2/hosts
Actual results:
{
"error": {"id":null,"errors":{"environment_id":["can't be blank"],"mac":["is invalid","can't be blank"],"architecture_id":["can't be blank"],"operatingsystem_id":["can't be blank"],"domain_id":["can't be blank"],"root_pass":["should be 8 characters or more","should not be blank - consider setting a global or host group default"],"ptable_id":["cant be blank unless a custom partition has been defined"]},"full_messages":["Environment can't be blank","MAC address is invalid","MAC address can't be blank","Architecture can't be blank","Operatingsystem can't be blank","Domain can't be blank","Root password should be 8 characters or more","Root password should not be blank - consider setting a global or host group default","Partition Table cant be blank unless a custom partition has been defined"]}
}
Expected results:
API doc should have updated list of required parameters
Updated by The Foreman Bot over 10 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/1732 added
- Pull request deleted (
)
Updated by Dominic Cleal over 10 years ago
- Related to Bug #6997: Host API v2 required parameters are wrong added
Updated by Anonymous over 10 years ago
- Target version changed from 1.7.4 to 1.7.3
Updated by Dominic Cleal about 10 years ago
- Target version changed from 1.7.3 to 1.7.2
Updated by Joseph Magen about 10 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 5638cc6871ed231c259ae64e998ff5907bfb7bb5.
Updated by Dominic Cleal about 10 years ago
- Translation missing: en.field_release set to 21