You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Ignasi Barrera <no...@github.com> on 2018/06/11 13:28:29 UTC

[jclouds/jclouds] Added Local Network Gateway API (#1216)

This PR adds the Local Gateway Network API and is the first of a set of PRs that will add support for configuring VPNs in Azure ARM: https://docs.microsoft.com/en-us/rest/api/network-gateway/

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

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

-- Commit Summary --

  * Added Local Network Gateway API

-- File Changes --

    M providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeApi.java (9)
    M providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeProviderMetadata.java (2)
    A providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/LocalNetworkGateway.java (75)
    A providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/LocalNetworkGatewayProperties.java (96)
    A providers/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/features/LocalNetworkGatewayApi.java (81)
    M providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/AvailabilitySetApiMockTest.java (2)
    A providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/LocalNetworkGatewayApiLiveTest.java (122)
    A providers/azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/LocalNetworkGatewayApiMockTest.java (148)
    A providers/azurecompute-arm/src/test/resources/localnetworkgatewaycreate.json (18)
    A providers/azurecompute-arm/src/test/resources/localnetworkgatewayget.json (18)
    A providers/azurecompute-arm/src/test/resources/localnetworkgatewaylist.json (22)

-- Patch Links --

https://github.com/jclouds/jclouds/pull/1216.patch
https://github.com/jclouds/jclouds/pull/1216.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/1216

Re: [jclouds/jclouds] Added Local Network Gateway API (#1216)

Posted by Ignasi Barrera <no...@github.com>.
Live test result:
```bash
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest
Configuring TestNG with: TestNG652Configurator
Starting test createLocalNetworkGateway(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest)
[TestNG] Test createLocalNetworkGateway(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest) succeeded: 1830ms
Test suite progress: tests succeeded: 1, failed: 0, skipped: 0.
Starting test getLocalNetworkGateway(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest)
[TestNG] Test getLocalNetworkGateway(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest) succeeded: 304ms
Test suite progress: tests succeeded: 2, failed: 0, skipped: 0.
Starting test listLocalNetworkGateways(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest)
[TestNG] Test listLocalNetworkGateways(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest) succeeded: 333ms
Test suite progress: tests succeeded: 3, failed: 0, skipped: 0.
Starting test updateLocalNetworkGateway(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest)
[TestNG] Test updateLocalNetworkGateway(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest) succeeded: 16668ms
Test suite progress: tests succeeded: 4, failed: 0, skipped: 0.
Starting test deleteLocalNetworkGateway(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest)
[TestNG] Test deleteLocalNetworkGateway(org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest) succeeded: 13891ms
Test suite progress: tests succeeded: 5, failed: 0, skipped: 0.
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 76.254 sec - in org.jclouds.azurecompute.arm.features.LocalNetworkGatewayApiLiveTest

Results :

Tests run: 5, Failures: 0, Errors: 0, Skipped: 0
```

-- 
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/1216#issuecomment-396243293

Re: [jclouds/jclouds] Added Local Network Gateway API (#1216)

Posted by Ignasi Barrera <no...@github.com>.
nacx commented on this pull request.



> +      // Make sure the resource is fully provisioned before deleting it
+      waitUntilAvailable(name);
+      URI uri = api().delete(name);
+      assertResourceDeleted(uri);
+   }
+
+   private LocalNetworkGatewayApi api() {
+      return api.getLocalNetworkGatewayApi(resourceGroupName);
+   }
+
+   private boolean waitUntilAvailable(final String name) {
+      return resourceAvailable.apply(new Supplier<Provisionable>() {
+         @Override
+         public Provisionable get() {
+            LocalNetworkGateway gw = api().get(name);
+            return gw == null ? null : gw.properties();

That's actually what it does. The predicate accepts a `Provisionable` object which is just an interface that exposes the `provisioningState` and then uses that state to check the desired status.

-- 
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/1216#discussion_r194875133

Re: [jclouds/jclouds] Added Local Network Gateway API (#1216)

Posted by Andrea Turli <no...@github.com>.
andreaturli approved this pull request.

lgtm, some minor changes

> @@ -138,7 +138,7 @@ public void deleteAvailabilitySet() throws InterruptedException {
       assertSent(server, "DELETE", path);
    }
 
-   public void deleteSubnetResourceDoesNotExist() throws InterruptedException {
+   public void deleteAvailabilitySetDoesNotExist() throws InterruptedException {

thanks for fixing it!

> +      // Make sure the resource is fully provisioned before deleting it
+      waitUntilAvailable(name);
+      URI uri = api().delete(name);
+      assertResourceDeleted(uri);
+   }
+
+   private LocalNetworkGatewayApi api() {
+      return api.getLocalNetworkGatewayApi(resourceGroupName);
+   }
+
+   private boolean waitUntilAvailable(final String name) {
+      return resourceAvailable.apply(new Supplier<Provisionable>() {
+         @Override
+         public Provisionable get() {
+            LocalNetworkGateway gw = api().get(name);
+            return gw == null ? null : gw.properties();

why not using `provisioningState` ?

-- 
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/1216#pullrequestreview-128105598