Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/com/openshift/client/IApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ public interface IApplication extends IOpenShiftResource {
*/
public String getGitUrl();

/**
* Returns the url to use to connect with ssh.
*
* @return the url to use to connect with ssh.
*/
public String getSshUrl();

/**
* Returns the git url that the application will get its initial code and configuration from.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ public class ApplicationResource extends AbstractOpenShiftResource implements IA
/** The url of this application. */
private final String applicationUrl;

/** The url to use to connect with ssh.*/
private final String sshUrl;

/** The url at which the git repo of this application may be reached. */
private final String gitUrl;

Expand Down Expand Up @@ -155,7 +158,7 @@ public class ApplicationResource extends AbstractOpenShiftResource implements IA

protected ApplicationResource(ApplicationResourceDTO dto, DomainResource domain) {
this(dto.getName(), dto.getUuid(), dto.getCreationTime(), dto.getMessages(), dto.getApplicationUrl(),
dto.getGitUrl(), dto.getInitialGitUrl(), dto.getGearProfile(), dto.getApplicationScale(),
dto.getSshUrl(), dto.getGitUrl(), dto.getInitialGitUrl(), dto.getGearProfile(), dto.getApplicationScale(),
dto.getAliases(), dto.getCartridges(), dto.getLinks(), domain);
}

Expand All @@ -174,6 +177,8 @@ protected ApplicationResource(ApplicationResourceDTO dto, DomainResource domain)
* the application url
* @param gitUrl
* the git url
* @param sshUrl
* the ssh url
* @param cartridge
* the cartridge (type/framework)
* @param aliases
Expand All @@ -185,7 +190,7 @@ protected ApplicationResource(ApplicationResourceDTO dto, DomainResource domain)
* @throws DatatypeConfigurationException
*/
protected ApplicationResource(final String name, final String uuid, final String creationTime,
final Messages messages, final String applicationUrl, final String gitUrl,
final Messages messages, final String applicationUrl, final String sshUrl, final String gitUrl,
final String initialGitUrl, final IGearProfile gearProfile, final ApplicationScale scale, final List<String> aliases,
final Map<String, CartridgeResourceDTO> cartridgesByName, final Map<String, Link> links,
final DomainResource domain) {
Expand All @@ -196,6 +201,7 @@ protected ApplicationResource(final String name, final String uuid, final String
this.scale = scale;
this.gearProfile = gearProfile;
this.applicationUrl = applicationUrl;
this.sshUrl = sshUrl;
this.gitUrl = gitUrl;
this.initialGitUrl = initialGitUrl;
this.domain = domain;
Expand Down Expand Up @@ -310,6 +316,13 @@ public String getInitialGitUrl() {
return initialGitUrl;
}

/**
* @return the sshUrl
*/
public String getSshUrl() {
return sshUrl;
}

public String getApplicationUrl() {
return applicationUrl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public class ApplicationResourceDTO extends BaseResourceDTO {
/** the application's url. */
private final String applicationUrl;

/** the ssh url. */
private final String sshUrl;

/** the application's git repository url. */
private final String gitUrl;

Expand All @@ -71,7 +74,7 @@ public class ApplicationResourceDTO extends BaseResourceDTO {
*/
ApplicationResourceDTO(final String framework, final String domainId, final String creationTime,
final String name, final IGearProfile gearProfile, final ApplicationScale scale, final String uuid,
final String applicationUrl, final String gitUrl, final String initialGitUrl, final List<String> aliases,
final String applicationUrl, final String sshUrl, final String gitUrl, final String initialGitUrl, final List<String> aliases,
final Map<String, CartridgeResourceDTO> cartridgeByName, final Map<String, Link> links, Messages messages) {
super(links, messages);
this.framework = framework;
Expand All @@ -82,6 +85,7 @@ public class ApplicationResourceDTO extends BaseResourceDTO {
this.gearProfile = gearProfile;
this.scale = scale;
this.applicationUrl = applicationUrl;
this.sshUrl = sshUrl;
this.gitUrl = gitUrl;
this.initialGitUrl = initialGitUrl;
this.aliases = aliases;
Expand Down Expand Up @@ -153,6 +157,14 @@ public final String getUuid() {
public final String getApplicationUrl() {
return applicationUrl;
}

/**
* @return the url to use to connect with ssh
*/
public String getSshUrl() {
return sshUrl;
}


/**
* @return the url at which this applications git repo may be reached at
Expand Down Expand Up @@ -187,4 +199,5 @@ public String toString() {
+ "]";
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import static com.openshift.internal.client.utils.IOpenShiftJsonConstants.PROPERTY_REL;
import static com.openshift.internal.client.utils.IOpenShiftJsonConstants.PROPERTY_REQUIRED_PARAMS;
import static com.openshift.internal.client.utils.IOpenShiftJsonConstants.PROPERTY_SCALABLE;
import static com.openshift.internal.client.utils.IOpenShiftJsonConstants.PROPERTY_SSH_URL;
import static com.openshift.internal.client.utils.IOpenShiftJsonConstants.PROPERTY_SUFFIX;
import static com.openshift.internal.client.utils.IOpenShiftJsonConstants.PROPERTY_TYPE;
import static com.openshift.internal.client.utils.IOpenShiftJsonConstants.PROPERTY_URL;
Expand Down Expand Up @@ -405,6 +406,7 @@ private ApplicationResourceDTO createApplication(ModelNode appNode, Messages mes
final ApplicationScale scalable = ApplicationScale.safeValueOf(getAsString(appNode, PROPERTY_SCALABLE));
final IGearProfile gearProfile = createGearProfile(appNode);
final String applicationUrl = getAsString(appNode, PROPERTY_APP_URL);
final String sshUrl = getAsString(appNode, PROPERTY_SSH_URL);
final String gitUrl = getAsString(appNode, PROPERTY_GIT_URL);
final String initialGitUrl = getAsString(appNode, PROPERTY_INITIAL_GIT_URL);
final String domainId = getAsString(appNode, PROPERTY_DOMAIN_ID);
Expand All @@ -421,6 +423,7 @@ private ApplicationResourceDTO createApplication(ModelNode appNode, Messages mes
scalable,
uuid,
applicationUrl,
sshUrl,
gitUrl,
initialGitUrl,
aliases,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public class IOpenShiftJsonConstants {
public static final String PROPERTY_SSH = "ssh";
public static final String PROPERTY_SSH_KEY = "ssh_key";
public static final String PROPERTY_SSH_TYPE = "ssh_type";
public static final String PROPERTY_SSH_URL = "ssh_url";
public static final String PROPERTY_STATUS = "status";
public static final String PROPERTY_SUFFIX = "suffix";
public static final String PROPERTY_TEXT = "text";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public void shouldUnmarshallGetApplicationsWith2AppsResponseBody() throws Throwa
assertThat(applicationDTO.getDomainId()).isEqualTo("foobarz");
assertThat(applicationDTO.getCreationTime()).isEqualTo("2013-09-20T21:28:53Z");
assertThat(applicationDTO.getApplicationUrl()).isEqualTo("http://springeap6-foobarz.rhcloud.com/");
assertThat(applicationDTO.getSshUrl()).isEqualTo("ssh://523cbe15e0b8cd0a520001b6@springeap6-foobarz.rhcloud.com");
assertThat(applicationDTO.getFramework()).isEqualTo(Cartridges.JBOSSEAP_6_NAME);
assertThat(applicationDTO.getName()).isEqualTo("springeap6");
assertThat(applicationDTO.getApplicationScale()).isEqualTo(ApplicationScale.NO_SCALE);
Expand Down