Project

General

Profile

Bug #7332

Host Create API documentation missing required parameters

Added by Joseph Magen over 4 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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

  1. 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


Related issues

Related to Foreman - Bug #6997: Host API v2 required parameters are wrongDuplicate2014-08-07

Associated revisions

Revision 5638cc68 (diff)
Added by Joseph Magen over 4 years ago

fixes #7332 - Host Create API documentation missing required parameters

History

#1 Updated by The Foreman Bot over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1732 added
  • Pull request deleted ()

#2 Updated by Dominic Cleal over 4 years ago

  • Related to Bug #6997: Host API v2 required parameters are wrong added

#3 Updated by Dominic Cleal over 4 years ago

  • Bugzilla link set to 1135651

#4 Updated by Dmitri Dolguikh over 4 years ago

  • Target version changed from 1.7.4 to 1.7.3

#5 Updated by Dominic Cleal over 4 years ago

  • Target version changed from 1.7.3 to 1.7.2

#6 Updated by Joseph Magen over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 21

Also available in: Atom PDF