VMware Networking Community
fred0204
Contributor
Contributor

Can not make apiClient.

Hello.

I am developing to contorol NSX-T(Using java SDK)

I made ApiClient by referring to the example code.

(vsphere-automation-sdk-java/VmcNsxAuthenticationHelper.java at master · vmware/vsphere-automation-sd... )

I filled in parameter(orgs, sddcId, refreshToken) as appropriate.

But It doesn't work. Below is my error Message.

     Unable to get SDDC information: I/O error

15:37:58.074 [main] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: default

15:37:58.074 [main] DEBUG o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context

15:37:58.075 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection request: [route: {s}->https://vmc.vmware.com:443][total kept alive: 0; route allocated: 0 of 2; total allocated: 1 of 20]

15:37:58.075 [main] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection leased: [id: 1][route: {s}->https://vmc.vmware.com:443][total kept alive: 0; route allocated: 1 of 2; total allocated: 2 of 20]

15:37:58.075 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Opening connection {s}->https://vmc.vmware.com:443

15:37:58.167 [main] DEBUG o.a.h.i.c.DefaultHttpClientConnectionOperator - Connecting to vmc.vmware.com/52.41.5.206:443

15:37:58.168 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Connecting socket to vmc.vmware.com/52.41.5.206:443 with timeout 0

15:38:19.171 [main] DEBUG o.a.h.i.c.DefaultHttpClientConnectionOperator - Connect to vmc.vmware.com/52.41.5.206:443 timed out. Connection will be retried using another IP address

15:38:19.171 [main] DEBUG o.a.h.i.c.DefaultHttpClientConnectionOperator - Connecting to vmc.vmware.com/52.35.231.108:443

15:38:19.171 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Connecting socket to vmc.vmware.com/52.35.231.108:443 with timeout 0

15:38:40.174 [main] DEBUG o.a.h.i.c.DefaultHttpClientConnectionOperator - Connect to vmc.vmware.com/52.35.231.108:443 timed out. Connection will be retried using another IP address

15:38:40.174 [main] DEBUG o.a.h.i.c.DefaultHttpClientConnectionOperator - Connecting to vmc.vmware.com/35.161.22.197:443

15:38:40.174 [main] DEBUG o.a.h.c.s.SSLConnectionSocketFactory - Connecting socket to vmc.vmware.com/35.161.22.197:443 with timeout 0

15:39:01.177 [main] DEBUG o.a.h.i.c.DefaultManagedHttpClientConnection - http-outgoing-1: Shutdown connection

15:39:01.177 [main] DEBUG o.a.h.impl.execchain.MainClientExec - Connection discarded

I can connect vmc.vmware.com using postman or chrome.

(vmc.vmware.com/vmc/api/orgs/xxxxxx/sddcs/xxxxx)

What is the problem? Detailed log attached.

Tags (2)
0 Kudos
2 Replies
mauricioamorim
VMware Employee
VMware Employee

VMC on AWS has its own programming guide, which is what you should always refer to. Have you taken a look here: https://vdc-download.vmware.com/vmwb-repository/dcr/63502295-7d8b-4ce0-9429-2457e96e64a2/f5472bb2-d4... ?

In this guide there are a bunch of examples and curl commands used. I would refer to them to make sure APIs work as expected and then debug your code to see if it is using the APIs right.

0 Kudos
Nick_Andreev
Expert
Expert

Hi @fred0204,

Check with your company if you've payed for VMware SDK/API support. You might be able to open a support request with the SDK team and ask for help.

Alternatively, you can join vmwarecode.slack.com and particularly the #vsphere-sdks channel. I think it's opened for everyone.

Also check out the VMware Code forums here: VMware {code} . There's a better chance you will get an answer there.

---
If you found my answers helpful please consider marking them as helpful or correct.
VCIX-DCV, VCIX-NV, VCAP-CMA | vExpert '16, '17, '18
Blog: http://niktips.wordpress.com | Twitter: @nick_andreev_au
0 Kudos