Examples of IOpenShiftConnection


Examples of com.openshift.client.IOpenShiftConnection

  private HttpClientMockDirector mockDirector;

  @Before
  public void setUp() throws SocketTimeoutException, HttpClientException, Throwable {
    this.mockDirector = new HttpClientMockDirector();
    final IOpenShiftConnection connection =
        new TestConnectionBuilder().defaultCredentials().create(mockDirector.client());
    this.user = connection.getUser();
  }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    // pre-condition
    IDomain domain = DomainTestUtils.ensureHasDomain(connection.getUser());
    assertThat(domain).isNotNull();
    String domainId = domain.getId();
    assertThat(domainId).isNotEmpty();
    IOpenShiftConnection connection = new TestConnectionBuilder().defaultCredentials().disableSSLCertificateChecks().create();
    APIResource api = ((APIResource) connection);
   
    // operation
    IDomain retrievedDomain = api.showDomain(domainId);
   
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

      return false;
    }
  }

  public Future<Boolean> waitForAccessibleAsync(final long timeout) throws OpenShiftException {
    IOpenShiftConnection connection = getConnection();
    return connection.getExecutorService().submit(new Callable<Boolean>() {

      public Boolean call() throws Exception {
        return waitForAccessible(timeout);
      }
    });
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

                } catch (MalformedURLException e) {
                    LOGGER.error("Failed to create DeploymentUpdater. " + e, e);
                }
                if (deployTask != null && OpenShiftUtils.isFabricManaged(openshiftConfiguration)) {
                    String containerId = container.getId();
                    IOpenShiftConnection connection = OpenShiftUtils.createConnection(container);
                    CreateOpenshiftContainerOptions options = OpenShiftUtils.getCreateOptions(container);
                    if (connection == null || options == null) {
                        LOGGER.warn(
                                "Ignoring container which has no openshift connection or options. connection: "
                                        + connection + " options: " + options);
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

        CreateOpenshiftContainerMetadata metadata = getContainerMetadata(container);
        if (metadata == null) {
            return null;
        }
        CreateOpenshiftContainerOptions options = metadata.getCreateOptions();
        IOpenShiftConnection connection = OpenShiftUtils.createConnection(options);
        String containerName = container.getId();
        IDomain domain = connection.getUser().getDomain(metadata.getDomainId());
        return domain.getApplicationByName(containerName);
    }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    /**
     * Returns an existing connection or attempts to create one.
     */
    IOpenShiftConnection getOrCreateConnection() {
        IOpenShiftConnection connection = null;
        if (connectionListener != null) {
            connection = connectionListener.getConnection();
        }
        if (connection == null) {
            connection = createConnection();
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    @Option(name = "--domain", required = false, description = "Show only applications of that domain.")
    String domainId;

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

        TablePrinter printer = new TablePrinter();
        printer.columns("domain", "application id");

        for (IDomain domain : connection.getDomains()) {
            if (domainId == null || domainId.equals(domain.getId())) {
                String displayDomain = domain.getId();
                domain.refresh();
                for (IApplication application : domain.getApplications()) {
                    printer.row(displayDomain, application.getName());
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.restart();
            }
        }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

    }


    public List<String> getDomains(String serverUrl, String login, String password) {
        List<String> answer = new ArrayList<String>();
        IOpenShiftConnection connection = OpenShiftUtils.createConnection(serverUrl, login, password);
        if (connection != null) {
            List<IDomain> domains = connection.getDomains();
            if (domains != null) {
                for (IDomain domain : domains) {
                    answer.add(domain.getId());
                }
            }
View Full Code Here

Examples of com.openshift.client.IOpenShiftConnection

        return answer;
    }

    public List<String> getGearProfiles(String serverUrl, String login, String password) {
        List<String> answer = new ArrayList<String>();
        IOpenShiftConnection connection = OpenShiftUtils.createConnection(serverUrl, login, password);
        if (connection != null) {
            List<IDomain> domains = connection.getDomains();
            if (domains != null) {
                for (IDomain domain : domains) {
                    List<IGearProfile> gearProfiles = domain.getAvailableGearProfiles();
                    for (IGearProfile gearProfile : gearProfiles) {
                        answer.add(gearProfile.getName());
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.