Code Monkey home page Code Monkey logo

java's Introduction

Searchlight Java Client

Build Status Client Capabilities Maven Central

Official Java client for the Searchlight by AppsCode.

Installation

To install the Java client library to your local Maven repository, simply execute:

git clone --recursive https://github.com/searchlight-client/java
cd java
mvn install

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>com.appscode.searchlight</groupId>
    <artifactId>client-java</artifactId>
    <version>0.1.0</version>
    <scope>compile</scope>
</dependency>

Gradle users

compile 'com.appscode.searchlight:client-java:0.1.0'

Others

At first generate the JAR by executing:

git clone --recursive https://github.com/searchlight-client/java
cd java
mvn package

Then manually install the following JARs:

  • target/client-java-1.0.0-SNAPSHOT.jar
  • target/lib/*.jar

Example

list all pods:

import com.appscode.searchlight.client.ApiClient;
import com.appscode.searchlight.client.ApiException;
import com.appscode.searchlight.client.Configuration;
import com.appscode.searchlight.client.apis.MonitoringAppscodeComV1alpha1Api;
import com.appscode.searchlight.client.models.V1alpha1ClusterAlert;
import com.appscode.searchlight.client.models.V1alpha1ClusterAlertList;
import com.appscode.searchlight.client.util.Config;
import java.io.IOException;

public class Example {
  public static void main(String[] args) throws IOException, ApiException {
    ApiClient client = Config.defaultClient();
    Configuration.setDefaultApiClient(client);

    MonitoringAppscodeComV1alpha1Api api = new MonitoringAppscodeComV1alpha1Api();
    V1alpha1ClusterAlertList list =
        api.listClusterAlertForAllNamespaces(null, null, null, null, null, null, null, null, null);
    for (V1alpha1ClusterAlert item : list.getItems()) {
      System.out.println(item.getMetadata().getName());
    }
  }
}

watch on cluster alert object:

import com.appscode.searchlight.client.ApiClient;
import com.appscode.searchlight.client.ApiException;
import com.appscode.searchlight.client.Configuration;
import com.appscode.searchlight.client.apis.MonitoringAppscodeComV1alpha1Api;
import com.appscode.searchlight.client.models.V1alpha1ClusterAlert;
import com.appscode.searchlight.client.util.Config;
import com.appscode.searchlight.client.util.Watch;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import java.util.concurrent.TimeUnit;

public class WatchExample {
  public static void main(String[] args) throws IOException, ApiException {
    ApiClient client = Config.defaultClient();
    client.getHttpClient().setReadTimeout(60, TimeUnit.SECONDS);
    Configuration.setDefaultApiClient(client);

    MonitoringAppscodeComV1alpha1Api api = new MonitoringAppscodeComV1alpha1Api();

    Watch<V1alpha1ClusterAlert> watch =
        Watch.createWatch(
            client,
            api.listClusterAlertForAllNamespacesCall(
                null, null, null, null, null, "false", null, null, Boolean.TRUE, null, null),
            new TypeToken<Watch.Response<V1alpha1ClusterAlert>>() {}.getType());

    for (Watch.Response<V1alpha1ClusterAlert> item : watch) {
      System.out.printf("%s : %s%n", item.type, item.object.getMetadata().getName());
    }
  }
}

More examples can be found in examples folder. To run examples, run this command:

mvn exec:java -Dexec.mainClass="com.appscode.searchlight.client.examples.Example"

Documentation

All APIs and Models' documentation can be found at the Generated client's README file

Compatibility

Kubernetes 1.4 Kubernetes 1.5 Kubernetes 1.6 Kubernetes 1.7 Kubernetes 1.8 Kubernetes 1.9
0.1.0 + + + + โœ“ -

Key:

  • โœ“ Exactly the same features / API objects in both java-client and the Kubernetes version.
  • + java-client has features or api objects that may not be present in the Kubernetes cluster, but everything they have in common will work.
  • - The Kubernetes cluster has features the java-client library can't use (additional API objects, etc).

See the CHANGELOG for a detailed description of changes between java-client versions.

Community, Support, Discussion

We use Slack for public discussions. To chit chat with us or the rest of the community, join us in the AppsCode Slack team channel #searchlight. To sign up, use our Slack inviter.

If you have any problem with the package or any suggestions, please file an issue.

Development

Update client

To update the client clone the gen repo and run this command at the root of this repo:

../gen/openapi/autoupdate.sh

java's People

Contributors

tamalsaha avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar Hossain Mahmud avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.