Skip to content

Commit

Permalink
move whole client2 to client2 package
Browse files Browse the repository at this point in the history
  • Loading branch information
brig committed Sep 20, 2023
1 parent c7e649e commit 61a6da7
Show file tree
Hide file tree
Showing 24 changed files with 1,104 additions and 61 deletions.
2 changes: 2 additions & 0 deletions client2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
<generatorName>java</generatorName>
<apiPackage>com.walmartlabs.concord.client2</apiPackage>
<modelPackage>com.walmartlabs.concord.client2</modelPackage>
<packageName>com.walmartlabs.concord.client2</packageName>
<invokerPackage>com.walmartlabs.concord.client2</invokerPackage>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
<dateLibrary>java8</dateLibrary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
* =====
*/

import com.walmartlabs.concord.ApiClient;

public interface ApiClientFactory {

ApiClient create(ApiClientConfiguration cfg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
* =====
*/

import com.walmartlabs.concord.ApiException;
import com.walmartlabs.concord.ApiResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
* =====
*/

import com.walmartlabs.concord.ApiClient;

import javax.net.ssl.*;
import java.net.http.HttpClient;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

public class ConcordApiClient extends ApiClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*/


import com.walmartlabs.concord.client2.ImmutableCreateSecretRequest;
import com.walmartlabs.concord.client2.ImmutableKeyPair;
import com.walmartlabs.concord.client2.ImmutableUsernamePassword;
import org.immutables.value.Value;

import javax.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* =====
*/

import com.walmartlabs.concord.client2.ImmutableProcessListFilter;
import com.walmartlabs.concord.client2.ProcessDataInclude;
import org.immutables.value.Value;

import javax.annotation.Nullable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
* =====
*/

import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.ApiException;
import com.walmartlabs.concord.ApiResponse;
import com.walmartlabs.concord.common.secret.BinaryDataSecret;
import com.walmartlabs.concord.common.secret.KeyPair;
import com.walmartlabs.concord.common.secret.UsernamePassword;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.walmartlabs.concord.ApiException;
import com.walmartlabs.concord.client2.ApiException;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
*/

import com.fasterxml.jackson.databind.ObjectMapper;
import com.walmartlabs.concord.ApiClient;
import org.junit.jupiter.api.Test;

import java.text.SimpleDateFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
* =====
*/

import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.client2.impl.auth.ApiKey;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo;
import com.github.tomakehurst.wiremock.junit5.WireMockTest;
import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.client2.impl.auth.ApiKey;
import com.walmartlabs.concord.common.secret.BinaryDataSecret;
import com.walmartlabs.concord.sdk.Constants;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.client2.*;
import com.walmartlabs.concord.client.*;
import com.walmartlabs.concord.sdk.Context;
import com.walmartlabs.concord.sdk.ContextUtils;
import com.walmartlabs.concord.sdk.Task;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* =====
*/

import com.walmartlabs.concord.client2.*;
import com.walmartlabs.concord.client.*;
import com.walmartlabs.concord.sdk.MapUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -102,7 +102,7 @@ public static List<HostEntry> findHostsWithArtifacts(NodeRosterHostsApi api,
"(limit: {}, offset: {})...", artifactPattern, limit, offset);

return ClientUtils.withRetry(Constants.RETRY_COUNT, Constants.RETRY_INTERVAL, () ->
api.listKnownHosts(null, artifactPattern, null, null, limit, offset));
api.list(null, artifactPattern, null, null, limit, offset));
}

/**
Expand All @@ -123,6 +123,6 @@ public static List<ArtifactEntry> findDeployedArtifacts(NodeRosterArtifactsApi a
log.info("Finding artifacts deployed on a host (hostName: {}, hostId: {})...", hostName, hostId);

return ClientUtils.withRetry(Constants.RETRY_COUNT, Constants.RETRY_INTERVAL, () ->
api.listHostArtifacts(hostId, hostName, null, limit, offset));
api.list(hostId, hostName, null, limit, offset));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

import com.walmartlabs.concord.ApiClient;
import com.walmartlabs.concord.client2.*;
import com.walmartlabs.concord.client.*;
import com.walmartlabs.concord.runtime.v2.sdk.Task;
import com.walmartlabs.concord.runtime.v2.sdk.TaskResult;
import com.walmartlabs.concord.runtime.v2.sdk.Variables;
Expand Down
62 changes: 43 additions & 19 deletions server/plugins/ansible/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,40 @@
<artifactId>concord-ansible-plugin-client</artifactId>
<packaging>jar</packaging>

<properties>
<swagger.version>1.5.20</swagger.version>
</properties>

<dependencies>
<dependency>
<groupId>com.walmartlabs.concord</groupId>
<artifactId>concord-client2</artifactId>
<artifactId>concord-client</artifactId>
</dependency>

<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp</groupId>
<artifactId>logging-interceptor</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.gsonfire</groupId>
<artifactId>gson-fire</artifactId>
</dependency>

<!-- JDK9+ compatibility -->
Expand All @@ -29,38 +59,32 @@
<build>
<plugins>
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>6.6.0</version>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/../impl/target/classes/com/walmartlabs/concord/server/plugins/ansible/swagger/swagger.yaml</inputSpec>
<generatorName>java</generatorName>
<apiPackage>com.walmartlabs.concord.client2</apiPackage>
<modelPackage>com.walmartlabs.concord.client2</modelPackage>
<inputSpec>${project.basedir}/swagger.json</inputSpec>
<language>java</language>
<languageSpecificPrimitives>
<supportJava6>false</supportJava6>
</languageSpecificPrimitives>
<templateDirectory>${project.basedir}/../../../../client/src/main/template</templateDirectory>
<library>okhttp-gson</library>
<!-- TODO change the package to "ansible" -->
<apiPackage>com.walmartlabs.concord.client</apiPackage>
<modelPackage>com.walmartlabs.concord.client</modelPackage>
<configOptions>
<sourceFolder>src/gen/java/main</sourceFolder>
<dateLibrary>java8</dateLibrary>
<serializableModel>true</serializableModel>
<openApiNullable>false</openApiNullable>
<supportUrlQuery>false</supportUrlQuery>
</configOptions>
<skipValidateSpec>false</skipValidateSpec>
<library>native</library>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<generateApiDocumentation>false</generateApiDocumentation>
<generateModelDocumentation>false</generateModelDocumentation>
<generateSupportingFiles>true</generateSupportingFiles>
<supportingFilesToGenerate>ApiClient.java,ApiResponse.java,ApiException.java,Pair.java</supportingFilesToGenerate>
<templateDirectory>../../../../client2/src/main/template</templateDirectory>
<cleanupOutput>true</cleanupOutput>
<typeMappings>string+binary=InputStream</typeMappings>
<importMappings>InputStream=java.io.InputStream</importMappings>
</configuration>
</execution>
</executions>
Expand Down
Loading

0 comments on commit 61a6da7

Please sign in to comment.