jclouds / legacy-jclouds

https://jclouds.apache.org
466 stars 216 forks source link

Add Named annotation to all Async methods #1184

Closed codefromthecrypt closed 9 years ago

codefromthecrypt commented 11 years ago

In order to allow stable per-operation configuration, we need to name methods that correspond to rest actions. This directly support smarter timeouts in issue #1089.

For example, in AWS, names are already present on all async ops following IAM naming conventions like s3:PutObject. Using constants names will replace the old Class.method syntax, which is especially brittle in openstack and ec2 clones who have vastly different timeouts, and also brittle when method names are refactored, or multiple methods execute the same command.

This issue will track addition of similar annotations for all async apis, and closes when we can remove the former property syntax.

codefromthecrypt commented 11 years ago

@dkoper can you give a hand on fgcp?

codefromthecrypt commented 11 years ago

@nacx can you help w/ chef, abiquo?

codefromthecrypt commented 11 years ago

@kedardave can you help add annotations for savvis, opsource, and azure mgmt?

codefromthecrypt commented 11 years ago

@dralves can you add annotations for oauth and google?

codefromthecrypt commented 11 years ago

@everett-toews can you handle rackspace and openstack?

codefromthecrypt commented 11 years ago

@spark404 can you help with adding named annotations for cloudstack?

codefromthecrypt commented 11 years ago

@KennethNagin can you backfill annotations for cdmi?

codefromthecrypt commented 11 years ago

@gaul could you help naming the atmos async commands?

codefromthecrypt commented 11 years ago

@petergardfjall can you help name the glesys commands?

codefromthecrypt commented 11 years ago

I'll do the others

spark404 commented 11 years ago

Sure, how can I help?

Cheers,

Hugo

Sent from my iPhone

On 16 jan. 2013, at 20:00, "Adrian Cole" notifications@github.com<mailto:notifications@github.com> wrote:

@spark404https://github.com/spark404 can you help with adding named annotations for cloudstack?

— Reply to this email directly or view it on GitHubhttps://github.com/jclouds/jclouds/issues/1184#issuecomment-12334152.

codefromthecrypt commented 11 years ago

So, if you look at the associated aws change, we are adding Named annotations to each async method. We need stable names, and probably for cloudstack the value of Action is best.

Sound good?

codefromthecrypt commented 11 years ago

So essentially a pull request with all async api methods containing Named annotations is the ideal case.

dralves commented 11 years ago

The base name is supposed to be the api id correct? (e.g. "google-compute" for gce.). Also the method name alone is not sufficient, I need to also use the particular api name to differentiate.

would this work?:

interface KernelsAsyncApi {
...

@Named("google-compute:kernels:list")
ListenableFuture<? extends PagedIterable<Kernel>> list(ListOptions listOptions)
}
jclouds commented 11 years ago

Good example, @dralves

So main thing is to make this intuitive to the backend api and not have jclouds-isms if at all possible. For example, the prefix of ec2 in the ec2 actions isn't on basis of the provider key in jclouds, rather that this reflects the IAM name of the operation.

For google, we don't need to prefix, but if we did, we'd want to use something non-jcloudsy, such as the name used in oauth scope.

Ex. the prefix compute as this is short and congruent with the oauth key: https://www.googleapis.com/auth/compute.

The unique part you mentioned makes sense, based on docs. For example, disks:list is literally how google describe the op. https://developers.google.com/compute/docs/reference/v1beta13/disks/list

In summary, something very similar to what you had makes sense to me:

@Named("compute:disks:list") or.. @Named("compute/disks:list")

etoews commented 11 years ago

@adriancole Can do. Roughly when did you want to have this done?

codefromthecrypt commented 11 years ago

How does a week sound? :)

petergardfjall commented 11 years ago

@adriancole I'll do it.

However, for future tasks related to the glesys provider it would be good to have someone else step up. Maybe someone at GleSYS? I'm actually not a GleSYS employee and my work doesn't involve GleSYS at the moment so I don't have that many cycles to put in on this kind of work. (I guess it would be in their best interest to make sure that the leading java cloud library supports their API! :) )

codefromthecrypt commented 11 years ago

@petergardfjall thanks tons. Didn't realize you didn't work for glesys!

codefromthecrypt commented 11 years ago

thanks @nacx for doing chef and abiquo!

codefromthecrypt commented 11 years ago

thx @everett-toews for covering openstack!

codefromthecrypt commented 11 years ago

thx @everett-toews for covering rackspace!

dralves commented 11 years ago

1224 does it for gce

dralves commented 11 years ago

1225 does it for oauth

codefromthecrypt commented 11 years ago

@dralves thanks for doing google and oauth! @dkoper thanks for doing fgcp!

codefromthecrypt commented 11 years ago

added cloudstack, atmos, azure, hpcloud

reworked swift and cloudfiles to the more dominant command-name style ex. ListContainers

would appreciate any help from others who can pick up one of the remaining providers

KennethNagin commented 11 years ago

I will take care of cdmi on the next pull request that I am working on.

Is this good?: What do you prefer: @Named( "storage:container:get") or @Named( "container:get")

From: Adrian Cole notifications@github.com To: jclouds/jclouds jclouds@noreply.github.com, Cc: Kenneth Nagin/Haifa/IBM@IBMIL Date: 04/02/2013 03:59 PM Subject: Re: [jclouds] Add Named annotation to all Async methods (#1184)

added cloudstack, atmos, azure, hpcloud

reworked swift and cloudfiles to the more dominant command-name style ex. ListContainers

would appreciate any help from others who can pick up one of the remaining providers

— Reply to this email directly or view it on GitHub.

jclouds commented 11 years ago

preferably "GetContainer" caseformat. thanks!

gaul commented 9 years ago

Async removed in 1.9.0.