> +
> +   /**
> +    * Returns the specified ForwardingRule resource.
> +    *
> +    * @param region     the name of the region scoping this request.
> +    * @param forwardingRule the name of the ForwardingRule resource to 
> return.
> +    * @return a ForwardingRule resource.
> +    */
> +   @Named("ForwardingRules:get")
> +   @GET
> +   @Consumes(MediaType.APPLICATION_JSON)
> +   @Path("/regions/{region}/forwardingRules/{forwardingRule}")
> +   @OAuthScopes(COMPUTE_READONLY_SCOPE)
> +   @Fallback(NullOnNotFoundOr404.class)
> +   @Nullable
> +   ForwardingRule getInRegion(@PathParam("region") String region, 
> @PathParam("forwardingRule") String forwardingRule);

The endpoint param provides a function that returns a URI given a value. In the 
nova example, it returns the endpoint given the region. jclouds has a set of 
default functions to do that, that delegate to different region/zone suppliers. 
You can have a look at the 
[RegionToEndpoint](https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/location/functions/RegionToEndpoint.java)
 function to see how it works and to the [keystone suppliers 
package](https://github.com/jclouds/jclouds/tree/master/apis/openstack-keystone/src/main/java/org/jclouds/openstack/keystone/v2_0/suppliers)
 to see how the suppliers where the function delegates are implemented in 
openstack.

This is needed, in general, when you need to perform an API call to get the 
endpoint (such as getting them from the keystone service catalog, or some 
complex work. In this case, if I'm not wrong, you can just move the `@Path` 
annotation to the "delegating" interface and all the methods in this one will 
already be scoped to that path.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-google/pull/22/files#r16397997

Reply via email to