Article ID: 124339, created on Jan 30, 2015, last review on Feb 27, 2015

  • Applies to:
  • Operations Automation 6.0
  • APS 2.x

Problem

I need to create a resource that will take a long time to provision, I don't want the user to wait for long but he should be able to check operation status/progress.

Resolution

There are two ways all operations are performed in APS:

  1. Synchronous: the user clicks a button in application UI, resource creation is initiated, result or error message is returned in user interface
  2. Asynchronous: operation is not initiated by user (subscription creation/cancellation)

An application developer can also decide whether the package would provide asyncronous provisioning

  • APS controller sends request to create a resource with header 'APS-Request-Phase: sync'
  • Endpoint sends response:
    • If endpoint responds with 200 OK then provisioning is finished, result is returned to the user
    • If endpoint responds with 202 Accepted POA creates a task to check the status of provisioning
  • POA reschedules task every APS-Retry-Timeout seconds, header APS-Request-Phase: async is sent along.
  • If endpoint sends APS-Info header it's contents are displayed in 'Additional Info' in task output
  • If endpoint responds with 500 Internal Server Error task is marked as Failed and rescheduling cycle stops
  • If endpoint responds with 200 OK task is marked as Successful and rescheduling cycle stops as well

In this example a task was rescheduled 5 times, finally endpoint responded with 200 OK:

[root@endpoint ~]# tail -f /var/log/httpd/ssl_access_log
10.28.99.128 - - [30/Jan/2015:11:34:10 +0300] "POST /async/vpses HTTP/1.1" 202 466
10.28.99.128 - - [30/Jan/2015:11:34:11 +0300] "POST /async/vpses HTTP/1.1" 202 466
10.28.99.128 - - [30/Jan/2015:11:34:41 +0300] "POST /async/vpses HTTP/1.1" 202 466
10.28.99.128 - - [30/Jan/2015:11:35:11 +0300] "POST /async/vpses HTTP/1.1" 202 466
10.28.99.128 - - [30/Jan/2015:11:35:41 +0300] "POST /async/vpses HTTP/1.1" 202 466
10.28.99.128 - - [30/Jan/2015:11:36:11 +0300] "POST /async/vpses HTTP/1.1" 200 465

956c448bddc7e1f3585373687602379f caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 5356b422f65bdad1c3e9edca5d74a1ae 6f1456866eed87488c0f02b298a741c0 717db81efe94e616312b74fb03a5d474 70bf700e0cdb9d7211df2595ef7276ab

Email subscription for changes to this article
Save as PDF