@nacx @andreaturli 
This initial PR reflects the first API and foundations needed for interacting 
with Azure Resource Manager (ARM) Rest APIs. The Resource Group API is the 
first API. 

The on-going implementation and documentation can be tracked in this 
[fork](https://github.com/ritazh/jclouds-labs/tree/azurecompute-arm/azurecompute-arm).
 There are currently 12 APIs implemented. To create an Azure credential and to 
run the live tests for each API, please refer to this 
[README](https://github.com/ritazh/jclouds-labs/blob/azurecompute-arm/azurecompute-arm/README.md).

```
# ResourceGroupApiLiveTest:

mvn -Dtest=ResourceGroupApiLiveTest 
-Dtest.azurecompute-arm.identity=<Application-id> 
-Dtest.azurecompute-arm.subscriptionid=<Subscription-id> 
-Dtest.azurecompute-arm.credential=<password> 
-Dtest.azurecompute-arm.endpoint="https://management.azure.com"; 
-Dtest.jclouds.oauth.resource="https://management.azure.com/"; 
-Dtest.oauth.endpoint="https://login.microsoftonline.com/<Tenant-id>/oauth2/token"
 test
```

One major difference between ARM and Azure Service Manager (ASM) is in 
authentication.  ARM uses Oauth2 to authenticate against Azure Active 
Directory.  There are two methods, use of a JSON Web Token — but Azure ADs 
requirements differ; and a `client_credentials` bearer token request using an 
ID and a password.  

This PR implements the second method, for simplicity and to get the work going. 
 However, it has been done by copying the existing OAuth code from jclouds core 
into the azurecompute-arm branch of this work.  This approach was taken in 
order to work on the APIs.  A question on this development: what is the best 
approach for OAuth extensions?  Derive and keep the new classes within 
azurecompute-arm or plan a cleaned up implementation targeting a PR into 
jclouds core?

Reference discussion around this issue:
https://pony-poc.apache.org/thread.html/Zr4ln1ju1yrizap

FYI
@jmspring @jtjk @isalento
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/250

-- Commit Summary --

  * JCLOUDS-664 Azurecompute-arm ResourceGroupApi

-- File Changes --

    M README.md (2)
    A azurecompute-arm/.gitignore (9)
    A azurecompute-arm/README.md (109)
    A azurecompute-arm/pom.xml (179)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/AzureComputeApi.java 
(43)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/AzureComputeProviderMetadata.java
 (99)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/AzureManagementApiMetadata.java
 (85)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/config/AzureComputeHttpApiModule.java
 (58)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/config/AzureComputeParserModule.java
 (29)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/config/AzureComputeProperties.java
 (34)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/domain/ResourceGroup.java
 (140)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/features/ResourceGroupApi.java
 (99)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/functions/StatusCodeParser.java
 (37)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/handlers/AzureComputeErrorHandler.java
 (86)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/oauth/v2/AzureAuthorizationApi.java
 (50)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/oauth/v2/config/AzureCredentialType.java
 (40)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/oauth/v2/config/AzureOAuthModule.java
 (78)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/oauth/v2/config/AzureOAuthProperties.java
 (27)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/oauth/v2/domain/ClientSecret.java
 (50)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecomputearm/oauth/v2/filters/ClientCredentialsSecretFlow.java
 (116)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/AzureComputeProviderMetadataTest.java
 (28)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/features/ResourceGroupApiLiveTest.java
 (105)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/features/ResourceGroupApiMockTest.java
 (153)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/internal/AbstractAzureComputeApiLiveTest.java
 (72)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/internal/AzureLiveTestUtils.java
 (36)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/internal/BaseAzureComputeApiLiveTest.java
 (81)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/internal/BaseAzureComputeApiMockTest.java
 (127)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/oauth/v2/AuthorizationApiLiveTest.java
 (81)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/oauth/v2/AuthorizationApiMockTest.java
 (131)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecomputearm/oauth/v2/OAuthTestUtils.java
 (56)
    A azurecompute-arm/src/test/resources/resourcegroup.json (11)
    A azurecompute-arm/src/test/resources/resourcegroups.json (22)
    A azurecompute-arm/src/test/resources/resourcegroupupdated.json (9)
    A azurecompute-arm/src/test/resources/testpk-oauth-arm.pem (15)
    M pom.xml (1)

-- Patch Links --

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

Reply via email to