/* * storage_plugin_getFileInfo, <class * 'agent.api.storageplugin.StoragePlugin'> argument: impl_name - default: * None */ public FileProperties storagePluginGetFileInfo(String poolUuid, String host, String file) throws Ovm3ResourceException { /* file path is the full path */ String uuid = deDash(poolUuid); StorageServer ss = new StorageServer(); StorageDetails sd = new StorageDetails(); FileProperties fp = new FileProperties(); ss.setUuid(uuid); ss.setAccessHost(host); sd.setUuid(poolUuid); sd.setDetailsRelationalUuid(uuid); sd.setState(1); fp.setName(file); fp.setProperties( (HashMap<String, Object>) callWrapper( "storage_plugin_getFileInfo", getPluginType, ss.getDetails(), sd.getDetails(), fp.getProperties())); if ("".equals(fp.getName())) { throw new Ovm3ResourceException("Unable to get file info for " + file); } return fp; }
/* * INFO: is used for files and dirs..., we only implement files for now... * storage_plugin_destroy, <class 'agent.api.storageplugin.StoragePlugin'> * argument: impl_name - default: None */ public Boolean storagePluginDestroy(String poolUuid, String file) throws Ovm3ResourceException { String uuid = deDash(poolUuid); StorageServer ss = new StorageServer(); StorageDetails sd = new StorageDetails(); FileProperties fp = new FileProperties(); ss.setUuid(uuid); sd.setDetailsRelationalUuid(uuid); sd.setUuid(poolUuid); fp.setType("file"); fp.setUuid(poolUuid); fp.setName(file); return nullIsTrueCallWrapper( "storage_plugin_destroy", getPluginType, ss.getDetails(), sd.getDetails(), fp.getProperties()); }