In the URI pattern, substitute the type of instance for the
{instance_type} and
the ID for the instance for the
{instance_id}.
The following table lists the value to use for each instance type:
Table 1. Values for {instance_type}
| Type of instance |
Value for {instance_type} |
Example |
| virtual system instance |
virtualSystemInstances |
GET /resources/virtualSystemInstances/d-65d29715-9063-436d-8593-d5218208f8aa/operations |
| virtual application instance |
virtualApplicationInstances |
GET /resources/virtualApplicationInstances/d-65d29715-9063-436d-8593-d5218208f8aa/operations |
| shared service instance |
sharedServiceInstances |
GET /resources/sharedServiceInstances/d-65d29715-9063-436d-8593-d5218208f8aa/operations |
Check the maintenance operation status
in each iteration
GET /resources/{instance_type}/{instance_id}/operations?role=MAINTENANCE
Table 4. Check the maintenance operation status in each iteration
| REST API information |
Value |
Description |
| Example URL |
http://server/resources/virtualSystemInstances/d-88cc2127-9380-4fa3-b644-899ad908a099/operations?role=MAINTENANCE |
|
| Response header |
application/json |
|
| Response body |
The operation status is in the result attribute.
For example:[
{
"role_status_retrieve": false,
"artifacts": [
],
"return_value": {
"OS_Node_1.11399281896317.MAINTENANCE": "Successfully installed ifixes: [u'https://1xx.16.65.154:9443/services/ifixes/name/imagefix/scriptArchive.zip']",
"OS_Node.11399281896316.MAINTENANCE": "Successfully installed ifixes: [u'https://1xx.16.65.154:9443/services/ifixes/name/imagefix/scriptArchive.zip']"
},
"target_role_instances": [
"OS_Node_1.11399281896317.MAINTENANCE"
],
"global": true,
"rolling": true,
"active_time": "2014-05-07T00:38:16.589Z",
"parameters": {
"MAINTENANCE.IFIXES": [
{
"vmtemplate": "OS_Node",
"vmfixes": [
{
"installtype": "WCA",
"id": 1,
"name": "imagefix"
}
]
},
{
"vmtemplate": "OS_Node_1",
"vmfixes": [
{
"installtype": "WCA",
"id": 1,
"name": "imagefix"
}
]
}
]
},
"script": "install_updates.py",
"target": "ALL",
"visible": true,
"running_status": "COMPLETED",
"preset_status": "CONFIGURING",
"complete_time": "2014-05-07T00:39:17.614Z",
"operation_id": "o-bbb6ea3a-4421-48c0-aaae-cb3ba1521e94",
"submit_time": "2014-05-07T00:38:11.089Z",
"role": "MAINTENANCE",
"type": "fixes",
"locale": [
"en_US",
"en"
],
"group_id": 1,
"rolling_config": {
"group_size": 2
},
"result": "{\n \"OS_Node_1.11399281896317.MAINTENANCE\": \"SUCCESS\",\n \"OS_Node.11399281896316.MAINTENANCE\": \"SUCCESS\"\n}"
}
]
|
|
| Response code |
200 |
OK |
| |
403 |
Access forbidden |
| |
500 |
Unexpected error |
Create an operation request
for an instance
POST /resources/{instance_type}/{instance_id}/operations/
Table 8. Create an operation request for an instance
| REST API information |
Value |
Description |
| Example URL |
https://localhost/resources/virtualSystemInstances/d-bcb20914-038c-485c-bcb9-75614332d5d9/operations/ |
|
| Request content-type |
application/json |
|
| Response header location |
https://localhost/resources/virtualApplications/d-bcb20914-038c-485c-bcb9-75614332d5d9/operations/ |
|
| Request example |
Request Body:{
"role":"Web_Application-was.WAS",
"type":"configuration",
"parameters": {
"WAS.ARCHIVE":"35593e24-7dc4-4034-b1b1-4870bfe3d584/ simpleWAS.war ",
"WAS.PASSWORD":"<xor>LDo+"
},
"depends": [
{
"role": "database-db2.DB2",
"parameters": {
"MAXPOOLSIZE": 1000,
"MINPOOLSIZE":50
}
},
{
"service": "Remote_Database",
"parameters": {
"key": "value"
}
}
]
}
|
|
| Response content-type |
application/json |
|
| Response example |
{
"method": "",
"artifacts": [
],
"operation_id": "o-c2bb569d-9626-40b5-8998-cfbf7ddb429d",
"global": false,
"role": "application-was.WAS",
"depends": [
{
"role": "database-db2.DB2",
"parameters": {
"MAXPOOLSIZE": 1000,
"MINPOOLSIZE":50
},
"script":"change.py"
},
{
"service": "Remote_Database",
"parameters": {
"key": "value"
},
"script":"change.py"
}
],
"type": "configuration",
"parameters": {
"WAS.ARCHIVE":"35593e24-7dc4-4034-b1b1-4870bfe3d584/ simpleWAS.war ",
"WAS.PASSWORD":"<xor>LDo+"
},
"script": "change.py",
"result": {
"application-was.11305307168260.WAS": "PENDING"
}
}
|
|
| Response code |
201 |
Created successfully |
| |
400 |
Bad request |
| |
401 |
The user is not authorized to perform this action. |
| |
403 |
Access forbidden |
| |
404 |
The deployment that is specified by {instance_id} is
not found. |
| |
500 |
Unexpected error |
One way that you can use this API is to submit a maintenance
operation to apply an interim fix or fix pack:
- If the operation is used to apply an interim fix, include the
list of interim fixes for each
vm-template in the parameters attribute:{"role":"MAINTENANCE",
"type":"fixes",
"parameters":{"MAINTENANCE.IFIXES":[
{"vmtemplate":"OS_Node",
"vmfixes":[
{"id":1,"name":"imagefix","installtype":"WCA"}]},
{"vmtemplate":"OS_Node_1",
"vmfixes":[
{"id":1,"name":"imagefix","installtype":"WCA"}]}]}}
- If the operation is used to apply a fix pack, include the list
of fix packs for each vm-template in the
parameters attribute:{"role":"MAINTENANCE",
"type":"configuration",
"parameters":{"MAINTENANCE.FIXPACKS":
{"OS_Node":{"IBM WebSphere Application Server":{"version":"8.5.0.1","fixpack":{"requireInstall":false}}},
"OS_Node_1":{"DB2":{"version":"10.1.0.3","fixpack":{"binaryUrl":"vsys/db2/v10.1fp3_linuxx64_server.tar.gz"}}}}}}
The current execution status is returned in the
result attribute
in the response for the operation, as shown in the following example:
{
"role_status_retrieve": false,
"artifacts": [
],
"global": true,
"rolling": true,
"parameters": {
"MAINTENANCE.IFIXES": [
{
"vmtemplate": "OS_Node",
"vmfixes": [
{
"installtype": "WCA",
"id": 1,
"name": "imagefix"
}
]
},
{
"vmtemplate": "OS_Node_1",
"vmfixes": [
{
"installtype": "WCA",
"id": 1,
"name": "imagefix"
}
]
}
]
},
"script": "install_updates.py",
"target": "ALL",
"preset_status": "CONFIGURING",
"visible": true,
"operation_id": "o-bbb6ea3a-4421-48c0-aaae-cb3ba1521e94",
"role": "MAINTENANCE",
"type": "configuration",
"locale": [
"en_US",
"en"
],
"id": "fixes",
"rolling_config": {
"group_size": 2
},
"result": {
"OS_Node_1.11399281896317.MAINTENANCE": "PENDING",
"OS_Node.11399281896316.MAINTENANCE": "PENDING"
}
}
Another way that
you can use this API is to start a scaling operation:
For a
horizontal scale out operation, include
"type" : "scaleOut" in
the request body:
{
"role": "OS_Node.OS_Node-Image",
"type": "scaleOut",
"parameters": {
"instanceCount": 1,
"lockTime": 0
},
}
For a scale in operation, include
"type"
: "scaleIn" in the request body:
{
"role": "OS_Node.OS_Node-Image",
"type": "scaleIn",
"parameters": {},
}
During a scale in operation, one virtual machine is removed
at a time. No parameter is needed.
For a vertical scale operation
for the processor, include
"type" : "resetCPU" in
the request body:
{
"role": "OS_Node.OS_Node-Image",
"type": "resetCPU",
"parameters": {
"cpuCount": 3,
},
}
For a vertical scale operation for the memory,
include
"type" : "resetMemory" in the request body:
{
"role": "OS_Node.OS_Node-Image",
"type": "resetMemory",
"parameters": {
"memorySize": 5120,
},
}
To determine the value of the role parameter,
go to the Operations page for the instance, which
you can access by selecting the instance on the Instances page
and clicking Manage, and look in the value
that corresponds to Image in the list of operations.