Search in sources :

Example 1 with UserSecretKeysAddCommandResult

use of com.emc.storageos.ecs.api.UserSecretKeysAddCommandResult in project coprhd-controller by CoprHD.

the class ECSObjectStorageDevice method doAddUserSecretKey.

@Override
public ObjectUserSecretKey doAddUserSecretKey(StorageSystem storageObj, String userId, String secretKey) throws InternalException {
    ECSApi ecsApi = getAPI(storageObj);
    ObjectUserSecretKey secretKeyRes = new ObjectUserSecretKey();
    try {
        UserSecretKeysAddCommandResult cmdRes = ecsApi.addUserSecretKey(userId, secretKey);
        // secretKeyRes.setSecret_key_1(cmdRes.getSecret_key()); //for security reason hiding the secrete key
        secretKeyRes.setSecret_key_1_expiry_timestamp(cmdRes.getKey_expiry_timestamp());
        return secretKeyRes;
    } catch (Exception e) {
        _log.error("ECSObjectStorageDevice:doAddUserSecretKey failed");
        throw e;
    }
}
Also used : ECSApi(com.emc.storageos.ecs.api.ECSApi) ObjectUserSecretKey(com.emc.storageos.db.client.model.ObjectUserSecretKey) UserSecretKeysAddCommandResult(com.emc.storageos.ecs.api.UserSecretKeysAddCommandResult) URISyntaxException(java.net.URISyntaxException) InternalException(com.emc.storageos.svcs.errorhandling.resources.InternalException) ControllerException(com.emc.storageos.volumecontroller.ControllerException) ECSException(com.emc.storageos.ecs.api.ECSException)

Aggregations

ObjectUserSecretKey (com.emc.storageos.db.client.model.ObjectUserSecretKey)1 ECSApi (com.emc.storageos.ecs.api.ECSApi)1 ECSException (com.emc.storageos.ecs.api.ECSException)1 UserSecretKeysAddCommandResult (com.emc.storageos.ecs.api.UserSecretKeysAddCommandResult)1 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)1 ControllerException (com.emc.storageos.volumecontroller.ControllerException)1 URISyntaxException (java.net.URISyntaxException)1