Package org.nimbustools.api.repr.vm

Examples of org.nimbustools.api.repr.vm.VM


    public VM[] getAll(String id, int type)
            throws DoesNotExistException, ManageException {
       
        switch (type) {
            case INSTANCE:
                final VM vm = this.getInstance(id);
                return new VM[]{vm};
            case GROUP:
                return this.getGroup(id);

            case COSCHEDULED:
View Full Code Here


       
        if (resource == null) {
            throw new CannotTranslateException("resource is missing");
        }

        VM vm = this.dataConvert.getVM(resource);
       
        if(VMConstants.LIFE_CYCLE_SPOT.equals(vm.getLifeCycle())){
            AsyncRequest request = asyncHome.getRequestFromVM(Integer.valueOf(vm.getID()));
            if(request != null){
                ((_VM)vm).setSpotInstanceRequestID(request.getId());
            }
        }
       
View Full Code Here

                errorMsg = "VM ID: " + id + " does not exist";
                return null;
            }

            VM[] vms = new VM[1];
            VM instance = manager.getInstance(id);
            vms[0] = instance;
            return vms;
        }
        catch (DoesNotExistException e) {
            errorMsg = "VM ID: " + id + " does not exist";
View Full Code Here

    public synchronized VM getCachedAndValidatedVM(String ip)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        final Element el = this.cache.get(ip);
        final VM vm;
        if (el == null) {
            vm = this.getVM(ip);
            this.validateVM(vm, ip);
            this.cache.put(new Element(ip, vm));
        } else {
View Full Code Here

     */
    public VM getValidatedVM(String ipAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {
       
        final VM vm = this.getVM(ipAddress);
        this.validateVM(vm, ipAddress);
        return vm;
    }
View Full Code Here

     */
    protected String userData(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final String data = vm.getMdUserData();
        if (data == null) {
            return "";
        } else {
            return data;
        }
View Full Code Here

     */
    protected String amiID(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        VM vm = this.getCachedAndValidatedVM(remoteAddress);
        VMFile[] files = vm.getVMFiles();
        for (VMFile file: files) {
            if (file.isRootFile()) {
                return this.justFilename(file.getURI().toASCIIString());
            }
        }
View Full Code Here

     */
    protected String amiLaunchIndex(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {
       
        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        return Integer.toString(vm.getLaunchIndex());
    }
View Full Code Here

     */
    protected String localIPV4(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final NIC nic = this.getLocalNIC(vm);
        if (nic != null) {
            final String ip = nic.getIpAddress();
            if (ip != null) {
                return ip.trim();
View Full Code Here

     */
    protected String publicIPV4(String remoteAddress)
            throws MetadataServerException,
                   MetadataServerUnauthorizedException {

        final VM vm = this.getCachedAndValidatedVM(remoteAddress);
        final NIC nic = this.getPublicNIC(vm);
        if (nic != null) {
            final String ip = nic.getIpAddress();
            if (ip != null) {
                return ip.trim();
View Full Code Here

TOP

Related Classes of org.nimbustools.api.repr.vm.VM

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.