How to set service or CI to maintenance using REST API call

Document ID : KB000121887
Last Modified Date : 03/12/2018
Show Technical Document Details
I was trying to set a CI to maintenance following procedure provided in "" but getting "unsupported Media Type" response from Rest. 
To set the Service to Maintenance using REST call 
For Service run following REST call to get the service ID 

GET https://<SOIUI hostname>:7403/rest/service?includeDetails=STATUS 

Once you extract the service ID from the above response run 

PUT https://<SOIUI hostname>:7403/rest/service/ServiceID extracted from above response 

The Body should look like the following 


Content-Type (or Media Type) - application/ 
To set the CI to Maintenance using REST call 

Run the following REST call to get the connector ID the CI belongs to 

GET https://<UI_Server>:<HTTPS_PORT>/rest/connector?includeDetails=NONE 

Following example would get you the CI ID for ComputerSystem class CI 

GET https://<UI_Server>:<HTTPS_PORT>/rest/repositoryCI?connectorId=<Type the Connector ID here>&classtype=ComputerSystem 

Following REST call will set the CI to maintenance 

PUT https://<UI_Server>:<HTTPS_PORT>/rest/repositoryCI/<type the CI ID from above response> 

The Body should look like this 

<CIuserAttribute1>New Attribute 1</CIuserAttribute1> 
<CIuserAttribute2>New Attribute 2</CIuserAttribute2> 
<CIuserAttribute3>New Attribute 3</CIuserAttribute3> 
<CIuserAttribute4>New Attribute 4</CIuserAttribute4> 
<CIuserAttribute5>New Attribute 5</CIuserAttribute5> 
<CIuserAttribute6>New Attribute 6</CIuserAttribute6> 
<CIuserAttribute7>New Attribute 7</CIuserAttribute7> 
<CIuserAttribute8>New Attribute 8</CIuserAttribute8> 
<CIuserAttribute9>New Attribute 9</CIuserAttribute9> 
<CIuserAttribute10>New Attribute 10</CIuserAttribute10> 

Content-Type (or Media Type) - application/ 

You can access all the valid SOI REST calls from here 
https://<SOIUI Host name>:7403/rest/docs/rest/resource_RootResource.html