text: <!DOCTYPE html>
  <html>
  <head>
    <title>Api Documentation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/>
  <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/>
  <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/>
    <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/>
    <!-- IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
  </head>
  <body>
    <div class="container-fluid">
      <div class="row-fluid">
        <div id='container'>
          <ul class='breadcrumb'>
    <li>
      <a href='../../../apidoc/v2.ca.html'>Foreman v2</a>
      <span class='divider'>/</span>
    </li>
    <li>
      <a href='../../../apidoc/v2/smart_variables.ca.html'>
        Smart variables
        
      </a>
      <span class='divider'>/</span>
    </li>
    <li class='active'>create</li>
    <li class='pull-right'>
    &nbsp;[ <b><a href="../../../apidoc/v2/smart_variables/create.ca.html">ca</a></b> | <a href="../../../apidoc/v2/smart_variables/create.cs_CZ.html">cs_CZ</a> | <a href="../../../apidoc/v2/smart_variables/create.de.html">de</a> | <a href="../../../apidoc/v2/smart_variables/create.en.html">en</a> | <a href="../../../apidoc/v2/smart_variables/create.en_GB.html">en_GB</a> | <a href="../../../apidoc/v2/smart_variables/create.es.html">es</a> | <a href="../../../apidoc/v2/smart_variables/create.fr.html">fr</a> | <a href="../../../apidoc/v2/smart_variables/create.gl.html">gl</a> | <a href="../../../apidoc/v2/smart_variables/create.it.html">it</a> | <a href="../../../apidoc/v2/smart_variables/create.ja.html">ja</a> | <a href="../../../apidoc/v2/smart_variables/create.ko.html">ko</a> | <a href="../../../apidoc/v2/smart_variables/create.nl_NL.html">nl_NL</a> | <a href="../../../apidoc/v2/smart_variables/create.pl.html">pl</a> | <a href="../../../apidoc/v2/smart_variables/create.pt_BR.html">pt_BR</a> | <a href="../../../apidoc/v2/smart_variables/create.ru.html">ru</a> | <a href="../../../apidoc/v2/smart_variables/create.sv_SE.html">sv_SE</a> | <a href="../../../apidoc/v2/smart_variables/create.zh_CN.html">zh_CN</a> | <a href="../../../apidoc/v2/smart_variables/create.zh_TW.html">zh_TW</a> ]
  </li>
  
  
  </ul>
  
    <div class='page-header'>
      <h1>
        POST /api/smart_variables
        <br>
        <small>Crea una variable intel·ligent</small>
      </h1>
    </div>
  
  <div>
  
    
  
  
  
    <h2><span class="translation_missing" title="translation missing: ca.apipie.examples">Examples</span></h2>
      <pre class="prettyprint">POST /api/smart_variables
  {
    &quot;smart_variable&quot;: {
      &quot;variable&quot;: &quot;BQfTtFEzQq&quot;,
      &quot;puppetclass_id&quot;: 298486374,
      &quot;hidden_value&quot;: true
    }
  }
  201
  {
    &quot;description&quot;: null,
    &quot;parameter_type&quot;: null,
    &quot;variable_type&quot;: null,
    &quot;hidden_value?&quot;: true,
    &quot;validator_type&quot;: null,
    &quot;validator_rule&quot;: null,
    &quot;override_value_order&quot;: &quot;fqdn\nhostgroup\nos\ndomain&quot;,
    &quot;merge_overrides&quot;: false,
    &quot;merge_default&quot;: false,
    &quot;avoid_duplicates&quot;: false,
    &quot;puppetclass_id&quot;: 298486374,
    &quot;puppetclass_name&quot;: &quot;apache&quot;,
    &quot;created_at&quot;: &quot;2019-11-07 08:37:10 UTC&quot;,
    &quot;updated_at&quot;: &quot;2019-11-07 08:37:10 UTC&quot;,
    &quot;variable&quot;: &quot;BQfTtFEzQq&quot;,
    &quot;id&quot;: 1018350796,
    &quot;default_value&quot;: &quot;*****&quot;,
    &quot;override_values_count&quot;: 0,
    &quot;override_values&quot;: []
  }</pre>
  
    <h2><span class="translation_missing" title="translation missing: ca.apipie.params">Params</span></h2>
    <table class='table'>
      <thead>
        <tr>
          <th><span class="translation_missing" title="translation missing: ca.apipie.param_name">Param Name</span></th>
          <th><span class="translation_missing" title="translation missing: ca.apipie.description">Description</span></th>
        </tr>
      </thead>
      <tbody>
          <tr style='background-color:rgb(255,255,255);'>
      <td>
        <strong>location_id </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          
        </small>
      </td>
      <td>
        
  <p>Set the current location context for the request</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be a Integer</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(255,255,255);'>
      <td>
        <strong>organization_id </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          
        </small>
      </td>
      <td>
        
  <p>Set the current organization context for the request</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be a Integer</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(255,255,255);'>
      <td>
        <strong>smart_variable </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.required">Required</span>
          
        </small>
      </td>
      <td>
        
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be a Hash</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
      <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[variable] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.required">Required</span>
          
        </small>
      </td>
      <td>
        
  <p>Nom de la variable</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be a String</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[puppetclass_id] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>ID de la classe de Puppet</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be a number.</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[default_value] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>Valor per defecte de la variable</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be one of types: <code>string</code>, <code>boolean</code>, <code>integer</code>, <code>real</code>, <code>array</code>, <code>hash</code>, <code>yaml</code>, <code>json</code></p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[hidden_value] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>When enabled the parameter is hidden in the UI</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[override_value_order] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>L’ordre en què es resolen els valors</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be a String</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[description] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>Descripció de la variable</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be a String</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[validator_type] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>Tipus de valors de validació</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be one of: <code>regexp</code>, <code>list</code>.</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[validator_rule] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>Used to enforce certain values for the parameter values</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be a String</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[variable_type] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>Tipus de valors de la variable</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be one of: <code>string</code>, <code>boolean</code>, <code>integer</code>, <code>real</code>, <code>array</code>, <code>hash</code>, <code>yaml</code>, <code>json</code>.</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[merge_overrides] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>Merge all matching values (only array/hash type)</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[merge_default] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>Include default value when merging all matching values</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
    <tr style='background-color:rgb(250,250,250);'>
      <td>
        <strong>smart_variable[avoid_duplicates] </strong><br>
        <small>
          <span class="translation_missing" title="translation missing: ca.apipie.optional">Optional</span>
          , &lt;span class=&quot;translation_missing&quot; title=&quot;translation missing: ca.apipie.nil_allowed&quot;&gt;Nil Allowed&lt;/span&gt;
        </small>
      </td>
      <td>
        
  <p>Remove duplicate values (only array type)</p>
  
          <p><strong>Validations:</strong></p>
          <ul>
              <li>
  <p>Must be one of: <code>true</code>, <code>false</code>, <code>1</code>, <code>0</code>.</p>
  </li>
          </ul>
  
      </td>
  
    </tr>
  
    
  
  
      </tbody>
    </table>
  
  
  
  
  </div>
  
    
  
          
        </div>
      </div>
      <hr>
      <footer></footer>
    </div>
    <script type='text/javascript' src='../../../apidoc/javascripts/bundled/jquery.js'></script>
  <script type='text/javascript' src='../../../apidoc/javascripts/bundled/bootstrap-collapse.js'></script>
  <script type='text/javascript' src='../../../apidoc/javascripts/bundled/prettify.js'></script>
  <script type='text/javascript' src='../../../apidoc/javascripts/apipie.js'></script>
  </body>
  </html>
  