OpenSecurity/bin/opensecurityd.py
changeset 54 59f1d824a070
parent 46 f659d8fb57a8
     1.1 --- a/OpenSecurity/bin/opensecurityd.py	Thu Jan 09 10:44:42 2014 +0100
     1.2 +++ b/OpenSecurity/bin/opensecurityd.py	Wed Jan 29 14:18:17 2014 +0100
     1.3 @@ -63,11 +63,11 @@
     1.4      '/sdvms/(.*)',                      'os_sdvm',              # http://localhost:8080/sdvms/[VMNAME]                          GET, DELETE
     1.5      '/vms',                             'os_vms',               # http://localhost:8080/vms                                     GET
     1.6      '/vms/(.*)',                        'os_vm',                # http://localhost:8080/vms/[VMNAME]                            GET
     1.7 -    '/',                                'os_root'               # http://localhost:8080/                                        GET
     1.8 +    '/',                                'os_root',              # http://localhost:8080/                                        GET
     1.9 +    '/update_template',                 'os_update_template'    # http://localhost:8080/update_template                         GET
    1.10  )
    1.11  
    1.12 -
    1.13 -# ------------------------------------------------------------
    1.14 + # ------------------------------------------------------------
    1.15  # vars
    1.16  
    1.17  # Global VMManager instance
    1.18 @@ -221,6 +221,15 @@
    1.19          res += "}"
    1.20          return res
    1.21  
    1.22 +class os_update_template:
    1.23 +    """OpenSecurity '/update_template' handler
    1.24 +    
    1.25 +    - GET: update template vm
    1.26 +    """
    1.27 +    
    1.28 +    def GET(self):
    1.29 +        #return gvm_mgr.guestExecute('SecurityDVM', 'sudo apt-get -y update')
    1.30 +        return gvm_mgr.updateTemplate()
    1.31  
    1.32  # start
    1.33  if __name__ == "__main__":