This all kind of depends on how you created your blueprint and what host groups 
you have defined. Assuming you have two host groups, here’s an example of what 
to POST. You also need to specify the blueprint name of the blueprint you 
created.

POST api/v1/clusters/indigo

{
  "blueprint": <your-blueprint-name-that-you-created>,
  "default_password": "password",
  "host_groups": [
    {
      "hosts": [
        {
          "fqdn": 
"ip-10-4-148-160.us<http://ip-10-4-148-160.us>-west-2.compute.internal"
        }
      ],
      "name": "host_group_1"
    },
    {
      "hosts": [
        {
          "fqdn": 
"ip-10-4-148-49.us<http://ip-10-4-148-49.us>-west-2.compute.internal"
        }
      ],
      "name": "host_group_2"
    }
  ]
}

On Nov 18, 2015, at 11:04 AM, Naga Vijay 
<[email protected]<mailto:[email protected]>> wrote:

I tried removing the href and items, but am unable to POST the host mappings 
file.

Can you please provide the right format for the minimal host mappings file 
below?

{
  "href" : "http://10.4.148.160:8080/api/v1/clusters/indigo/hosts";,
  "items" : [
    {
      "href" : 
"http://10.4.148.160:8080/api/v1/clusters/indigo/hosts/ip-10-4-148-160.us-west-2.compute.internal";,
      "Hosts" : {
        "cluster_name" : "indigo",
        "host_name" : 
"ip-10-4-148-160.us<http://ip-10-4-148-160.us>-west-2.compute.internal"
      }
    },
    {
      "href" : 
"http://10.4.148.160:8080/api/v1/clusters/indigo/hosts/ip-10-4-148-49.us-west-2.compute.internal";,
      "Hosts" : {
        "cluster_name" : "indigo",
        "host_name" : 
"ip-10-4-148-49.us<http://ip-10-4-148-49.us>-west-2.compute.internal"
      }
    }
  ]
}

Thanks
Naga



On Mon, Nov 16, 2015 at 11:01 AM, Jonathan Hurley 
<[email protected]<mailto:[email protected]>> wrote:
When you make a  REST request to Ambari, it gives you back some JSON which 
contains the data along with some decorator information. The “href” and “items” 
elements are only for informational and structure purposes; you wouldn’t want 
to include them in a POST going back to the server. What are you trying to do 
with your cluster? Chances are you just need to omit the fields it’s 
complaining about.

On Nov 15, 2015, at 3:50 PM, Naga Vijay 
<[email protected]<mailto:[email protected]>> wrote:

Just prefixed "Ambari Blueprints" to the subject line above.

On Sun, Nov 15, 2015 at 12:48 PM, Naga Vijay 
<[email protected]<mailto:[email protected]>> wrote:
Hello,

I am using Ambari 2.1.2 and facing this issue when I POST the host mappings 
json file ...

"message" : "The properties [href, items] specified in the request or predicate 
are not supported for the resource type Cluster."

Has anyone encountered this?

If yes, may I know how you have overcome?

Thanks
Naga




Reply via email to