Commit c6dd5b5d authored by Daniel Seybold's avatar Daniel Seybold
Browse files

added client codegen and client sources

parent 856bb73f
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# exclude jar for gradle wrapper
!gradle/wrapper/*.jar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# build files
**/target
target
.gradle
build
2.3.0
\ No newline at end of file
#
# Generated by: https://github.com/swagger-api/swagger-codegen.git
#
language: java
jdk:
- oraclejdk8
- oraclejdk7
before_install:
# ensure gradlew has proper permission
- chmod a+x ./gradlew
script:
# test using maven
- mvn test
# uncomment below to test using gradle
# - gradle test
# uncomment below to test using sbt
# - sbt test
# client
## Requirements
Building the API client library requires [Maven](https://maven.apache.org/) to be installed.
## Installation
To install the API client library to your local Maven repository, simply execute:
```shell
mvn install
```
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
```shell
mvn deploy
```
Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information.
### Maven users
Add this dependency to your project's POM:
```xml
<dependency>
<groupId>de.uulm.omi.cloudiator.catalogue</groupId>
<artifactId>client</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
```
### Gradle users
Add this dependency to your project's build file:
```groovy
compile "de.uulm.omi.cloudiator.catalogue:client:1.0.0"
```
### Others
At first generate the JAR by executing:
mvn package
Then manually install the following JARs:
* target/client-1.0.0.jar
* target/lib/*.jar
## Getting Started
Please follow the [installation](#installation) instruction and execute the following Java code:
```java
import de.uulm.omi.cloudiator.catalogue.client.*;
import de.uulm.omi.cloudiator.catalogue.client.auth.*;
import de.uulm.omi.cloudiator.catalogue.client.model.*;
import de.uulm.omi.cloudiator.catalogue.client.api.ApplicationApi;
import java.io.File;
import java.util.*;
public class ApplicationApiExample {
public static void main(String[] args) {
ApplicationApi apiInstance = new ApplicationApi();
String applicationName = "applicationName_example"; // String | maps to the parent application description to identify its application components
java.util.List<Component> components = Arrays.asList(new Component()); // java.util.List<Component> | a list of application components
try {
CloudiatorApplicationInstance result = apiInstance.genericPost(applicationName, components);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplicationApi#genericPost");
e.printStackTrace();
}
}
}
```
## Documentation for API Endpoints
All URIs are relative to *http://localhost/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ApplicationApi* | [**genericPost**](docs/ApplicationApi.md#genericPost) | **POST** /generic | Generic application deployment
*BigDataApi* | [**sparkJobPost**](docs/BigDataApi.md#sparkJobPost) | **POST** /sparkJob | submit an Apache Spark job to a Spark Master
*BigDataApi* | [**sparkPost**](docs/BigDataApi.md#sparkPost) | **POST** /spark | deploys an Apache Spark cluster
*DatabaseApi* | [**databaseClusterPost**](docs/DatabaseApi.md#databaseClusterPost) | **POST** /database/cluster | DDBMS cluster deployment
*DatabaseApi* | [**databaseCrossClusterPost**](docs/DatabaseApi.md#databaseCrossClusterPost) | **POST** /database/crossCluster | DDBMS cluster deployment
*DatabaseApi* | [**databaseSinglePost**](docs/DatabaseApi.md#databaseSinglePost) | **POST** /database/single | DDBMS cluster deployment
*DatabaseApi* | [**utilsRegisterCloudPost**](docs/DatabaseApi.md#utilsRegisterCloudPost) | **POST** /utils/registerCloud | Register a new cloud as deployment target
*ScriptsApi* | [**scriptsBigdataGet**](docs/ScriptsApi.md#scriptsBigdataGet) | **GET** /scripts/bigdata | Get custom database installation scripts
*ScriptsApi* | [**scriptsDatabaseGet**](docs/ScriptsApi.md#scriptsDatabaseGet) | **GET** /scripts/database | Get custom database installation scripts
## Documentation for Models
- [Cloud](docs/Cloud.md)
- [CloudiatorApplicationInstance](docs/CloudiatorApplicationInstance.md)
- [Cluster](docs/Cluster.md)
- [ClusterConfiguration](docs/ClusterConfiguration.md)
- [Component](docs/Component.md)
- [CrossClusterConfiguration](docs/CrossClusterConfiguration.md)
- [CustomConfiguration](docs/CustomConfiguration.md)
- [CustomConfigurationItem](docs/CustomConfigurationItem.md)
- [DataMemory](docs/DataMemory.md)
- [DatabaseCluster](docs/DatabaseCluster.md)
- [DatabaseConfiguration](docs/DatabaseConfiguration.md)
- [DatabaseCrossCluster](docs/DatabaseCrossCluster.md)
- [DatabaseSingle](docs/DatabaseSingle.md)
- [Error](docs/Error.md)
- [IndexMemory](docs/IndexMemory.md)
- [ManagementConfiguration](docs/ManagementConfiguration.md)
- [NodeConfiguration](docs/NodeConfiguration.md)
- [ReplicationFactor](docs/ReplicationFactor.md)
- [Resource](docs/Resource.md)
- [SparkJob](docs/SparkJob.md)
- [SparkMasterComponent](docs/SparkMasterComponent.md)
- [SparkWorkerComponent](docs/SparkWorkerComponent.md)
- [DatabaseDataComponent](docs/DatabaseDataComponent.md)
- [DatabaseSeedComponent](docs/DatabaseSeedComponent.md)
- [Node](docs/Node.md)
- [Requirement](docs/Requirement.md)
- [VM](docs/VM.md)
- [CrossDatabaseDataComponent](docs/CrossDatabaseDataComponent.md)
- [CrossDatabaseSeedComponent](docs/CrossDatabaseSeedComponent.md)
- [DatabaseManagementComponent](docs/DatabaseManagementComponent.md)
## Documentation for Authorization
All endpoints do not require authorization.
Authentication schemes defined for the API:
## Recommendation
It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues.
## Author
apply plugin: 'idea'
apply plugin: 'eclipse'
group = 'de.uulm.omi.cloudiator.catalogue'
version = '1.0.0'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}
repositories {
jcenter()
}
if(hasProperty('target') && target == 'android') {
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Rename the aar correctly
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
dependencies {
provided 'javax.annotation:jsr250-api:1.0'
}
}
afterEvaluate {
android.libraryVariants.all { variant ->
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
} else {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
install {
repositories.mavenInstaller {
pom.artifactId = 'client'
}
}
task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
}
dependencies {
compile 'io.swagger:swagger-annotations:1.5.15'
compile 'com.squareup.okhttp:okhttp:2.7.5'
compile 'com.squareup.okhttp:logging-interceptor:2.7.5'
compile 'com.google.code.gson:gson:2.8.1'
compile 'io.gsonfire:gson-fire:1.8.0'
testCompile 'junit:junit:4.12'
}
lazy val root = (project in file(".")).
settings(
organization := "de.uulm.omi.cloudiator.catalogue",
name := "client",
version := "1.0.0",
scalaVersion := "2.11.4",
scalacOptions ++= Seq("-feature"),
javacOptions in compile ++= Seq("-Xlint:deprecation"),
publishArtifact in (Compile, packageDoc) := false,
resolvers += Resolver.mavenLocal,
libraryDependencies ++= Seq(
"io.swagger" % "swagger-annotations" % "1.5.15",
"com.squareup.okhttp" % "okhttp" % "2.7.5",
"com.squareup.okhttp" % "logging-interceptor" % "2.7.5",
"com.google.code.gson" % "gson" % "2.8.1",
"io.gsonfire" % "gson-fire" % "1.8.0" % "compile",
"junit" % "junit" % "4.12" % "test",
"com.novocode" % "junit-interface" % "0.10" % "test"
)
)
# ApplicationApi
All URIs are relative to *http://localhost/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**genericPost**](ApplicationApi.md#genericPost) | **POST** /generic | Generic application deployment
<a name="genericPost"></a>
# **genericPost**
> CloudiatorApplicationInstance genericPost(applicationName, components)
Generic application deployment
Deploy a generic application in a multi-cloud setup
### Example
```java
// Import classes:
//import de.uulm.omi.cloudiator.catalogue.client.ApiException;
//import de.uulm.omi.cloudiator.catalogue.client.api.ApplicationApi;
ApplicationApi apiInstance = new ApplicationApi();
String applicationName = "applicationName_example"; // String | maps to the parent application description to identify its application components
java.util.List<Component> components = Arrays.asList(new Component()); // java.util.List<Component> | a list of application components
try {
CloudiatorApplicationInstance result = apiInstance.genericPost(applicationName, components);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplicationApi#genericPost");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**applicationName** | **String**| maps to the parent application description to identify its application components |
**components** | [**java.util.List&lt;Component&gt;**](Component.md)| a list of application components |
### Return type
[**CloudiatorApplicationInstance**](CloudiatorApplicationInstance.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# BigDataApi
All URIs are relative to *http://localhost/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**sparkJobPost**](BigDataApi.md#sparkJobPost) | **POST** /sparkJob | submit an Apache Spark job to a Spark Master
[**sparkPost**](BigDataApi.md#sparkPost) | **POST** /spark | deploys an Apache Spark cluster
<a name="sparkJobPost"></a>
# **sparkJobPost**
> java.util.List&lt;CloudiatorApplicationInstance&gt; sparkJobPost(job)
submit an Apache Spark job to a Spark Master
Submitting Spark jobs to an existing Apache Spark Cluster
### Example
```java
// Import classes:
//import de.uulm.omi.cloudiator.catalogue.client.ApiException;
//import de.uulm.omi.cloudiator.catalogue.client.api.BigDataApi;
BigDataApi apiInstance = new BigDataApi();
SparkJob job = new SparkJob(); // SparkJob | the Spark job to submit
try {
java.util.List<CloudiatorApplicationInstance> result = apiInstance.sparkJobPost(job);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BigDataApi#sparkJobPost");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**job** | [**SparkJob**](SparkJob.md)| the Spark job to submit |
### Return type
[**java.util.List&lt;CloudiatorApplicationInstance&gt;**](CloudiatorApplicationInstance.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="sparkPost"></a>
# **sparkPost**
> CloudiatorApplicationInstance sparkPost(name, applicationType, cluster)
deploys an Apache Spark cluster
Deploy a Spark cluster with 1 master and n workers the multi-cloud
### Example
```java
// Import classes:
//import de.uulm.omi.cloudiator.catalogue.client.ApiException;
//import de.uulm.omi.cloudiator.catalogue.client.api.BigDataApi;
BigDataApi apiInstance = new BigDataApi();
String name = "name_example"; // String | the application name, needs to map an existing application description
String applicationType = "applicationType_example"; // String | the application type
Cluster cluster = new Cluster(); // Cluster | the Spark cluster, including one master and n workers
try {
CloudiatorApplicationInstance result = apiInstance.sparkPost(name, applicationType, cluster);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling BigDataApi#sparkPost");
e.printStackTrace();
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**name** | **String**| the application name, needs to map an existing application description | [enum: Spark]
**applicationType** | **String**| the application type | [enum: bigdata]
**cluster** | [**Cluster**](Cluster.md)| the Spark cluster, including one master and n workers |
### Return type
[**CloudiatorApplicationInstance**](CloudiatorApplicationInstance.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
# Cloud
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**endpoint** | **String** | | [optional]
**user** | **String** | | [optional]
**password** | **String** | | [optional]
# CloudiatorApplicationInstance
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**applicationInstanceId** | **String** | Unique identifier representing a specific applicationInstance in Cloudiator | [optional]
# Cluster
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**sparkMasterComponent** | [**SparkMasterComponent**](SparkMasterComponent.md) | | [optional]
**sparkWorkerComponents** | [**java.util.List&lt;SparkWorkerComponent&gt;**](SparkWorkerComponent.md) | | [optional]
# ClusterConfiguration
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**clusterPort** | **Integer** | port to connect to a cluster | [optional]
# Component
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**instances** | **Integer** | number of component instances | [optional]
**resource** | [**VM**](VM.md) | | [optional]
# CrossClusterConfiguration
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**crossClusterPort** | **Integer** | port to connect across multiple clusters | [optional]
# CrossDatabaseDataComponent
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**instances** | **Integer** | number of component instances | [optional]
**resource** | [**VM**](VM.md) | | [optional]
**name** | **String** | | [optional]
**nodeConfiguration** | [**NodeConfiguration**](NodeConfiguration.md) | | [optional]
**customConfiguration** | [**CustomConfiguration**](CustomConfiguration.md) | | [optional]
# CrossDatabaseSeedComponent
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**instances** | **Integer** | number of component instances | [optional]
**resource** | [**VM**](VM.md) | | [optional]
**name** | [**NameEnum**](#NameEnum) | | [optional]
**nodeConfiguration** | [**NodeConfiguration**](NodeConfiguration.md) | | [optional]
**customConfiguration** | [**CustomConfiguration**](CustomConfiguration.md) | | [optional]
**crossClusterConfiguration** | [**CrossClusterConfiguration**](CrossClusterConfiguration.md) | | [optional]
<a name="NameEnum"></a>
## Enum: NameEnum
Name | Value
---- | -----
SEED | &quot;SEED&quot;
# CustomConfiguration
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
# CustomConfigurationItem
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**envName** | **String** | environment variable name | [optional]
**envValue** | **String** | environment variable value | [optional]