<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[CloudForms Now]]></provider_name><provider_url><![CDATA[http://cloudformsblog.redhat.com]]></provider_url><author_name><![CDATA[johnhardy36]]></author_name><author_url><![CDATA[https://cloudformsblog.redhat.com/author/johnhardy36/]]></author_url><title><![CDATA[Example using Tagging for Displaying Pricing and Quota on Service&nbsp;Dialogs]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>&nbsp;</p>
<h2><b>Introduction</b></h2>
<p><span style="font-weight:400;">This post explains a solution whereby Red Hat CloudForms is enabled to show back to the users their remaining tenant budget when ordering services via the service catalog. The implementation uses CloudForms taxonomy and custom methods to display service costs, quota, and a message on the Service Dialog screen.</span></p>
<h2><b>Use-Case</b></h2>
<p><span style="font-weight:400;">As a user, I wish to be presented the cost of the service I am ordering, along with my current budget and remaining budget when the service is ordered. I would like my budget to be set and maintained at my tenant level.</span></p>
<p><!--more--></p>
<h2><b>Solution</b></h2>
<p><span style="font-weight:400;">This article describes a possible solution which consists in adding a tab to the service dialog to display required information to the end-user.</span></p>
<p><img data-attachment-id="2318" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-28-06/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png" data-orig-size="1536,938" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.28.06" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png?w=1024" class="aligncenter wp-image-2318 size-large" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png?w=1024&#038;h=626" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png?w=1024&amp;h=626 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png?w=150&amp;h=92 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png?w=300&amp;h=183 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png?w=768&amp;h=469 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-28-06.png 1536w" sizes="(max-width: 1024px) 100vw, 1024px"   /></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">You can create a tab for that: the ‘Service Costs’ which contains a number of dynamic elements that retrieve tags from your tenant and service template and calculates the quota status. </span></p>
<p><span style="font-weight:400;">Upon ordering, the Service state machine is updated to call a method that updates the remaining budget tag(s) on the tenant.</span></p>
<p><img data-attachment-id="2319" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-30-00/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png" data-orig-size="1754,990" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.30.00" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png?w=1024" class="wp-image-2319 size-large aligncenter" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png?w=1024&#038;h=578" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png?w=1024&amp;h=578 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png?w=150&amp;h=85 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png?w=300&amp;h=169 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png?w=768&amp;h=433 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-30-00.png 1754w" sizes="(max-width: 1024px) 100vw, 1024px"   /></p>
<p><span style="font-weight:400;">In the state pre3 we have connected to an instance/method called “set_your_budget”. Each time a service is ordered the price of that service is deducted from the existing remaining balance tag on the tenant for the user ordering the service.</span></p>
<p>&nbsp;</p>
<h3><b>Service Dialog Automation</b></h3>
<p><span style="font-weight:400;">The methods behind the service dialog are as follows;</span></p>
<ul>
<li style="font-weight:400;"><b>Cost_of_this_service</b><span style="font-weight:400;"> &#8211; This method obtains the cost of the service from a tag assigned to the service.</span></li>
</ul>
<p><span style="font-weight:400;">Example Tag: cost_of_this_service_10000 or cost_of_this_service_10</span></p>
<ul>
<li style="font-weight:400;"><b>Remaining_budget_after_this_service</b><span style="font-weight:400;"> &#8211; This method calculates the subtracting of the cost_of_this_service from the your_budget value.</span></li>
<li style="font-weight:400;"><b>Set_your_budget</b><span style="font-weight:400;"> &#8211; Called from the state machine to maintain the state of the tags assigned at the tenant for the user ordering the service. Only one tag should exist and will contain the value for the remaining budget.</span></li>
</ul>
<p><span style="font-weight:400;">Example Tag : mycompany_budget_9500 or mycompany_budget_10000</span></p>
<ul>
<li style="font-weight:400;"><b>Your_budget</b><span style="font-weight:400;"> &#8211;  Returns the remaining budget from the tag assigned at the tenant level.</span></li>
<li style="font-weight:400;"><b>Status</b><span style="font-weight:400;"> &#8211; Returns the status message.</span></li>
</ul>
<p><img data-attachment-id="2320" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-32-57/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png" data-orig-size="1912,244" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.32.57" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png?w=1024" class="size-large wp-image-2320 aligncenter" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-32-57.png 1912w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">Or</span></p>
<p><img data-attachment-id="2321" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-33-36/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png" data-orig-size="1892,230" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.33.36" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png?w=1024" class="size-large wp-image-2321 aligncenter" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-33-36.png 1892w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p>&nbsp;</p>
<p><span style="font-weight:400;">There are two tags required to be set for the system to work,</span></p>
<p><img data-attachment-id="2322" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-34-56/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png" data-orig-size="1876,414" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.34.56" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png?w=1024" class="size-large wp-image-2322 aligncenter" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-34-56.png 1876w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<ul>
<li style="font-weight:400;"><b>cost_of_this_service_&lt;sum&gt;</b><span style="font-weight:400;"> &#8211; This tag you assign to the service template, you can have many of these covering different costs for many services, but only one can exist on any one service at any time. The sum is the cost of that service.</span></li>
<li style="font-weight:400;"><b>&lt;companyname&gt;_budget_&lt;sum&gt;</b><span style="font-weight:400;"> &#8211; This tag is the tenant budget, it works by company name that is set in the appliance. Only one tag can exist on any one tenant at any time. The sum is the STARTING budget for the tenant. The solution will dynamically create more tags with the same company prefix, and control the assignment of the tags to the tenant when services are ordered. The budget sum decreases each time a service is ordered by the cost of the service being ordered.</span></li>
</ul>
<p>&nbsp;</p>
<h2><b>Implementation</b></h2>
<p><span style="font-weight:400;">Materials and instructions required to implement this solution are available </span><a href="https://github.com/jonnyfiveiq/CloudFORMSNOW/tree/master/Billing_Sample"><span style="font-weight:400;">here</span></a><span style="font-weight:400;">.</span></p>
<p><b>Step 0 &#8211; Red Hat Consulting Scripts (pre-requirement)</b></p>
<p><span style="font-weight:400;">The Red Hat Consulting import/export scripts will be used in this example. They can be installed on the appliance following instructions on </span><a href="https://github.com/rhtconsulting/cfme-rhconsulting-scripts"><span style="font-weight:400;">https://github.com/rhtconsulting/cfme-rhconsulting-scripts</span></a></p>
<p><b>Step 1 &#8211; Clone the Materials</b></p>
<p><span style="font-weight:400;">git clone <a href="https://github.com/jonnyfiveiq/CloudFORMSNOW.git" rel="nofollow">https://github.com/jonnyfiveiq/CloudFORMSNOW.git</a></span></p>
<p><b>Step 2 &#8211; Import the Tags</b></p>
<p><span style="font-weight:400;">miqimport tags CloudFORMSNOW/Billing_Sample/tags/billing.yaml</span></p>
<p><b>Step 3 &#8211; Import the Sample Dialog</b></p>
<p><span style="font-weight:400;">miqimport service_dialogs CloudFORMSNOW/Billing_Sample/dialogs/Billing_Example.yml </span></p>
<p><b>Step 4 &#8211; Import the Automate domain</b></p>
<p><span style="font-weight:400;">miqimport domain Billing CloudFORMSNOW/Billing_Sample/automate/</span></p>
<p><b>Step 5 &#8211; Import the Sample Service</b></p>
<p><span style="font-weight:400;">miqimport service_catalogs CloudFORMSNOW/Billing_Sample/service_catalogs</span></p>
<p><b>Step 6 &#8211; Tag the Service</b></p>
<p><span style="font-weight:400;">We will use the sample tags imported in Step 2.</span></p>
<p><span style="font-weight:400;">Select the Service Item “Generic Sample Billing” and tag it with “cost_of_this_service_100”</span></p>
<p><b>Step 7 &#8211; Tag the Tenant</b></p>
<p><span style="font-weight:400;">We will use the sample tags imported in Step 2.</span></p>
<p><span style="font-weight:400;">Note, the tenant budget tag is prefixed with the “Company Name” without spaces and lowercase as configured in the CloudForms appliance, if you have changed from the default, you will need to change the tag NAME and VALUE. Example;</span></p>
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">Company Name = Red Hat</span></li>
</ul>
<p><span style="font-weight:400;">then</span></p>
<ul>
<li style="font-weight:400;"><span style="font-weight:400;">Tag name &amp; value = redhat_budget_10000</span></li>
</ul>
<p><span style="font-weight:400;">Select your </span><i><span style="font-weight:400;">TENANT</span></i><span style="font-weight:400;"> and tag it with “mycompany_budget_10000”</span></p>
<p><img data-attachment-id="2323" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-35-57/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png" data-orig-size="1878,302" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.35.57" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png?w=1024" class="size-large wp-image-2323 aligncenter" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-35-57.png 1878w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">And with the tag assigned.</span></p>
<p><img data-attachment-id="2324" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-36-26/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png" data-orig-size="1080,212" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.36.26" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png?w=1024" class="aligncenter wp-image-2324 size-large" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png?w=1024&#038;h=202" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png?w=1024&amp;h=202 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png?w=150&amp;h=29 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png?w=300&amp;h=59 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png?w=768&amp;h=151 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-36-26.png 1080w" sizes="(max-width: 1024px) 100vw, 1024px"   /></p>
<h2><b>Validation</b></h2>
<p><span style="font-weight:400;">We can now order the service item from the service catalog.</span></p>
<p><img data-attachment-id="2325" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-37-01/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png" data-orig-size="1928,312" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.37.01" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png?w=1024" class="size-large wp-image-2325 aligncenter" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-01.png 1928w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><span style="font-weight:400;">As part of the service dialog, we can see all pricing and quota information:</span></p>
<p><img data-attachment-id="2326" data-permalink="https://cloudformsblog.redhat.com/2018/02/07/example-using-tagging-for-displaying-pricing-and-quota-on-service-dialogs/screen-shot-2018-02-07-at-14-37-47/" data-orig-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png" data-orig-size="1492,926" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Screen Shot 2018-02-07 at 14.37.47" data-image-description="" data-medium-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png?w=300" data-large-file="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png?w=1024" class="size-large wp-image-2326 aligncenter" src="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png?w=1024" alt="" srcset="https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png?w=1024 1024w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png?w=150 150w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png?w=300 300w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png?w=768 768w, https://cloudformsredhat.files.wordpress.com/2018/02/screen-shot-2018-02-07-at-14-37-47.png 1492w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p><b>Service Costs</b></p>
<p><b>Cost of this Service</b><span style="font-weight:400;"> &#8211; Show the cost assigned to the service item.</span></p>
<p><b>Quota</b></p>
<p><b>Current Budget </b><span style="font-weight:400;">&#8211; Shows the Current Budget. If this is the first time Billing is being ran, then the value will be the tag you assigned at the tenant.</span></p>
<p><b>Remaining Budget</b><span style="font-weight:400;"> &#8211; Is the Current budget minus the service cost.</span></p>
<p><b>Message</b></p>
<p><b>Status</b><span style="font-weight:400;"> &#8211;  Plain English text to show status of quota.</span></p>
<p><span style="font-weight:400;">Note: This service item example will not deploy anything, but run the generic state machine and return a success. </span></p>
<p>&nbsp;</p>
<h2><b>Debugging examples</b></h2>
<p><span style="font-weight:400;">In the Automation log on the appliance that is processing the request, you will find the following output from the “set_your_budget” method.</span></p>
<p><span style="font-weight:400;">It shows the Tenant name, along with the currently assigned tag and what it will be changing it too. </span></p>
<pre>

<span style="font-weight:400;">&lt;AEMethod set_your_budget&gt; *********** STARTED /Billing/Dialogs/DynamicElements/set_your_budget ***********</span>

<span style="font-weight:400;">&lt;AEMethod set_your_budget&gt; Tenant Name = My Company</span>

<span style="font-weight:400;">&lt;AEMethod set_your_budget&gt; remaining_budget = 9900</span>

<span style="font-weight:400;">&lt;AEMethod set_your_budget&gt; your_budget = 10000</span>

<span style="font-weight:400;">&lt;AEMethod set_your_budget&gt; Created Tag = mycompany_budget_9900</span>

<span style="font-weight:400;">&lt;AEMethod set_your_budget&gt; ASSIGN your_budget_tag = mycompany_budget_9900</span>

<span style="font-weight:400;">&lt;AEMethod set_your_budget&gt; UNASSIGN your_budget_tag = mycompany_budget_10000</span>

<span style="font-weight:400;">&lt;AEMethod set_your_budget&gt; *********** ENDED /Billing/Dialogs/DynamicElements/set_your_budget ***********</span></pre>
<p><span style="font-weight:400;">Possible issues are</span></p>
<ol>
<li style="font-weight:400;"><span style="font-weight:400;">No Cost on service = you have not tagged the service with a cost.</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">No tenant budget = you have not tagged your tenant with a starting budget.</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Tenant budget does not change = The company name does not match the tags.</span></li>
<li style="font-weight:400;"><span style="font-weight:400;">Nothing being returned, could be automate issues with domain order, locked domain?</span></li>
</ol>
]]></html><thumbnail_url><![CDATA[https://cloudformsredhat.files.wordpress.com/2018/02/money-2180330_1280.jpg?w=1200&fit=440%2C330]]></thumbnail_url><thumbnail_width><![CDATA[440]]></thumbnail_width><thumbnail_height><![CDATA[293]]></thumbnail_height></oembed>