コード例 #1
0
 private Mono<String> startApplication(String applicationId) {
   return this.cloudFoundryClient
       .applicationsV2()
       .update(
           UpdateApplicationRequest.builder()
               .applicationId(applicationId)
               .state("STARTED")
               .build())
       .map(ResourceUtils::getId)
       .then(this::waitForStaging)
       .then(this::waitForStarting);
 }
コード例 #2
0
 private static Mono<AbstractApplicationResource> requestUpdateApplicationState(
     CloudFoundryClient cloudFoundryClient, String applicationId, String state) {
   return cloudFoundryClient
       .applicationsV2()
       .update(
           UpdateApplicationRequest.builder().applicationId(applicationId).state(state).build())
       .map(
           new Function<UpdateApplicationResponse, AbstractApplicationResource>() {
             @Override
             public AbstractApplicationResource apply(UpdateApplicationResponse x) {
               return x;
             }
           });
 }
コード例 #3
0
 @Test
 public void update() {
   this.applicationId
       .then(
           applicationId ->
               this.cloudFoundryClient
                   .applicationsV2()
                   .update(
                       UpdateApplicationRequest.builder()
                           .applicationId(applicationId)
                           .name("another-test-application-name")
                           .build())
                   .map(ResourceUtils::getId))
       .then(
           applicationId ->
               this.cloudFoundryClient
                   .applicationsV2()
                   .get(GetApplicationRequest.builder().applicationId(applicationId).build())
                   .map(response -> response.getEntity().getName()))
       .subscribe(testSubscriber().assertEquals("another-test-application-name"));
 }
コード例 #4
0
 private static Mono<AbstractApplicationResource> requestUpdateApplicationScale(
     CloudFoundryClient cloudFoundryClient,
     String applicationId,
     Integer disk,
     Integer instances,
     Integer memory) {
   return cloudFoundryClient
       .applicationsV2()
       .update(
           UpdateApplicationRequest.builder()
               .applicationId(applicationId)
               .diskQuota(disk)
               .instances(instances)
               .memory(memory)
               .build())
       .map(
           new Function<UpdateApplicationResponse, AbstractApplicationResource>() {
             @Override
             public AbstractApplicationResource apply(UpdateApplicationResponse x) {
               return x;
             }
           });
 }
コード例 #5
0
 private static Mono<UpdateApplicationResponse> requestUpdateApplicationRename(
     CloudFoundryClient cloudFoundryClient, String applicationId, final String name) {
   return cloudFoundryClient
       .applicationsV2()
       .update(UpdateApplicationRequest.builder().applicationId(applicationId).name(name).build());
 }