Symptoms

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

Resolution

The method descibed below is only applicable for OA versions below 7.1. For versions 7.1 and higher there is no supported API way to change parameters, to be added in scope of request PFR-1883.

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) -

Internal content