Hi Mirza! I've seen yours and Jasmin's work on 'profitbricks-rest', and I'd say that it's going to be a major improvement compared to it's SOAP predecessor.
I've looked at the api reference for server[1], and this is indeed different from it's SOAP counterpart. With that said, Ignasi's suggestion would definitely be the way to go: NodeMetadata.id() = *datacenter-id/server-id* NodeMetadata.providerId() = *server-id* ..instead of setting both as the id[2]. [1] ProfitBricks Server API Ref - https://devops.profitbricks.com/api/rest/#servers [2] #ids - https://github.com/jclouds/jclouds-labs/blob/master/profitbricks/src/main/java/org/jclouds/profitbricks/compute/function/ServerToNodeMetadata.java#L126 On Wed, Dec 30, 2015 at 6:19 PM Ignasi Barrera <n...@apache.org> wrote: > I'm forwarding this to the dev@ list. > > When implementing the compute abstraction, you'll need to implement two > main things: the ComputeService interface implementation, and a set of > functions to transform each entity from the provider specific domain to the > jclouds portable model. Jclouds always works with that portable model (with > the NodeMetadata object) and the info it has is completely up to those > functions. > > When building the model entities, most have a pair of properties "id" and > "providerId". The former is the id of the object "jclouds will use to > identify it" and the latter is the real id of the entitt in the provider. > Many providers use a custom coding for the id to provide additional info, > for example, in AWS an image object would have "ami-1234" as the providerId > but "us-east-1/ami-1234" as the id jclouds will use. > > So one option you have is to follow this approach (used in aws, openstack, > digitalocean and others) and implement the transformation function to > encode the location in the object id (and then implement the ComputeService > interface accordingly). > > HTH! > > I. > El 29/12/2015 9:50, "Mirza Licina" <mi...@stackpointcloud.com> escribió: > > > Hi, it’s Mirza from the irc channel. > > > > I’m working on the Compute part of the api for ProfitBricks Rest and I > > have a small issue. The thing is that to access server api, endpoints > such > > as “/datacenters/datacenterId/server/serverId“ should be used. However, > the > > Compute interface uses methods that accept only server id (such as start, > > stop server, get node .. etc). My question is, what would be the right > way > > to incorporate dataCenterId into the compute api? > > > > Thank in advance! > > > > > > >