class Constants(cereconst.Constants): # Entity type entity_feide_service = cereconst._EntityTypeCode('feide_service', 'Feide service') # Change log feide_service_add = cereconst._ChangeTypeCode( 'feide_service', 'add', 'added feide service %(subject)s', ("feide_id=%(int:feide_id)s", "name=%(string:name)s")) feide_service_mod = cereconst._ChangeTypeCode( 'feide_service', 'mod', 'modified feide service %(subject)s', ("feide_id=%(int:feide_id)s", "name=%(string:name)s")) feide_service_del = cereconst._ChangeTypeCode( 'feide_service', 'del', 'deleted feide service %(subject)s', ("feide_id=%(int:feide_id)s", "name=%(string:name)s")) feide_service_authn_level_add = cereconst._ChangeTypeCode( 'feide_service_authn_level', 'add', 'added authn level for %(subject)s, service=%(dest)s', ("level=%(int:level)s")) feide_service_authn_level_mod = cereconst._ChangeTypeCode( 'feide_service_authn_level', 'mod', 'modified authn level for %(subject)s, service=%(dest)s', ("level=%(int:level)s")) feide_service_authn_level_del = cereconst._ChangeTypeCode( 'feide_service_authn_level', 'del', 'deleted authn level for %(subject)s, service=%(dest)s', ("level=%(int:level)s"))
class HpcConstants(Constants.Constants): CpuArch = _CpuArchCode OperatingSystem = _OperatingSystemCode InterConnect = _InterConnectCode AllocationAuthority = _AllocationAuthorityCode AllocationStatus = _AllocationStatusCode AllocationCreditPriority = _AllocationCreditPriorityCode Science = _ScienceCode entity_project = Constants._EntityTypeCode( 'project', 'see table project_info and friends') entity_allocation = Constants._EntityTypeCode( 'allocation', 'see table allocation_info and friends') entity_allocationperiod = Constants._EntityTypeCode( 'allocationperiod', 'see table allocation_period_info and friends') machine_mod = _ChangeTypeCode('e_machine', 'mod', 'modified %(subject)s') machine_demote = _ChangeTypeCode('e_machine', 'demote', 'demote %(subject)s') machine_promote = _ChangeTypeCode('e_machine', 'promote', 'promote %(subject)s') project_create = _ChangeTypeCode('e_project', 'create', 'created %(subject)s') project_mod = _ChangeTypeCode('e_project', 'mod', 'modified %(subject)s') project_destroy = _ChangeTypeCode('e_project', 'destroy', 'destroyed %(subject)s') allocation_create = _ChangeTypeCode('e_allocation', 'create', 'created %(subject)s') allocation_mod = _ChangeTypeCode('e_allocation', 'mod', 'modified %(subject)s') allocation_destroy = _ChangeTypeCode('e_allocation', 'destroy', 'destroyed %(subject)s') allocation_period_create = _ChangeTypeCode('e_alloc_period', 'create', 'created %(subject)s') allocation_period_mod = _ChangeTypeCode('e_alloc_period', 'mod', 'modified %(subject)s') allocation_period_destroy = _ChangeTypeCode('e_alloc_period', 'destroy', 'destroyed %(subject)s')
class Constants(CereConst.Constants): entity_hostpolicy_atom = CereConst._EntityTypeCode( 'hostpolicy_atom', 'hostpolicy_atom - see table "cerebrum.hostpolicy_component" and friends.' ) entity_hostpolicy_role = CereConst._EntityTypeCode( 'hostpolicy_role', 'hostpolicy_role - see table "cerebrum.hostpolicy_component" and friends.' ) hostpolicy_component_namespace = CereConst._ValueDomainCode( 'hostpol_comp_ns', 'Domain for hostpolicy-components') hostpolicy_mutually_exclusive = _PolicyRelationshipCode( "hostpol_mutex", "Source policy and target policy are mutually exclusive") hostpolicy_contains = _PolicyRelationshipCode( "hostpol_contains", "Source policy contains target policy")
class Constants(Constants.Constants): entity_hostpolicy_atom = Constants._EntityTypeCode( 'hostpolicy_atom', 'hostpolicy_atom - see table "cerebrum.hostpolicy_component" and friends.') entity_hostpolicy_role = Constants._EntityTypeCode( 'hostpolicy_role', 'hostpolicy_role - see table "cerebrum.hostpolicy_component" and friends.') hostpolicy_component_namespace = Constants._ValueDomainCode('hostpol_comp_ns', 'Domain for hostpolicy-components') hostpolicy_mutually_exclusive = _PolicyRelationshipCode( "hostpol_mutex", "Source policy and target policy are mutually exclusive") hostpolicy_contains = _PolicyRelationshipCode( "hostpol_contains", "Source policy contains target policy") # ChangeLog constants hostpolicy_atom_create = _ChangeTypeCode( 'hostpolicy', 'atom_create', 'create atom %(subject)s') hostpolicy_atom_mod = _ChangeTypeCode( 'hostpolicy', 'atom_mod', 'modify atom %(subject)s') hostpolicy_atom_delete = _ChangeTypeCode( 'hostpolicy', 'atom_delete', 'delete atom %(subject)s') hostpolicy_role_create = _ChangeTypeCode( 'hostpolicy', 'role_create', 'create role %(subject)s') hostpolicy_role_mod = _ChangeTypeCode( 'hostpolicy', 'role_mod', 'modify role %(subject)s') hostpolicy_role_delete = _ChangeTypeCode( 'hostpolicy', 'role_delete', 'delete role %(subject)s') hostpolicy_relationship_add = _ChangeTypeCode( 'hostpolicy', 'relationship_add', 'add relationship %(subject)s -> %(dest)s') # TODO: type is not given here hostpolicy_relationship_remove = _ChangeTypeCode( 'hostpolicy', 'relationship_remove', 'remove relationship %(subject)s -> %(dest)s') # TODO: type is not given here hostpolicy_policy_add = _ChangeTypeCode( 'hostpolicy', 'policy_add', 'add policy %(dest)s to host %(subject)s') hostpolicy_policy_remove = _ChangeTypeCode( 'hostpolicy', 'policy_remove', 'remove policy %(dest)s from host %(subject)s')
class EmailConstants(Constants.Constants): # TODO: Clean up these constants! And do it in a way that lets # us import system specific constants EmailTarget = _EmailTargetCode EmailDomainCategory = _EmailDomainCategoryCode EmailServerType = _EmailServerTypeCode EmailSpamLevel = _EmailSpamLevelCode EmailSpamAction = _EmailSpamActionCode EmailTargetFilter = _EmailTargetFilterCode EmailVirusFound = _EmailVirusFoundCode EmailVirusRemoved = _EmailVirusRemovedCode entity_email_domain = Constants._EntityTypeCode( 'email_domain', 'Email domain - see table "cerebrum.email_domain" and friends.') entity_email_address = Constants._EntityTypeCode( 'email_address', 'Email address - see table "cerebrum.email_address" and friends.') entity_email_target = Constants._EntityTypeCode( 'email_target', 'Email target - see table "cerebrum.email_target" and friends.') email_domain_category_noexport = _EmailDomainCategoryCode( 'noexport', 'Addresses in these domains can be defined, but are not' ' exported to the mail system. This is useful for' ' pre-defining addresses prior to taking over a new' ' maildomain.') email_domain_category_cnaddr = _EmailDomainCategoryCode( 'cnaddr', "Primary user addresses in these domains will be based on the" " owner's full common name, and not just e.g. the username.") email_domain_category_uidaddr = _EmailDomainCategoryCode( 'uidaddr', 'Primary user addresses in these domains will be in the format' 'username@domain.') email_domain_category_include_all_uids = _EmailDomainCategoryCode( 'all_uids', 'All account email targets should get a valid address in this domain,' ' on the form <accountname@domain>.') email_target_account = _EmailTargetCode( 'account', "Target is the local delivery defined for the PosixUser whose" " account_id == email_target.using_uid.") # exchange-related-jazz email_target_dl_group = _EmailTargetCode( 'group', "Target is the Exchange - local delivery defined for" " the DistributionGroup with" " group_id == email_target.using_uid.") email_target_deleted = _EmailTargetCode( 'deleted', "Target type for addresses that are no longer working, but" " for which it is useful to include a short custom text in" " the error message returned to the sender. The text" " is taken from email_target.alias_value") email_target_forward = _EmailTargetCode( 'forward', "Target is a pure forwarding mechanism; local deliveries will" " only occur as indirect deliveries to the addresses forwarded" " to. Both email_target.target_entity_id, email_target.using_uid and" " email_target.alias_value should be NULL, as they are ignored." " The email address(es) to forward to is taken from table" " email_forward.") email_target_file = _EmailTargetCode( 'file', "Target is a file. The absolute path of the file is gathered" " from email_target.alias_value. Iff email_target.using_uid" " is set, deliveries to this target will be run as that" " PosixUser.") email_target_pipe = _EmailTargetCode( 'pipe', "Target is a shell pipe. The command (and args) to pipe mail" " into is gathered from email_target.alias_value. Iff" " email_target.using_uid is set, deliveries to this target" " will be run as that PosixUser.") email_target_RT = _EmailTargetCode( 'RT', "Target is a RT queue. The command (and args) to pipe mail" " into is gathered from email_target.alias_value. Iff" " email_target.using_uid is set, deliveries to this target" " will be run as that PosixUser.") email_target_Sympa = _EmailTargetCode( 'Sympa', "Target is a Sympa mailing list. The command (and args) to" " pipe mail into is gathered from email_target.alias_value." " Iff email_target.using_uid is set, deliveries to this target" " will be run as that PosixUser.") email_target_multi = _EmailTargetCode( 'multi', "Target is the set of `account`-type targets corresponding to" " the Accounts that are first-level members of the Group that" " has group_id == email_target.target_entity_id.") email_server_type_nfsmbox = _EmailServerTypeCode( 'nfsmbox', "Server delivers mail as mbox-style mailboxes over NFS.") email_server_type_cyrus = _EmailServerTypeCode( 'cyrus_IMAP', "Server is a Cyrus IMAP server, which keeps mailboxes in a " "Cyrus-specific format.") email_server_type_sympa = _EmailServerTypeCode( 'sympa', "Server is a Sympa mailing list server.") email_server_type_exchange = _EmailServerTypeCode('exchange', "Exchange server.") email_target_filter_greylist = _EmailTargetFilterCode( 'greylist', "Delay messages from unknown servers") email_target_filter_uioonly = _EmailTargetFilterCode( 'uioonly', "Only accept the use of an UiO address as sender address" " on the UiO network, or when using authenticated SMTP") email_target_filter_internalonly = _EmailTargetFilterCode( 'internalonly', "Only route internal mail. External mail is rejected")
class Constants(CereConst.Constants): # Entity type entity_feide_service = CereConst._EntityTypeCode('feide_service', 'Feide service')
class Constants(Constants.Constants): """``DnsConstants.Constants(Constants.Constants)`` defines constants used by the dns module""" entity_dns_cname = Constants._EntityTypeCode( 'cname', 'cname - see table "cerebrum.cname_info" and friends.') entity_dns_host = Constants._EntityTypeCode( # name-clash with existing entity_type 'dns_host', 'dns_host - see table "cerebrum.dns_host_info" and friends.') entity_dns_a_record = Constants._EntityTypeCode( 'a_record', 'a_record - see table "cerebrum.a_record_info" and friends.') entity_dns_aaaa_record = Constants._EntityTypeCode( 'aaaa_record', 'aaaa_record - see table "cerebrum.aaaa_record_info" and friends.') entity_dns_owner = Constants._EntityTypeCode( 'dns_owner', 'dns_owner - see table "cerebrum.dns_owner" and friends.') entity_dns_ip_number = Constants._EntityTypeCode( 'dns_ip_number', 'dns_ip_number - see table "cerebrum.dns_ip_number" and friends.') entity_dns_ipv6_number = Constants._EntityTypeCode( 'dns_ipv6_number', 'dns_ipv6_number - see table "cerebrum.dns_ipv6_number" and friends.') entity_dns_subnet = Constants._EntityTypeCode( 'dns_subnet', 'dns_subnet - see table "cerebrum.dns_subnet" and friends.') entity_dns_ipv6_subnet = Constants._EntityTypeCode( 'dns_ipv6_subnet', 'dns_ipv6_subnet - see table "cerebrum.dns_ipv6_subnet" and friends.') dns_owner_namespace = Constants._ValueDomainCode('dns_owner_ns', 'Domain for dns_owners') spread_uio_machine_netgroup = Constants._SpreadCode( 'NIS_mng@uio', Constants.Constants.entity_group, 'Machine netgroup in NIS domain "uio"') field_type_txt = _FieldTypeCode('TXT', 'TXT Record') trait_dns_contact = _EntityTraitCode( 'dns_contact', entity_dns_owner, """Contact information (e-mail address) for the host.""") trait_dns_comment = _EntityTraitCode( 'dns_comment', entity_dns_owner, """A freeform comment about the host.""") # TODO: The uio constants should be in a uio specific constants module uio_zone = _DnsZoneCode("uio", ".uio.no.") trofast_zone = _DnsZoneCode("trofast_uio", ".trofast.uio.no.") other_zone = _DnsZoneCode("other", None) # ChangeLog constants a_record_add = _ChangeTypeCode('host', 'a_rec_add', 'add a-record %(subject)s -> %(dest)s') a_record_del = _ChangeTypeCode('host', 'a_rec_del', 'del a-record %(subject)s -> %(dest)s') a_record_update = _ChangeTypeCode( 'host', 'a_rec_upd', 'update a-record %(subject)s -> %(dest)s') aaaa_record_add = _ChangeTypeCode( 'host', 'aaaa_rec_add', 'add aaaa-record %(subject)s -> %(dest)s') aaaa_record_del = _ChangeTypeCode( 'host', 'aaaa_rec_del', 'del aaaa-record %(subject)s -> %(dest)s') aaaa_record_update = _ChangeTypeCode( 'host', 'aaaa_rec_upd', 'update aaaa-record %(subject)s -> %(dest)s') cname_add = _ChangeTypeCode('host', 'cname_add', 'add cname %(subject)s -> %(dest)s') cname_del = _ChangeTypeCode('host', 'cname_del', 'del cname %(subject)s -> %(dest)s') cname_update = _ChangeTypeCode('host', 'cname_upd', 'update cname %(subject)s -> %(dest)s') dns_owner_add = _ChangeTypeCode('host', 'dns_owner_add', 'add dns-owner %(subject)s') dns_owner_update = _ChangeTypeCode('host', 'dns_owner_upd', 'update dns-owner %(subject)s') dns_owner_del = _ChangeTypeCode('host', 'dns_owner_del', 'del dns-owner %(subject)s') general_dns_record_add = _ChangeTypeCode( 'host', 'gen_dns_rec_add', 'add record for %(subject)s', ('%(int:field_type)s=%(string:data)s', )) general_dns_record_del = _ChangeTypeCode('host', 'gen_dns_rec_del', 'del record for %(subject)s', ('type=%(int:field_type)s', )) general_dns_record_update = _ChangeTypeCode( 'host', 'gen_dns_rec_upd', 'update record for %(subject)s', ('%(int:field_type)s=%(string:data)s', )) host_info_add = _ChangeTypeCode('host', 'host_info_add', 'add %(subject)s', ('hinfo=%(string:hinfo)s', )) host_info_update = _ChangeTypeCode('host', 'host_info_upd', 'update %(subject)s', ('hinfo=%(string:hinfo)s', )) host_info_del = _ChangeTypeCode('host', 'host_info_del', 'del %(subject)s') ip_number_add = _ChangeTypeCode('host', 'ip_number_add', 'add %(subject)s', ('a_ip=%(string:a_ip)s', )) ip_number_update = _ChangeTypeCode('host', 'ip_number_upd', 'update %(subject)s', ('a_ip=%(string:a_ip)s', )) ip_number_del = _ChangeTypeCode('host', 'ip_number_del', 'del %(subject)s') ipv6_number_add = _ChangeTypeCode('host', 'ipv6_number_add', 'add %(subject)s', ('aaaaaaa_ip=%(string:aaaa_ip)s', )) ipv6_number_update = _ChangeTypeCode('host', 'ipv6_number_upd', 'update %(subject)s', ('aaaaaaa_ip=%(string:aaaa_ip)s', )) ipv6_number_del = _ChangeTypeCode('host', 'ipv6_number_del', 'del %(subject)s') mac_adr_set = _ChangeTypeCode('host', 'mac_adr_set', 'set %(subject)s', ('mac_adr=%(string:mac_adr)s', )) rev_override_add = _ChangeTypeCode( 'host', 'rev_ovr_add', 'add rev-override %(subject)s -> %(dest)s') rev_override_del = _ChangeTypeCode('host', 'rev_ovr_del', 'del rev-override for %(subject)s') rev_override_update = _ChangeTypeCode( 'host', 'rev_ovr_upd', 'update rev-override %(subject)s -> %(dest)s') subnet_create = _ChangeTypeCode('subnet', 'subnet_create', 'create subnet %(subject)s') subnet_mod = _ChangeTypeCode('subnet', 'subnet_mod', 'modify subnet %(subject)s') subnet_delete = _ChangeTypeCode('subnet', 'subnet_delete', 'delete subnet %(subject)s') subnet6_create = _ChangeTypeCode('subnet', 'subnet6_create', 'create IPv6 subnet %(subject)s') subnet6_mod = _ChangeTypeCode('subnet', 'subnet6_mod', 'modify IPv6 subnet %(subject)s') subnet6_delete = _ChangeTypeCode('subnet', 'subnet6_delete', 'delete IPv6 subnet %(subject)s') srv_record_add = _ChangeTypeCode('host', 'srv_rec_add', 'add srv-record %(subject)s -> %(dest)s') srv_record_del = _ChangeTypeCode('host', 'srv_rec_del', 'del srv-record %(subject)s -> %(dest)s') FieldTypeCode = _FieldTypeCode DnsZone = _DnsZoneCode
class Constants(cereconst.Constants): """ Common DNS module constants. """ # TODO: move these to Cerebrum/modules/bofhd/utils.py? auth_dns_superuser = _AuthRoleOpCode('dns_superuser', 'Perform any DNS command') auth_dns_lita = _AuthRoleOpCode('dns_lita', 'Perform LITA-level DNS commands') # # DNS Entities # entity_dns_cname = cereconst._EntityTypeCode( 'cname', 'cname - see table "cerebrum.cname_info" and friends.') entity_dns_host = cereconst._EntityTypeCode( # name-clash with existing entity_type 'dns_host', 'dns_host - see table "cerebrum.dns_host_info" and friends.') entity_dns_a_record = cereconst._EntityTypeCode( 'a_record', 'a_record - see table "cerebrum.a_record_info" and friends.') entity_dns_aaaa_record = cereconst._EntityTypeCode( 'aaaa_record', 'aaaa_record - see table "cerebrum.aaaa_record_info" and friends.') entity_dns_owner = cereconst._EntityTypeCode( 'dns_owner', 'dns_owner - see table "cerebrum.dns_owner" and friends.') entity_dns_ip_number = cereconst._EntityTypeCode( 'dns_ip_number', 'dns_ip_number - see table "cerebrum.dns_ip_number" and friends.') entity_dns_ipv6_number = cereconst._EntityTypeCode( 'dns_ipv6_number', 'dns_ipv6_number - see table "cerebrum.dns_ipv6_number" and friends.') entity_dns_subnet = cereconst._EntityTypeCode( 'dns_subnet', 'dns_subnet - see table "cerebrum.dns_subnet" and friends.') entity_dns_ipv6_subnet = cereconst._EntityTypeCode( 'dns_ipv6_subnet', 'dns_ipv6_subnet - see table "cerebrum.dns_ipv6_subnet" and friends.') # # Namespace for DNS names # dns_owner_namespace = cereconst._ValueDomainCode('dns_owner_ns', 'Domain for dns_owners') # # NIS host group? # spread_uio_machine_netgroup = cereconst._SpreadCode( 'NIS_mng@uio', cereconst.Constants.entity_group, 'Machine netgroup in NIS domain "uio"') field_type_txt = _FieldTypeCode('TXT', 'TXT Record') # # Traits # trait_dns_contact = _EntityTraitCode( 'dns_contact', entity_dns_owner, """Contact information (e-mail address) for the host.""") trait_dns_comment = _EntityTraitCode( 'dns_comment', entity_dns_owner, """A freeform comment about the host.""") # # Default DNS zone # other_zone = _DnsZoneCode("other", None) FieldTypeCode = _FieldTypeCode DnsZone = _DnsZoneCode