How to use the heat.engine.translation.TranslationRule function in heat

To help you get started, we’ve selected a few heat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openstack / heat / heat / engine / resources / openstack / nova / server.py View on Github external
translation.TranslationRule.REPLACE,
                translation_path=[self.NETWORKS, self.NETWORK_ID],
                value_name=self.NETWORK_UUID),
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                translation_path=[self.FLAVOR],
                client_plugin=self.client_plugin('nova'),
                finder='find_flavor_by_name_or_id'),
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                translation_path=[self.IMAGE],
                client_plugin=glance_client_plugin,
                finder='find_image_by_name_or_id'),
            translation.TranslationRule(
                props,
                translation.TranslationRule.REPLACE,
                translation_path=[self.BLOCK_DEVICE_MAPPING_V2,
                                  self.BLOCK_DEVICE_MAPPING_IMAGE],
                value_name=self.BLOCK_DEVICE_MAPPING_IMAGE_ID),
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                translation_path=[self.BLOCK_DEVICE_MAPPING_V2,
                                  self.BLOCK_DEVICE_MAPPING_IMAGE],
                client_plugin=glance_client_plugin,
                finder='find_image_by_name_or_id'),
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                translation_path=[self.NETWORKS, self.NETWORK_ID],
github openstack / heat / heat / engine / resources / openstack / neutron / network_gateway.py View on Github external
def translation_rules(self, props):
        return [
            translation.TranslationRule(
                props,
                translation.TranslationRule.REPLACE,
                [self.CONNECTIONS, self.NETWORK],
                value_name=self.NETWORK_ID
            ),
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                [self.CONNECTIONS, self.NETWORK],
                client_plugin=self.client_plugin(),
                finder='find_resourceid_by_name_or_id',
                entity='network'
            )
github openstack / heat / heat / engine / resources / openstack / heat / random_string.py View on Github external
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]
                )
github openstack / heat / heat / engine / resources / openstack / nova / quota.py View on Github external
def translation_rules(self, props):
        return [
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                [self.PROJECT],
                client_plugin=self.client_plugin('keystone'),
                finder='get_project_id')
        ]
github openstack / heat / heat / engine / resources / openstack / keystone / role.py View on Github external
def translation_rules(self, properties):
        return [
            translation.TranslationRule(
                properties,
                translation.TranslationRule.RESOLVE,
                [self.DOMAIN],
                client_plugin=self.client_plugin(),
                finder='get_domain_id'
            )
github openstack / heat / heat / engine / resources / openstack / neutron / sfc / port_pair_group.py View on Github external
def translation_rules(self, props):
        return [
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                [self.PORT_PAIRS],
                client_plugin=self.client_plugin(),
                finder='resolve_ext_resource',
                entity='port_pair'
            )
github openstack / heat / heat / engine / resources / openstack / neutron / router.py View on Github external
def translation_rules(self, props):
        client_plugin = self.client_plugin()
        rules = [
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                [self.EXTERNAL_GATEWAY, self.EXTERNAL_GATEWAY_NETWORK],
                client_plugin=client_plugin,
                finder='find_resourceid_by_name_or_id',
                entity=client_plugin.RES_TYPE_NETWORK
            ),
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                [self.EXTERNAL_GATEWAY, self.EXTERNAL_GATEWAY_FIXED_IPS,
                 self.SUBNET],
                client_plugin=client_plugin,
                finder='find_resourceid_by_name_or_id',
                entity=client_plugin.RES_TYPE_SUBNET
            ),
github openstack / heat / heat / engine / resources / openstack / magnum / cluster.py View on Github external
def translation_rules(self, props):
        return [
            translation.TranslationRule(
                props,
                translation.TranslationRule.RESOLVE,
                [self.CLUSTER_TEMPLATE],
                client_plugin=self.client_plugin('magnum'),
                finder='get_cluster_template')
        ]
github openstack / heat / heat / engine / resources / openstack / keystone / role.py View on Github external
def translation_rules(self, properties):
        return [
            translation.TranslationRule(
                properties,
                translation.TranslationRule.RESOLVE,
                [self.DOMAIN],
                client_plugin=self.client_plugin(),
                finder='get_domain_id'
            )