Ask Your Question

Python Heat client API ResourceManager.geretae_template

asked 2014-04-10 15:35:13 -0500

anonymous user


updated 2014-04-10 15:48:11 -0500

I am looking for a way if in Heat there is anyway you can generate templates based on specifying resource type. For example, from my front end, I get passed on the resource types and the inpout parameters and from that infromation if there is any utility that calls the API to generate the template on the fly.

I am curious if there is any way in HeatAPI that can help. I see there is a function in Heat API called heat.resources.generate_template(self,resource_name). I tried among other things specifying resource type such as "OS::Heat::InstanceGroup" but it seems it is trying to create a url based off of that in '/resource_types/%s/template' % ( urlutils.quote(strutils.safe_encode(resource_name), ''))which gives me a connection error.

Is there any functionality in the Heat Client API that can help me with this?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-04-13 21:47:54 -0500

Steve Baker gravatar image

It sounds like resource-template provides what you are asking for here:

$ heat resource-template OS::Heat::InstanceGroup
HeatTemplateFormatVersion: '2012-12-12'
  InstanceList: {Description: A comma-delimited list of server ip addresses. (Heat
      extension)., Value: '{"Fn::GetAtt": ["InstanceGroup", "InstanceList"]}'}
  AvailabilityZones: {Description: Not Implemented., Type: CommaDelimitedList}
  LaunchConfigurationName: {Description: Name of LaunchConfiguration resource., Type: String}
  LoadBalancerNames: {Description: List of LoadBalancer resources., Type: CommaDelimitedList}
  Size: {Description: Desired number of instances., Type: Number}
  Tags: {Description: Tags to attach to this group., Type: CommaDelimitedList}
        - ','
        - {Ref: AvailabilityZones}
      LaunchConfigurationName: {Ref: LaunchConfigurationName}
        - ','
        - {Ref: LoadBalancerNames}
      Size: {Ref: Size}
        - ','
        - {Ref: Tags}
    Type: OS::Heat::InstanceGroup
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-04-10 15:35:13 -0500

Seen: 221 times

Last updated: Apr 13 '14