blob: 1281e3fdc21dc4727e5c2492d0cc5422ddc98999 [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.
8.. moduleauthor:: Fred Gansevles <Fred.Gansevles@cs.utwente.nl>
9.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
10
11
12The :mod:`nis` module gives a thin wrapper around the NIS library, useful for
13central administration of several hosts.
14
15Because NIS exists only on Unix systems, this module is only available for Unix.
16
17The :mod:`nis` module defines the following functions:
18
19
20.. function:: match(key, mapname[, domain=default_domain])
21
22 Return the match for *key* in map *mapname*, or raise an error
23 (:exc:`nis.error`) if there is none. Both should be strings, *key* is 8-bit
24 clean. Return value is an arbitrary array of bytes (may contain ``NULL`` and
25 other joys).
26
27 Note that *mapname* is first checked if it is an alias to another name.
28
Georg Brandl55ac8f02007-09-01 13:51:09 +000029 The *domain* argument allows to override the NIS domain used for the lookup. If
30 unspecified, lookup is in the default NIS domain.
Georg Brandl116aa622007-08-15 14:28:22 +000031
32
33.. function:: cat(mapname[, domain=default_domain])
34
35 Return a dictionary mapping *key* to *value* such that ``match(key,
36 mapname)==value``. Note that both keys and values of the dictionary are
37 arbitrary arrays of bytes.
38
39 Note that *mapname* is first checked if it is an alias to another name.
40
Georg Brandl55ac8f02007-09-01 13:51:09 +000041 The *domain* argument allows to override the NIS domain used for the lookup. If
42 unspecified, lookup is in the default NIS domain.
Georg Brandl116aa622007-08-15 14:28:22 +000043
44
45.. function:: maps([domain=default_domain])
46
47 Return a list of all valid maps.
48
Georg Brandl55ac8f02007-09-01 13:51:09 +000049 The *domain* argument allows to override the NIS domain used for the lookup. If
50 unspecified, lookup is in the default NIS domain.
Georg Brandl116aa622007-08-15 14:28:22 +000051
52
53.. function:: get_default_domain()
54
55 Return the system default NIS domain.
56
Georg Brandl116aa622007-08-15 14:28:22 +000057
58The :mod:`nis` module defines the following exception:
59
Georg Brandl116aa622007-08-15 14:28:22 +000060.. exception:: error
61
62 An error raised when a NIS function returns an error code.
63