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": {},
...
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"
},
...