Search in sources :

Example 1 with FileSystemSnapshotParam

use of com.emc.storageos.model.file.FileSystemSnapshotParam in project coprhd-controller by CoprHD.

the class ApiTest method checkSnapCreate.

private void checkSnapCreate(BalancedWebResource user, boolean good) {
    FileSystemSnapshotParam param = new FileSystemSnapshotParam();
    param.setLabel("test-fs-snap-" + System.currentTimeMillis());
    String snapCreateURL = String.format("/file/filesystems/%s/snapshots", _fs);
    if (good) {
        TaskResourceRep resp = user.path(snapCreateURL).post(TaskResourceRep.class, param);
        Assert.assertNotNull(resp.getOpId());
        Assert.assertNotNull(resp.getResource());
    } else {
        ClientResponse resp = user.path(snapCreateURL).post(ClientResponse.class, param);
        Assert.assertEquals(403, resp.getStatus());
    }
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) FileSystemSnapshotParam(com.emc.storageos.model.file.FileSystemSnapshotParam) TaskResourceRep(com.emc.storageos.model.TaskResourceRep)

Example 2 with FileSystemSnapshotParam

use of com.emc.storageos.model.file.FileSystemSnapshotParam in project coprhd-controller by CoprHD.

the class CreateFileSnapshot method doExecute.

@Override
protected Task<FileSnapshotRestRep> doExecute() throws Exception {
    FileSystemSnapshotParam snapshot = new FileSystemSnapshotParam();
    snapshot.setLabel(name);
    return getClient().fileSnapshots().createForFileSystem(fileSystemId, snapshot);
}
Also used : FileSystemSnapshotParam(com.emc.storageos.model.file.FileSystemSnapshotParam)

Aggregations

FileSystemSnapshotParam (com.emc.storageos.model.file.FileSystemSnapshotParam)2 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)1 ClientResponse (com.sun.jersey.api.client.ClientResponse)1