Building the API client library requires Maven to be installed.
To install the API client library to your local Maven repository, simply execute:
mvn installTo deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn deployRefer to the official documentation for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>com.cloudatio.openfaas</groupId>
<artifactId>openfaas-client</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>Add this dependency to your project's build file:
compile "com.cloudatio.openfaas:openfaas-client:0.0.1"At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
- target/openfaas-client-0.0.1.jar
- target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;
import java.io.File;
import java.util.*;
public class DefaultApiExample {
public static void main(String[] args) {
DefaultApi apiInstance = new DefaultApi();
String functionName = "functionName_example"; // String | Function name
byte[] input = BINARY_DATA_HERE; // byte[] | (Optional) data to pass to function
try {
apiInstance.asyncFunctionFunctionNamePost(functionName, input);
} catch (ApiException e) {
System.err.println("Exception when calling DefaultApi#asyncFunctionFunctionNamePost");
e.printStackTrace();
}
}
}All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| DefaultApi | asyncFunctionFunctionNamePost | POST /async-function/{functionName} | Invoke a function asynchronously in OpenFaaS |
| DefaultApi | functionFunctionNamePost | POST /function/{functionName} | Invoke a function defined in OpenFaaS |
| DefaultApi | healthzGet | GET /healthz | Healthcheck |
| DefaultApi | systemAlertPost | POST /system/alert | Event-sink for AlertManager, for auto-scaling |
| DefaultApi | systemFunctionFunctionNameGet | GET /system/function/{functionName} | Get a summary of an OpenFaaS function |
| DefaultApi | systemFunctionsDelete | DELETE /system/functions | Remove a deployed function. |
| DefaultApi | systemFunctionsGet | GET /system/functions | Get a list of deployed functions with: stats and image digest |
| DefaultApi | systemFunctionsPost | POST /system/functions | Deploy a new function. |
| DefaultApi | systemFunctionsPut | PUT /system/functions | Update a function. |
| DefaultApi | systemInfoGet | GET /system/info | Get info such as provider version number and provider orchestrator |
| DefaultApi | systemScaleFunctionFunctionNamePost | POST /system/scale-function/{functionName} | Scale a function |
- DeleteFunctionRequest
- FunctionDefintion
- FunctionDefintionLimits
- FunctionListEntry
- Info
- InfoProvider
- InfoProviderVersion
- InfoVersion
Authentication schemes defined for the API:
- Type: HTTP basic authentication
It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.