VNF Primitive Stop: Difference between revisions

From OSM Public Wiki
Jump to: navigation, search
(Created page with "'''DISCLAIMER: This page is being updated to reflect changes required for Release FOUR.''' The purpose of the Stop primitive is to stop your VNF application. {|class="wikita...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''DISCLAIMER: This page is being updated to reflect changes required for Release FOUR.'''
The purpose of the Stop primitive is to stop your VNF application.
The purpose of the Stop primitive is to stop your VNF application.


Line 37: Line 35:
         action_set({'outout': result})
         action_set({'outout': result})
     finally:
     finally:
         clear_flag('actions.start')
         clear_flag('actions.stop')
</pre>
</pre>


For a full example of creating a VNF charm, please see [[Creating your own VNF charm (Release FOUR)]].
For a full example of creating a VNF charm, please see [[Creating your own VNF charm (Release FOUR)]].

Latest revision as of 12:33, 26 June 2018

The purpose of the Stop primitive is to stop your VNF application.

Config Required
Day 0 Day 1 Day 2
No Yes Yes No

Example code:

@when('actions.stop')
def stop_vnf():
    err = ''
    try:
        """
        Run the command(s) necessary to perform a safe stop of your VNF
        This could be a single command that encapsulates your stop process...
        Or a series of commands for each step, such as:
         - stop accepting live traffic
         - perform cool-down operations
         - stop your vnf
        """
        result, err = charms.sshproxy._run("/srv/myvnf/stop.sh")
    except:
        action_fail('Stop failed:' + err)
    else:
        action_set({'outout': result})
    finally:
        clear_flag('actions.stop')

For a full example of creating a VNF charm, please see Creating your own VNF charm (Release FOUR).