当前位置: 首页>>代码示例>>Java>>正文


Java ListApplicationsRequest类代码示例

本文整理汇总了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();
	}
 
开发者ID:spring-cloud,项目名称:spring-cloud-spinnaker,代码行数:20,代码来源:ModuleService.java

示例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()));
}
 
开发者ID:orange-cloudfoundry,项目名称:sec-group-broker-filter,代码行数:16,代码来源:CloudFoundryCleaner.java

示例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);
            }
        });
    }
}
 
开发者ID:Sounie,项目名称:springer-gocd-cloudfoundry-plugin,代码行数:21,代码来源:LocalCfTest.java

示例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());
        }
    });
}
 
开发者ID:Sounie,项目名称:springer-gocd-cloudfoundry-plugin,代码行数:18,代码来源:LocalCfTest.java

示例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));
                }
        );
    }
}
 
开发者ID:Sounie,项目名称:springer-gocd-cloudfoundry-plugin,代码行数:30,代码来源:LocalCfTest.java


注:本文中的org.cloudfoundry.client.v2.applications.ListApplicationsRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。