Esempio n. 1
0
 def configure_cloud_account(self, dts, acct_type):
     account_xpath = "C,/rw-project:project/rw-cloud:cloud/account"
     msg = self.get_cloud_account_msg(acct_type)
     self.log.info("Configuring cloud-account: %s",msg)
     yield from dts.query_create(account_xpath,
                                 rwdts.XactFlag.ADVISE,
                                 msg)
Esempio n. 2
0
 def configure_network_resource_pools(self, dts, resource_type, cloud_type):
     pool_xpath = "C,/rw-project:project/rw-resource-mgr:resource-mgr-config/rw-resource-mgr:resource-pools"
     msg = self.get_network_pool_msg("virtual-network", resource_type, cloud_type)
     self.log.info("Configuring network-resource-pool: %s",msg)
     yield from dts.query_create(pool_xpath,
                                 rwdts.XactFlag.ADVISE,
                                 msg)
Esempio n. 3
0
 def configure_network_resource_pools(self, dts, resource_type, cloud_type):
     pool_xpath = "C,/rw-resource-mgr:resource-mgr-config/rw-resource-mgr:resource-pools"
     msg = self.get_network_pool_msg("virtual-network", resource_type, cloud_type)
     self.log.info("Configuring network-resource-pool: %s",msg)
     yield from dts.query_create(pool_xpath,
                                 rwdts.Flag.ADVISE,
                                 msg)
Esempio n. 4
0
 def configure_l2_network(self, dts):
     nwtop = RwTl.YangData_IetfNetwork()
     l2top = MyL2Topology(nwtop, self.log)
     l2top.setup_all()
     nw_xpath = "C,/nd:network"
     self.log.info("Configuring l2 network: %s", nwtop)
     yield from dts.query_create(nw_xpath, rwdts.XactFlag.ADVISE, nwtop)
Esempio n. 5
0
 def configure_cloud_account(self, dts, cloud_type, cloud_name="cloud1"):
     account = self.get_cal_account(cloud_type, cloud_name)
     account_xpath = "C,/rw-cloud:cloud/rw-cloud:account[rw-cloud:name='{}']".format(cloud_name)
     self.log.info("Configuring cloud-account: %s", account)
     yield from dts.query_create(account_xpath,
                                 rwdts.Flag.ADVISE | rwdts.Flag.TRACE,
                                 account)
Esempio n. 6
0
 def configure_cloud_account(self, dts, cloud_type, cloud_name="cloud1"):
     account = self.get_cal_account(cloud_type, cloud_name)
     account_xpath = "C,/rw-cloud:cloud/rw-cloud:account[rw-cloud:name='{}']".format(
         cloud_name)
     self.log.info("Configuring cloud-account: %s", account)
     yield from dts.query_create(account_xpath, rwdts.XactFlag.ADVISE,
                                 account)
Esempio n. 7
0
 def configure_compute_resource_pools(self, dts, resource_type, cloud_type):
     pool_xpath = "C,/rw-resource-mgr:resource-mgr-config/rw-resource-mgr:resource-pools"
     msg = self.get_compute_pool_msg("virtual-compute", resource_type, cloud_type)
     self.log.info("Configuring compute-resource-pool: %s",msg)
     yield from dts.query_create(pool_xpath,
                                 rwdts.XactFlag.ADVISE,
                                 msg)
Esempio n. 8
0
 def configure_cloud_account(self, dts, acct_type):
     account_xpath = "C,/rw-cloud:cloud/account"
     msg = self.get_cloud_account_msg(acct_type)
     self.log.info("Configuring cloud-account: %s",msg)
     yield from dts.query_create(account_xpath,
                                 rwdts.Flag.ADVISE,
                                 msg)
Esempio n. 9
0
 def configure_l2_network(self, dts):
     nwtop = RwTl.YangData_IetfNetwork()
     l2top = MyL2Topology(nwtop, self.log)
     l2top.setup_all()
     nw_xpath = "C,/nd:network"
     self.log.info("Configuring l2 network: %s",nwtop)
     yield from dts.query_create(nw_xpath,
                                 rwdts.Flag.ADVISE,
                                 nwtop)
Esempio n. 10
0
    def configure_juju_account(self, dts):
        # This is fake account for juju "mock - monkey patch"
        account = rwcfg_agent.ConfigAgentAccount()
        account.name = 'juju'
        account.account_type = 'juju'
        account.juju.ip_address = '1.1.1.1'
        account.juju.port = 17070
        account.juju.user = '******'
        account.juju.secret = 'nfvjuju'

        configagent_account_xpath = "C,/rw-config-agent:config-agent/rw-config-agent:account[rw-config-agent:name='juju']"
        self.log.info("Configuring juju-account: %s", account)
        yield from dts.query_create(configagent_account_xpath,
                                    rwdts.XactFlag.ADVISE | rwdts.XactFlag.TRACE,
                                    account)
