Hooks

Overview

infinisdk uses gossip library, implementaion of a basic hook mechanism for registering callbacks.

>>> from __future__ import print_function
>>> import gossip

>>> @gossip.register('infinidat.sdk.post_object_creation', tags=['pool'], token=gossip_token)
... def post_creation(obj, **_):
...     print("Pool '{}' was created".format(obj.get_name()))

>>> pool = system.pools.create(name='some_pool')
Pool 'some_pool' was created

Note

It is entirely possible for hooks to receive more keyword arguments as features are added to InfiniSDK. To cope with this you are strongly encouraged to allow passing “catch-all” keyword arguments to your hooks (e.g. **kwargs)

See also

For more information about gossip, see Gossip documentation

Available Hooks

The following hooks are available from the infinidat.sdk group:

infinidat.sdk.after_api_request(request, response)

No supported tags

infinidat.sdk.after_login(system)

No supported tags

infinidat.sdk.before_api_request(request)

No supported tags

infinidat.sdk.begin_fork(obj)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.cancel_fork(obj)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.cluster_add_host_failure(host, cluster, exception)

Supported tags: host_cluster, infinibox

infinidat.sdk.cluster_remove_host_failure(host, cluster, exception)

Supported tags: host_cluster, infinibox

infinidat.sdk.cons_group_add_member_failure(cons_group, member, request)

Supported tags: infinibox

infinidat.sdk.cons_group_deletion_failure(cons_group, delete_members)

Supported tags: cons_group, infinibox

infinidat.sdk.cons_group_remove_member_failure(cons_group, member)

Supported tags: infinibox

infinidat.sdk.data_restore_failure(source, target, exc)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.entity_child_creation_failure(obj, exception, system)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.finish_fork(obj, child)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.object_creation_failure(data, system, cls, parent, exception)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.object_deletion_failure(obj, exception, system, url)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.object_operation_failure(exception)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.object_restore_failure(source, target, exc)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.object_update_failure(obj, exception, system, data)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.pool_lock_failure(pool, exception)

Supported tags: infinibox, pool

infinidat.sdk.pool_move_failure(obj, with_capacity, system, exception, target_pool, source_pool)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.pool_unlock_failure(pool, exception)

Supported tags: infinibox, pool

infinidat.sdk.post_cluster_add_host(host, cluster)

Supported tags: host_cluster, infinibox

infinidat.sdk.post_cluster_remove_host(host, cluster)

Supported tags: host_cluster, infinibox

infinidat.sdk.post_cons_group_add_member(cons_group, member, request)

Supported tags: infinibox

infinidat.sdk.post_cons_group_deletion(cons_group, delete_members)

Supported tags: cons_group, infinibox

infinidat.sdk.post_cons_group_remove_member(cons_group, member)

Supported tags: infinibox

infinidat.sdk.post_data_restore(source, target, require_real_data, reason)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.post_entity_child_creation(source, target, system)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.post_object_creation(obj, data, response_dict, parent)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.post_object_deletion(obj, url)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.post_object_restore(source, target)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.post_object_update(obj, data, response_dict)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.post_pool_lock(pool)

Supported tags: infinibox, pool

infinidat.sdk.post_pool_move(obj, with_capacity, system, target_pool, source_pool)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.post_pool_unlock(pool)

Supported tags: infinibox, pool

infinidat.sdk.post_qos_policy_assign(qos_policy, entity)

Supported tags: infinibox, qos_policy

infinidat.sdk.post_qos_policy_unassign(qos_policy, entity)

Supported tags: infinibox, qos_policy

infinidat.sdk.post_refresh_snapshot(source, target)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.post_replica_change_role(replica)

Supported tags: infinibox

infinidat.sdk.post_replica_change_type(replica, old_type, new_type)

Supported tags: infinibox

infinidat.sdk.post_replica_resume(replica)

Supported tags: infinibox

infinidat.sdk.post_replica_suspend(replica)

Supported tags: infinibox

infinidat.sdk.post_replica_switch_role(replica)

Supported tags: infinibox

