<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Plugins on CloudBolt Documentation</title>
		<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/</link>
		<description>Recent content in Plugins on CloudBolt Documentation</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<atom:link href="https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Structure of a plugin</title>
				<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/structure/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/structure/</guid>
				<description>&lt;p&gt;A plugin module must contain a function called &lt;code&gt;run()&lt;/code&gt;. The Cloud Management Platform (CMP) job engine calls that function at particular points during a job&amp;rsquo;s execution.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-run-receives&#34;&gt;What run() receives&lt;/h2&gt;&#xA;&lt;p&gt;The function is passed a Job object and a set of keyword arguments that simplify access to the CMP objects the plugin is likely to need. Every keyword argument below is passed to any plugin&amp;rsquo;s &lt;code&gt;run&lt;/code&gt; method, but its value is &lt;code&gt;None&lt;/code&gt; when the object it refers to does not apply in that context.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Special case plugins</title>
				<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/special-cases/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/special-cases/</guid>
				<description>&lt;p&gt;Most plugins follow the shape described in &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/structure/&#34;&gt;Structure of a plugin&lt;/a&gt;. A few do not: they may run directly from the front-end appliance rather than inside a job, or they may have their own return types. Three are covered on this page; the rest are documented with the feature they belong to.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#order-approval-plugins&#34;&gt;Order approval plugins&lt;/a&gt;: Replace the built-in approval workflow. Covered below.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#generate-parameter-options-plugins&#34;&gt;Generate parameter options plugins&lt;/a&gt;: Decide a parameter&amp;rsquo;s options at run time. Covered below.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#auto-select-environment-plugins&#34;&gt;Auto-select environment plugins&lt;/a&gt;: Choose where a server tier is built. Covered below.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/orchestration/actions/orchestration-actions/#order-trigger-points&#34;&gt;Order validation plugins&lt;/a&gt;: Run at the Blueprint Validation, Server Tier Validation, and Validate Order Recipient trigger points.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/orchestration/actions/orchestration-actions/#user-trigger-points&#34;&gt;External user synchronization plugins&lt;/a&gt;: Run at the External Users Sync trigger point each time a directory user logs in.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/orchestration/actions/server-actions/&#34;&gt;Display condition plugins for server actions&lt;/a&gt;: Decide whether a server action&amp;rsquo;s button is shown.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/blueprints/build/discovery-sync-configuration/&#34;&gt;Discovery plugins on blueprints&lt;/a&gt;: Onboard resources that were created outside Cloud Management Platform (CMP).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;order-approval-plugins&#34;&gt;Order approval plugins&lt;/h2&gt;&#xA;&lt;p&gt;When an order approval plugin is enabled, it replaces Cloud Management Platform&amp;rsquo;s default behavior of emailing approvers when an order is submitted. Use one to integrate with a separate change management system, or to replace the standard approval workflow with something that fits your organization.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Development tips for plugins</title>
				<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/development-tips/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/development-tips/</guid>
				<description>&lt;h2 id=&#34;run-remote-scripts-with-connection-info-objects&#34;&gt;Run remote scripts with connection info objects&lt;/h2&gt;&#xA;&lt;p&gt;Connection info objects let a plugin run scripts against systems that have no REST API. They are also the way to run commands remotely on Windows servers via WinRM or on Linux servers via SSH.&lt;/p&gt;&#xA;&lt;h3 id=&#34;windows-servers&#34;&gt;Windows servers&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/configure/integrations/connection-info/&#34;&gt;connection info object&lt;/a&gt; and set its protocol to &lt;code&gt;winrm&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;In the CMP CLI (shell_plus), set the transport type. Supported types are &lt;code&gt;ntlm&lt;/code&gt;, &lt;code&gt;kerberos&lt;/code&gt;, &lt;code&gt;credssp&lt;/code&gt;, and &lt;code&gt;basic&lt;/code&gt;, depending on what the target requires.&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; utilities.models &lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; ConnectionInfo&#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;connection_info &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; ConnectionInfo&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;objects&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;get(name&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;my_connection_info&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;connection_info&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;transport &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ntlm&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;connection_info&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;save()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id=&#34;linux-servers&#34;&gt;Linux servers&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/configure/integrations/connection-info/&#34;&gt;connection info object&lt;/a&gt; and set its protocol to &lt;code&gt;ssh&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;execute-a-script-on-the-connection-info-host&#34;&gt;Execute a script on the connection info host&lt;/h2&gt;&#xA;&lt;p&gt;This works for both Windows and Linux targets. The example shows every parameter &lt;code&gt;execute_script&lt;/code&gt; accepts, with its default.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Plugin examples</title>
				<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/examples/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/examples/</guid>
				<description>&lt;p&gt;CMP hosts a &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/catalog/content-library/&#34;&gt;Content Library&lt;/a&gt; of example plugins, which you can import from most pages where actions are created, such as Server Actions and Orchestration Actions. The source for those plugins lives in a &lt;a href=&#34;https://github.com/CloudBoltSoftware/cloudbolt-forge/tree/master/actions/cloudbolt_plugins&#34;&gt;public GitHub repository&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;add-a-progress-message&#34;&gt;Add a progress message&lt;/h2&gt;&#xA;&lt;p&gt;Use this at the Pre-Create Resource trigger point in a Provision Server job. It writes the server&amp;rsquo;s IP address to the job progress and log, then waits 60 seconds so the message is easy to notice.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Plugin parameterization</title>
				<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/parameterization/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/parameterization/</guid>
				<description>&lt;p&gt;When you upload a plugin file or point at one by URL, CMP scans its contents for template variables such as &lt;code&gt;{{ variable }}&lt;/code&gt; and creates an action input for each one it finds. See &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/orchestration/actions/action-input-parameters/&#34;&gt;Action input parameters&lt;/a&gt; for more on generated inputs, and &lt;a href=&#34;https://docs.cloudbolt.io/docs/cmp/use/orchestration/actions/action-context/&#34;&gt;Action context&lt;/a&gt; for the objects available in each context.&lt;/p&gt;&#xA;&lt;p&gt;CMP prompts users for those inputs and renders them into the action before it runs. Input values are escaped so they cannot execute arbitrary code while still rendering as expected.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Resources for writing plugins</title>
				<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/resources/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/resources/</guid>
				<description>&lt;h2 id=&#34;interact-with-the-data-model&#34;&gt;Interact with the data model&lt;/h2&gt;&#xA;&lt;p&gt;Cloud Management Platform (CMP) has an interactive shell, allowing you to try a query before putting it in a plugin. Open an SSH session to the CMP appliance, switch to the root user, then start the shell_plus management command. It opens an interactive Python shell with all of the models already imported. From there you can work with them directly:&lt;/p&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:#75715e&#34;&gt;# Reboot the server with hostname &amp;#34;devtest0032&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;server &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Server&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;objects&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;get(hostname&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;devtest0032&amp;#34;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;server&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;reboot()&#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:#75715e&#34;&gt;# Re-assign all of David&amp;#39;s servers to Lisa&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;lisa &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; UserProfile&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;objects&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;get(user__username&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;lisa&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Server&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;objects&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;filter(owner__user__username&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;david&amp;#39;&lt;/span&gt;)&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;update(owner&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;lisa)&#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:#75715e&#34;&gt;# Get OS build attributes whose template name matches &amp;#34;ubuntu_16_sqaqe03_green&amp;#34;.&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:#75715e&#34;&gt;# This filter is case insensitive, so it can return several results when&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:#75715e&#34;&gt;# template names differ only by capitalization.&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; 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;&lt;span style=&#34;color:#ae81ff&#34;&gt;11&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;os_build_attributes&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;filter(template_name__iexact&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ubuntu_16_sqaqe03_green&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;alert alert-danger&#34; role=&#34;alert&#34;&gt;&#xA;&lt;p&gt;The internal API can be destructive, both to CMP and to the servers it manages. Do plugin development on a non-production instance that manages only development servers.&lt;/p&gt;&#xA;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Use Django ORM</title>
				<link>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/django-orm/</link>
				<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
				<guid>https://docs.cloudbolt.io/docs/cmp/use/orchestration/plugins/django-orm/</guid>
				<description>&lt;p&gt;CMP&amp;rsquo;s models are exposed through Django&amp;rsquo;s object-relational mapper. Rather than looking up table and field names for SQL statements, you express create, read, update, and delete operations as Python, which makes them straightforward to script from a plugin or the interactive shell.&lt;/p&gt;&#xA;&lt;h2 id=&#34;queries-become-python&#34;&gt;Queries become Python&lt;/h2&gt;&#xA;&lt;p&gt;For example, this SQL statement:&lt;/p&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-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;SELECT&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;FROM&lt;/span&gt; infrastructure_server;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;becomes:&lt;/p&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;Server&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;objects&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;all()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;iterate-results-directly&#34;&gt;Iterate results directly&lt;/h2&gt;&#xA;&lt;p&gt;Instead of loading a recordset from a database driver and stepping through it, you iterate the queryset with ordinary Python constructs.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
