Hi Anuj,
The policy will delete virtual machines along with the application. It
invokes the Startable.STOP effector with no arguments on its target. The
implementation of this effector for applications (extending
`org.apache.brooklyn.core.entity.AbstractApplication`) is to stop all
children. The implementation of the effector for entities extending
`org.apache.brooklyn.entity.software.base.SoftwareProcess` first stops
the entity's process and then releases the underlying location.
There is an example blueprint in my original email.
Sam
On 24/02/2016 12:57, Goyal, Anuj wrote:
Hi Sam,
Will it delete the virtual machine along with stopping application?
Also, It will be helpful, If you can point me to example blueprint using this
Policy.
Regards,
~Anuj
-----Original Message-----
From: Sam Corbett [mailto:[email protected]]
Sent: Wednesday, February 17, 2016 4:10 PM
To: [email protected]
Subject: New policy for auto-stopping applications after a fixed period
Hi everyone,
Merged into Brooklyn yesterday was a useful policy that stops entities after a
period has elapsed.
Example usage:
location: localhost
services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
brooklyn.policies:
* - type: org.apache.brooklyn.policy.action.StopAfterDurationPolicy**
** brooklyn.config:**
** lifetime: 4h**
* brooklyn.children:
- type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
The policy is configured to invoke the stop effector on the application after
four hours have passed.
Hidden inside this is a new DurationSinceSensor, which records the duration
since it was added to an entity.
You may find this useful if you run multi-user environments in which people
forget to release their resources.
Sam