Search in sources :

Example 1 with VirtualArrayInternalFlags

use of com.emc.storageos.model.varray.VirtualArrayInternalFlags in project coprhd-controller by CoprHD.

the class InternalVirtualArrayService method getProtectionType.

/**
 * Get protectionType attached with a virtual array
 *
 * @param id the URN of a ViPR varray
 * @return the VirtualArrayInternalFlags
 */
@GET
@Path("/{id}/protectionType")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public VirtualArrayInternalFlags getProtectionType(@PathParam("id") URI id) {
    String protectionType = "";
    VirtualArray varray = getVirtualArrayById(id, true);
    if (varray.getProtectionType() != null) {
        protectionType = varray.getProtectionType();
    }
    VirtualArrayInternalFlags varrayInternalFlags = new VirtualArrayInternalFlags();
    varrayInternalFlags.setProtectionType(protectionType);
    auditOp(OperationTypeEnum.GET_VARRAY_PROTECTIONTYPE, true, null, id.toString(), varray.getLabel(), protectionType);
    return varrayInternalFlags;
}
Also used : VirtualArray(com.emc.storageos.db.client.model.VirtualArray) VirtualArrayInternalFlags(com.emc.storageos.model.varray.VirtualArrayInternalFlags)

Example 2 with VirtualArrayInternalFlags

use of com.emc.storageos.model.varray.VirtualArrayInternalFlags in project coprhd-controller by CoprHD.

the class InternalVirtualArrayService method getDeviceRegistered.

/**
 * Get device registered status of a virtual array
 *
 * @param id the URN of a ViPR varray
 * @return the VirtualArrayInternalFlags
 */
@GET
@Path("/{id}/deviceRegistered")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public VirtualArrayInternalFlags getDeviceRegistered(@PathParam("id") URI id) {
    VirtualArray varray = getVirtualArrayById(id, true);
    VirtualArrayInternalFlags varrayInternalFlags = new VirtualArrayInternalFlags();
    varrayInternalFlags.setDeviceRegistered(varray.getDeviceRegistered());
    auditOp(OperationTypeEnum.GET_VARRAY_REGISTERED, true, null, id.toString(), varray.getLabel(), String.valueOf(varray.getDeviceRegistered()));
    return varrayInternalFlags;
}
Also used : VirtualArray(com.emc.storageos.db.client.model.VirtualArray) VirtualArrayInternalFlags(com.emc.storageos.model.varray.VirtualArrayInternalFlags)

Example 3 with VirtualArrayInternalFlags

use of com.emc.storageos.model.varray.VirtualArrayInternalFlags in project coprhd-controller by CoprHD.

the class InternalVirtualArrayServiceClient method getDeviceRegistered.

/**
 * Get device registered status of a virtual array
 *
 * @param id the URN of a ViPR varray
 * @return the device registered status
 */
public Boolean getDeviceRegistered(URI id) {
    String getFlag = String.format(INTERNAL_VARRAY_GET_REGISTERED, id.toString());
    WebResource rRoot = createRequest(getFlag);
    VirtualArrayInternalFlags resp = null;
    try {
        resp = addSignature(rRoot).get(VirtualArrayInternalFlags.class);
    } catch (UniformInterfaceException e) {
        _log.warn("could not get registered status of varray {}. Err:{}", id, e);
        if (e.getResponse().getStatus() == 404) {
            throw APIException.notFound.unableToFindEntityInURL(id);
        }
    }
    return resp.getDeviceRegistered();
}
Also used : VirtualArrayInternalFlags(com.emc.storageos.model.varray.VirtualArrayInternalFlags) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) WebResource(com.sun.jersey.api.client.WebResource)

Example 4 with VirtualArrayInternalFlags

use of com.emc.storageos.model.varray.VirtualArrayInternalFlags in project coprhd-controller by CoprHD.

the class InternalVirtualArrayServiceClient method getProtectionType.

/**
 * Get protectionType attached with a virtual array
 *
 * @param id the URN of a ViPR varray
 * @return the protection type
 */
public String getProtectionType(URI id) {
    String getFlag = String.format(INTERNAL_VARRAY_GET_PROTECTIONTYPE, id.toString());
    WebResource rRoot = createRequest(getFlag);
    VirtualArrayInternalFlags resp = null;
    try {
        resp = addSignature(rRoot).get(VirtualArrayInternalFlags.class);
    } catch (UniformInterfaceException e) {
        _log.warn("could not get protection of varray {}. Err:{}", id, e);
        if (e.getResponse().getStatus() == 404) {
            throw APIException.notFound.unableToFindEntityInURL(id);
        }
    }
    return resp.getProtectionType();
}
Also used : VirtualArrayInternalFlags(com.emc.storageos.model.varray.VirtualArrayInternalFlags) UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) WebResource(com.sun.jersey.api.client.WebResource)

Aggregations

VirtualArrayInternalFlags (com.emc.storageos.model.varray.VirtualArrayInternalFlags)4 VirtualArray (com.emc.storageos.db.client.model.VirtualArray)2 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)2 WebResource (com.sun.jersey.api.client.WebResource)2