diff --git a/client/.gitignore b/client/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a530464afa1b2835232cf27d5747f2e79c66d4a1 --- /dev/null +++ b/client/.gitignore @@ -0,0 +1,21 @@ +*.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 diff --git a/client/.swagger-codegen/VERSION b/client/.swagger-codegen/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..cc6612c36e05d4a1669f98ebbbe7412c16cf0af5 --- /dev/null +++ b/client/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.0 \ No newline at end of file diff --git a/client/.travis.yml b/client/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..70cb81a67c202721b749707d4539e0ffd9a08f92 --- /dev/null +++ b/client/.travis.yml @@ -0,0 +1,17 @@ +# +# 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 diff --git a/client/README.md b/client/README.md new file mode 100644 index 0000000000000000000000000000000000000000..197648eda266babbbf3f7cfae97e085e3d5a0e0a --- /dev/null +++ b/client/README.md @@ -0,0 +1,151 @@ +# 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 + + de.uulm.omi.cloudiator.catalogue + client + 1.0.0 + compile + +``` + +### 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 components = Arrays.asList(new Component()); // java.util.List | 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 + + + diff --git a/client/build.gradle b/client/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..691908d777ae1d48f8ecd6f82d53696eac0a6b46 --- /dev/null +++ b/client/build.gradle @@ -0,0 +1,103 @@ +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' +} diff --git a/client/build.sbt b/client/build.sbt new file mode 100644 index 0000000000000000000000000000000000000000..b784eece013be4a3f0da1c7394192e008b655a2e --- /dev/null +++ b/client/build.sbt @@ -0,0 +1,20 @@ +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" + ) + ) diff --git a/client/docs/ApplicationApi.md b/client/docs/ApplicationApi.md new file mode 100644 index 0000000000000000000000000000000000000000..7350d18f924d7f21c165fe0f3fb4e33bab1ece01 --- /dev/null +++ b/client/docs/ApplicationApi.md @@ -0,0 +1,56 @@ +# ApplicationApi + +All URIs are relative to *http://localhost/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**genericPost**](ApplicationApi.md#genericPost) | **POST** /generic | Generic application deployment + + + +# **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 components = Arrays.asList(new Component()); // java.util.List | 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<Component>**](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 + diff --git a/client/docs/BigDataApi.md b/client/docs/BigDataApi.md new file mode 100644 index 0000000000000000000000000000000000000000..4ff72f1a0160f1658d2eec0fead54cc240a582d7 --- /dev/null +++ b/client/docs/BigDataApi.md @@ -0,0 +1,104 @@ +# 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 + + + +# **sparkJobPost** +> java.util.List<CloudiatorApplicationInstance> 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 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<CloudiatorApplicationInstance>**](CloudiatorApplicationInstance.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **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 + diff --git a/client/docs/Cloud.md b/client/docs/Cloud.md new file mode 100644 index 0000000000000000000000000000000000000000..79089c856d2ef02419b485451ac8ca000b2e01d0 --- /dev/null +++ b/client/docs/Cloud.md @@ -0,0 +1,12 @@ + +# Cloud + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint** | **String** | | [optional] +**user** | **String** | | [optional] +**password** | **String** | | [optional] + + + diff --git a/client/docs/CloudiatorApplicationInstance.md b/client/docs/CloudiatorApplicationInstance.md new file mode 100644 index 0000000000000000000000000000000000000000..22f7017ba5d5cfc6101409a77581f4a269337568 --- /dev/null +++ b/client/docs/CloudiatorApplicationInstance.md @@ -0,0 +1,10 @@ + +# CloudiatorApplicationInstance + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**applicationInstanceId** | **String** | Unique identifier representing a specific applicationInstance in Cloudiator | [optional] + + + diff --git a/client/docs/Cluster.md b/client/docs/Cluster.md new file mode 100644 index 0000000000000000000000000000000000000000..9312fd8238539fec86352fe0cb16a36d12c675da --- /dev/null +++ b/client/docs/Cluster.md @@ -0,0 +1,11 @@ + +# Cluster + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sparkMasterComponent** | [**SparkMasterComponent**](SparkMasterComponent.md) | | [optional] +**sparkWorkerComponents** | [**java.util.List<SparkWorkerComponent>**](SparkWorkerComponent.md) | | [optional] + + + diff --git a/client/docs/ClusterConfiguration.md b/client/docs/ClusterConfiguration.md new file mode 100644 index 0000000000000000000000000000000000000000..6a0fb5f54554f74c0b7eb6af082bb90c05b3571c --- /dev/null +++ b/client/docs/ClusterConfiguration.md @@ -0,0 +1,10 @@ + +# ClusterConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clusterPort** | **Integer** | port to connect to a cluster | [optional] + + + diff --git a/client/docs/Component.md b/client/docs/Component.md new file mode 100644 index 0000000000000000000000000000000000000000..3b45b4f4e17fc190916f2f6b8ef8cc0de178f4c9 --- /dev/null +++ b/client/docs/Component.md @@ -0,0 +1,11 @@ + +# Component + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instances** | **Integer** | number of component instances | [optional] +**resource** | [**VM**](VM.md) | | [optional] + + + diff --git a/client/docs/CrossClusterConfiguration.md b/client/docs/CrossClusterConfiguration.md new file mode 100644 index 0000000000000000000000000000000000000000..ab59e9e5d7142bdd35d4c801b1ae33886067ffa7 --- /dev/null +++ b/client/docs/CrossClusterConfiguration.md @@ -0,0 +1,10 @@ + +# CrossClusterConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**crossClusterPort** | **Integer** | port to connect across multiple clusters | [optional] + + + diff --git a/client/docs/CrossDatabaseDataComponent.md b/client/docs/CrossDatabaseDataComponent.md new file mode 100644 index 0000000000000000000000000000000000000000..954d98637bdda7fba6c9db2dfd0b00090578258f --- /dev/null +++ b/client/docs/CrossDatabaseDataComponent.md @@ -0,0 +1,14 @@ + +# 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] + + + diff --git a/client/docs/CrossDatabaseSeedComponent.md b/client/docs/CrossDatabaseSeedComponent.md new file mode 100644 index 0000000000000000000000000000000000000000..3e7e78197a19d4ac6903ffb04a2af7ca6348f3b3 --- /dev/null +++ b/client/docs/CrossDatabaseSeedComponent.md @@ -0,0 +1,22 @@ + +# 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] + + + +## Enum: NameEnum +Name | Value +---- | ----- +SEED | "SEED" + + + diff --git a/client/docs/CustomConfiguration.md b/client/docs/CustomConfiguration.md new file mode 100644 index 0000000000000000000000000000000000000000..4fb4910b9e8482ce25333d321676f759940fa7cf --- /dev/null +++ b/client/docs/CustomConfiguration.md @@ -0,0 +1,9 @@ + +# CustomConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + + diff --git a/client/docs/CustomConfigurationItem.md b/client/docs/CustomConfigurationItem.md new file mode 100644 index 0000000000000000000000000000000000000000..49548fe7c2779c8b1815ab46b16cb8c04a68f649 --- /dev/null +++ b/client/docs/CustomConfigurationItem.md @@ -0,0 +1,11 @@ + +# CustomConfigurationItem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**envName** | **String** | environment variable name | [optional] +**envValue** | **String** | environment variable value | [optional] + + + diff --git a/client/docs/DataMemory.md b/client/docs/DataMemory.md new file mode 100644 index 0000000000000000000000000000000000000000..3a80d0eb3e4b6522bb82908ceb33b10cbf44f627 --- /dev/null +++ b/client/docs/DataMemory.md @@ -0,0 +1,18 @@ + +# DataMemory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**envName** | [**EnvNameEnum**](#EnvNameEnum) | environment variable name | [optional] +**envValue** | **String** | amount of RAM to allocate for data caching | [optional] + + + +## Enum: EnvNameEnum +Name | Value +---- | ----- +DATAMEMORY | "DATAMEMORY" + + + diff --git a/client/docs/DatabaseApi.md b/client/docs/DatabaseApi.md new file mode 100644 index 0000000000000000000000000000000000000000..209b5f31d6652432faadedc878a37aeeddf9b7fc --- /dev/null +++ b/client/docs/DatabaseApi.md @@ -0,0 +1,196 @@ +# DatabaseApi + +All URIs are relative to *http://localhost/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**databaseClusterPost**](DatabaseApi.md#databaseClusterPost) | **POST** /database/cluster | DDBMS cluster deployment +[**databaseCrossClusterPost**](DatabaseApi.md#databaseCrossClusterPost) | **POST** /database/crossCluster | DDBMS cluster deployment +[**databaseSinglePost**](DatabaseApi.md#databaseSinglePost) | **POST** /database/single | DDBMS cluster deployment +[**utilsRegisterCloudPost**](DatabaseApi.md#utilsRegisterCloudPost) | **POST** /utils/registerCloud | Register a new cloud as deployment target + + + +# **databaseClusterPost** +> CloudiatorApplicationInstance databaseClusterPost(name, databaseComponents) + +DDBMS cluster deployment + +Deploy a database cluster in the multi-cloud + +### Example +```java +// Import classes: +//import de.uulm.omi.cloudiator.catalogue.client.ApiException; +//import de.uulm.omi.cloudiator.catalogue.client.api.DatabaseApi; + + +DatabaseApi apiInstance = new DatabaseApi(); +String name = "name_example"; // String | database name, needs to map an existing database application description +DatabaseCluster databaseComponents = new DatabaseCluster(); // DatabaseCluster | a set of database components +try { + CloudiatorApplicationInstance result = apiInstance.databaseClusterPost(name, databaseComponents); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DatabaseApi#databaseClusterPost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| database name, needs to map an existing database application description | [enum: Couchbase] + **databaseComponents** | [**DatabaseCluster**](DatabaseCluster.md)| a set of database components | + +### Return type + +[**CloudiatorApplicationInstance**](CloudiatorApplicationInstance.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **databaseCrossClusterPost** +> CloudiatorApplicationInstance databaseCrossClusterPost(name, databaseComponents) + +DDBMS cluster deployment + +Deploy a database cluster in the multi-cloud + +### Example +```java +// Import classes: +//import de.uulm.omi.cloudiator.catalogue.client.ApiException; +//import de.uulm.omi.cloudiator.catalogue.client.api.DatabaseApi; + + +DatabaseApi apiInstance = new DatabaseApi(); +String name = "name_example"; // String | database name, needs to map an existing database application description +DatabaseCrossCluster databaseComponents = new DatabaseCrossCluster(); // DatabaseCrossCluster | a set of database components +try { + CloudiatorApplicationInstance result = apiInstance.databaseCrossClusterPost(name, databaseComponents); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DatabaseApi#databaseCrossClusterPost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| database name, needs to map an existing database application description | + **databaseComponents** | [**DatabaseCrossCluster**](DatabaseCrossCluster.md)| a set of database components | + +### Return type + +[**CloudiatorApplicationInstance**](CloudiatorApplicationInstance.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **databaseSinglePost** +> CloudiatorApplicationInstance databaseSinglePost(name, databaseComponents) + +DDBMS cluster deployment + +Deploy a database cluster in the multi-cloud + +### Example +```java +// Import classes: +//import de.uulm.omi.cloudiator.catalogue.client.ApiException; +//import de.uulm.omi.cloudiator.catalogue.client.api.DatabaseApi; + + +DatabaseApi apiInstance = new DatabaseApi(); +String name = "name_example"; // String | database name, needs to map an existing database application description +DatabaseSingle databaseComponents = new DatabaseSingle(); // DatabaseSingle | a set of database components +try { + CloudiatorApplicationInstance result = apiInstance.databaseSinglePost(name, databaseComponents); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DatabaseApi#databaseSinglePost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **String**| database name, needs to map an existing database application description | [enum: Couchbase] + **databaseComponents** | [**DatabaseSingle**](DatabaseSingle.md)| a set of database components | + +### Return type + +[**CloudiatorApplicationInstance**](CloudiatorApplicationInstance.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **utilsRegisterCloudPost** +> java.util.List<CloudiatorApplicationInstance> utilsRegisterCloudPost(cloud) + +Register a new cloud as deployment target + +### Example +```java +// Import classes: +//import de.uulm.omi.cloudiator.catalogue.client.ApiException; +//import de.uulm.omi.cloudiator.catalogue.client.api.DatabaseApi; + + +DatabaseApi apiInstance = new DatabaseApi(); +Cloud cloud = new Cloud(); // Cloud | cloud data required to enable it in cloudiator +try { + java.util.List result = apiInstance.utilsRegisterCloudPost(cloud); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DatabaseApi#utilsRegisterCloudPost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cloud** | [**Cloud**](Cloud.md)| cloud data required to enable it in cloudiator | + +### Return type + +[**java.util.List<CloudiatorApplicationInstance>**](CloudiatorApplicationInstance.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/client/docs/DatabaseCluster.md b/client/docs/DatabaseCluster.md new file mode 100644 index 0000000000000000000000000000000000000000..f7d9c29b1ebc3fce81b96d56480570c05ef6912b --- /dev/null +++ b/client/docs/DatabaseCluster.md @@ -0,0 +1,12 @@ + +# DatabaseCluster + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**databaseDataComponent** | [**java.util.List<DatabaseDataComponent>**](DatabaseDataComponent.md) | | [optional] +**databaseSeedComponent** | [**java.util.List<DatabaseSeedComponent>**](DatabaseSeedComponent.md) | | [optional] +**databaseManagementComponent** | [**java.util.List<DatabaseManagementComponent>**](DatabaseManagementComponent.md) | | [optional] + + + diff --git a/client/docs/DatabaseConfiguration.md b/client/docs/DatabaseConfiguration.md new file mode 100644 index 0000000000000000000000000000000000000000..94d5b222b86f14b45629a71f161cf93f03316016 --- /dev/null +++ b/client/docs/DatabaseConfiguration.md @@ -0,0 +1,12 @@ + +# DatabaseConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**databaseName** | **String** | database name | [optional] +**databaseUser** | **String** | database user name | [optional] +**databasePassword** | **String** | database password | [optional] + + + diff --git a/client/docs/DatabaseCrossCluster.md b/client/docs/DatabaseCrossCluster.md new file mode 100644 index 0000000000000000000000000000000000000000..222084f770e342e880099afc523cddf49a581719 --- /dev/null +++ b/client/docs/DatabaseCrossCluster.md @@ -0,0 +1,14 @@ + +# DatabaseCrossCluster + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**databaseDataComponent** | [**java.util.List<DatabaseDataComponent>**](DatabaseDataComponent.md) | | [optional] +**databaseSeedComponent** | [**java.util.List<DatabaseSeedComponent>**](DatabaseSeedComponent.md) | | [optional] +**databaseManagementComponent** | [**java.util.List<DatabaseManagementComponent>**](DatabaseManagementComponent.md) | | [optional] +**crossDatabaseDataComponent** | [**java.util.List<CrossDatabaseDataComponent>**](CrossDatabaseDataComponent.md) | | [optional] +**crossDatabaseSeedComponent** | [**java.util.List<CrossDatabaseSeedComponent>**](CrossDatabaseSeedComponent.md) | | [optional] + + + diff --git a/client/docs/DatabaseDataComponent.md b/client/docs/DatabaseDataComponent.md new file mode 100644 index 0000000000000000000000000000000000000000..1bb78f551eea521e86fabe88fc1b3f18c49ea1e5 --- /dev/null +++ b/client/docs/DatabaseDataComponent.md @@ -0,0 +1,21 @@ + +# DatabaseDataComponent + +## 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] + + + +## Enum: NameEnum +Name | Value +---- | ----- +DATA | "DATA" + + + diff --git a/client/docs/DatabaseManagementComponent.md b/client/docs/DatabaseManagementComponent.md new file mode 100644 index 0000000000000000000000000000000000000000..bf924d1b8754a5c05ddd2c3282ee174e0df463fd --- /dev/null +++ b/client/docs/DatabaseManagementComponent.md @@ -0,0 +1,22 @@ + +# DatabaseManagementComponent + +## 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] +**managementConfiguration** | [**ManagementConfiguration**](ManagementConfiguration.md) | | [optional] + + + +## Enum: NameEnum +Name | Value +---- | ----- +DATA | "DATA" + + + diff --git a/client/docs/DatabaseSeedComponent.md b/client/docs/DatabaseSeedComponent.md new file mode 100644 index 0000000000000000000000000000000000000000..2ad7367045d01df2086f93836fd44aa1930d1ba1 --- /dev/null +++ b/client/docs/DatabaseSeedComponent.md @@ -0,0 +1,21 @@ + +# DatabaseSeedComponent + +## 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] + + + +## Enum: NameEnum +Name | Value +---- | ----- +SEED | "SEED" + + + diff --git a/client/docs/DatabaseSingle.md b/client/docs/DatabaseSingle.md new file mode 100644 index 0000000000000000000000000000000000000000..caee84cc8651969b67a8f294fade8e326442bd8a --- /dev/null +++ b/client/docs/DatabaseSingle.md @@ -0,0 +1,11 @@ + +# DatabaseSingle + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**databaseSeedComponent** | [**DatabaseSeedComponent**](DatabaseSeedComponent.md) | | [optional] +**databaseManagementComponent** | [**java.util.List<DatabaseManagementComponent>**](DatabaseManagementComponent.md) | | [optional] + + + diff --git a/client/docs/Error.md b/client/docs/Error.md new file mode 100644 index 0000000000000000000000000000000000000000..a5930dc4eeb7d332423fe89247dc353d8aebfef4 --- /dev/null +++ b/client/docs/Error.md @@ -0,0 +1,12 @@ + +# Error + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**message** | **String** | | [optional] +**fields** | **String** | | [optional] + + + diff --git a/client/docs/IndexMemory.md b/client/docs/IndexMemory.md new file mode 100644 index 0000000000000000000000000000000000000000..ae5fdc5828056f7a50a315f5b702bca8c7dc9b22 --- /dev/null +++ b/client/docs/IndexMemory.md @@ -0,0 +1,18 @@ + +# IndexMemory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**envName** | [**EnvNameEnum**](#EnvNameEnum) | environment variable name | [optional] +**envValue** | **String** | amount of RAM to allocato for index caching | [optional] + + + +## Enum: EnvNameEnum +Name | Value +---- | ----- +INDEXMEMORY | "INDEXMEMORY" + + + diff --git a/client/docs/ManagementConfiguration.md b/client/docs/ManagementConfiguration.md new file mode 100644 index 0000000000000000000000000000000000000000..5a50ec0da3e19d39cb98acd08b0f5924871459ed --- /dev/null +++ b/client/docs/ManagementConfiguration.md @@ -0,0 +1,10 @@ + +# ManagementConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**crossClusterPort** | **Integer** | port to connect across multiple clusters | [optional] + + + diff --git a/client/docs/Node.md b/client/docs/Node.md new file mode 100644 index 0000000000000000000000000000000000000000..8fd19ee153bd0bf2d877eaad5df1ab97e81c96c1 --- /dev/null +++ b/client/docs/Node.md @@ -0,0 +1,11 @@ + +# Node + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**endpoint** | **Integer** | TODO | [optional] +**credentials** | **Integer** | TODO | [optional] + + + diff --git a/client/docs/NodeConfiguration.md b/client/docs/NodeConfiguration.md new file mode 100644 index 0000000000000000000000000000000000000000..4c794a141aeaeeb2eeb6eb07c2d030747b6ddbdf --- /dev/null +++ b/client/docs/NodeConfiguration.md @@ -0,0 +1,12 @@ + +# NodeConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dataMemory** | [**DataMemory**](DataMemory.md) | | [optional] +**indexMemory** | [**IndexMemory**](IndexMemory.md) | | [optional] +**replicationFactor** | [**ReplicationFactor**](ReplicationFactor.md) | | [optional] + + + diff --git a/client/docs/ReplicationFactor.md b/client/docs/ReplicationFactor.md new file mode 100644 index 0000000000000000000000000000000000000000..a39f90d1a9f0e905554b4419a78fc3296768e6e0 --- /dev/null +++ b/client/docs/ReplicationFactor.md @@ -0,0 +1,18 @@ + +# ReplicationFactor + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**envName** | [**EnvNameEnum**](#EnvNameEnum) | environment variable name | [optional] +**envValue** | **String** | replication factor, 0 = repliation disabled | [optional] + + + +## Enum: EnvNameEnum +Name | Value +---- | ----- +REPLICATIONFACTOR | "REPLICATIONFACTOR" + + + diff --git a/client/docs/Requirement.md b/client/docs/Requirement.md new file mode 100644 index 0000000000000000000000000000000000000000..9f6dd3d4d83fdc41366611941d52d87e4d0d39c6 --- /dev/null +++ b/client/docs/Requirement.md @@ -0,0 +1,10 @@ + +# Requirement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**item** | **Integer** | TODO | [optional] + + + diff --git a/client/docs/Resource.md b/client/docs/Resource.md new file mode 100644 index 0000000000000000000000000000000000000000..a554bdef2a921ba9fb702b758f1a64987f60686a --- /dev/null +++ b/client/docs/Resource.md @@ -0,0 +1,19 @@ + +# Resource + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resourceType** | [**ResourceTypeEnum**](#ResourceTypeEnum) | | + + + +## Enum: ResourceTypeEnum +Name | Value +---- | ----- +VM | "VM" +NODE | "NODE" +REQUIREMENT | "REQUIREMENT" + + + diff --git a/client/docs/ScriptsApi.md b/client/docs/ScriptsApi.md new file mode 100644 index 0000000000000000000000000000000000000000..5b45d122c9b7517deee37c5ee0b967fdf6c56355 --- /dev/null +++ b/client/docs/ScriptsApi.md @@ -0,0 +1,100 @@ +# ScriptsApi + +All URIs are relative to *http://localhost/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**scriptsBigdataGet**](ScriptsApi.md#scriptsBigdataGet) | **GET** /scripts/bigdata | Get custom database installation scripts +[**scriptsDatabaseGet**](ScriptsApi.md#scriptsDatabaseGet) | **GET** /scripts/database | Get custom database installation scripts + + + +# **scriptsBigdataGet** +> File scriptsBigdataGet(frameworkName, scriptType) + +Get custom database installation scripts + +### Example +```java +// Import classes: +//import de.uulm.omi.cloudiator.catalogue.client.ApiException; +//import de.uulm.omi.cloudiator.catalogue.client.api.ScriptsApi; + + +ScriptsApi apiInstance = new ScriptsApi(); +String frameworkName = "frameworkName_example"; // String | the Big Data Framework name, e.g. Spark +String scriptType = "scriptType_example"; // String | setup script type +try { + File result = apiInstance.scriptsBigdataGet(frameworkName, scriptType); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ScriptsApi#scriptsBigdataGet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **frameworkName** | **String**| the Big Data Framework name, e.g. Spark | [enum: spark] + **scriptType** | **String**| setup script type | [enum: install, init, master, worker] + +### Return type + +[**File**](File.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/x-sh + + +# **scriptsDatabaseGet** +> File scriptsDatabaseGet(dbName, scriptType) + +Get custom database installation scripts + +### Example +```java +// Import classes: +//import de.uulm.omi.cloudiator.catalogue.client.ApiException; +//import de.uulm.omi.cloudiator.catalogue.client.api.ScriptsApi; + + +ScriptsApi apiInstance = new ScriptsApi(); +String dbName = "dbName_example"; // String | database name +String scriptType = "scriptType_example"; // String | setup script type +try { + File result = apiInstance.scriptsDatabaseGet(dbName, scriptType); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ScriptsApi#scriptsDatabaseGet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dbName** | **String**| database name | [enum: couchbase, riak] + **scriptType** | **String**| setup script type | [enum: install, init, seed, data, management] + +### Return type + +[**File**](File.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/x-sh + diff --git a/client/docs/SparkJob.md b/client/docs/SparkJob.md new file mode 100644 index 0000000000000000000000000000000000000000..66ebc6e881b80047e6de53211735eb54e6480319 --- /dev/null +++ b/client/docs/SparkJob.md @@ -0,0 +1,13 @@ + +# SparkJob + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | processing job name | [optional] +**masterUrl** | **String** | Spark Master URL, e.g. spark://IP:7077 | [optional] +**appplicationUrl** | **String** | location of the application artifact, need to be accessible via http (to be verified) | [optional] +**mainClass** | **String** | the main class of the application, e.g. \"com.some.job\" | [optional] + + + diff --git a/client/docs/SparkMasterComponent.md b/client/docs/SparkMasterComponent.md new file mode 100644 index 0000000000000000000000000000000000000000..f99b23397f5261b37d6d16435e4f5dd0372db3e1 --- /dev/null +++ b/client/docs/SparkMasterComponent.md @@ -0,0 +1,15 @@ + +# SparkMasterComponent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Spark master description identifier, needs to map an existing application description | [optional] +**instances** | **Integer** | number of database nodes in the cluster | [optional] +**idCloud** | **Integer** | idCloud in Colosseum | [optional] +**idImage** | **Integer** | idImage in Colosseum | [optional] +**idLocation** | **Integer** | idLocation in Colosseum | [optional] +**idHardware** | **Integer** | idHardware in Colosseum | [optional] + + + diff --git a/client/docs/SparkWorkerComponent.md b/client/docs/SparkWorkerComponent.md new file mode 100644 index 0000000000000000000000000000000000000000..f72dea869bf4947cdc167b7de1bbd1a417c5d1dd --- /dev/null +++ b/client/docs/SparkWorkerComponent.md @@ -0,0 +1,15 @@ + +# SparkWorkerComponent + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Spark worker description identifier, needs to map an existing application description | [optional] +**instances** | **Integer** | number of database nodes in the cluster | [optional] +**idCloud** | **Integer** | idCloud in Colosseum | [optional] +**idImage** | **Integer** | idImage in Colosseum | [optional] +**idLocation** | **Integer** | idLocation in Colosseum | [optional] +**idHardware** | **Integer** | idHardware in Colosseum | [optional] + + + diff --git a/client/docs/VM.md b/client/docs/VM.md new file mode 100644 index 0000000000000000000000000000000000000000..154fe81b788d3e9b4bcc3c5343714200e86dd559 --- /dev/null +++ b/client/docs/VM.md @@ -0,0 +1,13 @@ + +# VM + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**idCloud** | **Integer** | idCloud in Colosseum | +**idImage** | **Integer** | idImage in Colosseum | +**idHardware** | **Integer** | idHardware in Colosseum | +**idLocation** | **Integer** | idLocation in Colosseum | + + + diff --git a/client/git_push.sh b/client/git_push.sh new file mode 100644 index 0000000000000000000000000000000000000000..ae01b182ae9eb047d0999a496b060e62d7b01e5c --- /dev/null +++ b/client/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/client/gradle.properties b/client/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..05644f0754af4d99d53558a2a52cc3233f7ed9d6 --- /dev/null +++ b/client/gradle.properties @@ -0,0 +1,2 @@ +# Uncomment to build for Android +#target = android \ No newline at end of file diff --git a/client/gradle/wrapper/gradle-wrapper.jar b/client/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..2c6137b87896c8f70315ae454e00a969ef5f6019 Binary files /dev/null and b/client/gradle/wrapper/gradle-wrapper.jar differ diff --git a/client/gradle/wrapper/gradle-wrapper.properties b/client/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..b7a3647395514b585a55c96dbf3fae30035c95dc --- /dev/null +++ b/client/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue May 17 23:08:05 CST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip diff --git a/client/gradlew b/client/gradlew new file mode 100644 index 0000000000000000000000000000000000000000..9d82f78915133e1c35a6ea51252590fb38efac2f --- /dev/null +++ b/client/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/client/gradlew.bat b/client/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..5f192121eb4f5b109f22fa96a6246eb39e749ed6 --- /dev/null +++ b/client/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/client/pom.xml b/client/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..ab3737ab8710b830a3e477ad35b4bb59ec82a4a0 --- /dev/null +++ b/client/pom.xml @@ -0,0 +1,236 @@ + + 4.0.0 + de.uulm.omi.cloudiator.catalogue + client + jar + client + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + + + Unlicense + http://unlicense.org + repo + + + + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.okhttp + okhttp + ${okhttp-version} + + + com.squareup.okhttp + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + + junit + junit + ${junit-version} + test + + + + 1.8 + ${java.version} + ${java.version} + 1.8.0 + 1.5.15 + 2.7.5 + 2.8.1 + 1.0.0 + 4.12 + UTF-8 + + diff --git a/client/settings.gradle b/client/settings.gradle new file mode 100644 index 0000000000000000000000000000000000000000..a3686960b2085f9ffb4a868aff98070ef4a38407 --- /dev/null +++ b/client/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "client" \ No newline at end of file diff --git a/client/src/main/AndroidManifest.xml b/client/src/main/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..2d5bb70c6411bfff494884ba835be9f3dae6cb71 --- /dev/null +++ b/client/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiCallback.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiCallback.java new file mode 100644 index 0000000000000000000000000000000000000000..1b1f19dde287247c4336364dbec4eb09cdbf0ada --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API downlond processing. + * + * @param bytesRead bytes Read + * @param contentLength content lenngth of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiClient.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiClient.java new file mode 100644 index 0000000000000000000000000000000000000000..7ba2221a8fbf4aeb0f0a9256e01ca8f59314bc72 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiClient.java @@ -0,0 +1,1205 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +import com.squareup.okhttp.*; +import com.squareup.okhttp.internal.http.HttpMethod; +import com.squareup.okhttp.logging.HttpLoggingInterceptor; +import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import de.uulm.omi.cloudiator.catalogue.client.auth.Authentication; +import de.uulm.omi.cloudiator.catalogue.client.auth.HttpBasicAuth; +import de.uulm.omi.cloudiator.catalogue.client.auth.ApiKeyAuth; +import de.uulm.omi.cloudiator.catalogue.client.auth.OAuth; + +public class ApiClient { + + private String basePath = "http://localhost/v1"; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /* + * Constructor for ApiClient + */ + public ApiClient() { + httpClient = new OkHttpClient(); + + + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("Swagger-Codegen/1.0.0/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Get base path + * + * @return Baes path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g http://localhost/v1 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client + * + * @param httpClient An instance of OkHttpClient + * @return Api Client + */ + public ApiClient setHttpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + public DateFormat getDateFormat() { + return dateFormat; + } + + public ApiClient setDateFormat(DateFormat dateFormat) { + this.json.setDateFormat(dateFormat); + return this; + } + + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + this.json.setSqlDateFormat(dateFormat); + return this; + } + + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + this.json.setOffsetDateTimeFormat(dateFormat); + return this; + } + + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + this.json.setLocalDateFormat(dateFormat); + return this; + } + + public ApiClient setLenientOnJson(boolean lenientOnJson) { + this.json.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient.interceptors().add(loggingInterceptor); + } else { + httpClient.interceptors().remove(loggingInterceptor); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default tempopary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.getConnectTimeout(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.getReadTimeout(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.getWriteTimeout(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = json.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection)param) { + if (b.length() > 0) { + b.append(","); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * or matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return json.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create(MediaType.parse(contentType), (byte[]) obj); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create(MediaType.parse(contentType), (File) obj); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = json.serialize(obj); + } else { + content = null; + } + return RequestBody.create(MediaType.parse(contentType), content); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @throws IOException If fail to prepare file for download + * @return Prepared file for the download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // File.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return File.createTempFile(prefix, suffix); + else + return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @throws ApiException If fail to execute the call + * @return ApiResponse<T> + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @see #execute(Call, Type) + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Request request, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @throws ApiException If the response has a unsuccessful status code or + * fail to deserialize the response body + * @return Type + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP call + * @throws ApiException If fail to serialize the request body object + */ + public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, progressRequestListener); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP request + * @throws ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + updateParamsForAuth(authNames, queryParams, headerParams); + + final String url = buildUrl(path, queryParams, collectionQueryParams); + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + + String contentType = (String) headerParams.get("Content-Type"); + // ensuring a default content type + if (contentType == null) { + contentType = "application/json"; + } + + RequestBody reqBody; + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create(MediaType.parse(contentType), ""); + } + } else { + reqBody = serialize(body, contentType); + } + + Request request = null; + + if(progressRequestListener != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, progressRequestListener); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + url.append(basePath).append(path); + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the ofrm of Map + * @param reqBuilder Reqeust.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + FormEncodingBuilder formBuilder = new FormEncodingBuilder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file)); + } else { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); + mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue()))); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers = null; + HostnameVerifier hostnameVerifier = null; + if (!verifyingSsl) { + TrustManager trustAll = new X509TrustManager() { + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {} + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {} + @Override + public X509Certificate[] getAcceptedIssuers() { return null; } + }; + SSLContext sslContext = SSLContext.getInstance("TLS"); + trustManagers = new TrustManager[]{ trustAll }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { return true; } + }; + } else if (sslCaCert != null) { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + Integer.toString(index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init(caKeyStore); + trustManagers = trustManagerFactory.getTrustManagers(); + } + + if (keyManagers != null || trustManagers != null) { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient.setSslSocketFactory(sslContext.getSocketFactory()); + } else { + httpClient.setSslSocketFactory(null); + } + httpClient.setHostnameVerifier(hostnameVerifier); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiException.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiException.java new file mode 100644 index 0000000000000000000000000000000000000000..34ccda42a95d7dc5932514485f21f449aac0f5b2 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiException.java @@ -0,0 +1,91 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiResponse.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiResponse.java new file mode 100644 index 0000000000000000000000000000000000000000..c6547c7366c9c4088da099085ffcc3e40edf91c5 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ApiResponse.java @@ -0,0 +1,59 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/Configuration.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/Configuration.java new file mode 100644 index 0000000000000000000000000000000000000000..603ff306906f748effef42d79e655acf54355161 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/GzipRequestInterceptor.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/GzipRequestInterceptor.java new file mode 100644 index 0000000000000000000000000000000000000000..e22bd928659a39446c8bb436d9b9a5308523042f --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/GzipRequestInterceptor.java @@ -0,0 +1,81 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/JSON.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/JSON.java new file mode 100644 index 0000000000000000000000000000000000000000..11ef1888066bf2bf5b9fa9bbc4b38ea57ccf2649 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/JSON.java @@ -0,0 +1,375 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import de.uulm.omi.cloudiator.catalogue.client.model.*; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Map; +import java.util.HashMap; + +public class JSON { + private Gson gson; + private boolean isLenientOnJson = false; + private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(Resource.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Node".toUpperCase(), Node.class); + classByDiscriminatorValue.put("Requirement".toUpperCase(), Requirement.class); + classByDiscriminatorValue.put("VM".toUpperCase(), VM.class); + classByDiscriminatorValue.put("Resource".toUpperCase(), Resource.class); + return getClassByDiscriminator( + classByDiscriminatorValue, + getDiscriminatorValue(readElement, "resourceType")); + } + }) + ; + return fireBuilder.createGsonBuilder(); + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if(null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); + if(null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + public JSON() { + gson = createGson() + .registerTypeAdapter(Date.class, dateTypeAdapter) + .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + * @return JSON + */ + public JSON setGson(Gson gson) { + this.gson = gson; + return this; + } + + public JSON setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + return this; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) + return (T) body; + else throw (e); + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + return this; + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() { + } + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() { + } + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public JSON setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + return this; + } + +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/Pair.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/Pair.java new file mode 100644 index 0000000000000000000000000000000000000000..6b5ed5e96c386d0483365dafbbf389653d650e9e --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/Pair.java @@ -0,0 +1,52 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) return; + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) return; + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) return false; + if (arg.trim().isEmpty()) return false; + + return true; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ProgressRequestBody.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ProgressRequestBody.java new file mode 100644 index 0000000000000000000000000000000000000000..ba8fc335c5f5ed99fb12e2e8ec2b28b9bc7636d1 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ProgressRequestBody.java @@ -0,0 +1,77 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + public interface ProgressRequestListener { + void onRequestProgress(long bytesWritten, long contentLength, boolean done); + } + + private final RequestBody requestBody; + + private final ProgressRequestListener progressListener; + + public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { + this.requestBody = requestBody; + this.progressListener = progressListener; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ProgressResponseBody.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ProgressResponseBody.java new file mode 100644 index 0000000000000000000000000000000000000000..d5c48245d0f80f60e8bbfaec99f001449b59c684 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/ProgressResponseBody.java @@ -0,0 +1,76 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + public interface ProgressListener { + void update(long bytesRead, long contentLength, boolean done); + } + + private final ResponseBody responseBody; + private final ProgressListener progressListener; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { + this.responseBody = responseBody; + this.progressListener = progressListener; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() throws IOException { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} + + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/StringUtil.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/StringUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..c0a738041f8f76470f4d15a757e42ee29432ef3f --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/StringUtil.java @@ -0,0 +1,55 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) return true; + if (value != null && value.equalsIgnoreCase(str)) return true; + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) return ""; + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/ApplicationApi.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/ApplicationApi.java new file mode 100644 index 0000000000000000000000000000000000000000..64fc8f222a2ab1ad3491266e3c95dd60c015dd94 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/ApplicationApi.java @@ -0,0 +1,188 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.api; + +import de.uulm.omi.cloudiator.catalogue.client.ApiCallback; +import de.uulm.omi.cloudiator.catalogue.client.ApiClient; +import de.uulm.omi.cloudiator.catalogue.client.ApiException; +import de.uulm.omi.cloudiator.catalogue.client.ApiResponse; +import de.uulm.omi.cloudiator.catalogue.client.Configuration; +import de.uulm.omi.cloudiator.catalogue.client.Pair; +import de.uulm.omi.cloudiator.catalogue.client.ProgressRequestBody; +import de.uulm.omi.cloudiator.catalogue.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import de.uulm.omi.cloudiator.catalogue.client.model.CloudiatorApplicationInstance; +import de.uulm.omi.cloudiator.catalogue.client.model.Component; +import de.uulm.omi.cloudiator.catalogue.client.model.Error; + +import java.lang.reflect.Type; + +public class ApplicationApi { + private ApiClient apiClient; + + public ApplicationApi() { + this(Configuration.getDefaultApiClient()); + } + + public ApplicationApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for genericPost + * @param applicationName maps to the parent application description to identify its application components (required) + * @param components a list of application components (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call genericPostCall(String applicationName, java.util.List components, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = components; + + // create path and map variables + String localVarPath = "/generic"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + if (applicationName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("applicationName", applicationName)); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call genericPostValidateBeforeCall(String applicationName, java.util.List components, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'applicationName' is set + if (applicationName == null) { + throw new ApiException("Missing the required parameter 'applicationName' when calling genericPost(Async)"); + } + + // verify the required parameter 'components' is set + if (components == null) { + throw new ApiException("Missing the required parameter 'components' when calling genericPost(Async)"); + } + + + com.squareup.okhttp.Call call = genericPostCall(applicationName, components, progressListener, progressRequestListener); + return call; + + } + + /** + * Generic application deployment + * Deploy a generic application in a multi-cloud setup + * @param applicationName maps to the parent application description to identify its application components (required) + * @param components a list of application components (required) + * @return CloudiatorApplicationInstance + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CloudiatorApplicationInstance genericPost(String applicationName, java.util.List components) throws ApiException { + ApiResponse resp = genericPostWithHttpInfo(applicationName, components); + return resp.getData(); + } + + /** + * Generic application deployment + * Deploy a generic application in a multi-cloud setup + * @param applicationName maps to the parent application description to identify its application components (required) + * @param components a list of application components (required) + * @return ApiResponse<CloudiatorApplicationInstance> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse genericPostWithHttpInfo(String applicationName, java.util.List components) throws ApiException { + com.squareup.okhttp.Call call = genericPostValidateBeforeCall(applicationName, components, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Generic application deployment (asynchronously) + * Deploy a generic application in a multi-cloud setup + * @param applicationName maps to the parent application description to identify its application components (required) + * @param components a list of application components (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call genericPostAsync(String applicationName, java.util.List components, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = genericPostValidateBeforeCall(applicationName, components, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/BigDataApi.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/BigDataApi.java new file mode 100644 index 0000000000000000000000000000000000000000..343cf9b99cd95f43bab7d904818975c6ff9f6d57 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/BigDataApi.java @@ -0,0 +1,322 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.api; + +import de.uulm.omi.cloudiator.catalogue.client.ApiCallback; +import de.uulm.omi.cloudiator.catalogue.client.ApiClient; +import de.uulm.omi.cloudiator.catalogue.client.ApiException; +import de.uulm.omi.cloudiator.catalogue.client.ApiResponse; +import de.uulm.omi.cloudiator.catalogue.client.Configuration; +import de.uulm.omi.cloudiator.catalogue.client.Pair; +import de.uulm.omi.cloudiator.catalogue.client.ProgressRequestBody; +import de.uulm.omi.cloudiator.catalogue.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import de.uulm.omi.cloudiator.catalogue.client.model.CloudiatorApplicationInstance; +import de.uulm.omi.cloudiator.catalogue.client.model.Cluster; +import de.uulm.omi.cloudiator.catalogue.client.model.Error; +import de.uulm.omi.cloudiator.catalogue.client.model.SparkJob; + +import java.lang.reflect.Type; + +public class BigDataApi { + private ApiClient apiClient; + + public BigDataApi() { + this(Configuration.getDefaultApiClient()); + } + + public BigDataApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for sparkJobPost + * @param job the Spark job to submit (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call sparkJobPostCall(SparkJob job, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = job; + + // create path and map variables + String localVarPath = "/sparkJob"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call sparkJobPostValidateBeforeCall(SparkJob job, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'job' is set + if (job == null) { + throw new ApiException("Missing the required parameter 'job' when calling sparkJobPost(Async)"); + } + + + com.squareup.okhttp.Call call = sparkJobPostCall(job, progressListener, progressRequestListener); + return call; + + } + + /** + * submit an Apache Spark job to a Spark Master + * Submitting Spark jobs to an existing Apache Spark Cluster + * @param job the Spark job to submit (required) + * @return java.util.List<CloudiatorApplicationInstance> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public java.util.List sparkJobPost(SparkJob job) throws ApiException { + ApiResponse> resp = sparkJobPostWithHttpInfo(job); + return resp.getData(); + } + + /** + * submit an Apache Spark job to a Spark Master + * Submitting Spark jobs to an existing Apache Spark Cluster + * @param job the Spark job to submit (required) + * @return ApiResponse<java.util.List<CloudiatorApplicationInstance>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse> sparkJobPostWithHttpInfo(SparkJob job) throws ApiException { + com.squareup.okhttp.Call call = sparkJobPostValidateBeforeCall(job, null, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * submit an Apache Spark job to a Spark Master (asynchronously) + * Submitting Spark jobs to an existing Apache Spark Cluster + * @param job the Spark job to submit (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call sparkJobPostAsync(SparkJob job, final ApiCallback> callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = sparkJobPostValidateBeforeCall(job, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken>(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for sparkPost + * @param name the application name, needs to map an existing application description (required) + * @param applicationType the application type (required) + * @param cluster the Spark cluster, including one master and n workers (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call sparkPostCall(String name, String applicationType, Cluster cluster, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = cluster; + + // create path and map variables + String localVarPath = "/spark"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + if (name != null) + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + if (applicationType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("applicationType", applicationType)); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call sparkPostValidateBeforeCall(String name, String applicationType, Cluster cluster, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling sparkPost(Async)"); + } + + // verify the required parameter 'applicationType' is set + if (applicationType == null) { + throw new ApiException("Missing the required parameter 'applicationType' when calling sparkPost(Async)"); + } + + // verify the required parameter 'cluster' is set + if (cluster == null) { + throw new ApiException("Missing the required parameter 'cluster' when calling sparkPost(Async)"); + } + + + com.squareup.okhttp.Call call = sparkPostCall(name, applicationType, cluster, progressListener, progressRequestListener); + return call; + + } + + /** + * deploys an Apache Spark cluster + * Deploy a Spark cluster with 1 master and n workers the multi-cloud + * @param name the application name, needs to map an existing application description (required) + * @param applicationType the application type (required) + * @param cluster the Spark cluster, including one master and n workers (required) + * @return CloudiatorApplicationInstance + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CloudiatorApplicationInstance sparkPost(String name, String applicationType, Cluster cluster) throws ApiException { + ApiResponse resp = sparkPostWithHttpInfo(name, applicationType, cluster); + return resp.getData(); + } + + /** + * deploys an Apache Spark cluster + * Deploy a Spark cluster with 1 master and n workers the multi-cloud + * @param name the application name, needs to map an existing application description (required) + * @param applicationType the application type (required) + * @param cluster the Spark cluster, including one master and n workers (required) + * @return ApiResponse<CloudiatorApplicationInstance> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse sparkPostWithHttpInfo(String name, String applicationType, Cluster cluster) throws ApiException { + com.squareup.okhttp.Call call = sparkPostValidateBeforeCall(name, applicationType, cluster, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * deploys an Apache Spark cluster (asynchronously) + * Deploy a Spark cluster with 1 master and n workers the multi-cloud + * @param name the application name, needs to map an existing application description (required) + * @param applicationType the application type (required) + * @param cluster the Spark cluster, including one master and n workers (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call sparkPostAsync(String name, String applicationType, Cluster cluster, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = sparkPostValidateBeforeCall(name, applicationType, cluster, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/DatabaseApi.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/DatabaseApi.java new file mode 100644 index 0000000000000000000000000000000000000000..433067fab40a43c93f2ed1c7332575fdd113403e --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/DatabaseApi.java @@ -0,0 +1,579 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.api; + +import de.uulm.omi.cloudiator.catalogue.client.ApiCallback; +import de.uulm.omi.cloudiator.catalogue.client.ApiClient; +import de.uulm.omi.cloudiator.catalogue.client.ApiException; +import de.uulm.omi.cloudiator.catalogue.client.ApiResponse; +import de.uulm.omi.cloudiator.catalogue.client.Configuration; +import de.uulm.omi.cloudiator.catalogue.client.Pair; +import de.uulm.omi.cloudiator.catalogue.client.ProgressRequestBody; +import de.uulm.omi.cloudiator.catalogue.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import de.uulm.omi.cloudiator.catalogue.client.model.Cloud; +import de.uulm.omi.cloudiator.catalogue.client.model.CloudiatorApplicationInstance; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseCluster; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseCrossCluster; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseSingle; +import de.uulm.omi.cloudiator.catalogue.client.model.Error; + +import java.lang.reflect.Type; + +public class DatabaseApi { + private ApiClient apiClient; + + public DatabaseApi() { + this(Configuration.getDefaultApiClient()); + } + + public DatabaseApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for databaseClusterPost + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call databaseClusterPostCall(String name, DatabaseCluster databaseComponents, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = databaseComponents; + + // create path and map variables + String localVarPath = "/database/cluster"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + if (name != null) + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call databaseClusterPostValidateBeforeCall(String name, DatabaseCluster databaseComponents, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling databaseClusterPost(Async)"); + } + + // verify the required parameter 'databaseComponents' is set + if (databaseComponents == null) { + throw new ApiException("Missing the required parameter 'databaseComponents' when calling databaseClusterPost(Async)"); + } + + + com.squareup.okhttp.Call call = databaseClusterPostCall(name, databaseComponents, progressListener, progressRequestListener); + return call; + + } + + /** + * DDBMS cluster deployment + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @return CloudiatorApplicationInstance + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CloudiatorApplicationInstance databaseClusterPost(String name, DatabaseCluster databaseComponents) throws ApiException { + ApiResponse resp = databaseClusterPostWithHttpInfo(name, databaseComponents); + return resp.getData(); + } + + /** + * DDBMS cluster deployment + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @return ApiResponse<CloudiatorApplicationInstance> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse databaseClusterPostWithHttpInfo(String name, DatabaseCluster databaseComponents) throws ApiException { + com.squareup.okhttp.Call call = databaseClusterPostValidateBeforeCall(name, databaseComponents, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * DDBMS cluster deployment (asynchronously) + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call databaseClusterPostAsync(String name, DatabaseCluster databaseComponents, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = databaseClusterPostValidateBeforeCall(name, databaseComponents, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for databaseCrossClusterPost + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call databaseCrossClusterPostCall(String name, DatabaseCrossCluster databaseComponents, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = databaseComponents; + + // create path and map variables + String localVarPath = "/database/crossCluster"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + if (name != null) + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call databaseCrossClusterPostValidateBeforeCall(String name, DatabaseCrossCluster databaseComponents, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling databaseCrossClusterPost(Async)"); + } + + // verify the required parameter 'databaseComponents' is set + if (databaseComponents == null) { + throw new ApiException("Missing the required parameter 'databaseComponents' when calling databaseCrossClusterPost(Async)"); + } + + + com.squareup.okhttp.Call call = databaseCrossClusterPostCall(name, databaseComponents, progressListener, progressRequestListener); + return call; + + } + + /** + * DDBMS cluster deployment + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @return CloudiatorApplicationInstance + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CloudiatorApplicationInstance databaseCrossClusterPost(String name, DatabaseCrossCluster databaseComponents) throws ApiException { + ApiResponse resp = databaseCrossClusterPostWithHttpInfo(name, databaseComponents); + return resp.getData(); + } + + /** + * DDBMS cluster deployment + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @return ApiResponse<CloudiatorApplicationInstance> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse databaseCrossClusterPostWithHttpInfo(String name, DatabaseCrossCluster databaseComponents) throws ApiException { + com.squareup.okhttp.Call call = databaseCrossClusterPostValidateBeforeCall(name, databaseComponents, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * DDBMS cluster deployment (asynchronously) + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call databaseCrossClusterPostAsync(String name, DatabaseCrossCluster databaseComponents, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = databaseCrossClusterPostValidateBeforeCall(name, databaseComponents, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for databaseSinglePost + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call databaseSinglePostCall(String name, DatabaseSingle databaseComponents, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = databaseComponents; + + // create path and map variables + String localVarPath = "/database/single"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + if (name != null) + localVarQueryParams.addAll(apiClient.parameterToPair("name", name)); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call databaseSinglePostValidateBeforeCall(String name, DatabaseSingle databaseComponents, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling databaseSinglePost(Async)"); + } + + // verify the required parameter 'databaseComponents' is set + if (databaseComponents == null) { + throw new ApiException("Missing the required parameter 'databaseComponents' when calling databaseSinglePost(Async)"); + } + + + com.squareup.okhttp.Call call = databaseSinglePostCall(name, databaseComponents, progressListener, progressRequestListener); + return call; + + } + + /** + * DDBMS cluster deployment + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @return CloudiatorApplicationInstance + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public CloudiatorApplicationInstance databaseSinglePost(String name, DatabaseSingle databaseComponents) throws ApiException { + ApiResponse resp = databaseSinglePostWithHttpInfo(name, databaseComponents); + return resp.getData(); + } + + /** + * DDBMS cluster deployment + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @return ApiResponse<CloudiatorApplicationInstance> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse databaseSinglePostWithHttpInfo(String name, DatabaseSingle databaseComponents) throws ApiException { + com.squareup.okhttp.Call call = databaseSinglePostValidateBeforeCall(name, databaseComponents, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * DDBMS cluster deployment (asynchronously) + * Deploy a database cluster in the multi-cloud + * @param name database name, needs to map an existing database application description (required) + * @param databaseComponents a set of database components (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call databaseSinglePostAsync(String name, DatabaseSingle databaseComponents, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = databaseSinglePostValidateBeforeCall(name, databaseComponents, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for utilsRegisterCloudPost + * @param cloud cloud data required to enable it in cloudiator (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call utilsRegisterCloudPostCall(Cloud cloud, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = cloud; + + // create path and map variables + String localVarPath = "/utils/registerCloud"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call utilsRegisterCloudPostValidateBeforeCall(Cloud cloud, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'cloud' is set + if (cloud == null) { + throw new ApiException("Missing the required parameter 'cloud' when calling utilsRegisterCloudPost(Async)"); + } + + + com.squareup.okhttp.Call call = utilsRegisterCloudPostCall(cloud, progressListener, progressRequestListener); + return call; + + } + + /** + * Register a new cloud as deployment target + * + * @param cloud cloud data required to enable it in cloudiator (required) + * @return java.util.List<CloudiatorApplicationInstance> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public java.util.List utilsRegisterCloudPost(Cloud cloud) throws ApiException { + ApiResponse> resp = utilsRegisterCloudPostWithHttpInfo(cloud); + return resp.getData(); + } + + /** + * Register a new cloud as deployment target + * + * @param cloud cloud data required to enable it in cloudiator (required) + * @return ApiResponse<java.util.List<CloudiatorApplicationInstance>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse> utilsRegisterCloudPostWithHttpInfo(Cloud cloud) throws ApiException { + com.squareup.okhttp.Call call = utilsRegisterCloudPostValidateBeforeCall(cloud, null, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Register a new cloud as deployment target (asynchronously) + * + * @param cloud cloud data required to enable it in cloudiator (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call utilsRegisterCloudPostAsync(Cloud cloud, final ApiCallback> callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = utilsRegisterCloudPostValidateBeforeCall(cloud, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken>(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/ScriptsApi.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/ScriptsApi.java new file mode 100644 index 0000000000000000000000000000000000000000..bdcb71a48607dc1ff9775a528926ad65a6e936de --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/api/ScriptsApi.java @@ -0,0 +1,323 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.api; + +import de.uulm.omi.cloudiator.catalogue.client.ApiCallback; +import de.uulm.omi.cloudiator.catalogue.client.ApiClient; +import de.uulm.omi.cloudiator.catalogue.client.ApiException; +import de.uulm.omi.cloudiator.catalogue.client.ApiResponse; +import de.uulm.omi.cloudiator.catalogue.client.Configuration; +import de.uulm.omi.cloudiator.catalogue.client.Pair; +import de.uulm.omi.cloudiator.catalogue.client.ProgressRequestBody; +import de.uulm.omi.cloudiator.catalogue.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import java.io.File; + +import java.lang.reflect.Type; + +public class ScriptsApi { + private ApiClient apiClient; + + public ScriptsApi() { + this(Configuration.getDefaultApiClient()); + } + + public ScriptsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for scriptsBigdataGet + * @param frameworkName the Big Data Framework name, e.g. Spark (required) + * @param scriptType setup script type (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call scriptsBigdataGetCall(String frameworkName, String scriptType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/scripts/bigdata"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + if (frameworkName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("frameworkName", frameworkName)); + if (scriptType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("scriptType", scriptType)); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/x-sh" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call scriptsBigdataGetValidateBeforeCall(String frameworkName, String scriptType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'frameworkName' is set + if (frameworkName == null) { + throw new ApiException("Missing the required parameter 'frameworkName' when calling scriptsBigdataGet(Async)"); + } + + // verify the required parameter 'scriptType' is set + if (scriptType == null) { + throw new ApiException("Missing the required parameter 'scriptType' when calling scriptsBigdataGet(Async)"); + } + + + com.squareup.okhttp.Call call = scriptsBigdataGetCall(frameworkName, scriptType, progressListener, progressRequestListener); + return call; + + } + + /** + * Get custom database installation scripts + * + * @param frameworkName the Big Data Framework name, e.g. Spark (required) + * @param scriptType setup script type (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File scriptsBigdataGet(String frameworkName, String scriptType) throws ApiException { + ApiResponse resp = scriptsBigdataGetWithHttpInfo(frameworkName, scriptType); + return resp.getData(); + } + + /** + * Get custom database installation scripts + * + * @param frameworkName the Big Data Framework name, e.g. Spark (required) + * @param scriptType setup script type (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse scriptsBigdataGetWithHttpInfo(String frameworkName, String scriptType) throws ApiException { + com.squareup.okhttp.Call call = scriptsBigdataGetValidateBeforeCall(frameworkName, scriptType, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get custom database installation scripts (asynchronously) + * + * @param frameworkName the Big Data Framework name, e.g. Spark (required) + * @param scriptType setup script type (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call scriptsBigdataGetAsync(String frameworkName, String scriptType, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = scriptsBigdataGetValidateBeforeCall(frameworkName, scriptType, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for scriptsDatabaseGet + * @param dbName database name (required) + * @param scriptType setup script type (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call scriptsDatabaseGetCall(String dbName, String scriptType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/scripts/database"; + + java.util.List localVarQueryParams = new java.util.ArrayList(); + java.util.List localVarCollectionQueryParams = new java.util.ArrayList(); + if (dbName != null) + localVarQueryParams.addAll(apiClient.parameterToPair("dbName", dbName)); + if (scriptType != null) + localVarQueryParams.addAll(apiClient.parameterToPair("scriptType", scriptType)); + + java.util.Map localVarHeaderParams = new java.util.HashMap(); + + java.util.Map localVarFormParams = new java.util.HashMap(); + + final String[] localVarAccepts = { + "application/x-sh" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call scriptsDatabaseGetValidateBeforeCall(String dbName, String scriptType, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + // verify the required parameter 'dbName' is set + if (dbName == null) { + throw new ApiException("Missing the required parameter 'dbName' when calling scriptsDatabaseGet(Async)"); + } + + // verify the required parameter 'scriptType' is set + if (scriptType == null) { + throw new ApiException("Missing the required parameter 'scriptType' when calling scriptsDatabaseGet(Async)"); + } + + + com.squareup.okhttp.Call call = scriptsDatabaseGetCall(dbName, scriptType, progressListener, progressRequestListener); + return call; + + } + + /** + * Get custom database installation scripts + * + * @param dbName database name (required) + * @param scriptType setup script type (required) + * @return File + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public File scriptsDatabaseGet(String dbName, String scriptType) throws ApiException { + ApiResponse resp = scriptsDatabaseGetWithHttpInfo(dbName, scriptType); + return resp.getData(); + } + + /** + * Get custom database installation scripts + * + * @param dbName database name (required) + * @param scriptType setup script type (required) + * @return ApiResponse<File> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse scriptsDatabaseGetWithHttpInfo(String dbName, String scriptType) throws ApiException { + com.squareup.okhttp.Call call = scriptsDatabaseGetValidateBeforeCall(dbName, scriptType, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * Get custom database installation scripts (asynchronously) + * + * @param dbName database name (required) + * @param scriptType setup script type (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call scriptsDatabaseGetAsync(String dbName, String scriptType, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = scriptsDatabaseGetValidateBeforeCall(dbName, scriptType, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/ApiKeyAuth.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000000000000000000000000000000000..f300c77b6f04921089bfd5d607fe81622ba53829 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/ApiKeyAuth.java @@ -0,0 +1,75 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.auth; + +import de.uulm.omi.cloudiator.catalogue.client.Pair; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/Authentication.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/Authentication.java new file mode 100644 index 0000000000000000000000000000000000000000..75b9f86e355baf9ed9b3d0da0012ebaf9e0bd641 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/Authentication.java @@ -0,0 +1,29 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.auth; + +import de.uulm.omi.cloudiator.catalogue.client.Pair; + +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + */ + void applyToParams(List queryParams, Map headerParams); +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/HttpBasicAuth.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000000000000000000000000000000000..f1c6b33a520da5516dd61991cc1d1e673f1cdb0e --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/HttpBasicAuth.java @@ -0,0 +1,54 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.auth; + +import de.uulm.omi.cloudiator.catalogue.client.Pair; + +import com.squareup.okhttp.Credentials; + +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/OAuth.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/OAuth.java new file mode 100644 index 0000000000000000000000000000000000000000..cff57d22a3d4f114c1f68aacd5a325b79cde29b1 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/OAuth.java @@ -0,0 +1,39 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.auth; + +import de.uulm.omi.cloudiator.catalogue.client.Pair; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/OAuthFlow.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/OAuthFlow.java new file mode 100644 index 0000000000000000000000000000000000000000..4c3239546e23f7dcc1fdf4bb361f2744fd3429c7 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/auth/OAuthFlow.java @@ -0,0 +1,18 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Cloud.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Cloud.java new file mode 100644 index 0000000000000000000000000000000000000000..ddf0650842c74e26e9b9849ce5f77cdf01128cb4 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Cloud.java @@ -0,0 +1,139 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Cloud + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class Cloud { + @SerializedName("endpoint") + private String endpoint = null; + + @SerializedName("user") + private String user = null; + + @SerializedName("password") + private String password = null; + + public Cloud endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * Get endpoint + * @return endpoint + **/ + @ApiModelProperty(value = "") + public String getEndpoint() { + return endpoint; + } + + public void setEndpoint(String endpoint) { + this.endpoint = endpoint; + } + + public Cloud user(String user) { + this.user = user; + return this; + } + + /** + * Get user + * @return user + **/ + @ApiModelProperty(value = "") + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user; + } + + public Cloud password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(value = "") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cloud cloud = (Cloud) o; + return Objects.equals(this.endpoint, cloud.endpoint) && + Objects.equals(this.user, cloud.user) && + Objects.equals(this.password, cloud.password); + } + + @Override + public int hashCode() { + return Objects.hash(endpoint, user, password); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cloud {\n"); + + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CloudiatorApplicationInstance.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CloudiatorApplicationInstance.java new file mode 100644 index 0000000000000000000000000000000000000000..d2fd4a92b912bf1df43bdcea01adc5777ad212d0 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CloudiatorApplicationInstance.java @@ -0,0 +1,94 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * the Cloudiator applicationInstanceId for further interactions with the application instance, e.g. getting application components details, scale application components + */ +@ApiModel(description = "the Cloudiator applicationInstanceId for further interactions with the application instance, e.g. getting application components details, scale application components") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class CloudiatorApplicationInstance { + @SerializedName("applicationInstanceId") + private String applicationInstanceId = null; + + public CloudiatorApplicationInstance applicationInstanceId(String applicationInstanceId) { + this.applicationInstanceId = applicationInstanceId; + return this; + } + + /** + * Unique identifier representing a specific applicationInstance in Cloudiator + * @return applicationInstanceId + **/ + @ApiModelProperty(value = "Unique identifier representing a specific applicationInstance in Cloudiator") + public String getApplicationInstanceId() { + return applicationInstanceId; + } + + public void setApplicationInstanceId(String applicationInstanceId) { + this.applicationInstanceId = applicationInstanceId; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudiatorApplicationInstance cloudiatorApplicationInstance = (CloudiatorApplicationInstance) o; + return Objects.equals(this.applicationInstanceId, cloudiatorApplicationInstance.applicationInstanceId); + } + + @Override + public int hashCode() { + return Objects.hash(applicationInstanceId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CloudiatorApplicationInstance {\n"); + + sb.append(" applicationInstanceId: ").append(toIndentedString(applicationInstanceId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Cluster.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Cluster.java new file mode 100644 index 0000000000000000000000000000000000000000..9a3564abdb4df988dbfa3eb57ada1ad5d8031f8b --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Cluster.java @@ -0,0 +1,126 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.SparkMasterComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.SparkWorkerComponent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Cluster + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class Cluster { + @SerializedName("sparkMasterComponent") + private SparkMasterComponent sparkMasterComponent = null; + + @SerializedName("sparkWorkerComponents") + private java.util.List sparkWorkerComponents = null; + + public Cluster sparkMasterComponent(SparkMasterComponent sparkMasterComponent) { + this.sparkMasterComponent = sparkMasterComponent; + return this; + } + + /** + * Get sparkMasterComponent + * @return sparkMasterComponent + **/ + @ApiModelProperty(value = "") + public SparkMasterComponent getSparkMasterComponent() { + return sparkMasterComponent; + } + + public void setSparkMasterComponent(SparkMasterComponent sparkMasterComponent) { + this.sparkMasterComponent = sparkMasterComponent; + } + + public Cluster sparkWorkerComponents(java.util.List sparkWorkerComponents) { + this.sparkWorkerComponents = sparkWorkerComponents; + return this; + } + + public Cluster addSparkWorkerComponentsItem(SparkWorkerComponent sparkWorkerComponentsItem) { + if (this.sparkWorkerComponents == null) { + this.sparkWorkerComponents = new java.util.ArrayList<>(); + } + this.sparkWorkerComponents.add(sparkWorkerComponentsItem); + return this; + } + + /** + * Get sparkWorkerComponents + * @return sparkWorkerComponents + **/ + @ApiModelProperty(value = "") + public java.util.List getSparkWorkerComponents() { + return sparkWorkerComponents; + } + + public void setSparkWorkerComponents(java.util.List sparkWorkerComponents) { + this.sparkWorkerComponents = sparkWorkerComponents; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cluster cluster = (Cluster) o; + return Objects.equals(this.sparkMasterComponent, cluster.sparkMasterComponent) && + Objects.equals(this.sparkWorkerComponents, cluster.sparkWorkerComponents); + } + + @Override + public int hashCode() { + return Objects.hash(sparkMasterComponent, sparkWorkerComponents); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cluster {\n"); + + sb.append(" sparkMasterComponent: ").append(toIndentedString(sparkMasterComponent)).append("\n"); + sb.append(" sparkWorkerComponents: ").append(toIndentedString(sparkWorkerComponents)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ClusterConfiguration.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ClusterConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..e19dc9bf07da1065a68771a2933818c4578e1f84 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ClusterConfiguration.java @@ -0,0 +1,93 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ClusterConfiguration + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class ClusterConfiguration { + @SerializedName("clusterPort") + private Integer clusterPort = null; + + public ClusterConfiguration clusterPort(Integer clusterPort) { + this.clusterPort = clusterPort; + return this; + } + + /** + * port to connect to a cluster + * @return clusterPort + **/ + @ApiModelProperty(value = "port to connect to a cluster") + public Integer getClusterPort() { + return clusterPort; + } + + public void setClusterPort(Integer clusterPort) { + this.clusterPort = clusterPort; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClusterConfiguration clusterConfiguration = (ClusterConfiguration) o; + return Objects.equals(this.clusterPort, clusterConfiguration.clusterPort); + } + + @Override + public int hashCode() { + return Objects.hash(clusterPort); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClusterConfiguration {\n"); + + sb.append(" clusterPort: ").append(toIndentedString(clusterPort)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Component.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Component.java new file mode 100644 index 0000000000000000000000000000000000000000..ceb86876afa1337e79bc1df0b1c0c0b6481e1e92 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Component.java @@ -0,0 +1,117 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.VM; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Component + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class Component { + @SerializedName("instances") + private Integer instances = null; + + @SerializedName("resource") + private VM resource = null; + + public Component instances(Integer instances) { + this.instances = instances; + return this; + } + + /** + * number of component instances + * @return instances + **/ + @ApiModelProperty(value = "number of component instances") + public Integer getInstances() { + return instances; + } + + public void setInstances(Integer instances) { + this.instances = instances; + } + + public Component resource(VM resource) { + this.resource = resource; + return this; + } + + /** + * Get resource + * @return resource + **/ + @ApiModelProperty(value = "") + public VM getResource() { + return resource; + } + + public void setResource(VM resource) { + this.resource = resource; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Component component = (Component) o; + return Objects.equals(this.instances, component.instances) && + Objects.equals(this.resource, component.resource); + } + + @Override + public int hashCode() { + return Objects.hash(instances, resource); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Component {\n"); + + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossClusterConfiguration.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossClusterConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..d99f0c2da217c8c664dc3719c2a14fda60d4ee59 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossClusterConfiguration.java @@ -0,0 +1,93 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * CrossClusterConfiguration + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class CrossClusterConfiguration { + @SerializedName("crossClusterPort") + private Integer crossClusterPort = null; + + public CrossClusterConfiguration crossClusterPort(Integer crossClusterPort) { + this.crossClusterPort = crossClusterPort; + return this; + } + + /** + * port to connect across multiple clusters + * @return crossClusterPort + **/ + @ApiModelProperty(value = "port to connect across multiple clusters") + public Integer getCrossClusterPort() { + return crossClusterPort; + } + + public void setCrossClusterPort(Integer crossClusterPort) { + this.crossClusterPort = crossClusterPort; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrossClusterConfiguration crossClusterConfiguration = (CrossClusterConfiguration) o; + return Objects.equals(this.crossClusterPort, crossClusterConfiguration.crossClusterPort); + } + + @Override + public int hashCode() { + return Objects.hash(crossClusterPort); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrossClusterConfiguration {\n"); + + sb.append(" crossClusterPort: ").append(toIndentedString(crossClusterPort)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossDatabaseDataComponent.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossDatabaseDataComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..682423a9e46aed73ad66b53238f75c106f4501c2 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossDatabaseDataComponent.java @@ -0,0 +1,190 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.CustomConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseDataComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.NodeConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.VM; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * A data component of a cross-DDBMS, requires existing seed and CrossDatabaseSeedComponents + */ +@ApiModel(description = "A data component of a cross-DDBMS, requires existing seed and CrossDatabaseSeedComponents") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class CrossDatabaseDataComponent { + @SerializedName("instances") + private Integer instances = null; + + @SerializedName("resource") + private VM resource = null; + + @SerializedName("name") + private String name = "seed"; + + @SerializedName("nodeConfiguration") + private NodeConfiguration nodeConfiguration = null; + + @SerializedName("customConfiguration") + private CustomConfiguration customConfiguration = null; + + public CrossDatabaseDataComponent instances(Integer instances) { + this.instances = instances; + return this; + } + + /** + * number of component instances + * @return instances + **/ + @ApiModelProperty(value = "number of component instances") + public Integer getInstances() { + return instances; + } + + public void setInstances(Integer instances) { + this.instances = instances; + } + + public CrossDatabaseDataComponent resource(VM resource) { + this.resource = resource; + return this; + } + + /** + * Get resource + * @return resource + **/ + @ApiModelProperty(value = "") + public VM getResource() { + return resource; + } + + public void setResource(VM resource) { + this.resource = resource; + } + + public CrossDatabaseDataComponent name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CrossDatabaseDataComponent nodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + return this; + } + + /** + * Get nodeConfiguration + * @return nodeConfiguration + **/ + @ApiModelProperty(value = "") + public NodeConfiguration getNodeConfiguration() { + return nodeConfiguration; + } + + public void setNodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + } + + public CrossDatabaseDataComponent customConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + return this; + } + + /** + * Get customConfiguration + * @return customConfiguration + **/ + @ApiModelProperty(value = "") + public CustomConfiguration getCustomConfiguration() { + return customConfiguration; + } + + public void setCustomConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrossDatabaseDataComponent crossDatabaseDataComponent = (CrossDatabaseDataComponent) o; + return Objects.equals(this.instances, crossDatabaseDataComponent.instances) && + Objects.equals(this.resource, crossDatabaseDataComponent.resource) && + Objects.equals(this.name, crossDatabaseDataComponent.name) && + Objects.equals(this.nodeConfiguration, crossDatabaseDataComponent.nodeConfiguration) && + Objects.equals(this.customConfiguration, crossDatabaseDataComponent.customConfiguration); + } + + @Override + public int hashCode() { + return Objects.hash(instances, resource, name, nodeConfiguration, customConfiguration); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrossDatabaseDataComponent {\n"); + + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nodeConfiguration: ").append(toIndentedString(nodeConfiguration)).append("\n"); + sb.append(" customConfiguration: ").append(toIndentedString(customConfiguration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossDatabaseSeedComponent.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossDatabaseSeedComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..a831aa9c4b20201f07f53569a3e439e5c1f46c3b --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CrossDatabaseSeedComponent.java @@ -0,0 +1,259 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.CrossClusterConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.CustomConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseSeedComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.NodeConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.VM; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * A seed component of a cross-DDBMS, provides the cluster entrypoint for DatabaseDataComponents and CrossDatabaseDataComponent + */ +@ApiModel(description = "A seed component of a cross-DDBMS, provides the cluster entrypoint for DatabaseDataComponents and CrossDatabaseDataComponent") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class CrossDatabaseSeedComponent { + @SerializedName("instances") + private Integer instances = null; + + @SerializedName("resource") + private VM resource = null; + + /** + * Gets or Sets name + */ + @JsonAdapter(NameEnum.Adapter.class) + public enum NameEnum { + SEED("SEED"); + + private String value; + + NameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameEnum fromValue(String text) { + for (NameEnum b : NameEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("name") + private NameEnum name = null; + + @SerializedName("nodeConfiguration") + private NodeConfiguration nodeConfiguration = null; + + @SerializedName("customConfiguration") + private CustomConfiguration customConfiguration = null; + + @SerializedName("crossClusterConfiguration") + private CrossClusterConfiguration crossClusterConfiguration = null; + + public CrossDatabaseSeedComponent instances(Integer instances) { + this.instances = instances; + return this; + } + + /** + * number of component instances + * @return instances + **/ + @ApiModelProperty(value = "number of component instances") + public Integer getInstances() { + return instances; + } + + public void setInstances(Integer instances) { + this.instances = instances; + } + + public CrossDatabaseSeedComponent resource(VM resource) { + this.resource = resource; + return this; + } + + /** + * Get resource + * @return resource + **/ + @ApiModelProperty(value = "") + public VM getResource() { + return resource; + } + + public void setResource(VM resource) { + this.resource = resource; + } + + public CrossDatabaseSeedComponent name(NameEnum name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public NameEnum getName() { + return name; + } + + public void setName(NameEnum name) { + this.name = name; + } + + public CrossDatabaseSeedComponent nodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + return this; + } + + /** + * Get nodeConfiguration + * @return nodeConfiguration + **/ + @ApiModelProperty(value = "") + public NodeConfiguration getNodeConfiguration() { + return nodeConfiguration; + } + + public void setNodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + } + + public CrossDatabaseSeedComponent customConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + return this; + } + + /** + * Get customConfiguration + * @return customConfiguration + **/ + @ApiModelProperty(value = "") + public CustomConfiguration getCustomConfiguration() { + return customConfiguration; + } + + public void setCustomConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + } + + public CrossDatabaseSeedComponent crossClusterConfiguration(CrossClusterConfiguration crossClusterConfiguration) { + this.crossClusterConfiguration = crossClusterConfiguration; + return this; + } + + /** + * Get crossClusterConfiguration + * @return crossClusterConfiguration + **/ + @ApiModelProperty(value = "") + public CrossClusterConfiguration getCrossClusterConfiguration() { + return crossClusterConfiguration; + } + + public void setCrossClusterConfiguration(CrossClusterConfiguration crossClusterConfiguration) { + this.crossClusterConfiguration = crossClusterConfiguration; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CrossDatabaseSeedComponent crossDatabaseSeedComponent = (CrossDatabaseSeedComponent) o; + return Objects.equals(this.instances, crossDatabaseSeedComponent.instances) && + Objects.equals(this.resource, crossDatabaseSeedComponent.resource) && + Objects.equals(this.name, crossDatabaseSeedComponent.name) && + Objects.equals(this.nodeConfiguration, crossDatabaseSeedComponent.nodeConfiguration) && + Objects.equals(this.customConfiguration, crossDatabaseSeedComponent.customConfiguration) && + Objects.equals(this.crossClusterConfiguration, crossDatabaseSeedComponent.crossClusterConfiguration); + } + + @Override + public int hashCode() { + return Objects.hash(instances, resource, name, nodeConfiguration, customConfiguration, crossClusterConfiguration); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CrossDatabaseSeedComponent {\n"); + + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nodeConfiguration: ").append(toIndentedString(nodeConfiguration)).append("\n"); + sb.append(" customConfiguration: ").append(toIndentedString(customConfiguration)).append("\n"); + sb.append(" crossClusterConfiguration: ").append(toIndentedString(crossClusterConfiguration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CustomConfiguration.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CustomConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..fefe43cb35d2da6789f46c5af11bb4de8f1c1a9b --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CustomConfiguration.java @@ -0,0 +1,65 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import de.uulm.omi.cloudiator.catalogue.client.model.CustomConfigurationItem; +import io.swagger.annotations.ApiModel; + +/** + * a set of custom configuration items, the LCA scripts need to be aware of + */ +@ApiModel(description = "a set of custom configuration items, the LCA scripts need to be aware of") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class CustomConfiguration extends java.util.ArrayList { + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomConfiguration {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CustomConfigurationItem.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CustomConfigurationItem.java new file mode 100644 index 0000000000000000000000000000000000000000..06a621f9a10811cc721aabb2904e9ac74021d0ad --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/CustomConfigurationItem.java @@ -0,0 +1,116 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * CustomConfigurationItem + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class CustomConfigurationItem { + @SerializedName("envName") + private String envName = null; + + @SerializedName("envValue") + private String envValue = null; + + public CustomConfigurationItem envName(String envName) { + this.envName = envName; + return this; + } + + /** + * environment variable name + * @return envName + **/ + @ApiModelProperty(value = "environment variable name") + public String getEnvName() { + return envName; + } + + public void setEnvName(String envName) { + this.envName = envName; + } + + public CustomConfigurationItem envValue(String envValue) { + this.envValue = envValue; + return this; + } + + /** + * environment variable value + * @return envValue + **/ + @ApiModelProperty(value = "environment variable value") + public String getEnvValue() { + return envValue; + } + + public void setEnvValue(String envValue) { + this.envValue = envValue; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomConfigurationItem customConfigurationItem = (CustomConfigurationItem) o; + return Objects.equals(this.envName, customConfigurationItem.envName) && + Objects.equals(this.envValue, customConfigurationItem.envValue); + } + + @Override + public int hashCode() { + return Objects.hash(envName, envValue); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomConfigurationItem {\n"); + + sb.append(" envName: ").append(toIndentedString(envName)).append("\n"); + sb.append(" envValue: ").append(toIndentedString(envValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DataMemory.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DataMemory.java new file mode 100644 index 0000000000000000000000000000000000000000..45d706be416049981ea877f9a21b4843a7524db1 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DataMemory.java @@ -0,0 +1,161 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * DataMemory + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class DataMemory { + /** + * environment variable name + */ + @JsonAdapter(EnvNameEnum.Adapter.class) + public enum EnvNameEnum { + DATAMEMORY("DATAMEMORY"); + + private String value; + + EnvNameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnvNameEnum fromValue(String text) { + for (EnvNameEnum b : EnvNameEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnvNameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnvNameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnvNameEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("envName") + private EnvNameEnum envName = null; + + @SerializedName("envValue") + private String envValue = null; + + public DataMemory envName(EnvNameEnum envName) { + this.envName = envName; + return this; + } + + /** + * environment variable name + * @return envName + **/ + @ApiModelProperty(value = "environment variable name") + public EnvNameEnum getEnvName() { + return envName; + } + + public void setEnvName(EnvNameEnum envName) { + this.envName = envName; + } + + public DataMemory envValue(String envValue) { + this.envValue = envValue; + return this; + } + + /** + * amount of RAM to allocate for data caching + * @return envValue + **/ + @ApiModelProperty(value = "amount of RAM to allocate for data caching") + public String getEnvValue() { + return envValue; + } + + public void setEnvValue(String envValue) { + this.envValue = envValue; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataMemory dataMemory = (DataMemory) o; + return Objects.equals(this.envName, dataMemory.envName) && + Objects.equals(this.envValue, dataMemory.envValue); + } + + @Override + public int hashCode() { + return Objects.hash(envName, envValue); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataMemory {\n"); + + sb.append(" envName: ").append(toIndentedString(envName)).append("\n"); + sb.append(" envValue: ").append(toIndentedString(envValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseCluster.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseCluster.java new file mode 100644 index 0000000000000000000000000000000000000000..c69a9cd3544dd898ad29a898b46b68d922fd574f --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseCluster.java @@ -0,0 +1,167 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseDataComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseManagementComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseSeedComponent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * todo + */ +@ApiModel(description = "todo") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class DatabaseCluster { + @SerializedName("databaseDataComponent") + private java.util.List databaseDataComponent = null; + + @SerializedName("databaseSeedComponent") + private java.util.List databaseSeedComponent = null; + + @SerializedName("databaseManagementComponent") + private java.util.List databaseManagementComponent = null; + + public DatabaseCluster databaseDataComponent(java.util.List databaseDataComponent) { + this.databaseDataComponent = databaseDataComponent; + return this; + } + + public DatabaseCluster addDatabaseDataComponentItem(DatabaseDataComponent databaseDataComponentItem) { + if (this.databaseDataComponent == null) { + this.databaseDataComponent = new java.util.ArrayList<>(); + } + this.databaseDataComponent.add(databaseDataComponentItem); + return this; + } + + /** + * Get databaseDataComponent + * @return databaseDataComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getDatabaseDataComponent() { + return databaseDataComponent; + } + + public void setDatabaseDataComponent(java.util.List databaseDataComponent) { + this.databaseDataComponent = databaseDataComponent; + } + + public DatabaseCluster databaseSeedComponent(java.util.List databaseSeedComponent) { + this.databaseSeedComponent = databaseSeedComponent; + return this; + } + + public DatabaseCluster addDatabaseSeedComponentItem(DatabaseSeedComponent databaseSeedComponentItem) { + if (this.databaseSeedComponent == null) { + this.databaseSeedComponent = new java.util.ArrayList<>(); + } + this.databaseSeedComponent.add(databaseSeedComponentItem); + return this; + } + + /** + * Get databaseSeedComponent + * @return databaseSeedComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getDatabaseSeedComponent() { + return databaseSeedComponent; + } + + public void setDatabaseSeedComponent(java.util.List databaseSeedComponent) { + this.databaseSeedComponent = databaseSeedComponent; + } + + public DatabaseCluster databaseManagementComponent(java.util.List databaseManagementComponent) { + this.databaseManagementComponent = databaseManagementComponent; + return this; + } + + public DatabaseCluster addDatabaseManagementComponentItem(DatabaseManagementComponent databaseManagementComponentItem) { + if (this.databaseManagementComponent == null) { + this.databaseManagementComponent = new java.util.ArrayList<>(); + } + this.databaseManagementComponent.add(databaseManagementComponentItem); + return this; + } + + /** + * Get databaseManagementComponent + * @return databaseManagementComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getDatabaseManagementComponent() { + return databaseManagementComponent; + } + + public void setDatabaseManagementComponent(java.util.List databaseManagementComponent) { + this.databaseManagementComponent = databaseManagementComponent; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatabaseCluster databaseCluster = (DatabaseCluster) o; + return Objects.equals(this.databaseDataComponent, databaseCluster.databaseDataComponent) && + Objects.equals(this.databaseSeedComponent, databaseCluster.databaseSeedComponent) && + Objects.equals(this.databaseManagementComponent, databaseCluster.databaseManagementComponent); + } + + @Override + public int hashCode() { + return Objects.hash(databaseDataComponent, databaseSeedComponent, databaseManagementComponent); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatabaseCluster {\n"); + + sb.append(" databaseDataComponent: ").append(toIndentedString(databaseDataComponent)).append("\n"); + sb.append(" databaseSeedComponent: ").append(toIndentedString(databaseSeedComponent)).append("\n"); + sb.append(" databaseManagementComponent: ").append(toIndentedString(databaseManagementComponent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseConfiguration.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..06dcb51de3d2ad9a81b4ea7cfc799f64dd389c59 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseConfiguration.java @@ -0,0 +1,139 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * DatabaseConfiguration + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class DatabaseConfiguration { + @SerializedName("databaseName") + private String databaseName = null; + + @SerializedName("databaseUser") + private String databaseUser = null; + + @SerializedName("databasePassword") + private String databasePassword = null; + + public DatabaseConfiguration databaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * database name + * @return databaseName + **/ + @ApiModelProperty(value = "database name") + public String getDatabaseName() { + return databaseName; + } + + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + public DatabaseConfiguration databaseUser(String databaseUser) { + this.databaseUser = databaseUser; + return this; + } + + /** + * database user name + * @return databaseUser + **/ + @ApiModelProperty(value = "database user name") + public String getDatabaseUser() { + return databaseUser; + } + + public void setDatabaseUser(String databaseUser) { + this.databaseUser = databaseUser; + } + + public DatabaseConfiguration databasePassword(String databasePassword) { + this.databasePassword = databasePassword; + return this; + } + + /** + * database password + * @return databasePassword + **/ + @ApiModelProperty(value = "database password") + public String getDatabasePassword() { + return databasePassword; + } + + public void setDatabasePassword(String databasePassword) { + this.databasePassword = databasePassword; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatabaseConfiguration databaseConfiguration = (DatabaseConfiguration) o; + return Objects.equals(this.databaseName, databaseConfiguration.databaseName) && + Objects.equals(this.databaseUser, databaseConfiguration.databaseUser) && + Objects.equals(this.databasePassword, databaseConfiguration.databasePassword); + } + + @Override + public int hashCode() { + return Objects.hash(databaseName, databaseUser, databasePassword); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatabaseConfiguration {\n"); + + sb.append(" databaseName: ").append(toIndentedString(databaseName)).append("\n"); + sb.append(" databaseUser: ").append(toIndentedString(databaseUser)).append("\n"); + sb.append(" databasePassword: ").append(toIndentedString(databasePassword)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseCrossCluster.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseCrossCluster.java new file mode 100644 index 0000000000000000000000000000000000000000..1772386760a35677321a47d23ac508be882bb1e9 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseCrossCluster.java @@ -0,0 +1,231 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.CrossDatabaseDataComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.CrossDatabaseSeedComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseDataComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseManagementComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseSeedComponent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * todo + */ +@ApiModel(description = "todo") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class DatabaseCrossCluster { + @SerializedName("databaseDataComponent") + private java.util.List databaseDataComponent = null; + + @SerializedName("databaseSeedComponent") + private java.util.List databaseSeedComponent = null; + + @SerializedName("databaseManagementComponent") + private java.util.List databaseManagementComponent = null; + + @SerializedName("crossDatabaseDataComponent") + private java.util.List crossDatabaseDataComponent = null; + + @SerializedName("crossDatabaseSeedComponent") + private java.util.List crossDatabaseSeedComponent = null; + + public DatabaseCrossCluster databaseDataComponent(java.util.List databaseDataComponent) { + this.databaseDataComponent = databaseDataComponent; + return this; + } + + public DatabaseCrossCluster addDatabaseDataComponentItem(DatabaseDataComponent databaseDataComponentItem) { + if (this.databaseDataComponent == null) { + this.databaseDataComponent = new java.util.ArrayList<>(); + } + this.databaseDataComponent.add(databaseDataComponentItem); + return this; + } + + /** + * Get databaseDataComponent + * @return databaseDataComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getDatabaseDataComponent() { + return databaseDataComponent; + } + + public void setDatabaseDataComponent(java.util.List databaseDataComponent) { + this.databaseDataComponent = databaseDataComponent; + } + + public DatabaseCrossCluster databaseSeedComponent(java.util.List databaseSeedComponent) { + this.databaseSeedComponent = databaseSeedComponent; + return this; + } + + public DatabaseCrossCluster addDatabaseSeedComponentItem(DatabaseSeedComponent databaseSeedComponentItem) { + if (this.databaseSeedComponent == null) { + this.databaseSeedComponent = new java.util.ArrayList<>(); + } + this.databaseSeedComponent.add(databaseSeedComponentItem); + return this; + } + + /** + * Get databaseSeedComponent + * @return databaseSeedComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getDatabaseSeedComponent() { + return databaseSeedComponent; + } + + public void setDatabaseSeedComponent(java.util.List databaseSeedComponent) { + this.databaseSeedComponent = databaseSeedComponent; + } + + public DatabaseCrossCluster databaseManagementComponent(java.util.List databaseManagementComponent) { + this.databaseManagementComponent = databaseManagementComponent; + return this; + } + + public DatabaseCrossCluster addDatabaseManagementComponentItem(DatabaseManagementComponent databaseManagementComponentItem) { + if (this.databaseManagementComponent == null) { + this.databaseManagementComponent = new java.util.ArrayList<>(); + } + this.databaseManagementComponent.add(databaseManagementComponentItem); + return this; + } + + /** + * Get databaseManagementComponent + * @return databaseManagementComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getDatabaseManagementComponent() { + return databaseManagementComponent; + } + + public void setDatabaseManagementComponent(java.util.List databaseManagementComponent) { + this.databaseManagementComponent = databaseManagementComponent; + } + + public DatabaseCrossCluster crossDatabaseDataComponent(java.util.List crossDatabaseDataComponent) { + this.crossDatabaseDataComponent = crossDatabaseDataComponent; + return this; + } + + public DatabaseCrossCluster addCrossDatabaseDataComponentItem(CrossDatabaseDataComponent crossDatabaseDataComponentItem) { + if (this.crossDatabaseDataComponent == null) { + this.crossDatabaseDataComponent = new java.util.ArrayList<>(); + } + this.crossDatabaseDataComponent.add(crossDatabaseDataComponentItem); + return this; + } + + /** + * Get crossDatabaseDataComponent + * @return crossDatabaseDataComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getCrossDatabaseDataComponent() { + return crossDatabaseDataComponent; + } + + public void setCrossDatabaseDataComponent(java.util.List crossDatabaseDataComponent) { + this.crossDatabaseDataComponent = crossDatabaseDataComponent; + } + + public DatabaseCrossCluster crossDatabaseSeedComponent(java.util.List crossDatabaseSeedComponent) { + this.crossDatabaseSeedComponent = crossDatabaseSeedComponent; + return this; + } + + public DatabaseCrossCluster addCrossDatabaseSeedComponentItem(CrossDatabaseSeedComponent crossDatabaseSeedComponentItem) { + if (this.crossDatabaseSeedComponent == null) { + this.crossDatabaseSeedComponent = new java.util.ArrayList<>(); + } + this.crossDatabaseSeedComponent.add(crossDatabaseSeedComponentItem); + return this; + } + + /** + * Get crossDatabaseSeedComponent + * @return crossDatabaseSeedComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getCrossDatabaseSeedComponent() { + return crossDatabaseSeedComponent; + } + + public void setCrossDatabaseSeedComponent(java.util.List crossDatabaseSeedComponent) { + this.crossDatabaseSeedComponent = crossDatabaseSeedComponent; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatabaseCrossCluster databaseCrossCluster = (DatabaseCrossCluster) o; + return Objects.equals(this.databaseDataComponent, databaseCrossCluster.databaseDataComponent) && + Objects.equals(this.databaseSeedComponent, databaseCrossCluster.databaseSeedComponent) && + Objects.equals(this.databaseManagementComponent, databaseCrossCluster.databaseManagementComponent) && + Objects.equals(this.crossDatabaseDataComponent, databaseCrossCluster.crossDatabaseDataComponent) && + Objects.equals(this.crossDatabaseSeedComponent, databaseCrossCluster.crossDatabaseSeedComponent); + } + + @Override + public int hashCode() { + return Objects.hash(databaseDataComponent, databaseSeedComponent, databaseManagementComponent, crossDatabaseDataComponent, crossDatabaseSeedComponent); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatabaseCrossCluster {\n"); + + sb.append(" databaseDataComponent: ").append(toIndentedString(databaseDataComponent)).append("\n"); + sb.append(" databaseSeedComponent: ").append(toIndentedString(databaseSeedComponent)).append("\n"); + sb.append(" databaseManagementComponent: ").append(toIndentedString(databaseManagementComponent)).append("\n"); + sb.append(" crossDatabaseDataComponent: ").append(toIndentedString(crossDatabaseDataComponent)).append("\n"); + sb.append(" crossDatabaseSeedComponent: ").append(toIndentedString(crossDatabaseSeedComponent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseDataComponent.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseDataComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..30e293f232cadfc0f03fc8e354f15759d51f9366 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseDataComponent.java @@ -0,0 +1,235 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.Component; +import de.uulm.omi.cloudiator.catalogue.client.model.CustomConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.NodeConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.VM; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * A data component of a DDBMS, requires existing seed components + */ +@ApiModel(description = "A data component of a DDBMS, requires existing seed components") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class DatabaseDataComponent { + @SerializedName("instances") + private Integer instances = null; + + @SerializedName("resource") + private VM resource = null; + + /** + * Gets or Sets name + */ + @JsonAdapter(NameEnum.Adapter.class) + public enum NameEnum { + DATA("DATA"); + + private String value; + + NameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameEnum fromValue(String text) { + for (NameEnum b : NameEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("name") + private NameEnum name = null; + + @SerializedName("nodeConfiguration") + private NodeConfiguration nodeConfiguration = null; + + @SerializedName("customConfiguration") + private CustomConfiguration customConfiguration = null; + + public DatabaseDataComponent instances(Integer instances) { + this.instances = instances; + return this; + } + + /** + * number of component instances + * @return instances + **/ + @ApiModelProperty(value = "number of component instances") + public Integer getInstances() { + return instances; + } + + public void setInstances(Integer instances) { + this.instances = instances; + } + + public DatabaseDataComponent resource(VM resource) { + this.resource = resource; + return this; + } + + /** + * Get resource + * @return resource + **/ + @ApiModelProperty(value = "") + public VM getResource() { + return resource; + } + + public void setResource(VM resource) { + this.resource = resource; + } + + public DatabaseDataComponent name(NameEnum name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public NameEnum getName() { + return name; + } + + public void setName(NameEnum name) { + this.name = name; + } + + public DatabaseDataComponent nodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + return this; + } + + /** + * Get nodeConfiguration + * @return nodeConfiguration + **/ + @ApiModelProperty(value = "") + public NodeConfiguration getNodeConfiguration() { + return nodeConfiguration; + } + + public void setNodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + } + + public DatabaseDataComponent customConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + return this; + } + + /** + * Get customConfiguration + * @return customConfiguration + **/ + @ApiModelProperty(value = "") + public CustomConfiguration getCustomConfiguration() { + return customConfiguration; + } + + public void setCustomConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatabaseDataComponent databaseDataComponent = (DatabaseDataComponent) o; + return Objects.equals(this.instances, databaseDataComponent.instances) && + Objects.equals(this.resource, databaseDataComponent.resource) && + Objects.equals(this.name, databaseDataComponent.name) && + Objects.equals(this.nodeConfiguration, databaseDataComponent.nodeConfiguration) && + Objects.equals(this.customConfiguration, databaseDataComponent.customConfiguration); + } + + @Override + public int hashCode() { + return Objects.hash(instances, resource, name, nodeConfiguration, customConfiguration); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatabaseDataComponent {\n"); + + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nodeConfiguration: ").append(toIndentedString(nodeConfiguration)).append("\n"); + sb.append(" customConfiguration: ").append(toIndentedString(customConfiguration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseManagementComponent.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseManagementComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..3150124cb69357f73ee3db401fc14239a0458799 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseManagementComponent.java @@ -0,0 +1,259 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.CustomConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseDataComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.ManagementConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.NodeConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.VM; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * A management component of a DDBMS + */ +@ApiModel(description = "A management component of a DDBMS") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class DatabaseManagementComponent { + @SerializedName("instances") + private Integer instances = null; + + @SerializedName("resource") + private VM resource = null; + + /** + * Gets or Sets name + */ + @JsonAdapter(NameEnum.Adapter.class) + public enum NameEnum { + DATA("DATA"); + + private String value; + + NameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameEnum fromValue(String text) { + for (NameEnum b : NameEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("name") + private NameEnum name = null; + + @SerializedName("nodeConfiguration") + private NodeConfiguration nodeConfiguration = null; + + @SerializedName("customConfiguration") + private CustomConfiguration customConfiguration = null; + + @SerializedName("managementConfiguration") + private ManagementConfiguration managementConfiguration = null; + + public DatabaseManagementComponent instances(Integer instances) { + this.instances = instances; + return this; + } + + /** + * number of component instances + * @return instances + **/ + @ApiModelProperty(value = "number of component instances") + public Integer getInstances() { + return instances; + } + + public void setInstances(Integer instances) { + this.instances = instances; + } + + public DatabaseManagementComponent resource(VM resource) { + this.resource = resource; + return this; + } + + /** + * Get resource + * @return resource + **/ + @ApiModelProperty(value = "") + public VM getResource() { + return resource; + } + + public void setResource(VM resource) { + this.resource = resource; + } + + public DatabaseManagementComponent name(NameEnum name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public NameEnum getName() { + return name; + } + + public void setName(NameEnum name) { + this.name = name; + } + + public DatabaseManagementComponent nodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + return this; + } + + /** + * Get nodeConfiguration + * @return nodeConfiguration + **/ + @ApiModelProperty(value = "") + public NodeConfiguration getNodeConfiguration() { + return nodeConfiguration; + } + + public void setNodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + } + + public DatabaseManagementComponent customConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + return this; + } + + /** + * Get customConfiguration + * @return customConfiguration + **/ + @ApiModelProperty(value = "") + public CustomConfiguration getCustomConfiguration() { + return customConfiguration; + } + + public void setCustomConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + } + + public DatabaseManagementComponent managementConfiguration(ManagementConfiguration managementConfiguration) { + this.managementConfiguration = managementConfiguration; + return this; + } + + /** + * Get managementConfiguration + * @return managementConfiguration + **/ + @ApiModelProperty(value = "") + public ManagementConfiguration getManagementConfiguration() { + return managementConfiguration; + } + + public void setManagementConfiguration(ManagementConfiguration managementConfiguration) { + this.managementConfiguration = managementConfiguration; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatabaseManagementComponent databaseManagementComponent = (DatabaseManagementComponent) o; + return Objects.equals(this.instances, databaseManagementComponent.instances) && + Objects.equals(this.resource, databaseManagementComponent.resource) && + Objects.equals(this.name, databaseManagementComponent.name) && + Objects.equals(this.nodeConfiguration, databaseManagementComponent.nodeConfiguration) && + Objects.equals(this.customConfiguration, databaseManagementComponent.customConfiguration) && + Objects.equals(this.managementConfiguration, databaseManagementComponent.managementConfiguration); + } + + @Override + public int hashCode() { + return Objects.hash(instances, resource, name, nodeConfiguration, customConfiguration, managementConfiguration); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatabaseManagementComponent {\n"); + + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nodeConfiguration: ").append(toIndentedString(nodeConfiguration)).append("\n"); + sb.append(" customConfiguration: ").append(toIndentedString(customConfiguration)).append("\n"); + sb.append(" managementConfiguration: ").append(toIndentedString(managementConfiguration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseSeedComponent.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseSeedComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..92bb7be8d6413065e278be543cd8711c0b43d1fc --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseSeedComponent.java @@ -0,0 +1,235 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.Component; +import de.uulm.omi.cloudiator.catalogue.client.model.CustomConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.NodeConfiguration; +import de.uulm.omi.cloudiator.catalogue.client.model.VM; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * A seed component of a DDBMS, provides the cluster entrypoint for DatabaseDataComponents + */ +@ApiModel(description = "A seed component of a DDBMS, provides the cluster entrypoint for DatabaseDataComponents") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class DatabaseSeedComponent { + @SerializedName("instances") + private Integer instances = null; + + @SerializedName("resource") + private VM resource = null; + + /** + * Gets or Sets name + */ + @JsonAdapter(NameEnum.Adapter.class) + public enum NameEnum { + SEED("SEED"); + + private String value; + + NameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameEnum fromValue(String text) { + for (NameEnum b : NameEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final NameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("name") + private NameEnum name = null; + + @SerializedName("nodeConfiguration") + private NodeConfiguration nodeConfiguration = null; + + @SerializedName("customConfiguration") + private CustomConfiguration customConfiguration = null; + + public DatabaseSeedComponent instances(Integer instances) { + this.instances = instances; + return this; + } + + /** + * number of component instances + * @return instances + **/ + @ApiModelProperty(value = "number of component instances") + public Integer getInstances() { + return instances; + } + + public void setInstances(Integer instances) { + this.instances = instances; + } + + public DatabaseSeedComponent resource(VM resource) { + this.resource = resource; + return this; + } + + /** + * Get resource + * @return resource + **/ + @ApiModelProperty(value = "") + public VM getResource() { + return resource; + } + + public void setResource(VM resource) { + this.resource = resource; + } + + public DatabaseSeedComponent name(NameEnum name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + public NameEnum getName() { + return name; + } + + public void setName(NameEnum name) { + this.name = name; + } + + public DatabaseSeedComponent nodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + return this; + } + + /** + * Get nodeConfiguration + * @return nodeConfiguration + **/ + @ApiModelProperty(value = "") + public NodeConfiguration getNodeConfiguration() { + return nodeConfiguration; + } + + public void setNodeConfiguration(NodeConfiguration nodeConfiguration) { + this.nodeConfiguration = nodeConfiguration; + } + + public DatabaseSeedComponent customConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + return this; + } + + /** + * Get customConfiguration + * @return customConfiguration + **/ + @ApiModelProperty(value = "") + public CustomConfiguration getCustomConfiguration() { + return customConfiguration; + } + + public void setCustomConfiguration(CustomConfiguration customConfiguration) { + this.customConfiguration = customConfiguration; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatabaseSeedComponent databaseSeedComponent = (DatabaseSeedComponent) o; + return Objects.equals(this.instances, databaseSeedComponent.instances) && + Objects.equals(this.resource, databaseSeedComponent.resource) && + Objects.equals(this.name, databaseSeedComponent.name) && + Objects.equals(this.nodeConfiguration, databaseSeedComponent.nodeConfiguration) && + Objects.equals(this.customConfiguration, databaseSeedComponent.customConfiguration); + } + + @Override + public int hashCode() { + return Objects.hash(instances, resource, name, nodeConfiguration, customConfiguration); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatabaseSeedComponent {\n"); + + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nodeConfiguration: ").append(toIndentedString(nodeConfiguration)).append("\n"); + sb.append(" customConfiguration: ").append(toIndentedString(customConfiguration)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseSingle.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseSingle.java new file mode 100644 index 0000000000000000000000000000000000000000..f718a82f66aa00aae2b06c0eb215e4580fc8d042 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/DatabaseSingle.java @@ -0,0 +1,127 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseManagementComponent; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseSeedComponent; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * todo + */ +@ApiModel(description = "todo") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class DatabaseSingle { + @SerializedName("databaseSeedComponent") + private DatabaseSeedComponent databaseSeedComponent = null; + + @SerializedName("databaseManagementComponent") + private java.util.List databaseManagementComponent = null; + + public DatabaseSingle databaseSeedComponent(DatabaseSeedComponent databaseSeedComponent) { + this.databaseSeedComponent = databaseSeedComponent; + return this; + } + + /** + * Get databaseSeedComponent + * @return databaseSeedComponent + **/ + @ApiModelProperty(value = "") + public DatabaseSeedComponent getDatabaseSeedComponent() { + return databaseSeedComponent; + } + + public void setDatabaseSeedComponent(DatabaseSeedComponent databaseSeedComponent) { + this.databaseSeedComponent = databaseSeedComponent; + } + + public DatabaseSingle databaseManagementComponent(java.util.List databaseManagementComponent) { + this.databaseManagementComponent = databaseManagementComponent; + return this; + } + + public DatabaseSingle addDatabaseManagementComponentItem(DatabaseManagementComponent databaseManagementComponentItem) { + if (this.databaseManagementComponent == null) { + this.databaseManagementComponent = new java.util.ArrayList<>(); + } + this.databaseManagementComponent.add(databaseManagementComponentItem); + return this; + } + + /** + * Get databaseManagementComponent + * @return databaseManagementComponent + **/ + @ApiModelProperty(value = "") + public java.util.List getDatabaseManagementComponent() { + return databaseManagementComponent; + } + + public void setDatabaseManagementComponent(java.util.List databaseManagementComponent) { + this.databaseManagementComponent = databaseManagementComponent; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DatabaseSingle databaseSingle = (DatabaseSingle) o; + return Objects.equals(this.databaseSeedComponent, databaseSingle.databaseSeedComponent) && + Objects.equals(this.databaseManagementComponent, databaseSingle.databaseManagementComponent); + } + + @Override + public int hashCode() { + return Objects.hash(databaseSeedComponent, databaseManagementComponent); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DatabaseSingle {\n"); + + sb.append(" databaseSeedComponent: ").append(toIndentedString(databaseSeedComponent)).append("\n"); + sb.append(" databaseManagementComponent: ").append(toIndentedString(databaseManagementComponent)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Error.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Error.java new file mode 100644 index 0000000000000000000000000000000000000000..088f1fcb7343ebaa243f37bf02b88f86a9760173 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Error.java @@ -0,0 +1,139 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Error + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class Error { + @SerializedName("code") + private Integer code = null; + + @SerializedName("message") + private String message = null; + + @SerializedName("fields") + private String fields = null; + + public Error code(Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @ApiModelProperty(value = "") + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public Error message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @ApiModelProperty(value = "") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public Error fields(String fields) { + this.fields = fields; + return this; + } + + /** + * Get fields + * @return fields + **/ + @ApiModelProperty(value = "") + public String getFields() { + return fields; + } + + public void setFields(String fields) { + this.fields = fields; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Error error = (Error) o; + return Objects.equals(this.code, error.code) && + Objects.equals(this.message, error.message) && + Objects.equals(this.fields, error.fields); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, fields); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/IndexMemory.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/IndexMemory.java new file mode 100644 index 0000000000000000000000000000000000000000..a1b37d5191da61460e9717dc11fc836e0ca62721 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/IndexMemory.java @@ -0,0 +1,161 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * IndexMemory + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class IndexMemory { + /** + * environment variable name + */ + @JsonAdapter(EnvNameEnum.Adapter.class) + public enum EnvNameEnum { + INDEXMEMORY("INDEXMEMORY"); + + private String value; + + EnvNameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnvNameEnum fromValue(String text) { + for (EnvNameEnum b : EnvNameEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnvNameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnvNameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnvNameEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("envName") + private EnvNameEnum envName = null; + + @SerializedName("envValue") + private String envValue = null; + + public IndexMemory envName(EnvNameEnum envName) { + this.envName = envName; + return this; + } + + /** + * environment variable name + * @return envName + **/ + @ApiModelProperty(value = "environment variable name") + public EnvNameEnum getEnvName() { + return envName; + } + + public void setEnvName(EnvNameEnum envName) { + this.envName = envName; + } + + public IndexMemory envValue(String envValue) { + this.envValue = envValue; + return this; + } + + /** + * amount of RAM to allocato for index caching + * @return envValue + **/ + @ApiModelProperty(value = "amount of RAM to allocato for index caching") + public String getEnvValue() { + return envValue; + } + + public void setEnvValue(String envValue) { + this.envValue = envValue; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IndexMemory indexMemory = (IndexMemory) o; + return Objects.equals(this.envName, indexMemory.envName) && + Objects.equals(this.envValue, indexMemory.envValue); + } + + @Override + public int hashCode() { + return Objects.hash(envName, envValue); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IndexMemory {\n"); + + sb.append(" envName: ").append(toIndentedString(envName)).append("\n"); + sb.append(" envValue: ").append(toIndentedString(envValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ManagementConfiguration.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ManagementConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..21a91ec672a4e5de2ca645468d17a8e9dfb382c8 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ManagementConfiguration.java @@ -0,0 +1,93 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ManagementConfiguration + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class ManagementConfiguration { + @SerializedName("crossClusterPort") + private Integer crossClusterPort = null; + + public ManagementConfiguration crossClusterPort(Integer crossClusterPort) { + this.crossClusterPort = crossClusterPort; + return this; + } + + /** + * port to connect across multiple clusters + * @return crossClusterPort + **/ + @ApiModelProperty(value = "port to connect across multiple clusters") + public Integer getCrossClusterPort() { + return crossClusterPort; + } + + public void setCrossClusterPort(Integer crossClusterPort) { + this.crossClusterPort = crossClusterPort; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagementConfiguration managementConfiguration = (ManagementConfiguration) o; + return Objects.equals(this.crossClusterPort, managementConfiguration.crossClusterPort); + } + + @Override + public int hashCode() { + return Objects.hash(crossClusterPort); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagementConfiguration {\n"); + + sb.append(" crossClusterPort: ").append(toIndentedString(crossClusterPort)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Node.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Node.java new file mode 100644 index 0000000000000000000000000000000000000000..458d62efc33d794c29047101c43883a8b08844af --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Node.java @@ -0,0 +1,119 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.Resource; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * An existing node resource + */ +@ApiModel(description = "An existing node resource") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class Node extends Resource { + @SerializedName("endpoint") + private Integer endpoint = null; + + @SerializedName("credentials") + private Integer credentials = null; + + public Node endpoint(Integer endpoint) { + this.endpoint = endpoint; + return this; + } + + /** + * TODO + * @return endpoint + **/ + @ApiModelProperty(value = "TODO") + public Integer getEndpoint() { + return endpoint; + } + + public void setEndpoint(Integer endpoint) { + this.endpoint = endpoint; + } + + public Node credentials(Integer credentials) { + this.credentials = credentials; + return this; + } + + /** + * TODO + * @return credentials + **/ + @ApiModelProperty(value = "TODO") + public Integer getCredentials() { + return credentials; + } + + public void setCredentials(Integer credentials) { + this.credentials = credentials; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Node node = (Node) o; + return Objects.equals(this.endpoint, node.endpoint) && + Objects.equals(this.credentials, node.credentials) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(endpoint, credentials, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Node {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" endpoint: ").append(toIndentedString(endpoint)).append("\n"); + sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/NodeConfiguration.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/NodeConfiguration.java new file mode 100644 index 0000000000000000000000000000000000000000..137dad440b95a978d24c6c93ddedaf277b780915 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/NodeConfiguration.java @@ -0,0 +1,143 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.DataMemory; +import de.uulm.omi.cloudiator.catalogue.client.model.IndexMemory; +import de.uulm.omi.cloudiator.catalogue.client.model.ReplicationFactor; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * configuration settings on node level + */ +@ApiModel(description = "configuration settings on node level") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class NodeConfiguration { + @SerializedName("dataMemory") + private DataMemory dataMemory = null; + + @SerializedName("indexMemory") + private IndexMemory indexMemory = null; + + @SerializedName("replicationFactor") + private ReplicationFactor replicationFactor = null; + + public NodeConfiguration dataMemory(DataMemory dataMemory) { + this.dataMemory = dataMemory; + return this; + } + + /** + * Get dataMemory + * @return dataMemory + **/ + @ApiModelProperty(value = "") + public DataMemory getDataMemory() { + return dataMemory; + } + + public void setDataMemory(DataMemory dataMemory) { + this.dataMemory = dataMemory; + } + + public NodeConfiguration indexMemory(IndexMemory indexMemory) { + this.indexMemory = indexMemory; + return this; + } + + /** + * Get indexMemory + * @return indexMemory + **/ + @ApiModelProperty(value = "") + public IndexMemory getIndexMemory() { + return indexMemory; + } + + public void setIndexMemory(IndexMemory indexMemory) { + this.indexMemory = indexMemory; + } + + public NodeConfiguration replicationFactor(ReplicationFactor replicationFactor) { + this.replicationFactor = replicationFactor; + return this; + } + + /** + * Get replicationFactor + * @return replicationFactor + **/ + @ApiModelProperty(value = "") + public ReplicationFactor getReplicationFactor() { + return replicationFactor; + } + + public void setReplicationFactor(ReplicationFactor replicationFactor) { + this.replicationFactor = replicationFactor; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NodeConfiguration nodeConfiguration = (NodeConfiguration) o; + return Objects.equals(this.dataMemory, nodeConfiguration.dataMemory) && + Objects.equals(this.indexMemory, nodeConfiguration.indexMemory) && + Objects.equals(this.replicationFactor, nodeConfiguration.replicationFactor); + } + + @Override + public int hashCode() { + return Objects.hash(dataMemory, indexMemory, replicationFactor); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NodeConfiguration {\n"); + + sb.append(" dataMemory: ").append(toIndentedString(dataMemory)).append("\n"); + sb.append(" indexMemory: ").append(toIndentedString(indexMemory)).append("\n"); + sb.append(" replicationFactor: ").append(toIndentedString(replicationFactor)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ReplicationFactor.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ReplicationFactor.java new file mode 100644 index 0000000000000000000000000000000000000000..149f3af00e1a9371651038ef7fd60bd1e8692420 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/ReplicationFactor.java @@ -0,0 +1,161 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ReplicationFactor + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class ReplicationFactor { + /** + * environment variable name + */ + @JsonAdapter(EnvNameEnum.Adapter.class) + public enum EnvNameEnum { + REPLICATIONFACTOR("REPLICATIONFACTOR"); + + private String value; + + EnvNameEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnvNameEnum fromValue(String text) { + for (EnvNameEnum b : EnvNameEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final EnvNameEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnvNameEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnvNameEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("envName") + private EnvNameEnum envName = null; + + @SerializedName("envValue") + private String envValue = null; + + public ReplicationFactor envName(EnvNameEnum envName) { + this.envName = envName; + return this; + } + + /** + * environment variable name + * @return envName + **/ + @ApiModelProperty(value = "environment variable name") + public EnvNameEnum getEnvName() { + return envName; + } + + public void setEnvName(EnvNameEnum envName) { + this.envName = envName; + } + + public ReplicationFactor envValue(String envValue) { + this.envValue = envValue; + return this; + } + + /** + * replication factor, 0 = repliation disabled + * @return envValue + **/ + @ApiModelProperty(value = "replication factor, 0 = repliation disabled") + public String getEnvValue() { + return envValue; + } + + public void setEnvValue(String envValue) { + this.envValue = envValue; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReplicationFactor replicationFactor = (ReplicationFactor) o; + return Objects.equals(this.envName, replicationFactor.envName) && + Objects.equals(this.envValue, replicationFactor.envValue); + } + + @Override + public int hashCode() { + return Objects.hash(envName, envValue); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReplicationFactor {\n"); + + sb.append(" envName: ").append(toIndentedString(envName)).append("\n"); + sb.append(" envValue: ").append(toIndentedString(envValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Requirement.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Requirement.java new file mode 100644 index 0000000000000000000000000000000000000000..bed87286ac9ac08a1ce2f7a65d8793bbd422c805 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Requirement.java @@ -0,0 +1,96 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.Resource; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * A requirement set Colosseum will solves an provision the resources + */ +@ApiModel(description = "A requirement set Colosseum will solves an provision the resources") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class Requirement extends Resource { + @SerializedName("item") + private Integer item = null; + + public Requirement item(Integer item) { + this.item = item; + return this; + } + + /** + * TODO + * @return item + **/ + @ApiModelProperty(value = "TODO") + public Integer getItem() { + return item; + } + + public void setItem(Integer item) { + this.item = item; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Requirement requirement = (Requirement) o; + return Objects.equals(this.item, requirement.item) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(item, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Requirement {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" item: ").append(toIndentedString(item)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Resource.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Resource.java new file mode 100644 index 0000000000000000000000000000000000000000..3b2ec9f746ae02740a74f726969c5edf64dc0b9d --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/Resource.java @@ -0,0 +1,143 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Resource + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") + +public class Resource { + /** + * Gets or Sets resourceType + */ + @JsonAdapter(ResourceTypeEnum.Adapter.class) + public enum ResourceTypeEnum { + VM("VM"), + + NODE("NODE"), + + REQUIREMENT("REQUIREMENT"); + + private String value; + + ResourceTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResourceTypeEnum fromValue(String text) { + for (ResourceTypeEnum b : ResourceTypeEnum.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ResourceTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResourceTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResourceTypeEnum.fromValue(String.valueOf(value)); + } + } + } + + @SerializedName("resourceType") + private ResourceTypeEnum resourceType = null; + + public Resource resourceType(ResourceTypeEnum resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * Get resourceType + * @return resourceType + **/ + @ApiModelProperty(required = true, value = "") + public ResourceTypeEnum getResourceType() { + return resourceType; + } + + public void setResourceType(ResourceTypeEnum resourceType) { + this.resourceType = resourceType; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Resource resource = (Resource) o; + return Objects.equals(this.resourceType, resource.resourceType); + } + + @Override + public int hashCode() { + return Objects.hash(resourceType); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Resource {\n"); + + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkJob.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkJob.java new file mode 100644 index 0000000000000000000000000000000000000000..cd22562e517c8c873d4a21571dcc15c2f93380c6 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkJob.java @@ -0,0 +1,162 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * SparkJob + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class SparkJob { + @SerializedName("name") + private String name = null; + + @SerializedName("masterUrl") + private String masterUrl = null; + + @SerializedName("appplicationUrl") + private String appplicationUrl = null; + + @SerializedName("main Class") + private String mainClass = null; + + public SparkJob name(String name) { + this.name = name; + return this; + } + + /** + * processing job name + * @return name + **/ + @ApiModelProperty(value = "processing job name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SparkJob masterUrl(String masterUrl) { + this.masterUrl = masterUrl; + return this; + } + + /** + * Spark Master URL, e.g. spark://IP:7077 + * @return masterUrl + **/ + @ApiModelProperty(value = "Spark Master URL, e.g. spark://IP:7077") + public String getMasterUrl() { + return masterUrl; + } + + public void setMasterUrl(String masterUrl) { + this.masterUrl = masterUrl; + } + + public SparkJob appplicationUrl(String appplicationUrl) { + this.appplicationUrl = appplicationUrl; + return this; + } + + /** + * location of the application artifact, need to be accessible via http (to be verified) + * @return appplicationUrl + **/ + @ApiModelProperty(value = "location of the application artifact, need to be accessible via http (to be verified)") + public String getAppplicationUrl() { + return appplicationUrl; + } + + public void setAppplicationUrl(String appplicationUrl) { + this.appplicationUrl = appplicationUrl; + } + + public SparkJob mainClass(String mainClass) { + this.mainClass = mainClass; + return this; + } + + /** + * the main class of the application, e.g. \"com.some.job\" + * @return mainClass + **/ + @ApiModelProperty(value = "the main class of the application, e.g. \"com.some.job\"") + public String getMainClass() { + return mainClass; + } + + public void setMainClass(String mainClass) { + this.mainClass = mainClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SparkJob sparkJob = (SparkJob) o; + return Objects.equals(this.name, sparkJob.name) && + Objects.equals(this.masterUrl, sparkJob.masterUrl) && + Objects.equals(this.appplicationUrl, sparkJob.appplicationUrl) && + Objects.equals(this.mainClass, sparkJob.mainClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, masterUrl, appplicationUrl, mainClass); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SparkJob {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" masterUrl: ").append(toIndentedString(masterUrl)).append("\n"); + sb.append(" appplicationUrl: ").append(toIndentedString(appplicationUrl)).append("\n"); + sb.append(" mainClass: ").append(toIndentedString(mainClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkMasterComponent.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkMasterComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..9d221c2447cb9386de595b837c593f78e9d8f1a0 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkMasterComponent.java @@ -0,0 +1,208 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * SparkMasterComponent + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class SparkMasterComponent { + @SerializedName("name") + private String name = null; + + @SerializedName("instances") + private Integer instances = null; + + @SerializedName("idCloud") + private Integer idCloud = null; + + @SerializedName("idImage") + private Integer idImage = null; + + @SerializedName("idLocation") + private Integer idLocation = null; + + @SerializedName("idHardware") + private Integer idHardware = null; + + public SparkMasterComponent name(String name) { + this.name = name; + return this; + } + + /** + * Spark master description identifier, needs to map an existing application description + * @return name + **/ + @ApiModelProperty(value = "Spark master description identifier, needs to map an existing application description") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SparkMasterComponent instances(Integer instances) { + this.instances = instances; + return this; + } + + /** + * number of database nodes in the cluster + * @return instances + **/ + @ApiModelProperty(value = "number of database nodes in the cluster") + public Integer getInstances() { + return instances; + } + + public void setInstances(Integer instances) { + this.instances = instances; + } + + public SparkMasterComponent idCloud(Integer idCloud) { + this.idCloud = idCloud; + return this; + } + + /** + * idCloud in Colosseum + * @return idCloud + **/ + @ApiModelProperty(value = "idCloud in Colosseum") + public Integer getIdCloud() { + return idCloud; + } + + public void setIdCloud(Integer idCloud) { + this.idCloud = idCloud; + } + + public SparkMasterComponent idImage(Integer idImage) { + this.idImage = idImage; + return this; + } + + /** + * idImage in Colosseum + * @return idImage + **/ + @ApiModelProperty(value = "idImage in Colosseum") + public Integer getIdImage() { + return idImage; + } + + public void setIdImage(Integer idImage) { + this.idImage = idImage; + } + + public SparkMasterComponent idLocation(Integer idLocation) { + this.idLocation = idLocation; + return this; + } + + /** + * idLocation in Colosseum + * @return idLocation + **/ + @ApiModelProperty(value = "idLocation in Colosseum") + public Integer getIdLocation() { + return idLocation; + } + + public void setIdLocation(Integer idLocation) { + this.idLocation = idLocation; + } + + public SparkMasterComponent idHardware(Integer idHardware) { + this.idHardware = idHardware; + return this; + } + + /** + * idHardware in Colosseum + * @return idHardware + **/ + @ApiModelProperty(value = "idHardware in Colosseum") + public Integer getIdHardware() { + return idHardware; + } + + public void setIdHardware(Integer idHardware) { + this.idHardware = idHardware; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SparkMasterComponent sparkMasterComponent = (SparkMasterComponent) o; + return Objects.equals(this.name, sparkMasterComponent.name) && + Objects.equals(this.instances, sparkMasterComponent.instances) && + Objects.equals(this.idCloud, sparkMasterComponent.idCloud) && + Objects.equals(this.idImage, sparkMasterComponent.idImage) && + Objects.equals(this.idLocation, sparkMasterComponent.idLocation) && + Objects.equals(this.idHardware, sparkMasterComponent.idHardware); + } + + @Override + public int hashCode() { + return Objects.hash(name, instances, idCloud, idImage, idLocation, idHardware); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SparkMasterComponent {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" idCloud: ").append(toIndentedString(idCloud)).append("\n"); + sb.append(" idImage: ").append(toIndentedString(idImage)).append("\n"); + sb.append(" idLocation: ").append(toIndentedString(idLocation)).append("\n"); + sb.append(" idHardware: ").append(toIndentedString(idHardware)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkWorkerComponent.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkWorkerComponent.java new file mode 100644 index 0000000000000000000000000000000000000000..f2d224992b2e10eff0cc64922678cd59d0859c7c --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/SparkWorkerComponent.java @@ -0,0 +1,208 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * SparkWorkerComponent + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class SparkWorkerComponent { + @SerializedName("name") + private String name = null; + + @SerializedName("instances") + private Integer instances = null; + + @SerializedName("idCloud") + private Integer idCloud = null; + + @SerializedName("idImage") + private Integer idImage = null; + + @SerializedName("idLocation") + private Integer idLocation = null; + + @SerializedName("idHardware") + private Integer idHardware = null; + + public SparkWorkerComponent name(String name) { + this.name = name; + return this; + } + + /** + * Spark worker description identifier, needs to map an existing application description + * @return name + **/ + @ApiModelProperty(value = "Spark worker description identifier, needs to map an existing application description") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SparkWorkerComponent instances(Integer instances) { + this.instances = instances; + return this; + } + + /** + * number of database nodes in the cluster + * @return instances + **/ + @ApiModelProperty(value = "number of database nodes in the cluster") + public Integer getInstances() { + return instances; + } + + public void setInstances(Integer instances) { + this.instances = instances; + } + + public SparkWorkerComponent idCloud(Integer idCloud) { + this.idCloud = idCloud; + return this; + } + + /** + * idCloud in Colosseum + * @return idCloud + **/ + @ApiModelProperty(value = "idCloud in Colosseum") + public Integer getIdCloud() { + return idCloud; + } + + public void setIdCloud(Integer idCloud) { + this.idCloud = idCloud; + } + + public SparkWorkerComponent idImage(Integer idImage) { + this.idImage = idImage; + return this; + } + + /** + * idImage in Colosseum + * @return idImage + **/ + @ApiModelProperty(value = "idImage in Colosseum") + public Integer getIdImage() { + return idImage; + } + + public void setIdImage(Integer idImage) { + this.idImage = idImage; + } + + public SparkWorkerComponent idLocation(Integer idLocation) { + this.idLocation = idLocation; + return this; + } + + /** + * idLocation in Colosseum + * @return idLocation + **/ + @ApiModelProperty(value = "idLocation in Colosseum") + public Integer getIdLocation() { + return idLocation; + } + + public void setIdLocation(Integer idLocation) { + this.idLocation = idLocation; + } + + public SparkWorkerComponent idHardware(Integer idHardware) { + this.idHardware = idHardware; + return this; + } + + /** + * idHardware in Colosseum + * @return idHardware + **/ + @ApiModelProperty(value = "idHardware in Colosseum") + public Integer getIdHardware() { + return idHardware; + } + + public void setIdHardware(Integer idHardware) { + this.idHardware = idHardware; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SparkWorkerComponent sparkWorkerComponent = (SparkWorkerComponent) o; + return Objects.equals(this.name, sparkWorkerComponent.name) && + Objects.equals(this.instances, sparkWorkerComponent.instances) && + Objects.equals(this.idCloud, sparkWorkerComponent.idCloud) && + Objects.equals(this.idImage, sparkWorkerComponent.idImage) && + Objects.equals(this.idLocation, sparkWorkerComponent.idLocation) && + Objects.equals(this.idHardware, sparkWorkerComponent.idHardware); + } + + @Override + public int hashCode() { + return Objects.hash(name, instances, idCloud, idImage, idLocation, idHardware); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SparkWorkerComponent {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" instances: ").append(toIndentedString(instances)).append("\n"); + sb.append(" idCloud: ").append(toIndentedString(idCloud)).append("\n"); + sb.append(" idImage: ").append(toIndentedString(idImage)).append("\n"); + sb.append(" idLocation: ").append(toIndentedString(idLocation)).append("\n"); + sb.append(" idHardware: ").append(toIndentedString(idHardware)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/VM.java b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/VM.java new file mode 100644 index 0000000000000000000000000000000000000000..80b4acb63bcfd802c643cbdf8d2b1f8560c7f883 --- /dev/null +++ b/client/src/main/java/de/uulm/omi/cloudiator/catalogue/client/model/VM.java @@ -0,0 +1,165 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.model; + +import java.util.Objects; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import de.uulm.omi.cloudiator.catalogue.client.model.Resource; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * A VM resource, which will be created by Colosseum + */ +@ApiModel(description = "A VM resource, which will be created by Colosseum") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-01-24T11:56:37.336Z") +public class VM extends Resource { + @SerializedName("idCloud") + private Integer idCloud = null; + + @SerializedName("idImage") + private Integer idImage = null; + + @SerializedName("idHardware") + private Integer idHardware = null; + + @SerializedName("idLocation") + private Integer idLocation = null; + + public VM idCloud(Integer idCloud) { + this.idCloud = idCloud; + return this; + } + + /** + * idCloud in Colosseum + * @return idCloud + **/ + @ApiModelProperty(required = true, value = "idCloud in Colosseum") + public Integer getIdCloud() { + return idCloud; + } + + public void setIdCloud(Integer idCloud) { + this.idCloud = idCloud; + } + + public VM idImage(Integer idImage) { + this.idImage = idImage; + return this; + } + + /** + * idImage in Colosseum + * @return idImage + **/ + @ApiModelProperty(required = true, value = "idImage in Colosseum") + public Integer getIdImage() { + return idImage; + } + + public void setIdImage(Integer idImage) { + this.idImage = idImage; + } + + public VM idHardware(Integer idHardware) { + this.idHardware = idHardware; + return this; + } + + /** + * idHardware in Colosseum + * @return idHardware + **/ + @ApiModelProperty(required = true, value = "idHardware in Colosseum") + public Integer getIdHardware() { + return idHardware; + } + + public void setIdHardware(Integer idHardware) { + this.idHardware = idHardware; + } + + public VM idLocation(Integer idLocation) { + this.idLocation = idLocation; + return this; + } + + /** + * idLocation in Colosseum + * @return idLocation + **/ + @ApiModelProperty(required = true, value = "idLocation in Colosseum") + public Integer getIdLocation() { + return idLocation; + } + + public void setIdLocation(Integer idLocation) { + this.idLocation = idLocation; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VM VM = (VM) o; + return Objects.equals(this.idCloud, VM.idCloud) && + Objects.equals(this.idImage, VM.idImage) && + Objects.equals(this.idHardware, VM.idHardware) && + Objects.equals(this.idLocation, VM.idLocation) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(idCloud, idImage, idHardware, idLocation, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VM {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" idCloud: ").append(toIndentedString(idCloud)).append("\n"); + sb.append(" idImage: ").append(toIndentedString(idImage)).append("\n"); + sb.append(" idHardware: ").append(toIndentedString(idHardware)).append("\n"); + sb.append(" idLocation: ").append(toIndentedString(idLocation)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/ApplicationApiTest.java b/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/ApplicationApiTest.java new file mode 100644 index 0000000000000000000000000000000000000000..c7fc22e37cbe6a81109bb6c060dc0b254b12b17d --- /dev/null +++ b/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/ApplicationApiTest.java @@ -0,0 +1,50 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.api; + +import de.uulm.omi.cloudiator.catalogue.client.ApiException; +import de.uulm.omi.cloudiator.catalogue.client.model.CloudiatorApplicationInstance; +import de.uulm.omi.cloudiator.catalogue.client.model.Component; +import de.uulm.omi.cloudiator.catalogue.client.model.Error; +import org.junit.Test; +import org.junit.Ignore; + + +/** + * API tests for ApplicationApi + */ +@Ignore +public class ApplicationApiTest { + + private final ApplicationApi api = new ApplicationApi(); + + + /** + * Generic application deployment + * + * Deploy a generic application in a multi-cloud setup + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void genericPostTest() throws ApiException { + String applicationName = null; + java.util.List components = null; + CloudiatorApplicationInstance response = api.genericPost(applicationName, components); + + // TODO: test validations + } + +} diff --git a/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/BigDataApiTest.java b/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/BigDataApiTest.java new file mode 100644 index 0000000000000000000000000000000000000000..6c17dce355c24348003a4237f3c85e24bf8548cc --- /dev/null +++ b/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/BigDataApiTest.java @@ -0,0 +1,68 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.api; + +import de.uulm.omi.cloudiator.catalogue.client.ApiException; +import de.uulm.omi.cloudiator.catalogue.client.model.CloudiatorApplicationInstance; +import de.uulm.omi.cloudiator.catalogue.client.model.Cluster; +import de.uulm.omi.cloudiator.catalogue.client.model.Error; +import de.uulm.omi.cloudiator.catalogue.client.model.SparkJob; +import org.junit.Test; +import org.junit.Ignore; + + +/** + * API tests for BigDataApi + */ +@Ignore +public class BigDataApiTest { + + private final BigDataApi api = new BigDataApi(); + + + /** + * submit an Apache Spark job to a Spark Master + * + * Submitting Spark jobs to an existing Apache Spark Cluster + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void sparkJobPostTest() throws ApiException { + SparkJob job = null; + java.util.List response = api.sparkJobPost(job); + + // TODO: test validations + } + + /** + * deploys an Apache Spark cluster + * + * Deploy a Spark cluster with 1 master and n workers the multi-cloud + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void sparkPostTest() throws ApiException { + String name = null; + String applicationType = null; + Cluster cluster = null; + CloudiatorApplicationInstance response = api.sparkPost(name, applicationType, cluster); + + // TODO: test validations + } + +} diff --git a/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/DatabaseApiTest.java b/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/DatabaseApiTest.java new file mode 100644 index 0000000000000000000000000000000000000000..fb3256f2e3df04687078a4ddfb6ab74f018adede --- /dev/null +++ b/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/DatabaseApiTest.java @@ -0,0 +1,103 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.api; + +import de.uulm.omi.cloudiator.catalogue.client.ApiException; +import de.uulm.omi.cloudiator.catalogue.client.model.Cloud; +import de.uulm.omi.cloudiator.catalogue.client.model.CloudiatorApplicationInstance; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseCluster; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseCrossCluster; +import de.uulm.omi.cloudiator.catalogue.client.model.DatabaseSingle; +import de.uulm.omi.cloudiator.catalogue.client.model.Error; +import org.junit.Test; +import org.junit.Ignore; + + +/** + * API tests for DatabaseApi + */ +@Ignore +public class DatabaseApiTest { + + private final DatabaseApi api = new DatabaseApi(); + + + /** + * DDBMS cluster deployment + * + * Deploy a database cluster in the multi-cloud + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void databaseClusterPostTest() throws ApiException { + String name = null; + DatabaseCluster databaseComponents = null; + CloudiatorApplicationInstance response = api.databaseClusterPost(name, databaseComponents); + + // TODO: test validations + } + + /** + * DDBMS cluster deployment + * + * Deploy a database cluster in the multi-cloud + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void databaseCrossClusterPostTest() throws ApiException { + String name = null; + DatabaseCrossCluster databaseComponents = null; + CloudiatorApplicationInstance response = api.databaseCrossClusterPost(name, databaseComponents); + + // TODO: test validations + } + + /** + * DDBMS cluster deployment + * + * Deploy a database cluster in the multi-cloud + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void databaseSinglePostTest() throws ApiException { + String name = null; + DatabaseSingle databaseComponents = null; + CloudiatorApplicationInstance response = api.databaseSinglePost(name, databaseComponents); + + // TODO: test validations + } + + /** + * Register a new cloud as deployment target + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void utilsRegisterCloudPostTest() throws ApiException { + Cloud cloud = null; + java.util.List response = api.utilsRegisterCloudPost(cloud); + + // TODO: test validations + } + +} diff --git a/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/ScriptsApiTest.java b/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/ScriptsApiTest.java new file mode 100644 index 0000000000000000000000000000000000000000..1fb30ef2c85c1b30fa5a25b5b68f530ddca70c4d --- /dev/null +++ b/client/src/test/java/de/uulm/omi/cloudiator/catalogue/client/api/ScriptsApiTest.java @@ -0,0 +1,65 @@ +/* + * Cloudiator Application Catalogue API + * Deploy a generic distributed application in the cloud + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package de.uulm.omi.cloudiator.catalogue.client.api; + +import de.uulm.omi.cloudiator.catalogue.client.ApiException; +import java.io.File; +import org.junit.Test; +import org.junit.Ignore; + + +/** + * API tests for ScriptsApi + */ +@Ignore +public class ScriptsApiTest { + + private final ScriptsApi api = new ScriptsApi(); + + + /** + * Get custom database installation scripts + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void scriptsBigdataGetTest() throws ApiException { + String frameworkName = null; + String scriptType = null; + File response = api.scriptsBigdataGet(frameworkName, scriptType); + + // TODO: test validations + } + + /** + * Get custom database installation scripts + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void scriptsDatabaseGetTest() throws ApiException { + String dbName = null; + String scriptType = null; + File response = api.scriptsDatabaseGet(dbName, scriptType); + + // TODO: test validations + } + +} diff --git a/input/applications/database/couchbase_single.app b/input/applications/database/couchbase_single.app index 9f2871b81208c3fccef35904acf0102a8109bd95..e251b80d6b69688ae70ad5da2095ce986d98c47b 100644 --- a/input/applications/database/couchbase_single.app +++ b/input/applications/database/couchbase_single.app @@ -9,7 +9,10 @@ components : number : 8091 lifecycleActions : init : "" - download : "sudo apt-get -y update && sudo apt-get install wget -y && sudo wget https://packages.couchbase.com/releases/4.5.0/couchbase-server-community_4.5.0-ubuntu14.04_amd64.deb && wget -O install.sh 'https://omi-gitlab.e-technik.uni-ulm.de/cloudiator/catalogue-scripts/raw/master/scripts/database/couchbase/install.sh' && wget -O init.sh 'https://omi-gitlab.e-technik.uni-ulm.de/cloudiator/catalogue-scripts/raw/master/scripts/database/couchbase/init.sh' && wget -O seed.sh 'https://omi-gitlab.e-technik.uni-ulm.de/cloudiator/catalogue-scripts/raw/master/scripts/database/couchbase/seed.sh' " + download : "sudo apt-get -y update && sudo apt-get install wget -y && sudo wget https://packages.couchbase.com/releases/4.5.0/couchbase-server-community_4.5.0-ubuntu14.04_amd64.deb + && wget -O install.sh 'https://omi-gitlab.e-technik.uni-ulm.de/cloudiator/catalogue-scripts/raw/master/scripts/database/couchbase/install.sh' + && wget -O init.sh 'https://omi-gitlab.e-technik.uni-ulm.de/cloudiator/catalogue-scripts/raw/master/scripts/database/couchbase/init.sh' + && wget -O seed.sh 'https://omi-gitlab.e-technik.uni-ulm.de/cloudiator/catalogue-scripts/raw/master/scripts/database/couchbase/seed.sh' " install : "sudo -E chmod +x install.sh && sudo -E ./install.sh" configure : " source /etc/environment && sudo -E chmod +x init.sh && sudo -E chmod +x seed.sh && sudo -E ./init.sh && sudo -E ./seed.sh" #configure : " sudo -E chmod +x init.sh && sudo -E chmod +x seed.sh " diff --git a/utils/java-client-config.json b/utils/java-client-config.json new file mode 100644 index 0000000000000000000000000000000000000000..7757319f96015a7b4e75675ebfacb6f2efe61830 --- /dev/null +++ b/utils/java-client-config.json @@ -0,0 +1,9 @@ +{ + "modelPackage" : "de.uulm.omi.cloudiator.catalogue.client.model", + "apiPackage" : "de.uulm.omi.cloudiator.catalogue.client.api", + "invokerPackage" : "de.uulm.omi.cloudiator.catalogue.client", + "groupId" : "de.uulm.omi.cloudiator.catalogue", + "artifactId" : "client", + "fullJavaUtil" : true, + "dateLibrary" : "java8" +} \ No newline at end of file diff --git a/utils/runCodegenClient.sh b/utils/runCodegenClient.sh new file mode 100644 index 0000000000000000000000000000000000000000..53cc50d18c6d0c19fc955340e52075ea1a14c724 --- /dev/null +++ b/utils/runCodegenClient.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +java -jar utils/swagger-codegen-cli-2.3.0.jar generate -i swagger/swagger.yaml -l java -c utils/java-client-config.json -o client/. diff --git a/utils/runCodegen.sh b/utils/runCodegenServer.sh similarity index 100% rename from utils/runCodegen.sh rename to utils/runCodegenServer.sh