688 lines
26 KiB
C#
688 lines
26 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Intel.Management.Wsman;
|
|
using System.Collections.ObjectModel;
|
|
using System.Management.Automation;
|
|
|
|
namespace Intel.Management.Module.Amt
|
|
{
|
|
public class StorageAdmin
|
|
{
|
|
|
|
class EnterpriseAcl : DriveItem
|
|
{
|
|
StorageAdmin _stgAdmin;
|
|
uint _handle;
|
|
static string[] _properties = { "Handle" };
|
|
|
|
public EnterpriseAcl(string handle, StorageAdmin stgAdmin)
|
|
: base(handle,ManagedValueType.Acl)
|
|
{
|
|
_stgAdmin = stgAdmin;
|
|
IManagedInstance outObj = _stgAdmin.GetEaclEntry(handle);
|
|
_name = outObj.GetProperty("EnterpriseName").ToString();
|
|
_handle = uint.Parse(handle);
|
|
}
|
|
|
|
public override string[] Properties
|
|
{
|
|
get
|
|
{
|
|
return _properties;
|
|
}
|
|
}
|
|
|
|
public override object GetProperty(Collection<string> propList, bool force)
|
|
{
|
|
|
|
foreach (string propName in propList)
|
|
{
|
|
if (string.Compare(propName, _properties[0], true) != 0) throw new PSArgumentException();
|
|
}
|
|
|
|
return _handle;
|
|
}
|
|
|
|
public override void RemoveItem(object dynamicParams, bool force)
|
|
{
|
|
_stgAdmin.RemoveEaclEntry(_handle.ToString());
|
|
_stgAdmin.RemoveItem(this);
|
|
}
|
|
}
|
|
|
|
class EnterpriseContainer : DriveContainer
|
|
{
|
|
StorageAdmin _stgAdmin;
|
|
|
|
public EnterpriseContainer(StorageAdmin stgAdmin) : base("Enterprises")
|
|
{
|
|
_stgAdmin = stgAdmin;
|
|
_items = null;
|
|
}
|
|
|
|
public override ManagedItem[] GetChildItems(bool force)
|
|
{
|
|
|
|
if (_items == null || force )
|
|
{
|
|
IManagedInstance outObj = _stgAdmin.GetEaclList();
|
|
|
|
List<ManagedItem> list = new List<ManagedItem>();
|
|
|
|
IWsmanItem handles = outObj.GetProperty("Handles");
|
|
if (handles!= null)
|
|
{
|
|
foreach (IWsmanItem handle in handles)
|
|
{
|
|
list.Add(new EnterpriseAcl(handle.ToString(), _stgAdmin));
|
|
}
|
|
}
|
|
list.Sort(_defaultComparer);
|
|
_items = list.ToArray();
|
|
}
|
|
return _items;
|
|
}
|
|
|
|
public override ManagedItem NewItem( string name, string type, object newItem, object dynamicParams, bool force)
|
|
{
|
|
if (!name.Equals(string.Empty))
|
|
{
|
|
string handle = _stgAdmin.AddEaclEntry(name);
|
|
EnterpriseAcl result = new EnterpriseAcl(handle, _stgAdmin);
|
|
AddChildItem(result);
|
|
return result;
|
|
}
|
|
return this;
|
|
}
|
|
}
|
|
|
|
public class PartnerAclDynamicParameters
|
|
{
|
|
public PartnerAclDynamicParameters()
|
|
{
|
|
_maxSize=48*1024; //default to 48K storage
|
|
}
|
|
|
|
[Parameter(Mandatory = false, Position = 0, HelpMessage = "Maximum size in bytes the partner can allocate")]
|
|
public uint TotalAllocationSize
|
|
{
|
|
get
|
|
{
|
|
return _maxSize;
|
|
}
|
|
set
|
|
{
|
|
uint blocksize = (value / (4 * 1024));
|
|
blocksize = blocksize * (4 * 1024);
|
|
if (value > blocksize)
|
|
blocksize = blocksize + (4 * 1024);
|
|
_maxSize = blocksize;
|
|
}
|
|
|
|
}
|
|
uint _maxSize;
|
|
}
|
|
|
|
class PartnerAcl : DriveItem
|
|
{
|
|
StorageAdmin _stgAdmin;
|
|
PartnerAclDynamicParameters _dynamicParams;
|
|
Dictionary<string, object> _props;
|
|
|
|
|
|
public PartnerAcl(Dictionary<string, object> props, StorageAdmin stgAdmin)
|
|
: base(props["ApplicationName"].ToString(), ManagedValueType.Acl)
|
|
{
|
|
_props = props;
|
|
_stgAdmin = stgAdmin;
|
|
}
|
|
|
|
public override string[] Properties
|
|
{
|
|
get { return _props.Keys.ToArray(); }
|
|
}
|
|
|
|
public override object GetProperty(Collection<string> propList,bool force)
|
|
{
|
|
return GetProperties(_props, propList);
|
|
}
|
|
|
|
public override void SetProperty(PSObject propertyValue, bool force)
|
|
{
|
|
_stgAdmin.UpdateFpaclEntry(_props["Handle"].ToString(),
|
|
propertyValue.Properties["TotalAllocationSize"].Value.ToString());
|
|
|
|
_props["TotalAllocationSize"] = propertyValue.Properties["TotalAllocationSize"].Value.ToString();
|
|
}
|
|
|
|
public override void RemoveItem( object dynamicParams,bool force)
|
|
{
|
|
_stgAdmin.RemoveFpaclEntry(_props["Handle"].ToString());
|
|
_stgAdmin.RemoveItem(this);
|
|
}
|
|
|
|
public override ManagedItem NewItem(string name, string type, object newItem, object dynamicParams, bool force)
|
|
{
|
|
PartnerAclDynamicParameters localParams = _dynamicParams;
|
|
_dynamicParams=null;
|
|
|
|
if (name.Equals(string.Empty) &&
|
|
!_dynamicParams.TotalAllocationSize.Equals(_props["TotalAllocationSize"]))
|
|
{
|
|
|
|
_stgAdmin.UpdateFpaclEntry(_props["Handle"].ToString(),
|
|
localParams.TotalAllocationSize.ToString());
|
|
|
|
_props["TotalAllocationSize"] = localParams.TotalAllocationSize;
|
|
|
|
}
|
|
return base.NewItem(name, type, newItem,dynamicParams, force);
|
|
}
|
|
|
|
public override object NewItemDynamicParameters(string itemTypeName, object newItemValue)
|
|
{
|
|
return _dynamicParams = new PartnerAclDynamicParameters();
|
|
}
|
|
}
|
|
|
|
|
|
class VendorContainer : DriveContainer
|
|
{
|
|
StorageAdmin _stgAdmin;
|
|
|
|
public VendorContainer(string name, StorageAdmin stgAdmin)
|
|
: base(name)
|
|
{
|
|
_stgAdmin = stgAdmin;
|
|
}
|
|
|
|
public VendorContainer(string handle, Dictionary<string,object> props, StorageAdmin stgAdmin)
|
|
: base(props["VendorName"].ToString())
|
|
{
|
|
_stgAdmin = stgAdmin;
|
|
|
|
List<ManagedItem> list = new List<ManagedItem>();
|
|
if (_items != null) list.AddRange(_items);
|
|
|
|
list.Add( new PartnerAcl(props,_stgAdmin) );
|
|
|
|
_items = list.ToArray();
|
|
}
|
|
|
|
public void RemovePartnerItem(PartnerAcl item)
|
|
{
|
|
List<ManagedItem> list = new List<ManagedItem>();
|
|
if (_items != null) list.AddRange(_items);
|
|
if (list.Remove(item)) _items = list.ToArray();
|
|
}
|
|
}
|
|
|
|
class PartnerContainer : DriveContainer
|
|
{
|
|
StorageAdmin _stgAdmin;
|
|
PartnerAclDynamicParameters _dynamicParams = null;
|
|
|
|
public PartnerContainer(StorageAdmin stgAdmin)
|
|
: base("Partners")
|
|
{
|
|
_stgAdmin = stgAdmin;
|
|
_items = null;
|
|
}
|
|
|
|
public override ManagedItem[] GetChildItems(bool force)
|
|
{
|
|
if (_items == null || force)
|
|
{
|
|
IManagedInstance outObj = _stgAdmin.GetFpaclList();
|
|
List<ManagedItem> list = new List<ManagedItem>();
|
|
|
|
IWsmanItem handles = outObj.GetProperty("Handles");
|
|
if (handles != null)
|
|
{
|
|
foreach (IWsmanItem handle in handles)
|
|
{
|
|
IManagedInstance entryObj = _stgAdmin.GetFpaclEntry(handle.ToString());
|
|
string vendorName= entryObj.GetProperty("VendorName").ToString();
|
|
|
|
Dictionary<string, object> props = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
|
|
|
|
props.Add("ApplicationName",entryObj.GetProperty("ApplicationName").ToString());
|
|
props.Add("TotalAllocationSize",uint.Parse(entryObj.GetProperty("TotalAllocationSize").ToString()));
|
|
props.Add("VendorName", vendorName);
|
|
props.Add("IsPartner", bool.Parse(entryObj.GetProperty("IsPartner").ToString()));
|
|
props.Add("AttrType", uint.Parse(entryObj.GetProperty("AttrType").ToString()));
|
|
props.Add("Handle", uint.Parse(handle.ToString()));
|
|
|
|
AddPartner(list, props);
|
|
}
|
|
}
|
|
list.Sort(_defaultComparer);
|
|
_items = list.ToArray();
|
|
}
|
|
return _items;
|
|
}
|
|
|
|
private PartnerAcl AddPartner(List<ManagedItem> list, Dictionary<string, object> props)
|
|
{
|
|
PartnerAcl result = null;
|
|
string vendorName = props["VendorName"].ToString();
|
|
|
|
//find the vendor container using anynomous delegate
|
|
DriveContainer vendorItem =
|
|
(DriveContainer)list.Find(
|
|
delegate(ManagedItem item) { return string.Compare(item.Name, vendorName, true) == 0; }
|
|
);
|
|
|
|
// No vendor container so add one
|
|
if (vendorItem == null)
|
|
{
|
|
vendorItem = new VendorContainer(vendorName, _stgAdmin);
|
|
list.Add(vendorItem);
|
|
}
|
|
|
|
result = new PartnerAcl(props, _stgAdmin);
|
|
vendorItem.AddChildItem(result);
|
|
return result;
|
|
|
|
}
|
|
|
|
public override ManagedItem NewItem(string name, string type, object newItem,object dynamicParams, bool force)
|
|
{
|
|
PartnerAclDynamicParameters localParams = _dynamicParams;
|
|
_dynamicParams=null;
|
|
|
|
char[] pathChar = { '\\', '/' };
|
|
string[] names = name.Split(pathChar, StringSplitOptions.RemoveEmptyEntries);
|
|
if (names.Length == 2)
|
|
{
|
|
Dictionary<string, object> props = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
|
|
|
|
props.Add("ApplicationName", names[1]);
|
|
props.Add("TotalAllocationSize", localParams.TotalAllocationSize);
|
|
props.Add("VendorName", names[0]);
|
|
props.Add("IsPartner", true);
|
|
props.Add("AttrType", (uint)1);
|
|
|
|
string handle = _stgAdmin.AddFpaclEntry(names[1], names[0],
|
|
localParams.TotalAllocationSize.ToString());
|
|
|
|
props.Add("Handle", uint.Parse(handle));
|
|
|
|
List<ManagedItem> list = new List<ManagedItem>();
|
|
if (_items != null) list.AddRange(_items);
|
|
PartnerAcl result = AddPartner(list, props);
|
|
_items = list.ToArray();
|
|
return result;
|
|
}
|
|
return base.NewItem(name, type, newItem, dynamicParams, force);
|
|
|
|
}
|
|
|
|
public override object NewItemDynamicParameters(string itemTypeName, object newItemValue)
|
|
{
|
|
return _dynamicParams = new PartnerAclDynamicParameters();
|
|
}
|
|
|
|
public void RemovePartnerItem(PartnerAcl item)
|
|
{
|
|
foreach (VendorContainer vendor in _items)
|
|
{
|
|
vendor.RemovePartnerItem(item);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class RegisteredItem : DriveItem
|
|
{
|
|
StorageAdmin _stgAdmin;
|
|
Dictionary<string, object> _props;
|
|
|
|
public RegisteredItem(string name, StorageAdmin stgAdmin)
|
|
: base(name, "StorgeApplication")
|
|
{
|
|
_props = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
|
|
_props.Add("AttrType", null);
|
|
_props.Add("UUID", null);
|
|
_props.Add("VendorName", null);
|
|
_props.Add("ApplicationName", null);
|
|
_props.Add("EnterpriseName", null);
|
|
_props.Add("CurrentAllocationSize", null);
|
|
_props.Add("ActiveSession", null);
|
|
_props.Add("Partner", null);
|
|
_props.Add("Handle", null);
|
|
|
|
_stgAdmin = stgAdmin;
|
|
}
|
|
|
|
|
|
public override string[] Properties
|
|
{
|
|
get { return _props.Keys.ToArray(); }
|
|
}
|
|
|
|
|
|
public override object GetProperty(Collection<string> propList, bool force)
|
|
{
|
|
if (_props["ApplicationName"] == null)
|
|
{
|
|
IManagedInstance outObj = _stgAdmin.GetApplicationAttributes(_name);
|
|
_props["VendorName"] = outObj.GetProperty("VendorName").ToString();
|
|
//convert UUID to string
|
|
Guid uuid = new Guid(Convert.FromBase64String(outObj.GetProperty("UUID").ToString()));
|
|
_props["UUID"] = uuid.ToString();
|
|
|
|
_props["ApplicationName"] = outObj.GetProperty("ApplicationName").ToString();
|
|
_props["EnterpriseName"] = outObj.GetProperty("EnterpriseName").ToString();
|
|
_props["CurrentAllocationSize"] = uint.Parse(outObj.GetProperty("CurrentAllocationSize").ToString());
|
|
_props["ActiveSession"] = bool.Parse(outObj.GetProperty("ActiveSession").ToString());
|
|
_props["Partner"] = bool.Parse(outObj.GetProperty("Partner").ToString());
|
|
_props["AttrType"] = uint.Parse(outObj.GetProperty("AttrType").ToString());
|
|
_props["Handle"] = uint.Parse(_name);
|
|
}
|
|
|
|
return GetProperties(_props, propList);
|
|
}
|
|
|
|
public override void SetProperty(PSObject propertyValue, bool force)
|
|
{
|
|
|
|
foreach (PSPropertyInfo propInfo in propertyValue.Properties)
|
|
{
|
|
if (string.Compare(propInfo.Name, "TotalAllocationSize", true) != 0)
|
|
throw new PSArgumentException();
|
|
|
|
_stgAdmin.UpdateFpaclEntry(propInfo.Name,
|
|
propertyValue.Properties[propInfo.Name].Value.ToString());
|
|
|
|
_props[propInfo.Name] = (uint)propertyValue.Properties[propInfo.Name].Value;
|
|
}
|
|
}
|
|
|
|
public override void RemoveItem(object dynamicParams,bool force)
|
|
{
|
|
|
|
_stgAdmin.RemoveApplication(_name);
|
|
//base.RemoveItem(force);
|
|
}
|
|
}
|
|
|
|
|
|
class RegistrationsContainer : DriveContainer
|
|
{
|
|
StorageAdmin _stgAdmin;
|
|
|
|
|
|
public RegistrationsContainer(StorageAdmin stgAdmin)
|
|
: base("Registrations")
|
|
{
|
|
_stgAdmin = stgAdmin;
|
|
_items = null;
|
|
}
|
|
|
|
public override ManagedItem[] GetChildItems(bool force)
|
|
{
|
|
if (_items == null || force)
|
|
{
|
|
IManagedInstance outObj = _stgAdmin.GetRegisteredApps();
|
|
|
|
List<DriveItem> list = new List<DriveItem>();
|
|
|
|
IWsmanItem handles = outObj.GetProperty("ApplicationHandles");
|
|
if (handles != null)
|
|
{
|
|
foreach (IWsmanItem handle in handles)
|
|
{
|
|
list.Add(new RegisteredItem(handle.ToString(), _stgAdmin));
|
|
}
|
|
}
|
|
_items = list.ToArray();
|
|
}
|
|
return _items;
|
|
}
|
|
}
|
|
|
|
|
|
class AdminRoot : DriveContainer
|
|
{
|
|
StorageAdmin _stgAdmin;
|
|
string[] _properties;
|
|
|
|
public AdminRoot(StorageAdmin stgAdmin)
|
|
: base("Third Party Data Storage")
|
|
{
|
|
_stgAdmin = stgAdmin;
|
|
_items = null;
|
|
}
|
|
|
|
public override ManagedItem[] GetChildItems(bool force)
|
|
{
|
|
if (_items == null)
|
|
{
|
|
List<ManagedItem> list = new List<ManagedItem>();
|
|
|
|
|
|
list.Add(new EnterpriseContainer(_stgAdmin));
|
|
list.Add(new PartnerContainer(_stgAdmin));
|
|
list.Add(new RegistrationsContainer(_stgAdmin));
|
|
|
|
list.Sort(_defaultComparer);
|
|
_items = list.ToArray();
|
|
}
|
|
return _items;
|
|
|
|
}
|
|
|
|
|
|
public override string[] Properties
|
|
{
|
|
get
|
|
{
|
|
if (_properties == null)
|
|
{
|
|
String[] props = {"TotalStorage",
|
|
"TotalAllocatedStorage",
|
|
"MaxPartnerStorage",
|
|
"TotalPartnerAllocatedStorage",
|
|
"MaxNonPartnerStorage",
|
|
"MaxFpaclEntries",
|
|
"MaxAslEntries",
|
|
"MaxEaclEntries",
|
|
"MaxGroupsPerBlock",
|
|
"MaxMembersPerGroup",
|
|
"MaxNonPartnerTotalAllocationSize",};
|
|
_properties = props;
|
|
}
|
|
return _properties;
|
|
}
|
|
}
|
|
|
|
|
|
public override object GetProperty(Collection<string> propList, bool force)
|
|
{
|
|
IManagedInstance outObj = _stgAdmin.GetGlobalStorageAttributes();
|
|
Dictionary<string, object> props = new Dictionary<string, object>();
|
|
|
|
foreach (string propName in Properties)
|
|
{
|
|
props.Add(propName, uint.Parse(outObj.GetProperty(propName).ToString()));
|
|
}
|
|
return GetProperties(props, propList);
|
|
}
|
|
|
|
public override void SetProperty(PSObject propertyValue, bool force)
|
|
{
|
|
string name = null;
|
|
string value = null;
|
|
foreach (PSPropertyInfo propInfo in propertyValue.Properties)
|
|
{
|
|
name = propInfo.Name;
|
|
value = propInfo.Value.ToString();
|
|
|
|
}
|
|
|
|
if (name == null ||
|
|
(string.Compare("MaxPartnerStorage", name, true) != 0 &&
|
|
string.Compare("MaxNonPartnerTotalAllocationSize", name, true) != 0))
|
|
new PSArgumentException();
|
|
|
|
_stgAdmin.SetGlobalStorageAttributes(name, value);
|
|
}
|
|
}
|
|
|
|
IManagedReference _storageAdminRef;
|
|
AdminRoot _root;
|
|
|
|
|
|
public StorageAdmin(WsmanConnection conn)
|
|
{
|
|
//_items = null;
|
|
_storageAdminRef = conn.NewReference("AMT_ThirdPartyDataStorageAdministrationService");
|
|
_root = new AdminRoot(this);
|
|
}
|
|
|
|
|
|
public ManagedItem RootFolder
|
|
{
|
|
get { return _root; }
|
|
}
|
|
|
|
private bool RemoveItem(DriveItem item)
|
|
{
|
|
return _root.RemoveChildItem(item, true);
|
|
}
|
|
|
|
|
|
|
|
private IManagedInstance GetGlobalStorageAttributes()
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("GetGlobalStorageAttributes");
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj;
|
|
}
|
|
|
|
|
|
private IManagedInstance SetGlobalStorageAttributes(string name, string value)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("SetGlobalStorageAttributes");
|
|
inputObj.SetProperty(name, value);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj;
|
|
}
|
|
|
|
|
|
private IManagedInstance GetEaclEntry(string handle)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("GetStorageEaclEntry");
|
|
inputObj.SetProperty("Handle", handle);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj;
|
|
}
|
|
|
|
private IManagedInstance GetFpaclEntry(string handle)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("GetStorageAllocEntry");
|
|
inputObj.SetProperty("Handle", handle);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj;
|
|
}
|
|
|
|
|
|
private IManagedInstance GetEaclList()
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("EnumerateStorageEaclEntries");
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj;
|
|
}
|
|
|
|
private IManagedInstance GetFpaclList()
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("EnumerateStorageAllocEntries");
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
|
|
return outObj;
|
|
}
|
|
|
|
private IManagedInstance GetRegisteredApps()
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("AdminGetRegisteredApplications");
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj;
|
|
}
|
|
|
|
private string AddEaclEntry(string name)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("AddStorageEaclEntry");
|
|
inputObj.SetProperty("EnterpriseName",name);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj.GetProperty("Handle").ToString();
|
|
}
|
|
|
|
private string AddFpaclEntry(string appName, string vendor, string size)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("AddStorageFpaclEntry");
|
|
inputObj = _storageAdminRef.CreateMethodInput("AddStorageFpaclEntry");
|
|
inputObj.SetProperty("AttrType","1");
|
|
inputObj.SetProperty("ApplicationName",appName);
|
|
inputObj.SetProperty("VendorName",vendor);
|
|
inputObj.SetProperty("IsPartner", "true");
|
|
inputObj.SetProperty("TotalAllocationSize",size);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj.GetProperty("Handle").ToString();
|
|
}
|
|
|
|
private void RemoveEaclEntry(string handle)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("RemoveStorageEaclEntry");
|
|
inputObj.SetProperty("Handle", handle);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
}
|
|
|
|
private void RemoveFpaclEntry(string handle)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("RemoveStorageFpaclEntry");
|
|
inputObj.SetProperty("Handle", handle);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
}
|
|
|
|
private void UpdateFpaclEntry(string handle, string newSize)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("UpdateStorageFpaclEntry");
|
|
inputObj.SetProperty("Handle", handle);
|
|
inputObj.SetProperty("NewAllocationSize", newSize);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
}
|
|
|
|
private void RemoveApplication(string handle)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("AdminRemoveApplication");
|
|
inputObj.SetProperty("Handle", handle);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
}
|
|
|
|
private IManagedInstance GetApplicationAttributes(string handle)
|
|
{
|
|
IManagedInstance inputObj = _storageAdminRef.CreateMethodInput("AdminGetApplicationAttributes");
|
|
inputObj.SetProperty("Handle", handle);
|
|
IManagedInstance outObj = _storageAdminRef.InvokeMethod(inputObj);
|
|
StorageManager.StorageOperationException.CheckResult(outObj);
|
|
return outObj;
|
|
}
|
|
}
|
|
}
|