noc.sa.models.managedobjectselector

Module Contents

noc.sa.models.managedobjectselector.id_lock
class noc.sa.models.managedobjectselector.ManagedObjectSelector

Bases: noc.core.model.base.NOCModel

class Meta

Bases: object

verbose_name
verbose_name_plural
db_table = sa_managedobjectselector
app_label = sa
ordering = ['name']
name
description
is_enabled
filter_id
filter_name
filter_managed
filter_pool
filter_profile
filter_vendor
filter_platform
filter_version
filter_object_profile
filter_address
filter_prefix
filter_administrative_domain
filter_vrf
filter_vc_domain
filter_service_group
filter_client_group
filter_tt_system
filter_user
filter_remote_path
filter_description
filter_tags
source_combine_method
sources
_id_cache
Q

Returns Q object which can be applied to ManagedObject.objects.filter

EXPR_MAP = [['filter_id', 'id', '=='], ['filter_name', 'name', '~'], ['filter_pool', 'pool', '=='], ['filter_profile', 'profile', '=='], ['filter_object_profile', 'object_profile', '=='], ['filter_address', 'address', '~'], ['filter_prefix', 'address', 'IN'], ['filter_administrative_domain', 'administrative_domain', 'IN'], ['filter_vrf', 'vrf', '=='], ['filter_vc_domain', 'vc_domain', '=='], ['filter_service_group', 'effective_service_groups', '=='], ['filter_client_group', 'effective_client_groups', '=='], ['filter_user', 'user', '=='], ['filter_remote_path', 'remote_path', '~'], ['filter_description', 'description', '~'], ['filter_tags', 'tags', 'CONTAINS']]
expr

Return selector as text expression

managed_objects

Returns queryset containing managed objects :return:

__str__(self)
classmethod get_by_id(cls, id)
on_save(self)
on_delete(self)
match(self, managed_object)

Check managed object matches selector :param managed_object: :return:

__contains__(self, managed_object)

“managed_object in selector” :param managed_object: :return:

classmethod get_objects_from_expression(cls, s)

Get list of Managed Object matching selector expression

Expression must be string or list. Elements must be one of: * string starting with @ - treated as selector name * string containing numbers - treated as object’s id * string - managed object name. * string - IPv4 or IPv6 address - management address

Raises ManagedObject.DoesNotExists if object is not found. Raises ManagedObjectSelector.DoesNotExists if selector is not found :param cls: :param s: :return:

class noc.sa.models.managedobjectselector.ManagedObjectSelectorByAttribute

Bases: noc.core.model.base.NOCModel

class Meta

Bases: object

verbose_name
db_table = sa_managedobjectselectorbyattribute
app_label = sa
selector
key_re
value_re
__str__(self)