Start a Conversation

Unsolved

This post is more than 5 years old

888

November 16th, 2015 11:00

Can't find working syntax for ViPR REST POST

Hi

A curl execution of the GET /vdc works correctly:

# curl -k -g  https://lxxx:4443/vdc -b viprcookiefile -v

* About to connect() to xxx port 4443 (#0)

*   Trying xxx... connected

* Connected to xxx(xxx) port 4443 (#0)

* Initializing NSS with certpath: sql:/etc/pki/nssdb

* warning: ignoring value of ssl.verifyhost

* skipping SSL peer certificate verification

* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA

* Server certificate:

*       subject: CN=xxx

*       start date: Sep 21 17:15:41 2015 GMT

*       expire date: Sep 18 17:15:41 2025 GMT

*       common name: xxx

*       issuer: CN=xxx

> GET /vdc HTTP/1.1

> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2

> Host: xxx:4443

> Accept: */*

> Cookie: X-SDS-AUTH-TOKEN=BAAcOXpERjdDaE45NVhTN3NnenJhcm5CQ3ZGdWVJPQMAVAQADTE0NDc2MDc2OTIyODACAAEABQA9dXJuOnN0b3JhZ2VvczpUb2tlbjpmNjJhODQ2My1kNWQxLTQzNDAtOTE5My02Y2ZjYmQzMjczZmQ6dmRjMQIAAtAP

>

< HTTP/1.1 200 OK

< Date: Mon, 16 Nov 2015 15:30:27 GMT

< Content-Type: application/xml

< Content-Length: 346

< Connection: keep-alive

<

* Connection #0 to host xxx left intact

* Closing connection #0

urn:storageos:VirtualDataCenter:a9bf1f92-3089-48e1-8233-a2dd717d5d5d:vdc1vdc1

#

But I can't find the correct syntax for the PUT /vdc function:

# curl -k -d 'urn:storageos:VirtualDataCenter:a9bf1f92-3089-48e1-8233-a2dd717d5d5d:vdc1' https://xxx:4443/vdc/bulk --header "content-type:application/xml" -b viprcookiefile -v

* About to connect() to xxx port 4443 (#0)

*   Trying xxx... connected

* Connected to xxx (xxx) port 4443 (#0)

* Initializing NSS with certpath: sql:/etc/pki/nssdb

* warning: ignoring value of ssl.verifyhost

* skipping SSL peer certificate verification

* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA

* Server certificate:

*       subject: CN=xxx

*       start date: Sep 21 17:15:41 2015 GMT

*       expire date: Sep 18 17:15:41 2025 GMT

*       common name: xxx

*       issuer: CN=xxx

> POST /vdc/bulk HTTP/1.1

> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2

> Host: xxx:4443

> Accept: */*

> Cookie: X-SDS-AUTH-TOKEN=BAAcOXpERjdDaE45NVhTN3NnenJhcm5CQ3ZGdWVJPQMAVAQADTE0NDc2MDc2OTIyODACAAEABQA9dXJuOnN0b3JhZ2VvczpUb2tlbjpmNjJhODQ2My1kNWQxLTQzNDAtOTE5My02Y2ZjYmQzMjczZmQ6dmRjMQIAAtAP

> content-type:application/xml

> Content-Length: 93

>

< HTTP/1.1 405 Method Not Allowed

< Date: Mon, 16 Nov 2015 15:38:15 GMT

< Content-Type: application/xml

< Content-Length: 204

< Connection: keep-alive

<

* Connection #0 to host xxx left intact

* Closing connection #0

1007Method not supported

Operation not supported
false

Thoughts, please.

Thanks

tl

17 Posts

November 16th, 2015 20:00

Hello,

My first thoughts were to use PUT instead of POST, however, /vdc/bulk is not listed in the REST API (2.3):

http://www.emc.com/collateral/TechnicalDocument/docu59838.pdf

Are you trying to add/link another ViPR VDC to your existing configuration?  If so, the requirement is that both VDCs have zero configured virtual of physical resources and usually needs to be done during initial deployment.

1 Rookie

 • 

87 Posts

November 19th, 2015 10:00

"My first thoughts were to use PUT instead of POST, however, /vdc/bulk is not listed in the REST API (2.3)". Huh?  It might not be in the document that you provided a link to, but it is in the ViPR Contoller REST API Reference (see ViPR 2.3 REST API).  Thanks.

No Events found!

Top