Examples of IOpenShiftConnection


Examples of com.openshift.client.IOpenShiftConnection

    private IApplication getContainerApplication(Container container, boolean required) {
        IApplication app = null;
        CreateOpenshiftContainerMetadata metadata = OpenShiftUtils.getContainerMetadata(container);
        if (metadata != null) {
            IOpenShiftConnection connection = getOrCreateConnection(metadata.getCreateOptions());
            app = OpenShiftUtils.getApplication(container, metadata, connection);
        }
        if (app == null && required) {
            throw new FabricException("Unable to find OpenShift application for " + container.getId());
        }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

        }
        return false;
    }

    private IOpenShiftConnection getOrCreateConnection(CreateOpenshiftContainerOptions options) {
        IOpenShiftConnection connection = openShiftConnection.getOptional();
        if (connection != null) {
            return connection;
        } else {
            return OpenShiftUtils.createConnection(options);
        }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    @Argument(index = 0, name = "application", required = true, description = "The target application.")
    String applicationName;

    @Override
    protected Object doExecute() throws Exception {
        IOpenShiftConnection connection = getOrCreateConnection();
        for (IDomain domain : connection.getDomains()) {
            if (domainId == null || domainId.equals(domain.getId())) {
                IApplication application = domain.getApplicationByName(applicationName);
                application.start();
            }
        }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    @Argument(index = 0, name = "application", required = true, description = "The target application.")
    String applicationName;

    @Override
    protected Object doExecute() throws Exception {
        IOpenShiftConnection connection = getOrCreateConnection();
        for (IDomain domain : connection.getDomains()) {
            if (domainId == null || domainId.equals(domain.getId())) {
                IApplication application = domain.getApplicationByName(applicationName);
                application.stop();
            }
        }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    @Argument(index = 0, name = "application", required = true, description = "The target application.")
    String applicationName;

    @Override
    protected Object doExecute() throws Exception {
        IOpenShiftConnection connection = getOrCreateConnection();
        for (IDomain domain : connection.getDomains()) {
            if (domainId == null || domainId.equals(domain.getId())) {
                IApplication application = domain.getApplicationByName(applicationName);
                application.destroy();
            }
        }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

@Command(name = "domain-list", scope = "openshift", description = "Lists available openshift domains")
public class DomainListAction extends OpenshiftCommandSupport {

    @Override
    protected Object doExecute() throws Exception {
        IOpenShiftConnection connection = getOrCreateConnection();

        TablePrinter printer = new TablePrinter();
        printer.column("id");

        for (IDomain domain :connection.getDomains()){
            printer.row(domain.getId());
        }
        printer.print();

        return null;
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    @Argument(index = 1, name = "cartridge", required = true, multiValued = false, description = "The cartridge to use.")
    String cartridge;

    @Override
    protected Object doExecute() throws Exception {
        IOpenShiftConnection connection = getOrCreateConnection();
        IUser user = connection.getUser();
        IDomain domain = domainId != null ? user.getDomain(domainId) : user.getDefaultDomain();
        if (domainId != null && domain == null) {
            domain = user.createDomain(domainId);
        }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    @Argument(index = 0, name = "application", required = true, description = "The target application.")
    String applicationName;

    @Override
    protected Object doExecute() throws Exception {
        IOpenShiftConnection connection = getOrCreateConnection();
        for (IDomain domain : connection.getDomains()) {
            if (domainId == null || domainId.equals(domain.getId())) {
                IApplication application = domain.getApplicationByName(applicationName);
                System.out.println(String.format(FORMAT, "Name:", application.getName()));
                System.out.println(String.format(FORMAT, "UUID:", application.getUUID()));
                System.out.println(String.format(FORMAT, "Application URL:", application.getApplicationUrl()));
View Full Code Here
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.