Esempio n. 11
0
    def configure_juju_account(self, dts):
        # This is fake account for juju "mock - monkey patch"
        account = rwcfg_agent.ConfigAgentAccount()
        account.name = 'juju'
        account.account_type = 'juju'
        account.juju.ip_address = '1.1.1.1'
        account.juju.port = 17070
        account.juju.user = '******'
        account.juju.secret = 'nfvjuju'

        configagent_account_xpath = "C,/rw-config-agent:config-agent/rw-config-agent:account[rw-config-agent:name='juju']"
        self.log.info("Configuring juju-account: %s", account)
        yield from dts.query_create(
            configagent_account_xpath,
            rwdts.XactFlag.ADVISE | rwdts.XactFlag.TRACE, account)
    def configure_vm_network(self, dts):
        nwtop = RwTl.YangData_IetfNetwork()
        l2top = MyL2Topology(nwtop, self.log)
        l2top.setup_all()

        provtop = MyProvTopology(nwtop, l2top, self.log)
        provtop.setup_all()

        vmtop = MyVMTopology(nwtop, l2top, provtop, self.log)
        vmtop.setup_all()
        nw_xpath = "C,/nd:network"
        self.log.info("Configuring VM network: %s",nwtop)
        yield from dts.query_create(nw_xpath,
                                    rwdts.XactFlag.ADVISE,
                                    nwtop)
Esempio n. 13
0
    def configure_sfc_network(self, dts):
        nwtop = RwTl.YangData_IetfNetwork()
        l2top = MyL2Topology(nwtop, self.log)
        l2top.setup_all()

        provtop = MyProvTopology(nwtop, l2top, self.log)
        provtop.setup_all()

        vmtop = MyVMTopology(nwtop, l2top, provtop, self.log)
        vmtop.setup_all()

        sfctop = MySfcTopology(nwtop, l2top, provtop, vmtop, self.log)
        sfctop.setup_all()

        nw_xpath = "C,/nd:network"
        self.log.info("Configuring SFC network: %s", nwtop)
        yield from dts.query_create(nw_xpath, rwdts.XactFlag.ADVISE, nwtop)
Esempio n. 14
0
 def reserve_compute_resources(self, name, dts, cloud_type, vlinks = []):
     compute_xpath = "D,/rw-resource-mgr:resource-mgmt/vdu-event/vdu-event-data[event-id='{}']"
     msg,xpath = self.get_compute_reserve_msg(name, cloud_type, compute_xpath, vlinks)
     self.log.debug("Sending create event to compute-event xpath %s with msg: %s" % (xpath, msg))
     yield from dts.query_create(xpath, 0, msg)
     return xpath
Esempio n. 15
0
 def reserve_network_resources(self, name, dts, cloud_type):
     network_xpath = "D,/rw-project:project/rw-resource-mgr:resource-mgmt/vlink-event/vlink-event-data[event-id={}]"
     msg,xpath = self.get_network_reserve_msg(name, cloud_type, network_xpath)
     self.log.debug("Sending create event to network-event xpath %s with msg: %s" % (xpath, msg))
     yield from dts.query_create(xpath, 0, msg)
     return xpath
Esempio n. 16
0
 def reserve_compute_resources(self, name, dts, cloud_type, vlinks = []):
     compute_xpath = "D,/rw-project:project/rw-resource-mgr:resource-mgmt/vdu-event/vdu-event-data[event-id={}]"
     msg,xpath = self.get_compute_reserve_msg(name, cloud_type, compute_xpath, vlinks)
     self.log.debug("Sending create event to compute-event xpath %s with msg: %s" % (xpath, msg))
     yield from dts.query_create(xpath, 0, msg)
     return xpath
Esempio n. 17
0
 def reserve_network_resources(self, name, dts, cloud_type):
     network_xpath = "D,/rw-resource-mgr:resource-mgmt/vlink-event/vlink-event-data[event-id='{}']"
     msg,xpath = self.get_network_reserve_msg(name, cloud_type, network_xpath)
     self.log.debug("Sending create event to network-event xpath %s with msg: %s" % (xpath, msg))
     yield from dts.query_create(xpath, 0, msg)
     return xpath