Plz have a look at code and tell me where I am doing mistake.. String provider = "openstack-keystone"; String identity = "admin:admin"; // tenantName:userName String credential = "cloud";
keystoneApi = ContextBuilder.newBuilder(provider) *.endpoint("http://xx.xx.xx.xx:35357/v2.0/ <http://xx.xx.xx.xx:35357/v2.0/>")* .credentials(identity, credential) .modules(modules) .buildApi(KeystoneApi.class); On Mon, Aug 3, 2015 at 12:41 PM, Ignasi Barrera <n...@apache.org> wrote: > Looking at the logs, you are still not connecting to the Keystone admin > endpoint. > > Please, read the thread again and pay special attention to the first > replies where we said you *must* use the keystone admin endpoint (in port > 35357 by default). > El 3/8/2015 7:54, "Alka Beniwal" <beniwala...@gmail.com> escribió: > >> Here it is.. >> >> >> 11:16:21.138 [main] DEBUG o.j.rest.internal.InvokeHttpMethod - >> >> invoking extension:list >> >> 11:16:21.161 [main] DEBUG o.j.rest.internal.InvokeHttpMethod - >> >> invoking AuthenticationApi.authenticateWithTenantNameAndCredentials >> >> 11:16:21.161 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - >> Sending request -157697619: POST http://10.xx.xx.xx:5000/v2.0/tokens >> HTTP/1.1 >> >> 11:16:21.161 [main] DEBUG jclouds.wire - >> >> "{"auth":{"passwordCredentials":{"username":"admin","password":"cloud"},"tenantName":"admin"}}" >> >> 11:16:21.162 [main] DEBUG jclouds.headers - >> POST >> http://10.xx.xx.xx:5000/v2.0/tokens >> HTTP/1.1 >> >> 11:16:21.162 [main] DEBUG jclouds.headers - >> Accept: application/json >> >> 11:16:21.162 [main] DEBUG jclouds.headers - >> Content-Type: >> application/json >> >> 11:16:21.162 [main] DEBUG jclouds.headers - >> Content-Length: 97 >> >> 11:16:21.352 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - >> Receiving response -157697619: HTTP/1.1 200 OK >> >> 11:16:21.353 [main] DEBUG jclouds.headers - << HTTP/1.1 200 OK >> >> 11:16:21.353 [main] DEBUG jclouds.headers - << Date: Mon, 03 Aug 2015 >> 05:36:53 GMT >> >> 11:16:21.353 [main] DEBUG jclouds.headers - << Vary: X-Auth-Token >> >> 11:16:21.354 [main] DEBUG jclouds.headers - << X-Distribution: Ubuntu >> >> 11:16:21.354 [main] DEBUG jclouds.headers - << Connection: keep-alive >> >> 11:16:21.354 [main] DEBUG jclouds.headers - << Content-Type: >> application/json >> >> 11:16:21.354 [main] DEBUG jclouds.headers - << Content-Length: 7905 >> >> 11:16:21.361 [main] DEBUG jclouds.wire - << "{"access": {"token": >> {"issued_at": "2015-08-03T05:36:53.579351", "expires": >> "2015-08-03T06:36:53Z", "id": >> "MIIN-QYJKoZIhvcNAQcCoIIN7jCCDeoCAQExCTAHBgUrDgMCGjCCDFMGCSqGSIb3DQEHAaCCDEQEggxAeyJhYpxRlf6KgzDnm1ZiJLoBX4pBsqJTrYycyqWuehC0lFmVOhJJhLkqVmiGQUMjbvzGfAeZkPNFL-aTj3SUbQRqmTnsVJGSxF+U", >> "tenant": {"description": "Admin Tenant - Do Not Delete", "enabled": true, >> "id": "eba51ca10658497289cdef23d3514e33", "name": "admin"}}, >> "serviceCatalog": [{"endpoints": [{"adminURL": >> "http://10.xx.xx.xx:8774/v2/eba51ca10658497289cdef23d3514e33", >> "region": "regionOne", "internalURL": >> "http://10.xx.xx.xx:8774/v2/eba51ca10658497289cdef23d3514e33", >> "id": "54cd9169b9fa4fc3b221e24ebdaf1e38", "publicURL": "http://10. >> xx.xx.xx:8774/v2/eba51ca10658497289cdef23d3514e33"}], "endpoints_links": >> [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": " >> http://10.xx.xx.xx:9696", "region": "regionOne", "internalURL": " >> http://10.xx.xx.xx:9696", "id": "769e144c187a4f1f80e7f24cd2b88ee6", >> "publicURL": "http://10.xx.xx.xx:9696"}], "endpoints_links": [], "type": >> "network", "name": "neutron"}, {"endpoints": [{"adminURL": "http://10. >> xx.xx.xx:8776/v2/eba51ca10658497289cdef23d3514e33", "region": >> "regionOne", "internalURL": >> "http://10.xx.xx.xx:8776/v2/eba51ca10658497289cdef23d3514e33", >> "id": "26450879453e4b0eab0a6c68fc66b54f", "publicURL": "http://10. >> xx.xx.xx:8776/v2/eba51ca10658497289cdef23d3514e33"}], "endpoints_links": >> [], "type": "volumev2", "name": "cinderv2"}, {"endpoints": [{"adminURL": " >> http://10.xx.xx.xx:9292", "region": "regionOne", "internalURL": " >> http://10.xx.xx.xx:9292", "id": "1be85c08f9244b2c8cf37540b7bf6f2a", >> "publicURL": "http://10.xx.xx.xx:9292"}], "endpoints_links": [], "type": >> "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://10. >> xx.xx.xx:8777", "region": "regionOne", "internalURL": >> "http://10.xx.xx.xx:8777", >> "id": "7428e3c2f8ba4e61b6fd524e8fa8f027", "publicURL": "http://10. >> xx.xx.xx:8777"}], "endpoints_links": [], "type": "metering", "name": >> "ceilometer"}, {"endpoints": [{"adminURL": >> "http://10.xx.xx.xx:8776/v1/eba51ca10658497289cdef23d3514e33", >> "region": "regionOne", "internalURL": >> "http://10.xx.xx.xx:8776/v1/eba51ca10658497289cdef23d3514e33", >> "id": "2905b83ade494664b38537c1b4702c3b", "publicURL": "http://1 10.xx.xx.xx >> :8776/v1/eba51ca10658497289cdef23d3514e33"}], "endpoints_links": [], >> "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL": " >> http://stgproxy:8080", "region": "regionOne", "internalURL": " >> http://stgproxy:8080/v1/AUTH_eba51ca10658497289cdef23d3514e33", "id": >> "308462c692314243b50e4b02946347a6", "publicURL": " >> http://stgproxy:8080/v1/AUTH_eba51ca10658497289cdef23d3514e33"}], >> "endpoints_links": [], "type": "object-store", "name": "swift"}, >> {"endpoints": [{"adminURL": "http://10.xx.xx.xx:35357/v2.0", "region": >> "regionOne", "internalURL": "http://10.xx.xx.xx:5000/v2.0", "id": >> "337333b5c09b447684743604bd114dc2", "publicURL": >> "http://10.xx.xx.xx:5000/v2.0"}], >> "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": >> {"username": "admin", "roles_links": [], "id": >> "04642f0017924fe88a3f020475bb7626", "roles": [{"name": "_member_"}, >> {"name": "admin"}], "name": "admin"}, "metadata": {"is_admin": 0, "roles": >> ["9fe2ff9ee4384b1894a90878d3e92bab", "ffd9f2e9a7504857b32a3050d3fa89ae"]}}}" >> >> 11:16:21.399 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - >> Sending request 1529183212: GET http://10.xx.xx.xx:5000/v2.0/extensions >> HTTP/1.1 >> >> 11:16:21.399 [main] DEBUG jclouds.headers - >> GET >> http://10.xx.xx.xx:5000/v2.0/extensions >> HTTP/1.1 >> >> 11:16:21.399 [main] DEBUG jclouds.headers - >> Accept: application/json >> >> 11:16:21.399 [main] DEBUG jclouds.headers - >> X-Auth-Token: >> MIIN-QYJKoZIhvcNAQcCoIIN7jCCDeoCAQExCTAHBgUrDgMCGjCCDFMGCSqGSIb3DQEHAaCCDEQEggxAeyJhYuDR9fdeSWAV3LhzF6Bni1wldqeKRL5rjVKEW4SANLEjFzHMBSsoU8Ar4x4Q63xeSIB9H8H1800vikVKHpxRlf6KgzDnm1ZiJLoBX4pBsqJTrYycyqWuehC0lFmVOhJJhLkqVmiGQUMjbvzGfAeZkPNFL-aTj3SUbQRqmTnsVJGSxF+U >> >> 11:16:21.414 [main] DEBUG o.j.h.i.JavaUrlHttpCommandExecutorService - >> Receiving response 1529183212: HTTP/1.1 200 OK >> >> 11:16:21.414 [main] DEBUG jclouds.headers - << HTTP/1.1 200 OK >> >> 11:16:21.414 [main] DEBUG jclouds.headers - << Date: Mon, 03 Aug 2015 >> 05:36:53 GMT >> >> 11:16:21.414 [main] DEBUG jclouds.headers - << Vary: X-Auth-Token >> >> 11:16:21.415 [main] DEBUG jclouds.headers - << X-Distribution: Ubuntu >> >> 11:16:21.415 [main] DEBUG jclouds.headers - << Connection: keep-alive >> >> 11:16:21.415 [main] DEBUG jclouds.headers - << Content-Type: >> application/json >> >> 11:16:21.415 [main] DEBUG jclouds.headers - << Content-Length: 1438 >> >> 11:16:21.416 [main] DEBUG jclouds.wire - << "{"extensions": {"values": >> [{"updated": "2013-12-17T12:00:0-00:00", "name": "OpenStack Federation >> APIs", "links": [{"href": "https://github.com/openstack/identity-api", >> "type": "text/html", "rel": "describedby"}], "namespace": " >> http://docs.openstack.org/identity/api/ext/OS-FEDERATION/v1.0", "alias": >> "OS-FEDERATION", "description": "OpenStack Identity Providers Mechanism."}, >> {"updated": "2013-07-07T12:00:0-00:00", "name": "OpenStack Keystone User >> CRUD", "links": [{"href": "https://github.com/openstack/identity-api", >> "type": "text/html", "rel": "describedby"}], "namespace": " >> http://docs.openstack.org/identity/api/ext/OS-KSCRUD/v1.0", "alias": >> "OS-KSCRUD", "description": "OpenStack extensions to Keystone v2.0 API >> enabling User Operations."}, {"updated": "2013-07-07T12:00:0-00:00", >> "name": "OpenStack EC2 API", "links": [{"href": " >> https://github.com/openstack/identity-api", "type": "text/html", "rel": >> "describedby"}], "namespace": " >> http://docs.openstack.org/identity/api/ext/OS-EC2/v1.0", "alias": >> "OS-EC2", "description": "OpenStack EC2 Credentials backend."}, {"updated": >> "2014-01-20T12:00:0-00:00", "name": "OpenStack Simple Certificate API", >> "links": [{"href": "https://github.com/openstack/identity-api", "type": >> "text/html", "rel": "describedby"}], "namespace": " >> http://docs.openstack.org/identity/api/ext/OS-SIMPLE-CERT/v1.0", >> "alias": "OS-SIMPLE-CERT", "description": "OpenStack simple certificate >> retrieval extension"}]}}" >> >> *java.lang.IllegalStateException*: Optional.get() cannot be called on an >> absent value >> >> at com.google.common.base.Absent.get(*Absent.java:47*) >> >> at JCloud.test.KeystoneClient.roleDetails(*KeystoneClient.java:96*) >> >> at JCloud.test.KeystoneClient.main(*KeystoneClient.java:36*) >> >> >> >> On Fri, Jul 31, 2015 at 6:57 PM, Zack Shoylev <zack.shoy...@rackspace.com >> > wrote: >> >>> Can you get us some wire logs for that issue? >>> >>> https://jclouds.apache.org/reference/logging/ >>> >>> ________________________________________ >>> From: Alka Beniwal <beniwala...@gmail.com> >>> Sent: Friday, July 31, 2015 6:07 AM >>> To: dev@jclouds.apache.org; Ignasi Barrera >>> Subject: Re: FW: Error in JCloud KeystoneApi getRoleAdminApi >>> >>> Hi all, >>> >>> Still I am getting same error. >>> >>> >>> On Thu, Dec 11, 2014 at 2:03 PM, Alka Beniwal <beniwala...@gmail.com> >>> wrote: >>> >>> > Hi Igansi, >>> > >>> > I am using keystone administrative API endpoint for connection. >>> > >>> > Thanks, >>> > Regards, >>> > AB >>> > >>> > >>> > On Thu, Dec 11, 2014 at 12:15 PM, Ignasi Barrera <n...@apache.org> >>> wrote: >>> > >>> >> There should be the OS-KSADM extension, which it is enabled by default >>> >> IIRC. Which endpoint are you connecting to? >>> >> El 11/12/2014 06:35, "Alka Beniwal" <beniwala...@gmail.com> escribió: >>> >> >>> >> > Hi Jeremy, >>> >> > >>> >> > As u told I executed Set<Extension> extensions = >>> >> > keystoneApi.getExtensionApi().list(); >>> >> > and in output list I got >>> >> > >>> >> > Extension{id=OS-FEDERATION, name=OpenStack Federation APIs >>> >> > Extension{id=OS-KSCRUD, name=OpenStack Keystone User CRUD >>> >> > Extension{id=OS-EC2, name=OpenStack EC2 API, >>> >> > Extension{id=OS-SIMPLE-CERT, name=OpenStack Simple Certificate API >>> >> > >>> >> > Roleadmin extension APi is not there. >>> >> > >>> >> > >>> >> > Thanks, >>> >> > Regards, >>> >> > AB >>> >> > >>> >> > On Wed, Dec 10, 2014 at 11:15 PM, Ignasi Barrera <n...@apache.org> >>> >> wrote: >>> >> > >>> >> > > Just to complete Jeremy's checklist, also make sure you're >>> connecting >>> >> to >>> >> > > the admin endpoint; double check the port. IIRC that extension is >>> not >>> >> > > exposed in the default endpoint. >>> >> > > El 10/12/2014 18:35, "Jeremy Daggett" < >>> jeremy.dagg...@rackspace.com> >>> >> > > escribió: >>> >> > > >>> >> > > > Forwarding to user@Š >>> >> > > > >>> >> > > > Hi Alka! >>> >> > > > >>> >> > > > It could be one of the following scenarios you are running in >>> to: >>> >> > > > >>> >> > > > - the extension is not available in your OpenStack installation >>> >> > > > - the user does not have an Admin role to access this specific >>> API >>> >> > > > >>> >> > > > Does the extension show up when executing this code? >>> >> > > > >>> >> > > > Set<Extension> extensions = >>> keystoneApi.getExtensionApi().list(); >>> >> > > > // iterate through to see what extensions are available... >>> >> > > > >>> >> > > > Please let us know, thanks! >>> >> > > > >>> >> > > > /jd >>> >> > > > >>> >> > > > On 12/9/14, 9:27 PM, "Alka Beniwal" <beniwala...@gmail.com> >>> wrote: >>> >> > > > >>> >> > > > >Hi, >>> >> > > > > >>> >> > > > >I am developing a code to retrieve list of roles in OpenStack. >>> >> > > > > >>> >> > > > >*Code-* >>> >> > > > > RoleAdminApi roleAdminApi= >>> >> > keystoneApi.getRoleAdminApi().get();//error >>> >> > > > > FluentIterable<? extends Role> list1 = >>> roleAdminApi.list(); >>> >> > > > > >>> >> > > > >*Error-* >>> >> > > > >java.lang.IllegalStateException: Optional.get() cannot be >>> called >>> >> on an >>> >> > > > >absent value >>> >> > > > > >>> >> > > > > >>> >> > > > >Any help is appreciated. >>> >> > > > > >>> >> > > > > >>> >> > > > > >>> >> > > > > >>> >> > > > >-- >>> >> > > > >Thanks, >>> >> > > > >Regards, >>> >> > > > >AB >>> >> > > > >>> >> > > > >>> >> > > >>> >> > >>> >> >>> > >>> > >>> >> >>