Ejemplo n.º 1
0
    def create(self, context, hm, pool_id):
        h = hm.copy()
        h['pool_id'] = pool_id
        with a10.A10WriteHMStatusContext(self, context, h) as c:
            try:
                self._set(c, c.client.slb.hm.create, context, hm)
            except acos_errors.Exists:
                pass

            if pool_id is not None:
                c.client.slb.service_group.update(
                    self._pool_name(context, pool_id),
                    health_monitor=self._meta_name(hm))

            for pool in hm['pools']:
                if pool['pool_id'] == pool_id:
                    continue
                c.client.slb.service_group.update(
                    self._pool_name(context, pool['pool_id']),
                    health_monitor=self._meta_name(hm))
Ejemplo n.º 2
0
 def update(self, context, old_hm, hm, pool_id):
     h = hm.copy()
     h['pool_id'] = pool_id
     with a10.A10WriteHMStatusContext(self, context, h) as c:
         self._set(c, c.client.slb.hm.update, context, hm)