initshutdownscript.create
=========================

Create an initshutdown script task.

`type` indicates if a command or script should be executed at `when`.

There are three choices for `when`:

1) PREINIT - This is early in the boot process before all the services have started 2) POSTINIT - This is late in the boot process when most of the services have started 3) SHUTDOWN - This is on shutdown

`timeout` is an integer value which indicates time in seconds which the system should wait for the execution of script/command. It should be noted that a hard limit for a timeout is configured by the base OS, so when a script/command is set to execute on SHUTDOWN, the hard limit configured by the base OS is changed adding the timeout specified by script/command so it can be ensured that it executes as desired and is not interrupted by the base OS's limit.

.. raw:: html

    <div id="json-schema"> <span class="badge badge-dark value-type">Type: object</span><br/> <div class="accordion" id="accordionCall_parameters"> <div class="card"> <div class="card-header" id="headingCall_parameters"> <h2 class="mb-0"> <button aria-controls="Call_parameters" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters" data-toggle="collapse" onclick="setAnchor('#Call_parameters')" type="button"><span class="property-name">Call parameters</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters" class="collapse property-definition-div" data-parent="#accordionCall_parameters" id="Call_parameters"> <div class="card-body pl-5"> <span class="badge badge-dark value-type">Type: array</span><br/> <span class="badge badge-info no-additional">No Additional Items</span><h4>Tuple Validation</h4> <h5>Parameter 1: data</h5> <div class="card"> <div class="card-body items-definition" id="Call_parameters_items_i0"> <h4>data</h4><span class="badge badge-dark value-type">Type: object</span><br/> <span class="description"><p>Init/shutdown script configuration data for creation.</p> </span> <span class="badge badge-info no-additional">No Additional Properties</span> <div class="accordion" id="accordionCall_parameters_items_i0_type"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i0_type"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i0_type" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_type" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_type')" type="button"><span class="property-name">type</span> <span class="badge badge-warning required-property">Required</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i0_type" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_type" id="Call_parameters_items_i0_type"> <div class="card-body pl-5"> <h4>Type</h4><span class="badge badge-dark value-type">Type: enum (of string)</span><br/> <span class="description"><p>Type of init/shutdown script to execute.</p> <ul> <li><code>COMMAND</code>: Execute a single command</li> <li><code>SCRIPT</code>: Execute a script file</li> </ul> </span><div class="enum-value" id="Call_parameters_items_i0_type_enum"> <h5>Must be one of:</h5> <ul class="list-group"><li class="list-group-item enum-item">"COMMAND"</li><li class="list-group-item enum-item">"SCRIPT"</li></ul> </div> </div> </div> </div> </div> <div class="accordion" id="accordionCall_parameters_items_i0_command"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i0_command"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i0_command" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_command" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_command')" type="button"><span class="property-name">command</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i0_command" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_command" id="Call_parameters_items_i0_command"> <div class="card-body pl-5"> <h4>Command</h4> <span class="badge badge-success default-value">Default: ""</span><br/> <span class="description"><p>Must be given if <code>type=&amp;#34;COMMAND&amp;#34;</code>.</p> </span><div class="any-of-value" id="Call_parameters_items_i0_command_anyOf"><h2 class="handle"> <label>Any of</label> </h2><ul class="nav nav-tabs" id="tabsCall_parameters_items_i0_command_anyOf_anyOf" role="tablist"><li class="nav-item"> <a class="nav-link active anyOf-option" data-toggle="tab" href="#tab-pane_Call_parameters_items_i0_command_anyOf_i0" id="Call_parameters_items_i0_command_anyOf_i0" onclick="setAnchor('#Call_parameters_items_i0_command_anyOf_i0')" role="tab">Option 1</a> </li><li class="nav-item"> <a class="nav-link anyOf-option" data-toggle="tab" href="#tab-pane_Call_parameters_items_i0_command_anyOf_i1" id="Call_parameters_items_i0_command_anyOf_i1" onclick="setAnchor('#Call_parameters_items_i0_command_anyOf_i1')" role="tab">Option 2</a> </li></ul> <div class="tab-content card"><div class="tab-pane fade card-body active show" id="tab-pane_Call_parameters_items_i0_command_anyOf_i0" role="tabpanel"> <span class="badge badge-dark value-type">Type: string</span><br/> </div><div class="tab-pane fade card-body" id="tab-pane_Call_parameters_items_i0_command_anyOf_i1" role="tabpanel"> <span class="badge badge-dark value-type">Type: null</span><br/> </div></div></div> </div> </div> </div> </div> <div class="accordion" id="accordionCall_parameters_items_i0_script"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i0_script"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i0_script" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_script" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_script')" type="button"><span class="property-name">script</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i0_script" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_script" id="Call_parameters_items_i0_script"> <div class="card-body pl-5"> <h4>Script</h4> <span class="badge badge-success default-value">Default: ""</span><br/> <span class="description"><p>Must be given if <code>type=&amp;#34;SCRIPT&amp;#34;</code>.</p> </span><div class="any-of-value" id="Call_parameters_items_i0_script_anyOf"><h2 class="handle"> <label>Any of</label> </h2><ul class="nav nav-tabs" id="tabsCall_parameters_items_i0_script_anyOf_anyOf" role="tablist"><li class="nav-item"> <a class="nav-link active anyOf-option" data-toggle="tab" href="#tab-pane_Call_parameters_items_i0_script_anyOf_i0" id="Call_parameters_items_i0_script_anyOf_i0" onclick="setAnchor('#Call_parameters_items_i0_script_anyOf_i0')" role="tab">Option 1</a> </li><li class="nav-item"> <a class="nav-link anyOf-option" data-toggle="tab" href="#tab-pane_Call_parameters_items_i0_script_anyOf_i1" id="Call_parameters_items_i0_script_anyOf_i1" onclick="setAnchor('#Call_parameters_items_i0_script_anyOf_i1')" role="tab">Option 2</a> </li></ul> <div class="tab-content card"><div class="tab-pane fade card-body active show" id="tab-pane_Call_parameters_items_i0_script_anyOf_i0" role="tabpanel"> <span class="badge badge-dark value-type">Type: string</span><br/> </div><div class="tab-pane fade card-body" id="tab-pane_Call_parameters_items_i0_script_anyOf_i1" role="tabpanel"> <span class="badge badge-dark value-type">Type: null</span><br/> </div></div></div> </div> </div> </div> </div> <div class="accordion" id="accordionCall_parameters_items_i0_when"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i0_when"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i0_when" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_when" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_when')" type="button"><span class="property-name">when</span> <span class="badge badge-warning required-property">Required</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i0_when" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_when" id="Call_parameters_items_i0_when"> <div class="card-body pl-5"> <h4>When</h4><span class="badge badge-dark value-type">Type: enum (of string)</span><br/> <span class="description"><ul> <li>"PREINIT": Early in the boot process before all services have started.</li> <li>"POSTINIT": Late in the boot process when most services have started.</li> <li>"SHUTDOWN": On shutdown.</li> </ul> </span><div class="enum-value" id="Call_parameters_items_i0_when_enum"> <h5>Must be one of:</h5> <ul class="list-group"><li class="list-group-item enum-item">"PREINIT"</li><li class="list-group-item enum-item">"POSTINIT"</li><li class="list-group-item enum-item">"SHUTDOWN"</li></ul> </div> </div> </div> </div> </div> <div class="accordion" id="accordionCall_parameters_items_i0_enabled"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i0_enabled"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i0_enabled" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_enabled" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_enabled')" type="button"><span class="property-name">enabled</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i0_enabled" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_enabled" id="Call_parameters_items_i0_enabled"> <div class="card-body pl-5"> <h4>Enabled</h4><span class="badge badge-dark value-type">Type: boolean</span> <span class="badge badge-success default-value">Default: true</span><br/> <span class="description"><p>Whether the init/shutdown script is enabled to execute.</p> </span> </div> </div> </div> </div> <div class="accordion" id="accordionCall_parameters_items_i0_timeout"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i0_timeout"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i0_timeout" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_timeout" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_timeout')" type="button"><span class="property-name">timeout</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i0_timeout" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_timeout" id="Call_parameters_items_i0_timeout"> <div class="card-body pl-5"> <h4>Timeout</h4><span class="badge badge-dark value-type">Type: integer</span> <span class="badge badge-success default-value">Default: 10</span><br/> <span class="description"><p>An integer time in seconds that the system should wait for the execution of the script/command.</p> <p>A hard limit for a timeout is configured by the base OS, so when a script/command is set to execute on SHUTDOWN, the hard limit configured by the base OS is changed adding the timeout specified by script/command so it can be ensured that it executes as desired and is not interrupted by the base OS's limit.</p> </span> </div> </div> </div> </div> <div class="accordion" id="accordionCall_parameters_items_i0_comment"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i0_comment"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i0_comment" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i0_comment" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i0_comment')" type="button"><span class="property-name">comment</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i0_comment" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i0_comment" id="Call_parameters_items_i0_comment"> <div class="card-body pl-5"> <h4>Comment</h4><span class="badge badge-dark value-type">Type: string</span> <span class="badge badge-success default-value">Default: ""</span><br/> <span class="description"><p>Optional comment describing the purpose of this script.</p> </span> <p><span class="badge badge-light restriction max-length-restriction" id="Call_parameters_items_i0_comment_maxLength">Must be at most <code>255</code> characters long</span></p> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value"> <div class="card"> <div class="card-header" id="headingReturn_value"> <h2 class="mb-0"> <button aria-controls="Return_value" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value" data-toggle="collapse" onclick="setAnchor('#Return_value')" type="button"><span class="property-name">Return value</span></button> </h2> </div> <div aria-labelledby="headingReturn_value" class="collapse property-definition-div" data-parent="#accordionReturn_value" id="Return_value"> <div class="card-body pl-5"> <h4>InitShutdownScriptEntry</h4><span class="badge badge-dark value-type">Type: object</span><br/> <span class="description"><p>The created init/shutdown script configuration.</p> </span> <span class="badge badge-info no-additional">No Additional Properties</span> <div class="accordion" id="accordionReturn_value_type"> <div class="card"> <div class="card-header" id="headingReturn_value_type"> <h2 class="mb-0"> <button aria-controls="Return_value_type" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_type" data-toggle="collapse" onclick="setAnchor('#Return_value_type')" type="button"><span class="property-name">type</span> <span class="badge badge-warning required-property">Required</span></button> </h2> </div> <div aria-labelledby="headingReturn_value_type" class="collapse property-definition-div" data-parent="#accordionReturn_value_type" id="Return_value_type"> <div class="card-body pl-5"> <h4>Type</h4><span class="badge badge-dark value-type">Type: enum (of string)</span><br/> <span class="description"><p>Type of init/shutdown script to execute.</p> <ul> <li><code>COMMAND</code>: Execute a single command</li> <li><code>SCRIPT</code>: Execute a script file</li> </ul> </span><div class="enum-value" id="Return_value_type_enum"> <h5>Must be one of:</h5> <ul class="list-group"><li class="list-group-item enum-item">"COMMAND"</li><li class="list-group-item enum-item">"SCRIPT"</li></ul> </div> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value_command"> <div class="card"> <div class="card-header" id="headingReturn_value_command"> <h2 class="mb-0"> <button aria-controls="Return_value_command" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_command" data-toggle="collapse" onclick="setAnchor('#Return_value_command')" type="button"><span class="property-name">command</span></button> </h2> </div> <div aria-labelledby="headingReturn_value_command" class="collapse property-definition-div" data-parent="#accordionReturn_value_command" id="Return_value_command"> <div class="card-body pl-5"> <h4>Command</h4> <span class="badge badge-success default-value">Default: ""</span><br/> <span class="description"><p>Must be given if <code>type=&amp;#34;COMMAND&amp;#34;</code>.</p> </span><div class="any-of-value" id="Return_value_command_anyOf"><h2 class="handle"> <label>Any of</label> </h2><ul class="nav nav-tabs" id="tabsReturn_value_command_anyOf_anyOf" role="tablist"><li class="nav-item"> <a class="nav-link active anyOf-option" data-toggle="tab" href="#tab-pane_Return_value_command_anyOf_i0" id="Return_value_command_anyOf_i0" onclick="setAnchor('#Return_value_command_anyOf_i0')" role="tab">Option 1</a> </li><li class="nav-item"> <a class="nav-link anyOf-option" data-toggle="tab" href="#tab-pane_Return_value_command_anyOf_i1" id="Return_value_command_anyOf_i1" onclick="setAnchor('#Return_value_command_anyOf_i1')" role="tab">Option 2</a> </li></ul> <div class="tab-content card"><div class="tab-pane fade card-body active show" id="tab-pane_Return_value_command_anyOf_i0" role="tabpanel"> <span class="badge badge-dark value-type">Type: string</span><br/> </div><div class="tab-pane fade card-body" id="tab-pane_Return_value_command_anyOf_i1" role="tabpanel"> <span class="badge badge-dark value-type">Type: null</span><br/> </div></div></div> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value_script"> <div class="card"> <div class="card-header" id="headingReturn_value_script"> <h2 class="mb-0"> <button aria-controls="Return_value_script" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_script" data-toggle="collapse" onclick="setAnchor('#Return_value_script')" type="button"><span class="property-name">script</span></button> </h2> </div> <div aria-labelledby="headingReturn_value_script" class="collapse property-definition-div" data-parent="#accordionReturn_value_script" id="Return_value_script"> <div class="card-body pl-5"> <h4>Script</h4> <span class="badge badge-success default-value">Default: ""</span><br/> <span class="description"><p>Must be given if <code>type=&amp;#34;SCRIPT&amp;#34;</code>.</p> </span><div class="any-of-value" id="Return_value_script_anyOf"><h2 class="handle"> <label>Any of</label> </h2><ul class="nav nav-tabs" id="tabsReturn_value_script_anyOf_anyOf" role="tablist"><li class="nav-item"> <a class="nav-link active anyOf-option" data-toggle="tab" href="#tab-pane_Return_value_script_anyOf_i0" id="Return_value_script_anyOf_i0" onclick="setAnchor('#Return_value_script_anyOf_i0')" role="tab">Option 1</a> </li><li class="nav-item"> <a class="nav-link anyOf-option" data-toggle="tab" href="#tab-pane_Return_value_script_anyOf_i1" id="Return_value_script_anyOf_i1" onclick="setAnchor('#Return_value_script_anyOf_i1')" role="tab">Option 2</a> </li></ul> <div class="tab-content card"><div class="tab-pane fade card-body active show" id="tab-pane_Return_value_script_anyOf_i0" role="tabpanel"> <span class="badge badge-dark value-type">Type: string</span><br/> </div><div class="tab-pane fade card-body" id="tab-pane_Return_value_script_anyOf_i1" role="tabpanel"> <span class="badge badge-dark value-type">Type: null</span><br/> </div></div></div> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value_when"> <div class="card"> <div class="card-header" id="headingReturn_value_when"> <h2 class="mb-0"> <button aria-controls="Return_value_when" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_when" data-toggle="collapse" onclick="setAnchor('#Return_value_when')" type="button"><span class="property-name">when</span> <span class="badge badge-warning required-property">Required</span></button> </h2> </div> <div aria-labelledby="headingReturn_value_when" class="collapse property-definition-div" data-parent="#accordionReturn_value_when" id="Return_value_when"> <div class="card-body pl-5"> <h4>When</h4><span class="badge badge-dark value-type">Type: enum (of string)</span><br/> <span class="description"><ul> <li>"PREINIT": Early in the boot process before all services have started.</li> <li>"POSTINIT": Late in the boot process when most services have started.</li> <li>"SHUTDOWN": On shutdown.</li> </ul> </span><div class="enum-value" id="Return_value_when_enum"> <h5>Must be one of:</h5> <ul class="list-group"><li class="list-group-item enum-item">"PREINIT"</li><li class="list-group-item enum-item">"POSTINIT"</li><li class="list-group-item enum-item">"SHUTDOWN"</li></ul> </div> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value_enabled"> <div class="card"> <div class="card-header" id="headingReturn_value_enabled"> <h2 class="mb-0"> <button aria-controls="Return_value_enabled" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_enabled" data-toggle="collapse" onclick="setAnchor('#Return_value_enabled')" type="button"><span class="property-name">enabled</span></button> </h2> </div> <div aria-labelledby="headingReturn_value_enabled" class="collapse property-definition-div" data-parent="#accordionReturn_value_enabled" id="Return_value_enabled"> <div class="card-body pl-5"> <h4>Enabled</h4><span class="badge badge-dark value-type">Type: boolean</span> <span class="badge badge-success default-value">Default: true</span><br/> <span class="description"><p>Whether the init/shutdown script is enabled to execute.</p> </span> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value_timeout"> <div class="card"> <div class="card-header" id="headingReturn_value_timeout"> <h2 class="mb-0"> <button aria-controls="Return_value_timeout" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_timeout" data-toggle="collapse" onclick="setAnchor('#Return_value_timeout')" type="button"><span class="property-name">timeout</span></button> </h2> </div> <div aria-labelledby="headingReturn_value_timeout" class="collapse property-definition-div" data-parent="#accordionReturn_value_timeout" id="Return_value_timeout"> <div class="card-body pl-5"> <h4>Timeout</h4><span class="badge badge-dark value-type">Type: integer</span> <span class="badge badge-success default-value">Default: 10</span><br/> <span class="description"><p>An integer time in seconds that the system should wait for the execution of the script/command.</p> <p>A hard limit for a timeout is configured by the base OS, so when a script/command is set to execute on SHUTDOWN, the hard limit configured by the base OS is changed adding the timeout specified by script/command so it can be ensured that it executes as desired and is not interrupted by the base OS's limit.</p> </span> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value_comment"> <div class="card"> <div class="card-header" id="headingReturn_value_comment"> <h2 class="mb-0"> <button aria-controls="Return_value_comment" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_comment" data-toggle="collapse" onclick="setAnchor('#Return_value_comment')" type="button"><span class="property-name">comment</span></button> </h2> </div> <div aria-labelledby="headingReturn_value_comment" class="collapse property-definition-div" data-parent="#accordionReturn_value_comment" id="Return_value_comment"> <div class="card-body pl-5"> <h4>Comment</h4><span class="badge badge-dark value-type">Type: string</span> <span class="badge badge-success default-value">Default: ""</span><br/> <span class="description"><p>Optional comment describing the purpose of this script.</p> </span> <p><span class="badge badge-light restriction max-length-restriction" id="Return_value_comment_maxLength">Must be at most <code>255</code> characters long</span></p> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value_id"> <div class="card"> <div class="card-header" id="headingReturn_value_id"> <h2 class="mb-0"> <button aria-controls="Return_value_id" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value_id" data-toggle="collapse" onclick="setAnchor('#Return_value_id')" type="button"><span class="property-name">id</span> <span class="badge badge-warning required-property">Required</span></button> </h2> </div> <div aria-labelledby="headingReturn_value_id" class="collapse property-definition-div" data-parent="#accordionReturn_value_id" id="Return_value_id"> <div class="card-body pl-5"> <h4>Id</h4><span class="badge badge-dark value-type">Type: integer</span><br/> <span class="description"><p>Unique identifier for the init/shutdown script.</p> </span> </div> </div> </div> </div> </div> </div> </div> </div> </div><br><br>

*Required roles:* SYSTEM_CRON_WRITE

