Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 181080

REST API

$
0
0

HI ,

 

Can anybody tell me how to pass input to POST method of REST API ?

 

My objective is to schedule a deployment using REST API with modified value of  key- 'domain_name_distingueshed'.

To schedule a deployment using POST method with modified key value, i am providing command as:

 

curl -i --user admin:ca$hc0w --Request POST -d '<node><name>AD-D_1.0</name><node-component><name>cmf_ad_config></name><property><key>domain_name_distinguished</key><value><![CDATA[test_rest.com]]></value></property></node-component></node>' https://10.99.130.221:8443/darwin/api/1.0/deployment-profile/182/action/deploy --url https://10.99.130.221:8443/darwin -k

 

But i am getting error as follows:

 

localhost:/Rest_Op # curl -i --user admin:ca$hc0w --Request POST -d '<node><name>AD-D_1.0</name><node-component><name>cmf_ad_config></name><property><key>domain_name_distinguished</key><value><![CDATA[test_rest.com]]></value></property></node-component></node>' https://10.99.130.221:8443/darwin/api/1.0/deployment-profile/182/action/deploy --url https://10.99.130.221:8443/darwin -k

HTTP/1.0 200 Connection established

 

HTTP/1.1 415 Unsupported Media Type

Server: Apache-Coyote/1.1

Set-Cookie: JSESSIONID=008C1EA0E619382E6E08377C4E122205; Path=/darwin/; Secure; HttpOnly

Content-Type: text/html;charset=utf-8

Content-Length: 1123

Date: Mon, 08 Apr 2013 09:18:02 GMT

 

<html><head><title>VMware vFabric tc Runtime 2.6.5.RELEASE/7.0.26.A.RELEASE - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 415 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server refused this request because the request entity is in a format not supported by the requested resource for the requested method ().</u></p><HR size="1" noshade="noshade"><h3>VMware vFabric tc Runtime 2.6.5.RELEASE/7.0.26.A.RELEASE</h3></body></html>HTTP/1.1 302 Moved Temporarily

Server: Apache-Coyote/1.1

Location: https://10.99.130.221:8443/darwin/

Transfer-Encoding: chunked

Date: Mon, 08 Apr 2013 09:18:02 GMT

 

 

 

 

Just wanted to confirm whether i am using correct way to provide input to POST method?

I have also tried with input XML file to POST command:

 

curl -i --user admin:ca$hc0w --Request POST -file -H "Content-Type: text/xml" -d -Binary @dep_prop.xml https://10.99.130.221:8443/darwin/api/1.0/deployment-profile/182/action/deploy --url https://10.99.130.221:8443/darwin -k  

 

But this is also giving error.

 

Am i missing out something?

 

 

Thanks in advance!


Viewing all articles
Browse latest Browse all 181080

Trending Articles