Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-22539

Cannot add host with host_name in request body

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.6.0
    • 2.6.1
    • ambari-server
    • None

    Description

      STR:

      1. Create cluster via blueprints
      2. Add a new node to one of the host groups specifying host_name in the request body according to the "multiple hosts" example in wiki

      Expected result: host is added
      Actual result: request is rejected with "Must specify either host_name or host_count" error

      $ curl -X POST -d '[ { "blueprint": "blue", "host_group": "node", "host_name": "c6402.ambari.apache.org" } ]' http://c6401.ambari.apache.org:8080/api/v1/clusters/TEST/hosts
      HTTP/1.1 400 Bad Request
      

      Similar request with host name under Hosts/host_name is accepted:

      $ curl -X POST -d '[ { "blueprint": "blue", "host_group": "node", "Hosts": { "host_name": "c6403.ambari.apache.org" } } ]' http://c6401.ambari.apache.org:8080/api/v1/clusters/TEST/hosts
      HTTP/1.1 202 Accepted
      

      Also, request with host name specified path is accepted:

      $ curl -X POST -d '[ { "blueprint": "blue", "host_group": "node" } ]' http://c6401.ambari.apache.org:8080/api/v1/clusters/TEST/hosts/c6404.ambari.apache.org
      HTTP/1.1 202 Accepted
      

      All three requests work fine in Ambari 2.5.2.

      Attachments

        1. AMBARI-22539.branch-2.6.patch
          6 kB
          Attila Doroszlai

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: