use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class ArgsCreator method getIntegerArrayValue16.
public final Object getIntegerArrayValue16(final Argument arg, final Map<String, Object> keyMap, int index) {
String[] arr = null;
if (arg.getValue() != null) {
String val = (String) arg.getValue();
arr = val.split(",");
}
UnsignedInteger16[] intarr = new UnsignedInteger16[arr.length];
for (int i = 0; i < arr.length; i++) {
intarr[i] = new UnsignedInteger16(Integer.parseInt(arr[i]));
}
return intarr;
}
use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class SmisDiscoveryArgsCreator method getInitialStorageTierMethodologyValue.
/**
* get Initial Storage Tiering methodology value for given Storage Pool Setting.
* used while modifying Storage Pool Setting Instance
*
* @param argument
* @param keyMap
* @param index
* @return
*/
public Object getInitialStorageTierMethodologyValue(final Argument argument, final Map<String, Object> keyMap, int index) {
@SuppressWarnings("unchecked") List<CIMInstance> vnxPoolSettingInstances = (List<CIMInstance>) keyMap.get(argument.getValue());
CIMInstance vnxPoolSettingInstance = vnxPoolSettingInstances.get(index);
String tierMethod = (String) keyMap.get(vnxPoolSettingInstance.getObjectPath().toString() + Constants.HYPHEN + Constants.TIERMETHODOLOGY);
_logger.debug("Tier Method got from Mapping :" + tierMethod);
CIMProperty<?> prop = new CIMProperty<Object>(Constants.INITIAL_STORAGE_TIER_METHODOLOGY, CIMDataType.UINT16_T, new UnsignedInteger16(tierMethod));
CIMProperty<?> initialStorageTierSelectionProp = new CIMProperty<Object>(Constants.INITIAL_STORAGE_TIERING_SELECTION, CIMDataType.UINT16_T, new UnsignedInteger16(Constants.RELATIVE_PERFORMANCE_ORDER));
CIMProperty<?>[] propArray = new CIMProperty<?>[] { prop, initialStorageTierSelectionProp };
return propArray;
}
use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class SmisCommandHelper method getCreateVolumesBasedOnVolumeGroupInputArguments80.
public CIMArgument[] getCreateVolumesBasedOnVolumeGroupInputArguments80(StorageSystem storage, CIMObjectPath poolPath, CIMObjectPath volumeGroupPath, String label, int count, long capacity) {
List<CIMArgument> list = new ArrayList<>();
list.add(_cimArgument.uint16Array(CP_ELEMENT_TYPE, toMultiElementArray(count, new UnsignedInteger16(STORAGE_VOLUME_VALUE))));
list.add(_cimArgument.uint32Array(CP_EMC_NUMBER_OF_DEVICE_FOR_EACH_CONFIG, toMultiElementArray(count, SINGLE_DEVICE_FOR_EACH_CONFIG)));
list.add(_cimArgument.uint64Array(CP_SIZE, toMultiElementArray(count, new UnsignedInteger64(Long.toString(capacity)))));
list.add(_cimArgument.referenceArray(CP_IN_POOL, toMultiElementArray(count, poolPath)));
if (volumeGroupPath != null) {
list.add(_cimArgument.referenceArray(CP_EMC_COLLECTIONS, toMultiElementArray(count, volumeGroupPath)));
}
if (label != null) {
list.add(_cimArgument.stringArray(CP_ELEMENT_NAMES, toMultiElementArray(count, label)));
}
return list.toArray(new CIMArgument[list.size()]);
}
use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class SmisCommandHelper method getReplicationSettingDataInstanceForDesiredCopyMethod.
/*
* Get ReplicationSettingData instance.
*
* @param storageSystem A reference to the storage system
*
* @param elementName An optional name for the instance
*
* @param desiredValue DesiredCopyMethodology value
*
* @param steTargetSupplier Whether or not the TargetElementSupplier should also be specified.
*/
@SuppressWarnings("rawtypes")
public CIMInstance getReplicationSettingDataInstanceForDesiredCopyMethod(final StorageSystem storageSystem, String elementName, int desiredValue, Boolean setTargetSupplier) {
CIMInstance modifiedInstance = null;
// only for vmax, otherwise, return null
if (!storageSystem.deviceIsType(Type.vmax)) {
return modifiedInstance;
}
try {
CIMObjectPath replicationSettingCapabilities = _cimPath.getReplicationServiceCapabilitiesPath(storageSystem);
CIMArgument[] inArgs = getReplicationSettingDataInstance();
CIMArgument[] outArgs = new CIMArgument[5];
invokeMethod(storageSystem, replicationSettingCapabilities, GET_DEFAULT_REPLICATION_SETTING_DATA, inArgs, outArgs);
for (CIMArgument<?> outArg : outArgs) {
if (null == outArg) {
continue;
}
ArrayList<CIMProperty> list = new ArrayList<>();
if (outArg.getName().equalsIgnoreCase(SmisConstants.DEFAULT_INSTANCE)) {
CIMInstance repInstance = (CIMInstance) outArg.getValue();
if (null != repInstance) {
CIMProperty<?> desiredMethod = new CIMProperty<Object>(SmisConstants.DESIRED_COPY_METHODOLOGY, UINT16_T, new UnsignedInteger16(desiredValue));
list.add(desiredMethod);
if (setTargetSupplier) {
CIMProperty<?> targetElementSupplier = new CIMProperty<Object>(TARGET_ELEMENT_SUPPLIER, UINT16_T, new UnsignedInteger16(CREATE_NEW_TARGET_VALUE));
list.add(targetElementSupplier);
}
/**
* To create SNAPVX snapshot smis uses the ElementName attribute in replicationSettingsInstance.
* By default Element Name of replicationSettingsInstance is "Default ReplicationSettingData".
* Element Name should not be having white space as it accept only alphanumeric value.
* To avoid SNAPVX creation failure i just removed white space as a workaround.
*/
if (null == elementName) {
elementName = SmisConstants.DEFAULT_REPLICATION_SETTING_DATA_ELEMENT_NAME;
}
CIMProperty<?> elementNameProp = new CIMProperty<Object>(SmisConstants.CP_ELEMENT_NAME, STRING_T, elementName);
list.add(elementNameProp);
modifiedInstance = repInstance.deriveInstance(list.toArray(new CIMProperty[] {}));
break;
}
}
}
} catch (Exception e) {
_log.error("Error retrieving Replication Setting Data Instance ", e);
}
return modifiedInstance;
}
use of javax.cim.UnsignedInteger16 in project coprhd-controller by CoprHD.
the class SmisCommandHelper method getCreateOrGrowStorageGroupInputArguments.
public CIMArgument[] getCreateOrGrowStorageGroupInputArguments(StorageSystem storage, URI exportMask, VolumeURIHLU[] volumeURIHLUs, List<Initiator> initiatorList, List<URI> targetURIList) throws Exception {
List<CIMArgument> argsList = new ArrayList<CIMArgument>();
if (volumeURIHLUs != null && volumeURIHLUs.length > 0) {
String[] lunNames = new String[volumeURIHLUs.length];
List<String> deviceNumbers = new ArrayList<String>();
UnsignedInteger16[] deviceAccesses = new UnsignedInteger16[volumeURIHLUs.length];
String elementName = getExportMaskName(exportMask);
argsList.add(_cimArgument.string(CP_EMC_ELEMENT_NAME, elementName));
for (int i = 0; i < volumeURIHLUs.length; i++) {
lunNames[i] = getBlockObjectAlternateName(volumeURIHLUs[i].getVolumeURI());
String hlu = volumeURIHLUs[i].getHLU();
// LUN_UNASSIGNED value (as a hex string).
if (hlu != null && !hlu.equalsIgnoreCase(ExportGroup.LUN_UNASSIGNED_STR)) {
deviceNumbers.add(hlu);
}
deviceAccesses[i] = READ_WRITE_UINT16;
}
argsList.add(_cimArgument.uint16Array(CP_DEVICE_ACCESSES, deviceAccesses));
argsList.add(_cimArgument.stringArray(CP_LU_NAMES, lunNames));
if (!deviceNumbers.isEmpty()) {
String[] numbers = {};
argsList.add(_cimArgument.stringArray(CP_DEVICE_NUMBERS, deviceNumbers.toArray(numbers)));
}
}
if (initiatorList != null && !initiatorList.isEmpty()) {
String[] initiatorPortIDs = getInitiatorNamesForClariion(initiatorList);
argsList.add(_cimArgument.stringArray(CP_INITIATOR_PORT_IDS, initiatorPortIDs));
}
if (targetURIList != null && !targetURIList.isEmpty()) {
CIMObjectPath[] targetEndpoints = _cimPath.getTargetPortPaths(storage, targetURIList);
Set<String> uniqueTargetPortIDs = new HashSet<String>();
for (CIMObjectPath path : targetEndpoints) {
uniqueTargetPortIDs.add(path.getKey(CP_NAME).getValue().toString());
}
argsList.add(_cimArgument.stringArray(CP_TARGET_PORT_IDS, uniqueTargetPortIDs.toArray(new String[] {})));
}
CIMObjectPath[] protocolControllers = _cimPath.getClarProtocolControllers(storage, getExportMaskNativeId(exportMask));
if (protocolControllers != null && protocolControllers.length > 0) {
argsList.add(_cimArgument.referenceArray(CP_PROTOCOL_CONTROLLERS, protocolControllers));
}
CIMArgument[] retArgs = {};
return argsList.toArray(retArgs);
}
Aggregations