本文整理汇总了Java中org.cloudfoundry.client.v2.applications.ListApplicationsRequest类的典型用法代码示例。如果您正苦于以下问题:Java ListApplicationsRequest类的具体用法?Java ListApplicationsRequest怎么用?Java ListApplicationsRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ListApplicationsRequest类属于org.cloudfoundry.client.v2.applications包,在下文中一共展示了ListApplicationsRequest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: link
import org.cloudfoundry.client.v2.applications.ListApplicationsRequest; //导入依赖的package包/类
public String link(String module, URL api, String email, String password) {
CloudFoundryClient client = appDeployerFactory.getCloudFoundryClient(email, password, api);
return PaginationUtils.requestClientV2Resources(page -> client.applicationsV2()
.list(ListApplicationsRequest.builder()
.name(module)
.build()))
.flatMap(applicationResource -> client.spaces()
.get(GetSpaceRequest.builder()
.spaceId(applicationResource.getEntity().getSpaceId())
.build())
.map(spaceResponse -> Tuples.of(spaceResponse, applicationResource)))
.map(function((spaceResponse, applicationResource) ->
"/organizations/" + spaceResponse.getEntity().getOrganizationId() +
"/spaces/" + spaceResponse.getMetadata().getId() +
"/applications/" + applicationResource.getMetadata().getId()))
.blockFirst();
}
示例2: cleanApplicationsV2
import org.cloudfoundry.client.v2.applications.ListApplicationsRequest; //导入依赖的package包/类
private static Flux<Void> cleanApplicationsV2(CloudFoundryClient cloudFoundryClient) {
return PaginationUtils.
requestClientV2Resources(page -> cloudFoundryClient.applicationsV2()
.list(ListApplicationsRequest.builder()
.page(page)
.build()))
.filter(application -> ResourceUtils.getEntity(application).getName().startsWith("test-application-"))
.map(ResourceUtils::getId)
.flatMap(applicationId -> removeServiceBindings(cloudFoundryClient, applicationId)
.thenMany(Flux.just(applicationId)))
.flatMap(applicationId -> cloudFoundryClient.applicationsV2()
.delete(DeleteApplicationRequest.builder()
.applicationId(applicationId)
.build()));
}
示例3: accumulateV2Apps
import org.cloudfoundry.client.v2.applications.ListApplicationsRequest; //导入依赖的package包/类
private void accumulateV2Apps(ReactorCloudFoundryClient client, String appName, List<String> matchingApps) {
ApplicationsV2 applicationsV2 = client.applicationsV2();
ListApplicationsRequest listApplicationsRequest = ListApplicationsRequest.builder()
.build();
Mono<ListApplicationsResponse> responseMono = applicationsV2.list(listApplicationsRequest);
ListApplicationsResponse response = responseMono.block();
if (response.getTotalResults() > 0) {
System.out.println(response.getTotalResults());
response.getResources().forEach(app ->
{
if (app.getEntity().getName().equals(appName)) {
matchingApps.add(appName);
}
});
}
}
示例4: accumulateV3Apps
import org.cloudfoundry.client.v2.applications.ListApplicationsRequest; //导入依赖的package包/类
private void accumulateV3Apps(ReactorCloudFoundryClient client, String appName, List<String> matchingApps) {
ApplicationsV3 applicationsV3 = client.applicationsV3();
org.cloudfoundry.client.v3.applications.ListApplicationsRequest listApplicationsRequest =
org.cloudfoundry.client.v3.applications.ListApplicationsRequest.builder()
.build();
Mono<org.cloudfoundry.client.v3.applications.ListApplicationsResponse> responseMono = applicationsV3.list(listApplicationsRequest);
org.cloudfoundry.client.v3.applications.ListApplicationsResponse response = responseMono.block();
response.getResources().forEach(app ->
{
if (app.getName().equals(appName)) {
matchingApps.add(app.getName());
}
});
}
示例5: shouldParseAppDates
import org.cloudfoundry.client.v2.applications.ListApplicationsRequest; //导入依赖的package包/类
@Test
public void shouldParseAppDates() {
if (majorApiVersion == 2) {
Mono<ListApplicationsResponse> responseMono = client.applicationsV2().list(ListApplicationsRequest.builder().build());
ListApplicationsResponse listApplicationsResponse = responseMono.block(Duration.ofSeconds(5L));
Integer totalResults = listApplicationsResponse.getTotalResults();
assertThat(totalResults, greaterThan(0));
List<ApplicationResource> resources = listApplicationsResponse.getResources();
resources.forEach(
r -> {
Date created = null;
Date updated = null;
try {
created = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss").parse(r.getMetadata().getCreatedAt());
updated = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss").parse(r.getMetadata().getUpdatedAt());
System.out.println("DEBUG - state " + r.getEntity().getState());
} catch (ParseException e) {
e.printStackTrace();
}
assertThat(updated.getTime() > created.getTime(), is(true));
}
);
}
}