public Create create(String name) { return create(name, null); }
/** * @see com.att.cdp.zones.IdentityService#getKeyPairs() */ @SuppressWarnings("nls") @Override public List<KeyPair> getKeyPairs() throws ZoneException { trackRequest(); Context context = getContext(); if (context.isLoggedIn()) { NovaConnector connector = ((OpenStackContext) context).getNovaConnector(); KeyPairs pairs = null; try { pairs = connector.getClient().keyPairs().list().execute(); } catch (OpenStackConnectException e) { throw new ContextConnectionException(EELFResourceManager.format(OSMsg.PAL_OS_CONNECTION_FAILED, "Compute", connector.getEndpoint()), e); } catch (OpenStackResponseException e) { throw new ZoneException(EELFResourceManager.format(OSMsg.PAL_OS_REQUEST_FAILURE, "get key-pair list"), e); } ArrayList<KeyPair> list = new ArrayList<>(); for (com.woorea.openstack.nova.model.KeyPair pair : pairs.getList()) { OpenStackKeyPair kp = new OpenStackKeyPair(context, pair); list.add(kp); } return list; } throw new ZoneException( "Unable to retrieve key-pairs when the context has not been logged in and authenticated"); }
public Nova(String endpoint, OpenStackClientConnector connector) { super(endpoint, connector); EXTENSIONS = new ExtensionsResource(this); SERVERS = new ServersResource(this); IMAGES = new ImagesResource(this); FLAVORS = new FlavorsResource(this); KEY_PAIRS = new KeyPairsExtension(this); FLOATING_IPS = new FloatingIpsExtension(this); SECURITY_GROUPS = new SecurityGroupsExtension(this); SNAPSHOTS = new SnapshotsExtension(this); VOLUMES = new VolumesExtension(this); AGGREGATES = new AggregatesExtension(this); QUOTA_SETS = new QuotaSetsResource(this); HOSTS = new HostsExtension(this); SERVICES = new ServicesResource(this); HYPERVISORS = new HypervisorsResource(this); }
/** * @see com.att.cdp.zones.IdentityService#deleteKeyPair(com.att.cdp.zones.model.KeyPair) */ @SuppressWarnings("nls") @Override public void deleteKeyPair(KeyPair keyPair) throws ZoneException { trackRequest(); RequestState.put(RequestState.KEYPAIR, keyPair.getName()); Context context = getContext(); if (context.isLoggedIn()) { NovaConnector connector = ((OpenStackContext) context).getNovaConnector(); try { connector.getClient().keyPairs().delete(keyPair.getName()).execute(); } catch (OpenStackConnectException e) { throw new ContextConnectionException(EELFResourceManager.format(OSMsg.PAL_OS_CONNECTION_FAILED, "Compute", connector.getEndpoint()), e); } catch (OpenStackResponseException e) { throw new ZoneException(EELFResourceManager.format(OSMsg.PAL_OS_REQUEST_FAILURE, "delete key-pair " + keyPair.getName()), e); } return; } throw new ZoneException("Unable to delete key-pairs when the context has not been logged in and authenticated"); }
KeyPairs keysPairs = nova.keyPairs().list().execute();
public Nova(String endpoint, OpenStackClientConnector connector) { super(endpoint, connector); EXTENSIONS = new ExtensionsResource(this); SERVERS = new ServersResource(this); IMAGES = new ImagesResource(this); FLAVORS = new FlavorsResource(this); KEY_PAIRS = new KeyPairsExtension(this); FLOATING_IPS = new FloatingIpsExtension(this); SECURITY_GROUPS = new SecurityGroupsExtension(this); SNAPSHOTS = new SnapshotsExtension(this); VOLUMES = new VolumesExtension(this); AGGREGATES = new AggregatesExtension(this); QUOTA_SETS = new QuotaSetsResource(this); HOSTS = new HostsExtension(this); SERVICES = new ServicesResource(this); HYPERVISORS = new HypervisorsResource(this); NETWORKS = new NetworksExtension(this); }
public Create create(String name) { return create(name, null); }
KeyPairs pairs; try { pairs = connector.getClient().keyPairs().list().execute(); } catch (OpenStackConnectException e) { throw new ContextConnectionException(EELFResourceManager.format(OSMsg.PAL_OS_CONNECTION_FAILED,
com.woorea.openstack.nova.model.KeyPair pair; try { pair = connector.getClient().keyPairs().create(keyPair.getName()).execute(); } catch (OpenStackConnectException e) { throw new ContextConnectionException(EELFResourceManager.format(OSMsg.PAL_OS_CONNECTION_FAILED,