Skip to content

Commit

Permalink
Merge pull request #7 from AzBuilder/provider-support
Browse files Browse the repository at this point in the history
Rename endpoint file to implementation
  • Loading branch information
alfespa17 authored Aug 1, 2021
2 parents d685712 + b86a909 commit 35cb851
Show file tree
Hide file tree
Showing 15 changed files with 87 additions and 26 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/maven-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/azbuilder/terraform-spring-boot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>${env.USER_NAME}</username>
<password>${env.ACCESS_TOKEN}</password>
</server>
</servers>

</settings>
23 changes: 23 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Java CI with Maven

on:
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Verify with Maven
run: mvn -s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml -B verify --file pom.xml
env:
USER_NAME: ${{ secrets.USER_NAME }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Simply add the following dependency to your project's `pom.xml` will enable you
<dependency>
<groupId>org.azbuilder.api.spring.starter</groupId>
<artifactId>api-client-spring-boot-starter</artifactId>
<version>0.3.1</version>
<version>0.4.1</version>
</dependency>
```
2 changes: 1 addition & 1 deletion api-client-spring-boot-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<gson.version>2.8.6</gson.version>
<feign.version>11.1</feign.version>
<okhttp.version>4.9.1</okhttp.version>
<revision>0.4.0</revision>
<revision>0.4.1</revision>
<maven.deploy.skip>false</maven.deploy.skip>
<lombok.version>1.18.20</lombok.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion api-client-spring-boot-starter-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<revision>0.4.0</revision>
<revision>0.4.1</revision>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.azbuilder.api.client.model.organization.Organization;
import org.azbuilder.api.client.model.organization.provider.version.Version;
import org.azbuilder.api.client.model.organization.provider.version.file.File;
import org.azbuilder.api.client.model.organization.provider.version.implementation.Implementation;
import org.azbuilder.api.client.model.response.Response;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -63,7 +63,7 @@ void contextLoads() {
System.out.println(restClient.getModuleByNameAndProvider(organizationId, "azure","azurerm").getData().get(0).getAttributes().getSource());
*/

/*
/*
Response<List<Organization>> listResponse =
restClient.getOrganizationsByNameAndProvider("sampleOrg","sampleProvider");
Expand All @@ -74,22 +74,22 @@ void contextLoads() {
restClient.getVersionsByOrganizationIdAndProviderIdAndVersionNumber(
listResponse.getData().get(0).getId(),
listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId(),
"1");
"2.0.0");
Response<List<File>> files= restClient.getFileByOsArchVersion(
System.out.println(listVersion.getData().get(0).getId());
Response<List<Implementation>> files= restClient.getImplementationByOsArchVersion(
listResponse.getData().get(0).getId(),
listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId(),
listVersion.getData().get(0).getId(),
"linux",
"darwin",
"amd64");
System.out.println(files.getData().get(0).getId());
System.out.println(files.getData().get(0).getAttributes().getFilename());
System.out.println(restClient.getAllVersionsByProvider(listResponse.getData().get(0).getId(),
System.out.println(restClient.getAllVersionsByProviderWithImplementation(listResponse.getData().get(0).getId(),
listResponse.getData().get(0).getRelationships().getProvider().getData().get(0).getId()).getIncluded().size());*/

}
Expand Down
2 changes: 1 addition & 1 deletion api-client-spring-boot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>0.4.0</revision>
<revision>0.4.1</revision>
<maven.deploy.skip>false</maven.deploy.skip>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion api-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
<revision>0.4.0</revision>
<revision>0.4.1</revision>
<feign.version>11.1</feign.version>
<feign-form.version>3.8.0</feign-form.version>
<maven.deploy.skip>false</maven.deploy.skip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.azbuilder.api.client.model.organization.job.JobRequest;
import org.azbuilder.api.client.model.organization.module.Module;
import org.azbuilder.api.client.model.organization.provider.version.Version;
import org.azbuilder.api.client.model.organization.provider.version.file.File;
import org.azbuilder.api.client.model.organization.provider.version.implementation.Implementation;
import org.azbuilder.api.client.model.organization.workspace.Workspace;
import org.azbuilder.api.client.model.organization.workspace.environment.Environment;
import org.azbuilder.api.client.model.organization.workspace.secret.Secret;
Expand Down Expand Up @@ -66,13 +66,13 @@ public interface RestClient {
@RequestLine("GET /api/v1/organization?filter[organization]=name=={organizationName}&filter[provider]=name=={providerName}")
Response<List<Organization>> getOrganizationsByNameAndProvider(@Param("organizationName") String organizationName, @Param("providerName") String providerName);

@RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version?include=file")
ResponseWithInclude<List<Version>, File> getAllVersionsByProviderWithFile(@Param("organizationId") String organizationId, @Param("providerId") String providerId);
@RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version?include=implementation")
ResponseWithInclude<List<Version>, Implementation> getAllVersionsByProviderWithImplementation(@Param("organizationId") String organizationId, @Param("providerId") String providerId);

@RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version?filter[version]=versionNumber=={versionNumber}")
Response<List<Version>> getVersionsByOrganizationIdAndProviderIdAndVersionNumber(@Param("organizationId") String organizationId, @Param("providerId") String providerId, @Param("versionNumber") String versionNumber);

@RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version/{versionId}/file?filter[file]=os=={os};arch=={arch}")
Response<List<File>> getFileByOsArchVersion(@Param("organizationId") String organizationId, @Param("providerId") String providerId, @Param("versionId") String versionId, @Param("os") String os, @Param("arch") String arch);
@RequestLine("GET /api/v1/organization/{organizationId}/provider/{providerId}/version/{versionId}/implementation?filter[implementation]=os=={os};arch=={arch}")
Response<List<Implementation>> getImplementationByOsArchVersion(@Param("organizationId") String organizationId, @Param("providerId") String providerId, @Param("versionId") String versionId, @Param("os") String os, @Param("arch") String arch);

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

@Getter
@Setter
public class FileData {
public class ImplementationData {
List<Resource> data;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
@Getter
@Setter
public class Relationships {
FileData file;
ImplementationData implementation;
ProviderData provider;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.azbuilder.api.client.model.organization.provider.version.file;
package org.azbuilder.api.client.model.organization.provider.version.implementation;

import lombok.Getter;
import lombok.Setter;
import org.azbuilder.api.client.model.generic.Resource;

@Getter
@Setter
public class File extends Resource {
FileAttributes attributes;
public class Implementation extends Resource {
ImplementationAttributes attributes;
Relationships relationships;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.azbuilder.api.client.model.organization.provider.version.file;
package org.azbuilder.api.client.model.organization.provider.version.implementation;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class FileAttributes {
public class ImplementationAttributes {
private String os;
private String arch;
private String filename;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.azbuilder.api.client.model.organization.provider.version.file;
package org.azbuilder.api.client.model.organization.provider.version.implementation;

import lombok.Getter;
import lombok.Setter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.azbuilder.api.client.model.organization.provider.version.file;
package org.azbuilder.api.client.model.organization.provider.version.implementation;

import lombok.Getter;
import lombok.Setter;
Expand Down

0 comments on commit 35cb851

Please sign in to comment.