public Update(Subnet subnet) { super(CLIENT, HttpMethod.PUT, buildPath("subnets/", subnet.getId()), Entity.json(subnet), Subnet.class); } }
ObjectMapper.map(subnet, this, dictionary); switch (subnet.getIpversion().code()) { case IPV6: setIpv4(false); setIpv4(true); setDhcp(subnet.getEnableDHCP().booleanValue()); if (!subnet.getHostRoutes().isEmpty()) { List<com.woorea.openstack.quantum.model.Route> routes = subnet.getHostRoutes();
com.woorea.openstack.quantum.model.Subnet subnetToCreate = new com.woorea.openstack.quantum.model.Subnet(); subnetToCreate.setName(subnet.getName()); subnetToCreate.setNetworkId(subnet.getNetwork()); subnetToCreate.setCidr(subnet.getRouting()); subnetToCreate.setGw(subnet.getGatewayIp()); subnetToCreate.setEnableDHCP(subnet.isDhcp()); subnetToCreate.setDnsNames(subnet.getDns()); subnetToCreate.setIpversion(IpVersion.IPV4); } else { subnetToCreate.setIpversion(IpVersion.IPV6); subnetToCreate.setHostRoutes(routesToCreate);
Subnet sub = new Subnet(); SubnetForCreate subnet = new SubnetForCreate(); subnet.setCidr(""); .execute(); RouterForAddInterface routerForAdd = new RouterForAddInterface(); routerForAdd.setSubnetId(sub.getId()); routerForAdd.setRouterId(router.getId()); quantum.routers().addInterface(routerForAdd).execute();
/** * @see com.att.cdp.zones.NetworkService#getSubnetsByName(java.lang.String) */ @SuppressWarnings("nls") @Override public List<Subnet> getSubnetsByName(String name) throws ZoneException { connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SUBNET, name); RequestState.put(RequestState.SERVICE, "Network"); RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint()); List<Subnet> list = new ArrayList<>(); try { Quantum client = quantumConnector.getClient(); SubnetsResource resource = client.subnets(); for (com.woorea.openstack.quantum.model.Subnet net : resource.list().execute()) { if (net.getName().equals(name)) { list.add(new OpenStackSubnet(context, net)); } } } catch (OpenStackBaseException e) { ExceptionMapper.mapException(e); } return list; }
public Update(Subnet subnet) { super(CLIENT, HttpMethod.PUT, buildPath("subnets", subnet.getId()), Entity.json(subnet), Subnet.class); } }
public Update(Subnet subnet) { super(CLIENT, HttpMethod.PUT, buildPath("subnets", subnet.getId()), Entity.json(subnet), Subnet.class); } }
/** * @see com.att.cdp.zones.NetworkService#getSubnetById(java.lang.String) */ @SuppressWarnings("nls") @Override public Subnet getSubnetById(String id) throws ZoneException { connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SUBNET, id); RequestState.put(RequestState.SERVICE, "Network"); RequestState.put(RequestState.SERVICE_URL, quantumConnector.getEndpoint()); try { Quantum client = quantumConnector.getClient(); SubnetsResource resource = client.subnets(); for (com.woorea.openstack.quantum.model.Subnet net : resource.list().execute()) { if (net.getId().equals(id)) { return new OpenStackSubnet(context, net); } } } catch (OpenStackBaseException e) { ExceptionMapper.mapException(e); } return null; }