softlayer / softlayer-ruby

http://softlayer.github.io/softlayer-ruby/
MIT License
54 stars 35 forks source link

Accessing ResourceMetadata without an API key #107

Closed davissp14 closed 8 years ago

davissp14 commented 8 years ago

According to the spec: http://sldn.softlayer.com/reference/services/SoftLayer_Resource_Metadata

I should be able to access basic resource information without specifying an api key / username as long as the request originates from the backend network of the resource. When trying to access the service, i continue to receive "XMLRPC::FaultException: Access Denied".

Can be reproduced by the following:

 # On a Softlayer host
   client = SoftLayer::Client.new 
   service = client.service_named("Resource_Metadata")
   service.getDatacenter
   => XMLRPC::FaultException: Access Denied.

Any thoughts?

SLsthompson commented 8 years ago

My first thought is that you would probably need to use the "service" API endpoint (the one available the private network) to make your API call. So your client would need to be configured to use API_PRIVATE_ENDPOINT (SoftLayer::Client.new(endpoint_url : API_PRIVATE_ENDPOINT).

Having said that, I'm not sure that the high level classes like SoftLayer::Client and SoftLayer::Service are prepared to make unauthenticated calls. Please try with the alternate endpoint URL and let me know if that helps. Otherwise we may have to do some hard work to allow for unauthenticated calls.

davissp14 commented 8 years ago

Thanks for the help! Pointing to the private api endpoint did the trick!