<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Continuous Infrastructure Testing (CIT) on CloudBolt Documentation</title>
		<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/cit/</link>
		<description>Recent content in Continuous Infrastructure Testing (CIT) on CloudBolt Documentation</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<atom:link href="https://docs.cloudbolt.io/docs/cmp/use/orchestration/cit/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Check infrastructure health with CIT</title>
				<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/cit/infrastructure-health-checks/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://docs.cloudbolt.io/docs/cmp/use/orchestration/cit/infrastructure-health-checks/</guid>
				<description>&lt;p&gt;A resource handler is the starting point for provisioning a server and for running remote scripts through a platform&amp;rsquo;s own channel, so its connection is worth checking on a schedule rather than when an order fails. This example uses Cloud Management Platform (CMP) Continuous Infrastructure Testing to do that. For CIT itself, see &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/orchestration/cit/&#34;&gt;Continuous Infrastructure Testing (CIT)&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You are a super admin in CMP.&lt;/li&gt;&#xA;&lt;li&gt;A &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/configure/infrastructure/resource-handlers/&#34;&gt;resource handler&lt;/a&gt; is already configured.&lt;/li&gt;&#xA;&lt;li&gt;You have its &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/configure/infrastructure/resource-handlers/&#34;&gt;resource handler ID&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;create-the-test&#34;&gt;Create the test&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go to &lt;strong&gt;Admin&lt;/strong&gt; &amp;gt; &lt;strong&gt;Continuous Infrastructure Testing&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;strong&gt;Add&lt;/strong&gt; &amp;gt; &lt;strong&gt;New Action Test&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;strong&gt;CloudBolt Plug-in&lt;/strong&gt; &amp;gt; &lt;strong&gt;+ Add a New CloudBolt Plug-in&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Enter a name, then scroll to the bottom of the form.&lt;/li&gt;&#xA;&lt;li&gt;For &lt;strong&gt;File Location&lt;/strong&gt;, select &lt;strong&gt;Enter code later&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Select &lt;strong&gt;Create&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;add-the-code&#34;&gt;Add the code&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Find the new test in the &lt;strong&gt;Tests&lt;/strong&gt; list and select its name.&lt;/li&gt;&#xA;&lt;li&gt;Under &lt;strong&gt;Actions&lt;/strong&gt;, select the action name to open the plugin for editing.&lt;/li&gt;&#xA;&lt;li&gt;Replace the default code with the following, then save.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; common.methods &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; set_progress&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; resourcehandlers.models &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; ResourceHandler&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;from&lt;/span&gt; utilities.logger &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; ThreadLogger&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;logger &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; ThreadLogger(__name__)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;run&lt;/span&gt;(&lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt;args, &lt;span style=&#34;color:#f92672&#34;&gt;**&lt;/span&gt;kwargs):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    rh &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; ResourceHandler&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;objects&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;get(id&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;int(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;{{ resource_handler }}&amp;#34;&lt;/span&gt;))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    rh &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; rh&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;cast()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; rh&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;can_verify_connection:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        set_progress(&lt;span style=&#34;color:#e6db74&#34;&gt;f&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Verifying connection to &amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{&lt;/span&gt;rh&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;.&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        rh&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;verify_connection()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        set_progress(&lt;span style=&#34;color:#e6db74&#34;&gt;f&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;Successfully verified connection to &amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;{&lt;/span&gt;rh&lt;span style=&#34;color:#e6db74&#34;&gt;}&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;.&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The plugin reads a resource handler ID from an action input, casts the handler to its concrete type, and calls &lt;code&gt;verify_connection()&lt;/code&gt; on it if that handler supports connection checks.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
