OpenStack Orchestration (Heat)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.0 KiB

# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
Register of resource types and their mapping to Resource classes.
from heat.engine import resources
from heat.engine import cloud_watch
from heat.engine import eip
from heat.engine import instance
from heat.engine import loadbalancer
from heat.engine import security_group
from heat.engine import stack
from heat.engine import user
from heat.engine import volume
from heat.engine import wait_condition
_resource_classes = {
'AWS::CloudFormation::Stack': stack.Stack,
'AWS::CloudFormation::WaitCondition': wait_condition.WaitCondition,
'AWS::CloudWatch::Alarm': cloud_watch.CloudWatchAlarm,
'AWS::EC2::EIP': eip.ElasticIp,
'AWS::EC2::EIPAssociation': eip.ElasticIpAssociation,
'AWS::EC2::Instance': instance.Instance,
'AWS::EC2::SecurityGroup': security_group.SecurityGroup,
'AWS::EC2::Volume': volume.Volume,
'AWS::EC2::VolumeAttachment': volume.VolumeAttachment,
'AWS::ElasticLoadBalancing::LoadBalancer': loadbalancer.LoadBalancer,
'AWS::IAM::User': user.User,
'AWS::IAM::AccessKey': user.AccessKey,
'HEAT::HA::Restarter': instance.Restarter,
def getClass(resource_type):
"""Return the appropriate Resource class for the resource type."""
return _resource_classes.get(resource_type, resources.GenericResource)