Originally posted by: 87F8_sadf_sdf
This is my test code.
public <T> ResponseEntity<T> getByContetType(String url, Class<T> clazz,String contentType,
Object... args) {
HttpHeaders head = new HttpHeaders();
head.add("Content-Type", contentType);
head.add("X-API-Session", this.getSession());
head.add("Accept", "*/*");
HttpEntity<String> requestEntity = new HttpEntity<>(head);
return this.getRest().exchange(url, HttpMethod.GET, requestEntity, clazz);
}
String xml = getByContetType(url, String.class, "application/vnd.ibm.powervm.uom+xml;type=VirtualIOServer",args).getBody();
JSONObject r=session.getFullPathxml("https://10.20.32.90:12443/rest/api/uom/ManagedSystem/e41dbc2b-2389-3c45-9fea-4c8e109b06b2/LogicalPartition");
AP.testPrintLpar(r);
String link="https://10.20.32.90:12443/rest/api/uom/VirtualIOServer";
JSONObject j=session.viosServer(link);
//
System.err.println(j);
result:
2017-03-28 16:16:32 INFO [com.cyancloud.manager.powervm.session.SessionFactory] - create session to host:10.20.32.90
id:47E66CBA-8ED7-4611-94B7-000C39DB0259;name:TestAlex{application/vnd.ibm.powervm.uom+xml; type=LogicalPartition}
id:55E9ECF3-5469-4935-9FD3-D10F85386FF0;name:AIX6100-01{application/vnd.ibm.powervm.uom+xml; type=LogicalPartition}
id:5BEADFE4-4F1D-4AED-86AE-8FD717DD6B3E;name:TESt_lpar{application/vnd.ibm.powervm.uom+xml; type=LogicalPartition}
id:3356B447-6145-4CCF-88F5-E9764FF6EA8F;name:Demo_sunyy{application/vnd.ibm.powervm.uom+xml; type=LogicalPartition}
id:456AF685-BA4C-42E6-A530-2EA310BB1CBE;name:DemoSunyy{application/vnd.ibm.powervm.uom+xml; type=LogicalPartition}
id:71CBEE0E-4E1B-4FFF-AA1C-BD48DBAD322D;name:VIOS{application/vnd.ibm.powervm.uom+xml; type=LogicalPartition}
null
why /rest/api/uom/VirtualIOServer return null?
#Power-Hardware-Management-Console-Programmers#HMCandCMC