You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "qpointsystems (via GitHub)" <gi...@apache.org> on 2024/03/24 21:53:06 UTC

[PR] For EC2, Introduce "allocationId" to IP Address and a new describeRouteTablesWithFilter method for searching RouteTables [jclouds]

qpointsystems opened a new pull request, #202:
URL: https://github.com/apache/jclouds/pull/202

   Hello JClouds!  My first pull request.  Wanted to try and get this in as I saw activity picking up on the project recently.
   
   The PublicIPInstanceIdPair was missing the "allocationId" attribute and I had a need for that for tracking purposes.
   
   The RouteTable object lacked a method for searching "WithFilter" which I had a need for.  Tried to follow the projects existing pattern for this sort of thing.
   
   Cheers!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] For EC2, Introduce "allocationId" to IP Address and a new describeRouteTablesWithFilter method for searching RouteTables [jclouds]

Posted by "nacx (via GitHub)" <gi...@apache.org>.
nacx commented on code in PR #202:
URL: https://github.com/apache/jclouds/pull/202#discussion_r1547349446


##########
apis/ec2/src/main/java/org/jclouds/ec2/features/ElasticIPAddressApi.java:
##########
@@ -144,6 +144,28 @@ void releaseAddressInRegion(
             @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
             @FormParam("PublicIp") String publicIp);
 
+   /**
+    * Releases an elastic IP address associated with your identity.
+    *
+    * @param region
+    *           Elastic IP addresses are tied to a Region and cannot be mapped across Regions.
+    * @param allocationId
+    *           The Allocation ID (e.g., eipalloc-0ca038968f2a2c986) of the IP address that you are releasing from your identity.
+    *
+    * @see #allocateAddress
+    * @see #describeAddresses
+    * @see #associateAddress
+    * @see #disassociateAddress
+    * @see <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-query-ReleaseAddress.html"
+    */
+   @Named("ReleaseAddress")
+   @POST
+   @Path("/")
+   @FormParams(keys = ACTION, values = "ReleaseAddress")
+   void releaseAddressInRegionByAllocationId(
+           @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
+           @FormParam("AllocationId") String allocationId);

Review Comment:
   Can you please add the corresponding unit test to the `ElasticIPAddressApiTest`?



##########
providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/features/RouteTableApi.java:
##########
@@ -276,4 +282,21 @@ boolean deleteRoute(
    FluentIterable<RouteTable> describeRouteTables(
       @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
       @BinderParam(BindRouteTableIdsToIndexedFormParams.class) String... routeTableIds);
+
+   /**
+    * Describes route tables.
+    * @param region The region to search for route tables.
+    * @param filter One or more filters utilized to search for RouteTable instances
+    *
+    * @link <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeRouteTables.html">...</a>
+    */
+   @Named("DescribeRouteTables")
+   @POST
+   @FormParams(keys = ACTION, values = "DescribeRouteTables")
+   @XMLResponseParser(DescribeRouteTablesResponseHandler.class)
+   @Fallback(Fallbacks.EmptyFluentIterableOnNotFoundOr404.class)
+   FluentIterable<RouteTable> describeRouteTablesWithFilter(
+           @EndpointParam(parser = RegionToEndpointOrProviderIfNull.class) @Nullable String region,
+           @BinderParam(BindFiltersToIndexedFormParams.class) Multimap<String, String> filter);

Review Comment:
   Can you please add the corresponding unit tests to the `RouteTableApiMockTest`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@jclouds.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org