Ask Your Question
1

how to display the provider template output in heat client or horizon?

asked 2014-07-29 12:10:17 -0500

updated 2014-07-30 14:11:59 -0500

smaffulli gravatar image

I am using nested templates with autoscale groups and I want to be able to define the autoscale group in a provider template but be able to display the "output" section of that provider template.

IS it possible to pass or the display the output section of the ASG.yaml with heat client and/or Horizon? IS it referenced from top.yaml in the outputs section?

Template example below.

TOP.yaml: - defines router, network and subnet - defines a resource pointing to a provider template, ASG.yaml

code snippet top.yaml

resource:
... shortened
 AWE_ASG:
    type: "http://192.xxx.xxx.xxx/heat/v1/asg.yaml"
    properties:
      Private_net_name: { get_param: Private_net_name }
      private_net: { get_resource: private_net }
      private_subnet: { get_resource: private_subnet }
      public_net: 176487e8-d187-4e42-88ff-4f8ec4674c0d

ASG.yaml - defines the Autoscale group - defines the scale up and down policy - defines output section to expose webhook URLs

code snippet asg.yaml

resource:
... shortened
outputs:
  scale_up_url:
    description: >
      This URL is the webhook to scale up the group. 
    value: {get_attr: [scale_up_policy, alarm_url]}
  scale_dn_url:
    description: >
      This URL is the webhook to scale down the group.  
    value: {get_attr: [scale_down_policy, alarm_url]}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-07-30 03:44:32 -0500

I found the answer with some lateral thinking ( and looking at the code ).

Anything defined in an 'outputs' section can be referenced as an 'attribute' of the provider (resource) instance created. Using my example above with the outputs being 'scale_up_url' and 'scale_dn_url' defined in the asg.yaml provider template. The top.yaml file should include in the outputs section references to the the provider stack resource with the name of the output ('scale_up_url' and 'scale_dn_url').

top.yaml

outputs:
  scale_up_url:
    description: >
      This URL is the webhook to scale up the group. 
    value: {get_attr: [AWE_ASG, scale_up_url]}
  scale_dn_url:
    description: >
      This URL is the webhook to scale down the group.  
    value: {get_attr: [AWE_ASG, scale_dn_url]}
edit flag offensive delete link more

Comments

Yep, this is the best way.

FWIW, a provider stack is also a stack, so you can also read its outputs from the API if you want. (The UUID of the provider stack can be obtained from the physical_resource_id of the provider/facade resource.)

zaneb gravatar imagezaneb ( 2014-08-04 11:43:53 -0500 )edit

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

Stats

Asked: 2014-07-29 12:10:17 -0500

Seen: 708 times

Last updated: Jul 30 '14