How can I get the ReferenceType for me after I have logged in? Assume that I am here:
VcloudClient client = VcloudClient.login(username, password);
What I would like is to get either the UUID or a reference for my user. Something that I could use for this code:
User me = User.getUserById(client, userId);
User me = User.getUserByReference(client, userRef);
I see no methods on VcloudClient that can get me there... Any help would be greatly appreciated!
Once you login, the VcloudClient contains the orgname and the username with which one has logged in. Using that information you can get the user reference from the AdminOrganization.
Something like this,
client.login(adminUsername, adminPassword);String userName = client.getUserName();String orgName = client.getOrgName();AdminOrganization adminOrg = AdminOrganization.getAdminOrgByReference(client, client.getVcloudAdmin().getAdminOrgRefByName(orgName));ReferenceType userRef = adminOrg.getUserRefByName(userName);User user = User.getUserByReference(client, userRef);
can you guys help me out with vcloud api 5.1 ?? when i use https://example.vcloud.com/api, Im not getting any respose. Is there anything to setup before we use APIs? Can you please guide me ?
Thanks in advance.
Actually, My developer wants to use these APS's. As he told me, He wrote me some script for login purpose and he tried to call that script to vcloud director but he doesnt get anything reply back, And i tried that in url which is https://ip-address/api/login not working in the browser as well. Im not sure this is the right way to use API's. Is there anything we need to set up in the vcloud director to use APIs?
vCD 5.1 API's has dropped support for the 1.0 API's. 1.0 API's contained the api/login.
1.5 and 5.1 API's have the POST - api/sessions login mechanism.
Use the api/sessions instead of the api/login.
So we dont need to set up anything in vcloud right? Just directly access them using SDK/REST API tools ?
My developer Using PHP/SDK, but he is saying he doesnt get any response.
I have downloaded REST client and sent request for https://ip-address/api, saying not authenticated
here is the respose
peer not authenticated
javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
When i selected trust self-signed certificate checkmark, hostnaem verifier allow all,
I get this response, No valid API version can be selected
0000: 4E 6F 20 76 61 6C 69 64 20 41 50 49 20 76 65 72 | No valid API ver |
0010: 73 69 6F 6E 20 63 61 6E 20 62 65 20 73 65 6C 65 | sion can be sele |
0020: 63 74 65 64 cted |
This is a completely different thread / discussion. Please create a new discussion to satisfy your request.
Here is a guide that can help you get started with the vCloud API:
It gives a very good introduction to how and what you can do with the API... This thread is concerning the Java SDK, which is an SDK built for Java based on the Schema of the SDK. (a layer higher than what you are inquiring about).
PHP SDK 5.1.0 works against vCD 5.1.
To make it work against vCD 1.5.X we released a PHP SDK 5.1.1 patch. Just a minor change in the login method.
Its not working for me SDK PHP 5.1.0 against vCD 5.1
[Rajesh] This should work, what is not working. Can you elaborate.
Should i use SDK PHP 5.1.0 patch? against vCD 5.1
[Rajesh] This should work against vCD 5.1 and vCD 1.5.X