Git Product home page Git Product logo

susestudio-lib-java's Introduction

SUSE Studio Java Client SDK

This is a Java based library for interacting with the SUSE Studio image store and appliances toolkit. The library is supposed to enable developers to easily implement client applications for SUSE Studio in Java, even for mobile platforms like Android. All functionality that is offered by the Studio REST API should be covered eventually, but the implementation is at the moment still a work in progress. Feel free to send pull requests!

Example Usage

General Information

// Initialize
SUSEStudio studio = new SUSEStudio("username", "password");
System.out.println("Version: " + studio.getApiVersion());

// Get user details
User user = studio.getUser();
System.out.println("Name: " + user.getUsername());

// Disk quota
DiskQuota dq = user.getDiskQuota();
System.out.println("DiskQuota: " + dq.getUsed() + " of " + dq.getAvailable());

Appliances

// Get the appliances
List<Appliance> appliances = studio.getAppliances();
for (Appliance a : appliances) {
    System.out.println("Name: " + a.getName());
    System.out.println("UUID: " + a.getUuid());
    System.out.println("Basesystem: " + a.getBasesystem());
    System.out.println("Type: " + a.getType());
    System.out.println("Edit URL: " + a.getEditUrl());
    System.out.println("Raw Size: " + a.getEstimatedRawSize());

    // List the builds
    for(Build b : a.getBuilds()) {
        System.out.println("Build ID: " + b.getId());
        System.out.println("Download URL: " + b.getDownloadUrl());
    }
}

Running Builds

// Schedule a build
ScheduleBuildResult result = studio.scheduleBuild(654321, SUSEStudio.ImageType.iso);
System.out.println("Build ID: " + result.getId());

Testdrives

// Start a testdrive for a given build
Testdrive testdrive = studio.startTestdrive(1234567);

// Get information about how to access it
VNCServer vncServer = testdrive.getVNCServer();
System.out.println("VNC Server Hostname: " + vncServer.getHost());
System.out.println("VNC Server Port: " + vncServer.getPort());

// Get all currently running testdrives
List<Testdrive> testdrives = studio.getTestdrives();
for (Testdrive testdrive : testdrives) {
    System.out.println("Testdrive ID: " + testdrive.getId());
    System.out.println("Build ID: " + testdrive.getBuildId());
    System.out.println("State: " + testdrive.getState());
}

Gallery

// Get popular appliances
Gallery gallery = studio.getGallery(SUSEStudio.GALLERY_POPULAR);
GalleryAppliances appliances = gallery.getAppliances();
System.out.println(appliances.getCount());

Build From Sources

Call ant on the commandline to build the library jarfile from sources. The artifact can be found in the dist folder.

License

See the LICENSE file.

susestudio-lib-java's People

Contributors

hagzag avatar maddy03 avatar mess110 avatar moio avatar renner avatar thom311 avatar

Watchers

 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.