Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Unable to properly make an API call to Redhat Satellite 6 via HTTP-REST/Operation Workflow

$
0
0

Hi

 

I am trying to make an API call to the Redhat Satellite 6 API (Forman API) to create a new host entry.

 

URL: https://xx.xx.xx.xx/api/v2/hosts

METHOD: POST

Content-Type: application/json

Accept: application/json

 

I have been using Postman to construct the JSON payload that I have working by sending raw JSON data:

{

  "name": "gs-test01",

  "mac": "00:50:56:a9:4f:d6",

  "hostgroup_id": "13",

  "location_id": "3",

  "organization_id": "1",

  "ptable_id": "107",

  "content_facet_attributes": {

      "content_view_id": "2",

      "lifecycle_environment_id": "2"

  },

  "managed": "true",

  "build": "true"

}

 

I get a response from the API and the host is created.

 

I am now trying to do the same using Orchestrator. I have created the REST host and the REST operation and submit the same JSON data as the 'content' payload but always get this response: (I have reduced the payload to just 3 elements for this test)

 

[2016-12-06 09:46:29.246] [I] Content is: {"name": "gs-test01","mac": "00:50:56:a9:4f:d6","hostgroup_id": "13"}

[2016-12-06 09:46:29.248] [I] Request: DynamicWrapper (Instance) : [RESTRequest]-[class com.vmware.o11n.plugin.rest.Request] -- VALUE : com.vmware.o11n.plugin.rest.Request@4a7c8e73

[2016-12-06 09:46:29.249] [I] Request URL: https://xx.xx.xx.xx/api/v2/hosts

[2016-12-06 09:46:29.418] [I] Response: DynamicWrapper (Instance) : [RESTResponse]-[class com.vmware.o11n.plugin.rest.Response] -- VALUE : com.vmware.o11n.plugin.rest.Response@39cdf59a

[2016-12-06 09:46:29.420] [I] Status code: 404

[2016-12-06 09:46:29.422] [I] Content as string: {"message":"Hostgroup not found by id '13'"}

 

On the Postman request, I changed the hostgroup_id to "99" (which doesn't exist) and it comes back with a response like the above, which is valid because 99 doesn't exist.

 

So I am scratching my head with why when I send the request via Orchestrator that the forman API returns a not found when it does exist.

 

has anyone else had any experience with the above?

 

Thanks,

 

Gavin


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>