infinidat.sdk.post_replication_snapshot_expose

Supported tags: cons_group, filesystem, volume

infinidat.sdk.post_treeq_creation(fields, system, filesystem, treeq)

Supported tags: infinibox, treeq

infinidat.sdk.pre_cluster_add_host(host, cluster)

Supported tags: host_cluster, infinibox

infinidat.sdk.pre_cluster_remove_host(host, cluster)

Supported tags: host_cluster, infinibox

infinidat.sdk.pre_cons_group_add_member(cons_group, member, request)

Supported tags: infinibox

infinidat.sdk.pre_cons_group_deletion(cons_group, delete_members)

Supported tags: cons_group, infinibox

infinidat.sdk.pre_cons_group_remove_member(cons_group, member)

Supported tags: infinibox

infinidat.sdk.pre_creation_data_validation(fields, system, cls)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.pre_data_restore(source, target)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.pre_entity_child_creation(source, system)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.pre_fields_update(fields, source)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.pre_object_creation(data, system, cls, parent)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.pre_object_deletion(obj, url)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.pre_object_restore(source, target)

Supported tags: filesystem, infinibox, volume

infinidat.sdk.pre_object_update(obj, data)

Supported tags: cons_group, export, fc_soft_target, fc_switch, filesystem, host, host_cluster, infinibox, initiator, ldap_config, link, network_interface, network_space, nlm_lock, notification_rule, notification_target, plugin, pool, qos_policy, replica, tenant, treeq, user, volume

infinidat.sdk.pre_pool_lock(pool)

Supported tags: infinibox, pool

infinidat.sdk.pre_pool_move(obj, with_capacity, system, target_pool, source_pool)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.pre_pool_unlock(pool)

Supported tags: infinibox, pool

infinidat.sdk.pre_qos_policy_assign(qos_policy, entity)

Supported tags: infinibox, qos_policy

infinidat.sdk.pre_qos_policy_unassign(qos_policy, entity)

Supported tags: infinibox, qos_policy

infinidat.sdk.pre_refresh_snapshot(source, target)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.pre_replica_change_role(replica)

Supported tags: infinibox

infinidat.sdk.pre_replica_change_type(replica, old_type, new_type)

Supported tags: infinibox

infinidat.sdk.pre_replica_resume(replica)

Supported tags: infinibox

infinidat.sdk.pre_replica_suspend(replica)

Supported tags: infinibox

infinidat.sdk.pre_replica_switch_role(replica)

Supported tags: infinibox

infinidat.sdk.pre_replication_snapshot_expose

Supported tags: cons_group, filesystem, volume

infinidat.sdk.pre_treeq_creation(fields, system, filesystem)

Supported tags: infinibox, treeq

infinidat.sdk.qos_policy_assign_failure(qos_policy, entity, exception)

Supported tags: infinibox, qos_policy

infinidat.sdk.qos_policy_unassign_failure(qos_policy, entity, exception)

Supported tags: infinibox, qos_policy

infinidat.sdk.refresh_snapshot_failure(source, target)

Supported tags: cons_group, filesystem, infinibox, volume

infinidat.sdk.replica_change_role_failure(replica, exception)

Supported tags: infinibox

infinidat.sdk.replica_change_type_failure(replica, old_type, new_type, exception)

Supported tags: infinibox

infinidat.sdk.replica_deleted(replica, entity_pairs, deletion_params)

Supported tags: infinibox

infinidat.sdk.replica_resume_failure(replica, exception)

Supported tags: infinibox

infinidat.sdk.replica_snapshot_created(snapshot, replica_deleted)

Supported tags: infinibox

infinidat.sdk.replica_suspend_failure(replica, exception)

Supported tags: infinibox

infinidat.sdk.replica_switch_role_failure(replica, exception)

Supported tags: infinibox

infinidat.sdk.replication_snapshot_expose_failure

Supported tags: cons_group, filesystem, volume

infinidat.sdk.treeq_creation_failure(fields, system, filesystem, exception)

Supported tags: infinibox, treeq