Skip to main content
Solved

Self Destruct Calm App

  • August 3, 2018
  • 1 reply
  • 2633 views

Forum|alt.badge.img+6
Hi

I have a calm blue print which the user can use to create an app which does some processing depending on the value of variables specified by the user and stores the result in persistent storage. But then the user has to remeber to delete the application.

Is there any way to get the blue print to delete the application affter it has done the processing?

I can shutdown the VM by having the service start call service stop with a task to execute "shutdown -h +1" but that still leaves the app

Best answer by Chandru

You can try this following workaround,

Add the following script as the last task in Service Start action with type as escript and create the following application profile level variables,

username - prism central admin username
password - password for the above mentioned username

code:
sleep (120)
headers= {"accept":"application/json"}
url="https://127.0.0.1:9440/api/nutanix/v3/apps/@@{calm_application_uuid}@@"
resp=urlreq(url,verb="DELETE",auth="BASIC",user="@@{username}@@",passwd="@@{password}@@",headers=headers,verify=False)




The above script uses Prism Central REST API to call the APP delete action.

Note: The above script has been tested only on single service blueprints
This topic has been closed for replies.

1 reply

Forum|alt.badge.img+13
  • Nutanix Employee
  • Answer
  • August 5, 2018
You can try this following workaround,

Add the following script as the last task in Service Start action with type as escript and create the following application profile level variables,

username - prism central admin username
password - password for the above mentioned username

code:
sleep (120)
headers= {"accept":"application/json"}
url="https://127.0.0.1:9440/api/nutanix/v3/apps/@@{calm_application_uuid}@@"
resp=urlreq(url,verb="DELETE",auth="BASIC",user="@@{username}@@",passwd="@@{password}@@",headers=headers,verify=False)




The above script uses Prism Central REST API to call the APP delete action.

Note: The above script has been tested only on single service blueprints