Hello,
I’m trying out the DCS DDC API to automatically provision new VMs, in this test through vagrant and the vagrant-vcloud plugin. Because the vagrant plugin threw exceptions I started trying it out manually as per https://www.exoscale.ch/syslog/2014/03/11/fiddling-vcloud-api/
$ http –session=vcloud -a api_vcd_username@0sme00org01dcl:password POST https://datacenter.swisscomcloud.com/api/sessions ‘Accept:application/*+xml;version=5.1’
HTTP/1.1 200 OK
Content-Type: application/vnd.vmware.vcloud.session+xml;version=5.1
Date: Fri, 04 Sep 2015 17:50:29 GMT
Date: Fri, 04 Sep 2015 17:50:30 GMT
Set-Cookie: vcloud-token=01dbe263657042fc94xxxxxxec70d0fa; Secure; Path=/
Set-Cookie: TS01627006=0116f001c77ab7d2c4a326197b695526afc3cf7679a9f31a3f2344efee43fff5a3310942fd6fe8b1d4a66acc21be1f88479a3e63fc6faa567f82143a80f3bd60eec89fc346; Path=/
Transfer-Encoding: chunked
X-VMWARE-VCLOUD-REQUEST-EXECUTION-TIME: 212
X-VMWARE-VCLOUD-REQUEST-ID: 184f7b62-d40b-4a3c-8081-1c6873122e76
x-vcloud-authorization: 01dbe263657042fc94xxxxxxec70d0fa
<?xml version=“1.0” encoding=“UTF-8”?>
<ns0:Session xmlns:ns0=“http://www.vmware.com/vcloud/v1.5” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” href=“https://datacenter.swisscomcloud.com/api/session” org=“0sme00org01dcl” type=“application/vnd.vmware.vcloud.session+xml” user=“api_vcd_vshntest” xsi:schemaLocation=“http://www.vmware.com/vcloud/v1.5 https://datacenter.swisscomcloud.com/api/v1.5/schema/master.xsd”>
<ns0:Link href="[https://datacenter.swisscomcloud.com/api/org/"](https://datacenter.swisscomcloud.com/api/org/") rel="down" type="application/vnd.vmware.vcloud.orgList+xml" />
<ns0:Link href="[https://datacenter.swisscomcloud.com/api/session"](https://datacenter.swisscomcloud.com/api/session") rel="remove" />
<ns0:Link href="[https://datacenter.swisscomcloud.com/api/org/49d8b721-xxxx-xxxx-xxxx-cc1cfa9f98dc"](https://datacenter.swisscomcloud.com/api/org/49d8b721-xxxx-xxxx-xxxx-cc1cfa9f98dc") name="0sme00org01dcl" rel="down" type="application/vnd.vmware.vcloud.org+xml" />
<ns0:Link href="[https://datacenter.swisscomcloud.com/api/query"](https://datacenter.swisscomcloud.com/api/query") rel="down" type="application/vnd.vmware.vcloud.query.queryList+xml" />
<ns0:Link href="[https://datacenter.swisscomcloud.com/api/entity/"](https://datacenter.swisscomcloud.com/api/entity/") rel="entityResolver" type="application/vnd.vmware.vcloud.entity+xml" />
<ns0:Link href="[https://datacenter.swisscomcloud.com/api/extensibility"](https://datacenter.swisscomcloud.com/api/extensibility") rel="down:extensibility" type="application/vnd.vmware.vcloud.apiextensibility+xml" />
</ns0:Session>
So the session and authentication seems to work fine.
When I try to query the organisation information (following the tutorial above) the following happens:
$ http –session=vcloud GET https://datacenter.swisscomcloud.com/api/org/ ‘Accept:application/*+xml;version=5.1’
HTTP/1.0 302 Found
Cache-Control: no-store, no-cache
Connection: close
Content-Length: 0
Location: https://extranet.swisscom.ch
Pragma: no-cache
looks like the WAF intercepts the request and redirects to the login page. How can I use the API?
Thanks and best regards,
Aarno