maintenance_info is not updating using CF Java Client
search cancel

maintenance_info is not updating using CF Java Client

book

Article ID: 424956

calendar_today

Updated On:

Products

VMware Tanzu Platform Spring

Issue/Introduction

When using CF Java Client to update the maintenance_info on an instance, it is not getting updated. It shows "null" or empty

Example:

~ % cf curl /v3/service_instances/################# | jq
{
  "guid": "#################",
  "created_at": "2026-01-07T19:48:23Z",
  "updated_at": "2026-01-07T20:19:56Z",
  "name": "example-service",
...
  "type": "managed",
  "maintenance_info": {},
...

Resolution

You need to use the MaintenanceInfo object to update this field. Below is an example code snippet of how it might be used with CF Java Client:

        MaintenanceInfo maintenanceInfo = MaintenanceInfo.builder()
                .version("3.3.8")
                .build();

        UpdateServiceInstanceRequest updateServiceInstanceRequest = UpdateServiceInstanceRequest.builder()
                .serviceInstanceName("example-service")
                .maintenanceInfo(maintenanceInfo)
                .build();

        cloudFoundryOperations.services().updateInstance(updateServiceInstanceRequest).block();

 

After updating the instance, you should see the maintenance info:

~ % cf curl /v3/service_instances/################# | jq
{
  "guid": "#################",
  "created_at": "2026-01-07T19:48:23Z",
  "updated_at": "2026-01-07T20:19:56Z",
  "name": "example-service",
...
  "type": "managed",
  "maintenance_info": {
    "version": "3.3.8"
  },
...