You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Sergey Torgashov <no...@github.com> on 2016/05/17 15:02:03 UTC

[jclouds/jclouds] Support for "Placement.Tenancy" and "Placement.HostId" AWS EC2 parameters (#954)

Fixes [JCLOUDS-1114](https://issues.apache.org/jira/browse/JCLOUDS-1114).

This adds support for "Placement.Tenancy" and "Placement.HostId" for the "RunInstances" action in AWS EC2 API.

See also AWS EC2 API docs:
- [RunInstances](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html) action
- [Placement](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Placement.html) data type

You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds/pull/954

-- Commit Summary --

  * adding support for "Placement.Tenancy" and "Placement.HostId" AWS EC2 parameters

-- File Changes --

    M providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateOptions.java (54)
    M providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/strategy/CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.java (4)
    M providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/options/AWSRunInstancesOptions.java (32)
    M providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/options/AWSEC2TemplateOptionsTest.java (38)
    M providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/options/AWSRunInstancesOptionsTest.java (49)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/954.patch
https://github.com/jclouds/jclouds/pull/954.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/954

Re: [jclouds/jclouds] Support for "Placement.Tenancy" and "Placement.HostId" AWS EC2 parameters (#954)

Posted by Ignasi Barrera <no...@github.com>.
Closed #954.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/954#event-666488147

Re: [jclouds/jclouds] Support for "Placement.Tenancy" and "Placement.HostId" AWS EC2 parameters (#954)

Posted by Ignasi Barrera <no...@github.com>.
Thanks for the patch @storgashov! Code looks good, but a couple of tests should also be added:

* Add the new options to the [AWSInstanceApiTest#testRunInstancesOptions](https://github.com/jclouds/jclouds/blob/master/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/features/AWSInstanceApiTest.java#L119-L143), to verify the requests are properly generated.
* Include the new options in the [AWSEC2ComputeServiceApiMockTest#launchVPCSpotInstanceSubnetId](https://github.com/jclouds/jclouds/blob/master/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2ComputeServiceApiMockTest.java#L49-L87), or just copy the test and create a new one, to verify that options are properly populated from the compute service options to the generated http request.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/954#issuecomment-219988320

Re: [jclouds/jclouds] Support for "Placement.Tenancy" and "Placement.HostId" AWS EC2 parameters (#954)

Posted by Ignasi Barrera <no...@github.com>.
> @@ -61,6 +61,22 @@ public AWSRunInstancesOptions inPlacementGroup(String placementGroup) {
>     }
>  
>     /**
> +    * Specifies the tenancy of the instance within which to launch the instance(s).
> +    */
> +   public AWSRunInstancesOptions withTenancy(String tenancy) {

Looking at the docs, it looks like the only allowed values are `default | dedicated | host`. I think it is worth creating an enum so users don't have the chance to pass in the wrong values (the same enum should be used here and in the aws template options.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/954/files/6913bfa4ec512f2410c16769f96588e2c2e5cc9c#r63680675

Re: [jclouds/jclouds] Support for "Placement.Tenancy" and "Placement.HostId" AWS EC2 parameters (#954)

Posted by Sergey Torgashov <no...@github.com>.
@nacx, thanks for your review! I've updated the patch according to your comments, please take a look.
Also please confirm, if the ``Tenancy`` enum name and package I've selected is ok.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/954#issuecomment-220390856

Re: [jclouds/jclouds] Support for "Placement.Tenancy" and "Placement.HostId" AWS EC2 parameters (#954)

Posted by Ignasi Barrera <no...@github.com>.
Squashed, amended commit message to include the JIRA issue, and pushed to master as [ccd1ef2b](http://git-wip-us.apache.org/repos/asf/jclouds/commit/ccd1ef2b).Thanks @storgashov!

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/954#issuecomment-220472400