Пример #1
0
 def translation_rules(self, props):
     return [
         translation.TranslationRule(
             props,
             translation.TranslationRule.REPLACE,
             [self.SUBNET],
             value_path=[self.SUBNET_ID]
         ),
         translation.TranslationRule(
             props,
             translation.TranslationRule.RESOLVE,
             [self.SUBNET],
             client_plugin=self.client_plugin(),
             finder='find_resourceid_by_name_or_id',
             entity='subnet'
         ),
         translation.TranslationRule(
             props,
             translation.TranslationRule.RESOLVE,
             [self.VIP, self.VIP_SUBNET],
             client_plugin=self.client_plugin(),
             finder='find_resourceid_by_name_or_id',
             entity='subnet'
         )
     ]
Пример #2
0
 def translation_rules(self, props):
     rules = [
         translation.TranslationRule(
             props,
             translation.TranslationRule.RESOLVE,
             [self.EXTERNAL_GATEWAY, self.EXTERNAL_GATEWAY_NETWORK],
             client_plugin=self.client_plugin(),
             finder='find_resourceid_by_name_or_id',
             entity='network'),
         translation.TranslationRule(
             props,
             translation.TranslationRule.RESOLVE, [
                 self.EXTERNAL_GATEWAY, self.EXTERNAL_GATEWAY_FIXED_IPS,
                 self.SUBNET
             ],
             client_plugin=self.client_plugin(),
             finder='find_resourceid_by_name_or_id',
             entity='subnet')
     ]
     if props.get(self.L3_AGENT_ID):
         rules.extend([
             translation.TranslationRule(props,
                                         translation.TranslationRule.ADD,
                                         [self.L3_AGENT_IDS],
                                         [props.get(self.L3_AGENT_ID)]),
             translation.TranslationRule(props,
                                         translation.TranslationRule.DELETE,
                                         [self.L3_AGENT_ID])
         ])
     return rules
Пример #3
0
 def translation_rules(self, props):
     return [
         translation.TranslationRule(props,
                                     translation.TranslationRule.REPLACE,
                                     [self.NETWORK],
                                     value_path=[self.NETWORK_ID]),
         translation.TranslationRule(props,
                                     translation.TranslationRule.RESOLVE,
                                     [self.NETWORK],
                                     client_plugin=self.client_plugin(),
                                     finder='find_resourceid_by_name_or_id',
                                     entity='network')
     ]
Пример #4
0
 def translation_rules(self, props):
     if props.get(self.SEQUENCE):
         return [
             translation.TranslationRule(
                 props, translation.TranslationRule.ADD,
                 [self.CHARACTER_CLASSES],
                 [{
                     self.CHARACTER_CLASSES_CLASS: props.get(self.SEQUENCE),
                     self.CHARACTER_CLASSES_MIN: 1
                 }]),
             translation.TranslationRule(props,
                                         translation.TranslationRule.DELETE,
                                         [self.SEQUENCE])
         ]