use of com.att.cdp.zones.ComputeService in project AJSC by att.
the class TestSecurityGroups method testAssociations.
@Test
@Ignore
public void testAssociations() throws ZoneException {
Context context = connect();
ComputeService service = context.getComputeService();
String name = "sm974v";
String server_id = "7d5b3322-6a00-45cd-ae8f-95d985c4148b";
Server server = service.getServer(server_id);
service.associateACL(server_id, name);
server.refresh();
service.disassociateACL(server_id, name);
server.refresh();
}
use of com.att.cdp.zones.ComputeService in project AJSC by att.
the class TestTemplates method listTemplates.
/**
* Verifies that we can list the existing templates on a provider. This test requires that the provider actually has
* templates installed.
*
* @throws ZoneException
*/
@Test
@Ignore
public void listTemplates() throws ZoneException {
Context context = connect();
ComputeService service = context.getComputeService();
List<Template> templates = service.getTemplates();
assertNotNull(templates);
assertFalse(templates.isEmpty());
for (Template template : templates) {
System.out.println(template.toString());
}
}
use of com.att.cdp.zones.ComputeService in project AJSC by att.
the class OpenStackServer method loadVolumeAttachments.
/**
* This method is called to load the volume attachments, if they have not already been loaded. If they have been
* loaded, then the call is ignored.
*
* @param context
* The context that represents the connection we are servicing
* @throws ZoneException
* If the attachments cannot be obtained, or if a volume cannot be listed, or a volume does not exist
*/
private void loadVolumeAttachments(Context context) throws ZoneException {
if (volumeAttachmentsProcessed.compareAndSet(false, true)) {
VolumeService volumeService = context.getVolumeService();
ComputeService computeService = context.getComputeService();
Map<String, String> attachments = computeService.getAttachments(getId());
for (Entry<String, String> entry : attachments.entrySet()) {
Volume volume = volumeService.getVolume(entry.getValue());
getVolumes().put(entry.getKey(), volume);
}
}
}
use of com.att.cdp.zones.ComputeService in project AJSC by att.
the class OpenStackNetworkService method releaseIpAddress.
/**
* @see com.att.cdp.zones.NetworkService#releaseIpAddress(java.lang.String, java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void releaseIpAddress(String serverId, String assignedAddress) throws ZoneException {
checkArg(serverId, "serverId");
checkArg(assignedAddress, "assignedAddress");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVER, serverId);
RequestState.put(RequestState.IPADDRESS, assignedAddress);
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, novaConnector.getEndpoint());
ComputeService compute = context.getComputeService();
compute.releaseIpAddress(serverId, assignedAddress);
((OpenStackContext) context).deallocateFloatingIP(assignedAddress);
}
use of com.att.cdp.zones.ComputeService in project AJSC by att.
the class TestComputeService method testDeletePort.
@Ignore
@Test
public void testDeletePort() throws ZoneException {
String[] ids = { "0e1ae02a-f34e-4208-a031-ba251c9d6538", "7235a241-a5d1-473c-97e2-f3115e91d878", "791b9689-7f19-469a-9759-154018315d4b", "958bbf73-7559-439d-bbad-94e67fc07263", "b43449bc-a427-4838-a0ab-4fd544533677", "b94deec4-fdcc-41d9-ae93-8d0f746011d2" };
Context context = connect();
ComputeService compute = context.getComputeService();
NetworkService network = context.getNetworkService();
for (String id : ids) {
Port port = network.getPort(id);
if (port != null) {
port.delete();
}
}
}
Aggregations