Adam Litke has uploaded a new change for review.

Change subject: schema: Fix the Hooks schema definition
......................................................................

schema: Fix the Hooks schema definition

The schema does not correctly describe the format of the hook info as returned
in VdsmCapabilities.  The correct format looks like the following:

{'after_vm_start':  {'01_faqemu':  {'md5': 'xxx-xxx'},
                     '02_another': {'md5': 'yyy-yyy'}},
 'before_vm_start': {'01_faqemu':  {'md5': 'xxx-xxx'},
                     '02_another': {'md5': 'yyy-yyy'}}}

This means we need to add a new map type to define the outermost dict as a map
of HookType -> HookScriptInfoMap.  HookScriptInfoMap remains a map of
<Hook name> -> HookScriptInfo.

Change-Id: I07168edf4ec71c4640d873e854da184abd4230e8
Signed-off-by: Adam Litke <a...@us.ibm.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 90 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/68/11568/1

diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index a863b19..944ed17 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -861,6 +861,95 @@
  'key': 'str', 'value': 'HookScriptInfo'}
 
 ##
+# @HookType:
+#
+# An enumeration of hook types.
+#
+# @before_vm_start:                Executed before starting a VM
+#
+# @after_vm_start:                 Executed after a VM has been started
+#
+# @before_vm_cont:                 Executed before resuming a paused VM
+#
+# @after_vm_cont:                  Executed after after resuming a paused VM
+#
+# @before_vm_pause:                Executed before pausing a VM
+#
+# @after_vm_pause:                 Executed after a VM has been paused
+#
+# @before_vm_migrate_source:       Executed on the source host prior to
+#                                  beginning the migration
+#
+# @after_vm_migrate_source:        Executed on the source host after the
+#                                  migration has finished
+#
+# @before_vm_migrate_destination:  Executed on the destination host prior to
+#                                  beginning migration
+#
+# @after_vm_migrate_destination:   Executed on the destination host after the
+#                                  migration has finished
+#
+# @before_vm_hibernate:            Executed before hibernating a VM
+#
+# @after_vm_hibernate:             Executed after a VM has been hiberbated
+#
+# @before_vm_dehibernate:          Executed before thawing a hibernated VM
+#
+# @after_vm_dehibernate:           Executed after thawing a hibernated VM
+#
+# @before_vm_destroy:              Executed before destroying a VM
+#
+# @after_vm_destroy:               Executed after destroying a VM
+#
+# @before_vm_set_ticket:           Executed before creating an access ticket 
for
+#                                  client access to a VM
+#
+# @after_vm_set_ticket:            Executed after a ticket has been created to
+#                                  grant client access to a VM
+#
+# @before_nic_hotplug:             Executed before plugging a virtual NIC
+#
+# @after_nic_hotplug:              Executed after plugging in a virtual NIC
+#
+# @before_nic_hotunplug:           Executed before unplugging a virtual NIC
+#
+# @after_nic_hotunplug:            Executed after a virtual NIC is unplugged
+#
+# @after_nic_hotplug_fail:         Executed after a virtual NIC hotplug
+#                                  operation has failed
+#
+# @after_nic_hotunplug_fail:       Executed after a virtual NIC hot unplug
+#                                  operation has failed
+#
+# @before_vdsm_start:              Executed before vdsm starts up
+#
+# @after_vdsm_stop:                Executed after vdsm has stopped
+#
+# Since: 4.10.3
+##
+{'enum': 'HookType',
+ 'data': ['before_vm_start', 'after_vm_start', 'before_vm_cont',
+          'after_vm_cont', 'before_vm_pause', 'after_vm_pause',
+          'before_vm_migrate_source', 'after_vm_migrate_source',
+          'before_vm_migrate_destination', 'after_vm_migrate_destination',
+          'before_vm_hibernate', 'after_vm_hibernate', 'before_vm_dehibernate',
+          'after_vm_dehibernate', 'before_vm_destroy', 'after_vm_destroy',
+          'before_vm_set_ticket', 'after_vm_set_ticket', 'before_nic_hotplug',
+          'after_nic_hotplug', 'before_nic_hotunplug', 'after_nic_hotunplug',
+          'after_nic_hotplug_fail', 'after_nic_hotunplug_fail',
+          'before_vdsm_start', 'after_vdsm_stop']}
+
+##
+# @HookScriptTypesMap:
+#
+# A mapping of installed hook scripts indexed by hook type.
+#
+# Since: 4.10.0
+##
+{'map': 'HookScriptTypesMap',
+ 'key': 'HookType', 'value': 'HookScriptInfoMap'}
+
+##
 # @SoftwarePackageInfoMap:
 #
 # A mapping of information indexed by software package name.
@@ -949,7 +1038,7 @@
           'supportedProtocols': ['str'], 'clusterLevels': ['str'],
           'networks': 'NetInfoNetworkMap', 'bridges': 'NetInfoBridgeMap',
           'nics': 'NetInfoNicMap', 'bondings': 'NetInfoBondMap',
-          'vlans': 'NetInfoVlanMap', '*hooks': 'HookScriptInfoMap',
+          'vlans': 'NetInfoVlanMap', '*hooks': 'HookScriptTypesMap',
           'operatingSystem': 'OsVersion', 'uuid': 'str',
           'packages2': 'SoftwarePackageInfoMap',
           'emulatedMachines': ['str'], 'ISCSIInitiatorName': 'str',


--
To view, visit http://gerrit.ovirt.org/11568
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07168edf4ec71c4640d873e854da184abd4230e8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <a...@us.ibm.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to