Get the Build Version and Daily Maintenance Window Time

Returns information about the current build version and the scheduled daily maintenance window time.

This API is version v1.

Before using the REST resources, you must understand how to access the REST resources and other important concepts. See About the REST APIs. Using these REST APIs requires prerequisites. See Prerequisites.

REST Resource

GET /interop/rest/{api_version}/services/dailymaintenance

Parameters:

The following table summarizes the request parameters.

Table 7-2 Parameters

Name Description Type Required Default
api_version Specific API version Path Yes None

Response

Supported Media Types: application/json

Table 7-3 Parameters

Parameters Description
details In case of errors, details are published with the error string
status See Migration Status Codes
items Detailed information about the API
amwTime Scheduled time for the daily maintenance window time in 24 hour format. The time is provided with respect to the existing time zone.
buildVersion Current build version
links Detailed information about the link
href Links to API call
action The HTTP call type
rel Possible value: self
data Parameters as key value pairs passed in the request

Example of Response Body

The following shows an example of the response body in JSON format.

{
"details":null,
"links":[
{
"rel":"self","href":"https://<SERVICE_NAME>-<TENANT_NAME>.<SERVICE_TYPE>.<dcX>.oraclecloud.com/interop/rest/v1/services/dailymaintenance",
"data":"null",
"action":"GET"}],
"status":"0",
"items":[
{
"amwTime":"19",
"buildVersion":"16.10.17"}
]
}

Get Build Version and Daily Maintenance Time Sample Code

Example 7-1 Java Sample – GetMaintenanceDetails.java

Prerequisites: json.jar

Common Functions: See Common Helper Functions for Java

//
// BEGIN
//
public void getMaintenanceDetails () throws Exception {
	String urlString = String.format("%s/interop/rest/v1/services/dailymaintenance", serverUrl);
	String response = executeRequest(urlString, "GET", null);
	JSONObject json = new JSONObject(response);
	int resStatus = json.getInt("status");
	if (resStatus == 0) {
		JSONArray fileList = json.getJSONArray("items");
		System.out.println("List of items are :");
		JSONObject jObj = null;
		for(int i=0; i<fileList.length(); i++){
			jObj = (JSONObject)fileList.get(i);
			System.out.println("build version :" + jObj.getString("buildVersion"));
			System.out.println("AMW time :" + jObj.getString("amwTime"));
			System.out.println("Link :" + ((JSONObject) ((JSONArray)json.getJSONArray("links")).get(0)).getString("href") + "\n");
		}
	}
}
//
// END
//

Example 7-2 cURL Sample – GetMaintenanceDetails.sh

Prerequisites: jq (http://stedolan.github.io/jq/download/linux64/jq)

Common Functions: See Common Helper Functions for cURL

funcGetMaintenanceDetails () {
	url=$SERVER_URL/interop/rest/v1/services/dailymaintenance
	funcExecuteRequest "GET" $url

	output=`cat response.txt`
	status=`echo $output | jq '.status'`
	if [ $status == 0 ]; then
		echo "List of items :"
		count=`echo $output | jq '.items | length'`
		i=0
		while [ $i -lt $count ]; do
			echo "Build Version : " `echo $output | jq '.items['$i'].buildVersion'`
			echo "AMW Time :" `echo $output | jq '.items['$i'].amwTime`
			echo "Link :" `echo $output | jq '.links[0].href'`
			echo ""
			i=`expr $i + 1`
		done
	else
		error=`echo $output | jq '.details'`
		echo "Error occurred. " $error
	fi
	funcRemoveTempFiles "respHeader.txt" "response.txt"
}

Example 7-3 Groovy Sample – GetMaintenanceDetails.groovy

Prerequisites: json.jar

Common Functions: See CSS Common Helper Functions for Groovy

def getMaintenanceDetails () {
	def url;
	try {
			url = new URL(serverUrl + "/interop/rest/v1/services/dailymaintenance ")
	} catch (MalformedURLException e) {
			println "Malformed URL. Please pass valid URL"
			System.exit(0);
	}
	response = executeRequest(url, "GET", null);
	def object = new JsonSlurper().parseText(response)
	def status = object.status
	if (status == 0 ) {
		def items = object.items
		println "List of items :"
		items.each{
			println "Build Version : " + it.buildVersion
			println "AMW Time : " + it.amwTime
			println "Link : " + it.links[0].href + "\n"
		}
	} else {
		println "Error occurred while listing versions"
		if (object.details != null)
				println "Error details: " + object.details
	}
}