Skip to content

Commit

Permalink
Adds support for new v2 & v3 API fields (#1248)
Browse files Browse the repository at this point in the history
* adds support for new v2 & v3 API fields

* run spotless:apply

---------

Co-authored-by: Anthony Dahanne <[email protected]>
  • Loading branch information
pivotal-david-osullivan and anthonydahanne authored Nov 1, 2024
1 parent 1fffc4c commit 0e3d9ab
Show file tree
Hide file tree
Showing 37 changed files with 438 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ void getUsageSummary() {
UsageSummary.builder()
.startedInstances(3)
.memoryInMb(50)
.routes(0)
.serviceInstances(0)
.reservedPorts(0)
.perAppTasks(2)
.domains(2)
.serviceKeys(0)
.build())
.link(
"self",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ void getOpenIdProviderConfigurationRequest() {
.supportedUiLocale(Locale.US)
.tokenEndpoint("http://localhost/oauth/token")
.userInfoEndpoint("http://localhost/userinfo")
.endSessionEndpoint("http://localhost/logout.do")
.build())
.expectComplete()
.verify(Duration.ofSeconds(5));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
{
"usage_summary": {
"started_instances": 3,
"memory_in_mb": 50
"memory_in_mb": 50,
"routes": 0,
"service_instances": 0,
"reserved_ports": 0,
"per_app_tasks": 2,
"domains": 2,
"service_keys": 0
},
"links": {
"self": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
],
"claims_parameter_supported": false,
"service_documentation": "http://docs.cloudfoundry.org/api/uaa/",
"end_session_endpoint": "http://localhost/logout.do",
"ui_locales_supported": [
"en-US"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public interface CloudFoundryClient {
/**
* The currently supported Cloud Controller API version
*/
String SUPPORTED_API_VERSION = "2.186.0";
String SUPPORTED_API_VERSION = "2.233.0";

/**
* Main entry point to the Cloud Foundry Application Usage Events Client API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,11 @@ abstract class _ApplicationEntity extends AbstractApplicationEntity {
@Nullable
abstract String getVersion();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit")
@Nullable
abstract Integer getLogRateLimit();

}
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,11 @@ abstract class _ApplicationInstanceInfo {
@Nullable
abstract Long getUptime();

/**
* Routable
*/
@JsonProperty("routable")
@Nullable
abstract String getRoutable();

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,11 @@ abstract class _InstanceStatistics {
@Nullable
abstract Statistics getStatistics();

/**
* Routable
*/
@JsonProperty("routable")
@Nullable
abstract String getRoutable();

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,11 @@ abstract class _RestageApplicationEntity extends AbstractApplicationEntity {
@Nullable
abstract String getVersion();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit")
@Nullable
abstract Integer getLogRateLimit();

}
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,11 @@ abstract class _Statistics {
@Nullable
abstract Usage getUsage();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit")
@Nullable
abstract Integer getLogRateLimit();

}
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,11 @@ abstract class _SummaryApplicationResponse extends AbstractApplicationEntity {
@Nullable
abstract String getVersion();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit")
@Nullable
abstract Integer getLogRateLimit();

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ abstract class _Usage {
@Nullable
abstract Double getCpu();

/**
* The CPU entitlement
*/
@JsonProperty("cpu_entitlement")
@Nullable
abstract Double getCpuEntitlement();

/**
* The disk usage
*/
Expand All @@ -56,4 +63,11 @@ abstract class _Usage {
@Nullable
abstract String getTime();

/**
* The log rate limit
*/
@JsonProperty("log_rate")
@Nullable
abstract Integer getLogRate();

}
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,11 @@ abstract class _CreateOrganizationQuotaDefinitionRequest {
@Nullable
abstract Boolean getTrialDatabaseAllowed();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit")
@Nullable
abstract Integer getLogRateLimit();

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.cloudfoundry.Nullable;
import org.immutables.value.Value;
import org.immutables.value.Value.Default;

/**
* The entity response payload for the Quota Definition resource
Expand Down Expand Up @@ -113,4 +114,13 @@ abstract class _OrganizationQuotaDefinitionEntity {
@Nullable
abstract Boolean getTrialDatabaseAllowed();

/**
* The log rate limit
*/
@Value.Default
@JsonProperty("log_rate_limit")
@Nullable
Integer getLogRateLimit(){
return -1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,12 @@ abstract class _SummaryOrganizationResponse {
@Nullable
abstract String getStatus();

/**
* mode
*/
@JsonProperty("mode")
@Nullable
abstract String getMode();


}
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,11 @@ abstract class _SpaceQuotaDefinitionEntity {
@Nullable
abstract Integer getTotalServices();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit")
@Nullable
abstract Integer getLogRateLimit();

}
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,11 @@ abstract class _SpaceApplicationSummary extends AbstractApplicationEntity {
@Nullable
abstract String getVersion();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit")
@Nullable
abstract Integer getLogRateLimit();

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,18 @@ abstract class _StackEntity {
@Nullable
abstract String getName();

/**
* Build RootFS Image
*/
@JsonProperty("build_rootfs_image")
@Nullable
abstract String getBuildRootfsImage();

/**
* Run RootFS Image
*/
@JsonProperty("run_rootfs_image")
@Nullable
abstract String getRunRootfsImage();

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

import org.cloudfoundry.Nullable;
import org.immutables.value.Value;

/**
Expand All @@ -39,4 +41,46 @@ abstract class _UsageSummary {
@JsonProperty("started_instances")
abstract Integer getStartedInstances();

/**
* The number of routes
*/
@JsonProperty("routes")
@Nullable
abstract Integer getRoutes();

/**
* The number of service instances
*/
@JsonProperty("service_instances")
@Nullable
abstract Integer getServiceInstances();

/**
* The number of reserved ports
*/
@JsonProperty("reserved_ports")
@Nullable
abstract Integer getReservedPorts();

/**
* The number of domains
*/
@JsonProperty("domains")
@Nullable
abstract Integer getDomains();

/**
* The number of tasks per app
*/
@JsonProperty("per_app_tasks")
@Nullable
abstract Integer getPerAppTasks();

/**
* The number of service keys
*/
@JsonProperty("service_keys")
@Nullable
abstract Integer getServiceKeys();

}
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,11 @@ public abstract class Build extends Resource {
@JsonProperty("staging_disk_in_mb")
@Nullable
public abstract Integer getStagingDisk();

/**
* Log rate limit in bytes per second allocated for staging of the build
*/
@JsonProperty("staging_log_rate_limit_bytes_per_second")
@Nullable
public abstract Integer getStagingLogRateLimitBytesPerSecond();
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.cloudfoundry.client.v3.processes;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.cloudfoundry.Nullable;
import org.cloudfoundry.client.v3.Metadata;
import org.cloudfoundry.client.v3.Resource;

Expand Down Expand Up @@ -72,4 +73,18 @@ public abstract class Process extends Resource {
*/
@JsonProperty("type")
public abstract String getType();

/**
* The version UUID
*/
@JsonProperty("version")
@Nullable
public abstract String getVersion();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit_in_bytes_per_second")
@Nullable
public abstract Integer getLogRateLimitInBytesPerSecond();
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,25 @@ public abstract class ProcessStatistics {
@JsonProperty("usage")
@Nullable
public abstract ProcessUsage getUsage();

/**
* Routable
*/
@JsonProperty("routable")
@Nullable
abstract String getRoutable();

/**
* The internal IP address of the instance
*/
@JsonProperty("instance_internal_ip")
@Nullable
public abstract String getInstanceInternalIp();

/**
* The log rate limit
*/
@JsonProperty("log_rate_limit")
@Nullable
abstract Integer getLogRateLimit();
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,18 @@ abstract class _ProcessUsage {
@Nullable
abstract String getTime();

/**
* The CPU entitlement
*/
@JsonProperty("cpu_entitlement")
@Nullable
abstract Double getCpuEntitlement();

/**
* The current logging usage of the instance
*/
@JsonProperty("log_rate")
@Nullable
abstract Integer getLogRateLimit();

}
Loading

0 comments on commit 0e3d9ab

Please sign in to comment.