blob: 10c67cbb81b2f057470ff6f039f37da10336f3a2 [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001
2:mod:`nis` --- Interface to Sun's NIS (Yellow Pages)
3====================================================
4
5.. module:: nis
6 :platform: Unix
7 :synopsis: Interface to Sun's NIS (Yellow Pages) library.
Terry Jan Reedyfa089b92016-06-11 15:02:54 -04008
Georg Brandl116aa622007-08-15 14:28:22 +00009.. moduleauthor:: Fred Gansevles <Fred.Gansevles@cs.utwente.nl>
10.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
11
Terry Jan Reedyfa089b92016-06-11 15:02:54 -040012--------------
Georg Brandl116aa622007-08-15 14:28:22 +000013
14The :mod:`nis` module gives a thin wrapper around the NIS library, useful for
15central administration of several hosts.
16
17Because NIS exists only on Unix systems, this module is only available for Unix.
18
19The :mod:`nis` module defines the following functions:
20
21
Hynek Schlawackdfa46522012-05-21 11:01:54 +020022.. function:: match(key, mapname, domain=default_domain)
Georg Brandl116aa622007-08-15 14:28:22 +000023
24 Return the match for *key* in map *mapname*, or raise an error
25 (:exc:`nis.error`) if there is none. Both should be strings, *key* is 8-bit
26 clean. Return value is an arbitrary array of bytes (may contain ``NULL`` and
27 other joys).
28
29 Note that *mapname* is first checked if it is an alias to another name.
30
Martin Panterc04fb562016-02-10 05:44:01 +000031 The *domain* argument allows overriding the NIS domain used for the lookup. If
Georg Brandl55ac8f02007-09-01 13:51:09 +000032 unspecified, lookup is in the default NIS domain.
Georg Brandl116aa622007-08-15 14:28:22 +000033
34
Hynek Schlawackdfa46522012-05-21 11:01:54 +020035.. function:: cat(mapname, domain=default_domain)
Georg Brandl116aa622007-08-15 14:28:22 +000036
37 Return a dictionary mapping *key* to *value* such that ``match(key,
38 mapname)==value``. Note that both keys and values of the dictionary are
39 arbitrary arrays of bytes.
40
41 Note that *mapname* is first checked if it is an alias to another name.
42
Martin Panterc04fb562016-02-10 05:44:01 +000043 The *domain* argument allows overriding the NIS domain used for the lookup. If
Georg Brandl55ac8f02007-09-01 13:51:09 +000044 unspecified, lookup is in the default NIS domain.
Georg Brandl116aa622007-08-15 14:28:22 +000045
46
Hynek Schlawackdfa46522012-05-21 11:01:54 +020047.. function:: maps(domain=default_domain)
Georg Brandl116aa622007-08-15 14:28:22 +000048
49 Return a list of all valid maps.
50
Martin Panterc04fb562016-02-10 05:44:01 +000051 The *domain* argument allows overriding the NIS domain used for the lookup. If
Georg Brandl55ac8f02007-09-01 13:51:09 +000052 unspecified, lookup is in the default NIS domain.
Georg Brandl116aa622007-08-15 14:28:22 +000053
54
55.. function:: get_default_domain()
56
57 Return the system default NIS domain.
58
Georg Brandl116aa622007-08-15 14:28:22 +000059
60The :mod:`nis` module defines the following exception:
61
Georg Brandl116aa622007-08-15 14:28:22 +000062.. exception:: error
63
64 An error raised when a NIS function returns an error code.
65