@Override public String toString() { return "CloudApplication [staging=" + staging + ", instances=" + instances + ", name=" + getName() + ", memory=" + memory + ", diskQuota=" + diskQuota + ", state=" + state + ", debug=" + debug + ", uris=" + uris + ", services=" + services + ", env=" + env + ", space=" + space.getName() + "]"; }
public CloudApplication(String name, String command, String buildpackUrl, int memory, int instances, List<String> uris, List<String> serviceNames, AppState state) { super(CloudEntity.Meta.defaultMeta(), name); this.staging = new Staging(command, buildpackUrl); this.memory = memory; this.instances = instances; this.uris = uris; this.services = serviceNames; this.state = state; }
private CloudControllerClient getClientForApplicationSpace(ExecutionWrapper execution, CloudApplication app) { CloudSpace space = app.getSpace(); CloudOrganization organization = space.getOrganization(); return execution.getControllerClient(organization.getName(), space.getName()); }
public CloudFoundrySpace(CloudSpace space) { this(space.getOrganization().getName(), space.getName()); this.space = space; }
@Override public void deleteSpace(String spaceName) { assertSpaceProvided("delete a space"); UUID orgGuid = sessionSpace.getOrganization().getMeta().getGuid(); UUID spaceGuid = getSpaceGuid(spaceName, orgGuid); if (spaceGuid != null) { doDeleteSpace(spaceGuid); } }
public CloudApplication(String name, String command, String buildpackUrl, int memory, int instances, List<String> uris, List<String> serviceNames, AppState state) { super(CloudEntity.Meta.defaultMeta(), name); this.staging = new Staging.StagingBuilder().command(command) .buildpackUrl(buildpackUrl) .build(); this.memory = memory; this.instances = instances; this.uris = uris; this.services = serviceNames; this.state = state; }
private boolean isApplicationReady(CloudApplication application) { /* * RestTemplate restTemplate = new RestTemplate(); String response = * restTemplate.getForObject(application.getUris().get(0), * String.class); if * (response.contains("B29 ROUTER: 404 - FILE NOT FOUND")) { return * false; } */ return AppState.STARTED.equals(application.getState()); }
CloudApplication toCloudApplication() { CloudApplication app = new CloudApplication(Meta.defaultMeta(), name); app.setEnv(env); return app; } }
private CloudDomain mapDomainResource(Map<String, Object> resource) { @SuppressWarnings("unchecked") Map<String, Object> ownerResource = getAttributeOfV2Resource(resource, "owning_organization", Map.class); CloudOrganization owner; if (ownerResource == null) { owner = new CloudOrganization(CloudEntity.Meta.defaultMeta(), "none"); } else { owner = mapOrganizationResource(ownerResource); } return new CloudDomain(getV2Meta(resource), getNameOfV2Resource(resource), owner); }
/** * Set quota to organization * * @param orgName * @param quotaName */ public void setQuotaToOrg(String orgName, String quotaName) { CloudQuota quota = this.getQuotaByName(quotaName, true); CloudOrganization org = this.getOrgByName(orgName, true); doSetQuotaToOrg(org.getMeta().getGuid(), quota.getMeta().getGuid()); }
@Override public Upload getUploadStatus(String uploadToken) { CloudPackage cloudPackage = getCloudPackage(uploadToken); ErrorDetails errorDetails = new ErrorDetails(0, cloudPackage.getData() .getError(), null); return new Upload(cloudPackage.getStatus(), errorDetails); }
@Override public void createSpace(String spaceName) { assertSpaceProvided("create a new space"); UUID orgGuid = sessionSpace.getOrganization() .getMeta() .getGuid(); UUID spaceGuid = getSpaceGuid(spaceName, orgGuid); if (spaceGuid == null) { doCreateSpace(spaceName, orgGuid); } }
@Override public String toString() { return "CloudApplication [staging=" + staging + ", instances=" + instances + ", name=" + getName() + ", memory=" + memory + ", diskQuota=" + diskQuota + ", state=" + state + ", debug=" + debug + ", uris=" + uris + ", services=" + services + ", env=" + env + ", space=" + space.getName() + "]"; } }
@Override public void deleteSpace(String spaceName) { assertSpaceProvided("delete a space"); UUID orgGuid = sessionSpace.getOrganization() .getMeta() .getGuid(); UUID spaceGuid = getSpaceGuid(spaceName, orgGuid); if (spaceGuid != null) { doDeleteSpace(spaceGuid); } }