Package hudson.plugins.openshift

Source Code of hudson.plugins.openshift.Util

package hudson.plugins.openshift;

import com.openshift.client.IApplication;
import com.openshift.client.IDomain;
import com.openshift.client.IOpenShiftConnection;

import java.io.IOException;

public class Util {
    public static IApplication getApplicationFromUuid(String uuid) {
        IOpenShiftConnection connection;
        try {
            connection = OpenShiftCloud.get().getOpenShiftConnection();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

        for(IDomain domain : connection.getDomains()) {
            for(IApplication app : domain.getApplications()) {
                if(app.getUUID().equals(uuid)) {
                    return app;
                }
            }
        }
        return null;
    }
}
TOP

Related Classes of hudson.plugins.openshift.Util

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.