use of com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState in project photon-model by vmware.
the class ResourceAllocationTaskService method newNicStateFromDescription.
private NetworkInterfaceState newNicStateFromDescription(ResourceAllocationTaskState state, NetworkInterfaceDescription nid) {
NetworkInterfaceState nic = new NetworkInterfaceState();
nic.id = UUID.randomUUID().toString();
nic.documentSelfLink = nic.id;
nic.name = nid.name;
nic.deviceIndex = nid.deviceIndex;
nic.address = nid.address;
nic.networkLink = nid.networkLink;
nic.subnetLink = nid.subnetLink;
nic.networkInterfaceDescriptionLink = nid.documentSelfLink;
nic.securityGroupLinks = nid.securityGroupLinks;
nic.groupLinks = nid.groupLinks;
nic.tagLinks = nid.tagLinks;
nic.tenantLinks = state.tenantLinks;
nic.endpointLink = nid.endpointLink;
nic.endpointLinks = new HashSet<String>();
nic.endpointLinks.add(nid.endpointLink);
nic.computeHostLink = nid.computeHostLink;
nic.regionId = nid.regionId;
nic.customProperties = nid.customProperties;
return nic;
}
use of com.vmware.photon.controller.model.resources.NetworkInterfaceService.NetworkInterfaceState in project photon-model by vmware.
the class NicSecurityGroupsTaskServiceTest method createNetworkInterface.
private static NetworkInterfaceState createNetworkInterface(BaseModelTest test) throws Throwable {
NetworkInterfaceState networkInterfaceState = new NetworkInterfaceState();
networkInterfaceState.subnetLink = "subnetLink";
networkInterfaceState.name = UUID.randomUUID().toString();
networkInterfaceState.regionId = "regionId";
networkInterfaceState.id = UUID.randomUUID().toString();
return test.postServiceSynchronously(NetworkInterfaceService.FACTORY_LINK, networkInterfaceState, NetworkInterfaceState.class);
}
Aggregations