Search in sources :

Example 1 with NetworkCreate

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

the class ApiTest method zoneCosSetup.

private void zoneCosSetup() {
    VirtualArrayList nList = rSTAdmin1.path("/vdc/varrays/").get(VirtualArrayList.class);
    Assert.assertEquals(1, nList.getVirtualArrays().size());
    _nh = nList.getVirtualArrays().get(0).getId();
    _log.info("varray: " + _nh.toString());
    NetworkCreate param = new NetworkCreate();
    param.setTransportType("IP");
    param.setLabel("iptz");
    _iptzone = rZAdmin.path(String.format("/vdc/varrays/%s/networks", _nh).toString()).post(NetworkRestRep.class, param);
    NetworkCreate fctzone = new NetworkCreate();
    fctzone.setTransportType("FC");
    fctzone.setLabel("fctz");
    _fctzone = rZAdmin.path(String.format("/vdc/varrays/%s/networks", _nh).toString()).post(NetworkRestRep.class, fctzone);
    FileVirtualPoolParam paramCosFile = new FileVirtualPoolParam();
    paramCosFile.setName("isilon-file");
    paramCosFile.setProtocols(new HashSet<String>());
    paramCosFile.getProtocols().add(StorageProtocol.File.NFS.name());
    _cosFile = rZAdmin.path("/file/vpools").post(FileVirtualPoolRestRep.class, paramCosFile);
    BlockVirtualPoolParam paramCosBlock = new BlockVirtualPoolParam();
    paramCosBlock.setName("vnx-block");
    paramCosBlock.setProtocols(new HashSet<String>());
    paramCosBlock.getProtocols().add(StorageProtocol.Block.FC.name());
    paramCosBlock.setProvisionType("Thick");
    paramCosBlock.setMaxPaths(2);
    _cosBlock = rZAdminGr.path("/block/vpools").post(BlockVirtualPoolRestRep.class, paramCosBlock);
    ACLAssignmentChanges changes = new ACLAssignmentChanges();
    changes.setAdd(new ArrayList<ACLEntry>());
    ACLEntry entry1 = new ACLEntry();
    entry1.setTenant(subtenant1Id.toString());
    entry1.setAces(new ArrayList<String>());
    entry1.getAces().add("USE");
    changes.getAdd().add(entry1);
    ClientResponse resp = rSys.path(String.format(_blockCosAclUrl, _cosBlock.getId().toString())).put(ClientResponse.class, changes);
    Assert.assertEquals(200, resp.getStatus());
    resp = rSys.path(String.format(_fileCosAclUrl, _cosFile.getId().toString())).put(ClientResponse.class, changes);
    Assert.assertEquals(200, resp.getStatus());
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) FileVirtualPoolParam(com.emc.storageos.model.vpool.FileVirtualPoolParam) ACLAssignmentChanges(com.emc.storageos.model.auth.ACLAssignmentChanges) FileVirtualPoolRestRep(com.emc.storageos.model.vpool.FileVirtualPoolRestRep) NetworkCreate(com.emc.storageos.model.varray.NetworkCreate) ACLEntry(com.emc.storageos.model.auth.ACLEntry) VirtualArrayList(com.emc.storageos.model.varray.VirtualArrayList) BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) BlockVirtualPoolParam(com.emc.storageos.model.vpool.BlockVirtualPoolParam) NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep)

Example 2 with NetworkCreate

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

the class Networks method createIpNetwork.

@FlashException("list")
public static void createIpNetwork(String name, String virtualArrayId) {
    NetworkCreate param = new NetworkCreate();
    param.setLabel(name);
    param.setTransportType(TransportProtocols.IP);
    if (StringUtils.isNotBlank(virtualArrayId)) {
        param.setVarrays(uris(virtualArrayId));
    }
    NetworkRestRep network = NetworkUtils.create(param);
    edit(stringId(network), virtualArrayId);
}
Also used : NetworkCreate(com.emc.storageos.model.varray.NetworkCreate) NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep) FlashException(controllers.util.FlashException)

Aggregations

NetworkCreate (com.emc.storageos.model.varray.NetworkCreate)2 NetworkRestRep (com.emc.storageos.model.varray.NetworkRestRep)2 ACLAssignmentChanges (com.emc.storageos.model.auth.ACLAssignmentChanges)1 ACLEntry (com.emc.storageos.model.auth.ACLEntry)1 VirtualArrayList (com.emc.storageos.model.varray.VirtualArrayList)1 BlockVirtualPoolParam (com.emc.storageos.model.vpool.BlockVirtualPoolParam)1 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)1 FileVirtualPoolParam (com.emc.storageos.model.vpool.FileVirtualPoolParam)1 FileVirtualPoolRestRep (com.emc.storageos.model.vpool.FileVirtualPoolRestRep)1 ClientResponse (com.sun.jersey.api.client.ClientResponse)1 FlashException (controllers.util.FlashException)1