Package com.cloud.agent.api

Examples of com.cloud.agent.api.CreateVnsPortAnswer


                BroadcastDomainType.getValue(network.getBroadcastUri()),
                vm.getUuid(),
                tenantId,
                nic.getName(),
                mac);
        CreateVnsPortAnswer answer = (CreateVnsPortAnswer)_agentMgr
                .easySend(bigswitchVnsHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
            s_logger.error("CreatePortCommand failed");
            return false;
        }

        return true;
View Full Code Here


            } catch (BigSwitchVnsApiException ex) {
                s_logger.warn("modifyPortAttachment failed after switchport was created, removing switchport");
                _bigswitchVnsApi.deletePort(cmd.getTenantUuid(), cmd.getNetworkUuid(), cmd.getPortUuid());
                throw (ex); // Rethrow the original exception
            }
            return new CreateVnsPortAnswer(cmd, true, "network port " + cmd.getPortUuid() + " created");
        } catch (BigSwitchVnsApiException e) {
                if (numRetries > 0) {
                        return retry(cmd, --numRetries);
                }
                else {
                        return new CreateVnsPortAnswer(cmd, e);
                }
        }
    }
View Full Code Here

                network.getBroadcastUri().getSchemeSpecificPart(),
                vm.getUuid(),
                tenantId,
                nic.getName(),
                mac);
        CreateVnsPortAnswer answer = (CreateVnsPortAnswer) _agentMgr
                .easySend(bigswitchVnsHost.getId(), cmd);

        if (answer == null || !answer.getResult()) {
            s_logger.error("CreatePortCommand failed");
            return false;
        }

        return true;
View Full Code Here

        Port networkp = mock(Port.class);
        when(networkp.getId()).thenReturn("eeee");

        CreateVnsPortCommand cntkc = new CreateVnsPortCommand("networkid", "portid", "tenantid", "portname", "aa:bb:cc:dd:ee:ff");
        CreateVnsPortAnswer cntka = (CreateVnsPortAnswer) _resource.executeRequest(cntkc);
        assertTrue(cntka.getResult());
    }
View Full Code Here

        Port networkp = mock(Port.class);
        when(networkp.getId()).thenReturn("eeee");
        doThrow(new BigSwitchVnsApiException()).when(_bigswitchVnsApi).createPort((String)any(), (Port)any());

        CreateVnsPortCommand cntkc = new CreateVnsPortCommand("networkid", "portid", "tenantid", "portname", "aa:bb:cc:dd:ee:ff");
        CreateVnsPortAnswer cntka = (CreateVnsPortAnswer) _resource.executeRequest(cntkc);
        assertFalse(cntka.getResult());
    }
View Full Code Here

        Port networkp = mock(Port.class);
        when(networkp.getId()).thenReturn("eeee");
        doThrow(new BigSwitchVnsApiException()).when(_bigswitchVnsApi).modifyPortAttachment((String)any(), (String)any(), (String)any(), (Attachment)any());

        CreateVnsPortCommand cntkc = new CreateVnsPortCommand("networkid", "portid", "tenantid", "portname", "aa:bb:cc:dd:ee:ff");
        CreateVnsPortAnswer cntka = (CreateVnsPortAnswer) _resource.executeRequest(cntkc);
        assertFalse(cntka.getResult());
        verify(_bigswitchVnsApi, atLeastOnce()).deletePort((String) any(), (String) any(), (String) any());
    }
View Full Code Here

TOP

Related Classes of com.cloud.agent.api.CreateVnsPortAnswer

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.