public Create(Network network) { super(CLIENT, HttpMethod.POST, "/os-networks", Entity.json(network), Network.class); this.network = network; } }
/** * Construct the request to evacuate the server * * @param uuid * The instance to be evacuated * @param entity * The request entity */ public EvacuateAction(String uuid, ServerAction.Evacuate entity) { super(uuid, Entity.json(entity), Void.class); } }
public Create(VolumeForCreate volume) { super(CLIENT, HttpMethod.POST, "/os-volumes", Entity.json(volume), Volume.class); // this.volume = volume; }
public AddHost(String aggregateId, String hostId) { super(CLIENT, HttpMethod.POST, new StringBuffer("/os-aggregates/") .append(aggregateId).append("/action"), Entity.json("{\"add_host\": {\"host\": \"" + hostId + "\" }}"), HostAggregate.class); }
public RemoveHost(String hostId, String aggregateId) { super(CLIENT, HttpMethod.POST, new StringBuffer("/os-aggregates/") .append(aggregateId).append("/action"), Entity.json("{\"remove_host\": {\"host\": \"" + hostId + "\" }}"), HostAggregate.class); }
public SetMetadata(String aggregateId, String key, String value) { super(CLIENT, HttpMethod.POST, new StringBuffer("/os-aggregates/") .append(aggregateId).append("/action"), Entity.json("{\"set_metadata\": {\"metadata\": { \"" + key + "\": \"" + value + "\" }}}"), HostAggregate.class); } }
public RemoveHost(String hostId, String aggregateId) { super(CLIENT, HttpMethod.POST, new StringBuffer("/os-aggregates/") .append(aggregateId).append("/action"), Entity.json("{\"remove_host\": {\"host\": \"" + hostId + "\" }}"), HostAggregate.class); }
public InitializeConnection(String id, ConnectionForInitialize connectionForInitialize) { super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/") .append(id).append("/action").toString(), Entity.json(connectionForInitialize), ConnectionInfo.class); }
public TerminateConnection(String id, ConnectionForTerminate connectionForTerminate) { super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/") .append(id).append("/action").toString(), Entity.json(connectionForTerminate), Void.class); }
public UploadToImage(VolumeForImageCreate volumeForImageCreate) { super(CLIENT, HttpMethod.POST, new StringBuilder("/volumes/") .append(volumeForImageCreate.getVolumeId() + "/action"), Entity.json(volumeForImageCreate), Void.class); }
public Allocate allocate(String pool) { Entity<?> entity=null; if(pool!=null) { Map<String, String> body = new HashMap<String, String>(); body.put("pool", pool); entity=Entity.json(body); } return new Allocate(entity); }
public Update(LoadBalancerHealthMonitor hm) { super(CLIENT, HttpMethod.PUT, buildPath("lb/health_monitors/", hm.getId()), Entity.json(hm), LoadBalancerHealthMonitor.class); } }
public Detach(RouterForAddInterface interfaceToAdd) { super(CLIENT, HttpMethod.PUT, buildPath("routers/", interfaceToAdd.getRouterId(), "/remove_router_interface"), Entity.json(interfaceToAdd), RouterInterface.class); }
public Update(LoadBalancerMember member) { super(CLIENT, HttpMethod.PUT, buildPath("lb/members/", member.getId()), Entity.json(member), LoadBalancerMember.class); } }
public Detach(RouterForAddInterface interfaceToAdd) { super(CLIENT, HttpMethod.PUT, buildPath("routers", interfaceToAdd.getRouterId(), "remove_router_interface"), Entity.json(interfaceToAdd), RouterInterface.class); }
public Disable(final String host, final String binary) { super(CLIENT, HttpMethod.PUT, "/os-services/disable", Entity.json(new HashMap<String, String>() {{ put("host", host); put("binary", binary); }}), Void.class); } }
public Update(LoadBalancerPool pool) { super(CLIENT, HttpMethod.PUT, buildPath("lb/pools/", pool.getId()), Entity.json(pool), LoadBalancerPool.class); } }
public Enable(final String host, final String binary) { super(CLIENT, HttpMethod.PUT, "/os-services/enable", Entity.json(new HashMap<String, String>() {{ put("host", host); put("binary", binary); }}), Void.class); } }
public Update(LoadBalancerVIP vip) { super(CLIENT, HttpMethod.PUT, buildPath("lb/vips/", vip.getId()), Entity.json(vip), LoadBalancerVIP.class); } }
public Detach(RouterForAddInterface interfaceToAdd) { super(CLIENT, HttpMethod.PUT, buildPath("routers", interfaceToAdd.getRouterId(), "remove_router_interface"), Entity.json(interfaceToAdd), RouterInterface.class); }