Search Engine: Elastic

Article ID: 115550, created on Feb 15, 2013, last review on Aug 15, 2017

  • Applies to:
  • Operations Automation 7.0
  • Operations Automation 6.0
  • Operations Automation 5.5
  • Operations Automation 5.4

Symptoms

It is required to reschedule an existing OA task with different task parameters.

Resolution

Since OA 5.4, Providers may use the pem.tasks.rescheduleTask OpenAPI method to change task parameters. The method allows rescheduling (i.e. the ability to both change and to immediately try to re-run) a failed or canceled task without restarting OA or reloading the whole Task Manager queue.

The following use cases are available:

  • Reschedule the task with a default timeout of 3,600 seconds.
  • Reschedule the task with changed task parameters. The list of parameters provided will be added to the given task's parameters. If some of them already exist, their values will be changed to the new ones.
  • Reschedule the task with a changed task timeout.

Keep in mind that a task timeout means only a CORBA timeout, i.e., a timeout during execution of the operation on the hosting or external servers. If a task performs a lengthy operation on the OA Management Node (e.g., it executes a lot of SQL requests), a task timeout does not affect execution. Only if the task starts a remote operation via CORBA and this operation executes after a proper amount of time has elapsed will it be stopped with the error "CORBA::TIMEOUT."

The pem.tasks.rescheduleTask API method has the following input parameters:

  • task_id - integer, ID of the task
  • [timeout] - integer, task's new timeout (in seconds)
  • [params] - array of struct; task parameter is a pair of "name" and "value" parameters, such as params=[{'name':'parameter',''value':'new value'}]

Please refer to the OA Public API Reference to obtain more information about pem.tasks.rescheduleTask method.

See a couple of examples of XML API requests using the pem.tasks.rescheduleTask method below.

  1. XML request to reschedule a task with a different ve_info parameter for a PACI subscription:

    <?xml version="1.0" encoding="UTF-8" ?>
    <methodCall>
      <methodName>pem.tasks.rescheduleTask</methodName>
      <params>
        <param>
          <value>
            <struct>
              <member>
                <name>task_id</name>
                <value><int>497184</int></value>
              </member>
              <member>
                <name>params</name>
                <value>
                  <array>
                    <data>
                      <value>
                        <struct>
                          <member>
                            <name>name</name>
                            <value><string>ve_info</string></value>
                          </member>
                          <member>
                            <name>value</name>
                            <value><string>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;ve&gt;&lt;name&gt;first-server&lt;/name&gt;&lt;description&gt;Server, purchased via Online Store&lt;/description&gt;&lt;subscription-id&gt;1002652&lt;/subscription-id&gt;&lt;cpu number=&quot;2&quot; power=&quot;500&quot;/&gt;&lt;ram-size&gt;2048&lt;/ram-size&gt;&lt;bandwidth&gt;10240&lt;/bandwidth&gt;&lt;no-of-public-ip&gt;1&lt;/no-of-public-ip&gt;&lt;ve-disk local=&quot;true&quot; size=&quot;60&quot; primary=&quot;true&quot;/&gt;&lt;platform&gt;&lt;os-info type=&quot;windows&quot; technology=&quot;CT&quot;/&gt;&lt;/platform&gt;&lt;/ve&gt;</string></value>
                          </member> 
                        </struct>   
                      </value>  
                    </data> 
                  </array>  
                </value>    
              </member>
            </struct>
          </value>
        </param>
      </params>
    </methodCall>
    
  2. XML request to reschedule a task with a changed env_var_SETTINGS_up_PreferredLanguage parameter for an Office 365 subscription:

    <?xml version='1.0'?>
    <methodCall>
    <methodName>pem.tasks.rescheduleTask</methodName>
      <params>
      <param>
        <value>
          <struct>
            <member>
              <name>task_id</name>
                <value>
                <i4>690982</i4>
                  </value>
                </member>
              <member>
              <name>params</name>
                <value>
                <array>
                  <data>
                   <value>
                      <struct>
                        <member>
                          <name>name</name>
                            <value>
                            <string>env_var_SETTINGS_up_PreferredLanguage</string>
                              </value>
                            </member>
                          <member>
                          <name>value</name>
                            <value>
                            <string>pl_PL</string>
                              </value>
                            </member>
                          </struct>
                        </value>
                      </data>
                   </array>
                  </value>
                </member>
              </struct>
            </value>
          </param>
        </params>
      </methodCall>
    
  3. XML request to reschedule a task with a changed timeout:

    <?xml version="1.0" encoding="UTF-8"?>
    <methodCall>
      <methodName>pem.tasks.rescheduleTask</methodName>
      <params>
        <param>
          <value>
            <struct>
              <member>
                <name>task_id</name>
                <value><int>3607909</int></value>
              </member>
              <member>
                <name>timeout</name>
                <value><int>1200</int></value>
              </member>
            </struct>
          </value>
        </param>
      </params>
    </methodCall>
    

There can be many values within each array; this means you may change several or all parameters of a task in a single XML request.

- INTERNAL (content below this line is not visible in published article) -

caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae ac82ce33439a9c1feec4ff4f2f638899 2554725ed606193dd9bbce21365bed4e 5b048d9bddf8048a00aba7e0bdadef37 e12cea1d47a3125d335d68e6d4e15e07 0871c0b47b3b86ae3b1af4c2942cd0ce 1941880841f714e458ae4dc3d9f3062d 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0

Email subscription for changes to this article
Save as PDF