-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathclient_legacy.py
1438 lines (1207 loc) · 43 KB
/
client_legacy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from python_freeipa.client import Client
from python_freeipa.exceptions import (
DuplicateEntry,
parse_group_management_error,
parse_hostgroup_management_error,
)
class ClientLegacy(Client):
"""Lightweight FreeIPA JSON RPC client."""
def __init__(self, host, verify_ssl=True, version=None):
super(ClientLegacy, self).__init__(
host=host, verify_ssl=verify_ssl, version=version
)
def user_add(
self,
username,
first_name,
last_name,
full_name,
display_name=None,
noprivate=False,
mail=None,
ssh_key=None,
job_title=None,
gid_number=None,
uid_number=None,
preferred_language=None,
disabled=False,
random_pass=False,
initials=None,
home_directory=None,
gecos=None,
login_shell=None,
user_password=None,
street_address=None,
city=None,
state=None,
postal_code=None,
telephone_number=None,
mobile_number=None,
pager_number=None,
fax_number=None,
organization_unit=None,
manager=None,
car_license=None,
user_auth_type=None,
user_class=None,
radius_proxy_config=None,
radius_proxy_username=None,
department_number=None,
employee_number=None,
employee_type=None,
**kwargs,
):
"""
Add a new user. Username corresponds to UID field of user.
:param username: User login, it should be alphanumeric and maximum length is 32.
:type username: str
:param first_name: First name
:type first_name: str
:param last_name: Last name
:type last_name: str
:param full_name: Full name
:type full_name: str
:param display_name: Display name
:type display_name: str
:param noprivate: Don't create user private group
:type noprivate: bool
:param mail: Email address
:type mail: str or list
:param ssh_key: SSH public key
:type ssh_key: str or list
:param job_title: Job title
:type job_title: str
:param gid_number: gidNumber
:type gid_number: str
:param uid_number: uidNumber
:type uid_number: str
:param preferred_language: Preferred language ISO code
:type preferred_language: str
:param disabled: Account disabled
:type disabled: bool
:param random_pass: Generate a random user password
:type random_pass: bool
:param initials: Represent initials of user
:type initials: str
:param home_directory: Home directory field of user
:type home_directory: str
:param gecos: GECOS field is a comma-delimited list used to record general information about the user.
:type gecos: str
:param login_shell: Login shell field of user
:type login_shell: str
:param user_password: Prompt to set the user password
:type user_password: str
:param street_address: Street address field of user
:type street_address: str
:param city: City field of user
:type city: str
:param state: State/Province field of user
:type state: str
:param postal_code: ZIP code field of user
:type postal_code: str
:param telephone_number: Telephone number field of user
:type telephone_number: str or list
:param mobile_number: Mobile number field of user
:type mobile_number: str or list
:param pager_number: Pager number field of user
:type pager_number: str or list
:param fax_number: Fax number field of user
:type fax_number: str or list
:param organization_unit: Organization unit of user
:type organization_unit: str
:param manager: Manager field of user
:type manager: str
:param car_license: Car license of user
:type car_license: str or list
:param user_auth_type: Types of supported user authentication. Possible values(password, radius, otp)
:type user_auth_type: str or list
:param user_class: Category of user
:type user_class: str
:param radius_proxy_config: RADIUS proxy configuration
:type radius_proxy_config: str
:param radius_proxy_username: RADIUS proxy username
:type radius_proxy_username: str
:param department_number: Department number of user
:type department_number: str
:param employee_number: Employee number of user
:type employee_number: str
:param employee_type: Employee type of user
:type employee_type: str
"""
params = {
"all": True,
"givenname": first_name,
"sn": last_name,
"cn": full_name,
}
if gid_number:
params["gidnumber"] = gid_number
if uid_number:
params["uidnumber"] = uid_number
if display_name:
params["displayname"] = display_name
if noprivate:
params["noprivate"] = noprivate
if mail:
params["mail"] = mail
if ssh_key:
params["ipasshpubkey"] = ssh_key
if job_title:
params["title"] = job_title
if preferred_language:
params["preferredlanguage"] = preferred_language
if disabled:
params["nsaccountlock"] = disabled
if random_pass:
params["random"] = True
if initials:
params["initials"] = initials
if home_directory:
params["homedirectory"] = home_directory
if gecos:
params["gecos"] = gecos
if login_shell:
params["loginshell"] = login_shell
if user_password:
params["userpassword"] = user_password
if street_address:
params["street"] = street_address
if city:
params["l"] = city
if state:
params["st"] = state
if postal_code:
params["postalcode"] = postal_code
if telephone_number:
params["telephonenumber"] = telephone_number
if mobile_number:
params["mobile"] = mobile_number
if pager_number:
params["pager"] = pager_number
if fax_number:
params["facsimiletelephonenumber"] = fax_number
if organization_unit:
params["ou"] = organization_unit
if manager:
params["manager"] = manager
if car_license:
params["carlicense"] = car_license
if user_auth_type:
params["ipauserauthtype"] = user_auth_type
if user_class:
params["userclass"] = user_class
if radius_proxy_config:
params["ipatokenradiusconfiglink"] = radius_proxy_config
if radius_proxy_username:
params["ipatokenradiususername"] = radius_proxy_username
if department_number:
params["departmentnumber"] = department_number
if employee_number:
params["employeenumber"] = employee_number
if employee_type:
params["employeetype"] = employee_type
params.update(kwargs)
data = self._request("user_add", username, params)
return data["result"]
def user_find(self, criteria=None, **kwargs):
"""
Search for users.
:param criteria: A string searched in all relevant object attributes.
:type criteria: str
"""
params = {
"all": True,
"no_members": False, # Suppress processing of membership attributes.
"sizelimit": 0, # Maximum number of entries returned (0 is unlimited)
"whoami": False, # Display user record for current Kerberos principal.
}
params.update(kwargs)
return self._request("user_find", criteria, params)
def user_show(self, username):
"""
Display information about a user.
:param username: User login.
:type username: str
"""
data = self._request("user_show", username, {"all": True, "raw": False})
return data["result"]
def user_status(self, username):
"""
Get lockout status of a user account.
:param username: User login.
:type username: str
"""
return self._request("user_status", username, {"all": True, "raw": False})
def user_disable(self, username):
"""
Disable a user account.
:param username: User login.
:type username: str
"""
self._request("user_disable", username)
def user_enable(self, username):
"""
Enable a user account.
:param username: User login.
:type username: str
"""
self._request("user_enable", username)
def user_mod(
self,
username,
first_name=None,
last_name=None,
full_name=None,
display_name=None,
noprivate=False,
mail=None,
ssh_key=None,
job_title=None,
preferred_language=None,
disabled=False,
random_pass=False,
initials=None,
home_directory=None,
gecos=None,
login_shell=None,
user_password=None,
street_address=None,
city=None,
state=None,
postal_code=None,
telephone_number=None,
mobile_number=None,
pager_number=None,
fax_number=None,
organization_unit=None,
manager=None,
car_license=None,
user_auth_type=None,
user_class=None,
radius_proxy_config=None,
radius_proxy_username=None,
department_number=None,
employee_number=None,
employee_type=None,
**kwargs,
):
"""
Modify a user.
:param username: User login.
:type username: str
:param first_name: First name
:type first_name: str
:param last_name: Last name
:type last_name: str
:param full_name: Full name
:type full_name: str
:param display_name: Display name
:type display_name: str
:param noprivate: Don't create user private group
:type noprivate: bool
:param mail: Email address
:type mail: str or list
:param ssh_key: SSH public key
:type ssh_key: str or list
:param job_title: Job title
:type job_title: str
:param preferred_language: Preferred language ISO code
:type preferred_language: str
:param disabled: Account disabled
:type disabled: bool
:param random_pass: Generate a random user password
:type random_pass: bool
:param initials: Represent initials of user
:type initials: str
:param home_directory: Home directory field of user
:type home_directory: str
:param gecos: Gecos field of user
:type gecos: str
:param login_shell: Login shell field of user
:type login_shell: str
:param user_password: Prompt to set the user password
:type user_password: str
:param street_address: Street address field of user
:type street_address: str
:param city: City field of user
:type city: str
:param state: State/Province field of user
:type state: str
:param postal_code: ZIP code field of user
:type postal_code: str
:param telephone_number: Telephone number field of user
:type telephone_number: str or list
:param mobile_number: Mobile number field of user
:type mobile_number: str or list
:param pager_number: Pager number field of user
:type pager_number: str or list
:param fax_number: Fax number field of user
:type fax_number: str or list
:param organization_unit: Organization unit of user
:type organization_unit: str
:param manager: Manager field of user
:type manager: str
:param car_license: Car license of user
:type car_license: str or list
:param user_auth_type: Types of supported user authentication. Possible values(password, radius, otp)
:type user_auth_type: str or list
:param user_class: Category of user
:type user_class: str
:param radius_proxy_config: RADIUS proxy configuration
:type radius_proxy_config: str
:param radius_proxy_username: RADIUS proxy username
:type radius_proxy_username: str
:param department_number: Department number of user
:type department_number: str
:param employee_number: Employee number of user
:type employee_number: str
:param employee_type: Employee type of user
:type employee_type: str
"""
params = {
"all": False, # Retrieve and print all attributes from the server.
"no_members": False, # Suppress processing of membership attributes.
"raw": False, # Print entries as stored on the server.
"rights": False, # Display the access rights of this entry.
}
if first_name:
params["givenname"] = first_name
if last_name:
params["sn"] = last_name
if full_name:
params["cn"] = full_name
if display_name:
params["displayname"] = display_name
if noprivate:
params["noprivate"] = noprivate
if mail:
params["mail"] = mail
if ssh_key:
params["ipasshpubkey"] = ssh_key
if job_title:
params["title"] = job_title
if preferred_language:
params["preferredlanguage"] = preferred_language
if disabled:
params["nsaccountlock"] = disabled
if random_pass:
params["random"] = True
if initials:
params["initials"] = initials
if home_directory:
params["homedirectory"] = home_directory
if gecos:
params["gecos"] = gecos
if login_shell:
params["loginshell"] = login_shell
if user_password:
params["userpassword"] = user_password
if street_address:
params["street"] = street_address
if city:
params["l"] = city
if state:
params["st"] = state
if postal_code:
params["postalcode"] = postal_code
if telephone_number:
params["telephonenumber"] = telephone_number
if mobile_number:
params["mobile"] = mobile_number
if pager_number:
params["pager"] = pager_number
if fax_number:
params["facsimiletelephonenumber"] = fax_number
if organization_unit:
params["ou"] = organization_unit
if manager:
params["manager"] = manager
if car_license:
params["carlicense"] = car_license
if user_auth_type:
params["ipauserauthtype"] = user_auth_type
if user_class:
params["userclass"] = user_class
if radius_proxy_config:
params["ipatokenradiusconfiglink"] = radius_proxy_config
if radius_proxy_username:
params["ipatokenradiususername"] = radius_proxy_username
if department_number:
params["departmentnumber"] = department_number
if employee_number:
params["employeenumber"] = employee_number
if employee_type:
params["employeetype"] = employee_type
params.update(kwargs)
data = self._request("user_mod", username, params)
return data["result"]
def user_del(self, username, skip_errors=False, soft_delete=False):
"""
Delete a user.
:param username: User login.
:type username: str
:param skip_errors: Continuous mode: Don't stop on errors.
:type skip_errors: bool
:param soft_delete: Mark user as deleted instead of removing record.
:type soft_delete: bool
"""
params = {
"continue": skip_errors,
"preserve": soft_delete,
}
return self._request("user_del", username, params)
def user_undel(self, username):
"""
Undelete a user.
:param username: User login.
:type username: str
"""
return self._request("user_undel", username)
def passwd(self, login, password, current_password=None):
"""
Set the password of a user.
:param login: User login (username)
:type login: str
:param password: New password for the user
:type password: str
:param current_password: current password of the logged in user.
Leave blank if resetting for another user,
this will set the new password to expired
:type current_password: str
"""
if not current_password: # resetting for another user
params = {}
else: # resetting for current user
params = {"current_password": current_password}
data = self._request("passwd", args=[login, password], params=params)
return data["result"]
def group_add(
self,
group,
description=None,
non_posix=False,
external=False,
no_members=False,
**kwargs,
):
"""
Create a new group.
:param group: Group name, it should be alphanumeric and maximum length is 255.
:type group: str
:param description: Group description
:type description: str
:param non_posix: Create as non-POSIX group
:type non_posix: bool
:param external: Allow adding external non-IPA members from trusted domains
:type external: bool
:param no_members: Suppress processing of membership attributes
:type no_members: bool
"""
params = {"all": True}
if description is not None:
params["description"] = description
if non_posix is not None:
params["nonposix"] = non_posix
if external is not None:
params["external"] = external
if no_members is not None:
params["no_members"] = no_members
params.update(kwargs)
data = self._request("group_add", group, params)
return data["result"]
def group_del(self, group, skip_errors=False):
"""
Delete a group.
:param group: Group name
:param skip_errors: Continuous mode: Don't stop on errors.
:type skip_errors: bool
"""
params = {"continue": skip_errors}
self._request("group_del", group, params)
def group_add_member(
self, group, users=None, groups=None, skip_errors=False, **kwargs
):
"""
Add members to a group.
:param group: Group name.
:param users: Users to add.
:type users: str or list
:param groups: Groups to add.
:type groups: str or list
:param skip_errors: Skip processing errors.
:type skip_errors: bool
"""
params = {
"all": True,
"raw": True,
"user": users,
"group": groups,
}
params.update(kwargs)
data = self._request("group_add_member", group, params)
if not skip_errors:
parse_group_management_error(data)
return data["result"]
def group_remove_member(
self, group, users=None, groups=None, skip_errors=False, **kwargs
):
"""
Remove members from a group.
:param group: Group name.
:param users: Users to remove.
:type users: str or list
:param groups: Groups to remove.
:type groups: str or list
:param skip_errors: Skip processing errors.
:type skip_errors: bool
"""
params = {
"all": False,
"no_members": False,
"raw": False,
"user": users,
"group": groups,
}
params.update(kwargs)
data = self._request("group_remove_member", group, params)
if not skip_errors:
parse_group_management_error(data)
return data["result"]
def group_find(self, criteria=None, **kwargs):
"""
Search for groups.
:param criteria: A string searched in all relevant object attributes.
:type criteria: str
"""
params = {"all": True, "sizelimit": 0}
params.update(kwargs)
return self._request("group_find", criteria, params)
def group_show(self, group, **kwargs):
"""
Display information about a named group.
:param group: Group name.
"""
params = {"all": True, "raw": False}
params.update(kwargs)
data = self._request("group_show", group, params)
return data["result"]
def group_mod(
self,
group,
description=None,
posix=False,
external=False,
no_members=False,
rename=None,
**kwargs,
):
"""
Modify a group.
:param group: Group name.
:type group: str
:param description: Group description
:type description: str
:param posix: change to a POSIX group
:type posix: bool
:param external: Allow adding external non-IPA members from trusted domains
:type external: bool
:param no_members: Suppress processing of membership attributes
:type no_members: bool
:param rename: Rename the group object
:type rename: str
"""
params = {
"all": False,
"raw": False,
"rights": False,
}
if description:
params["description"] = description
if posix:
params["posix"] = posix
if external:
params["external"] = external
if no_members:
params["no_members"] = no_members
if rename:
params["rename"] = rename
params.update(kwargs)
data = self._request("group_mod", group, params)
return data["result"]
def automountkey_find(
self, location, automount_map, key=None, criteria=None, **kwargs
):
"""
Search for the automount key.
:param key: Automount key name.
:type key: str
:param location: Automount location name
:type location: str
:param automount_map: Automount map name
:type automount_map: str
:param criteria: A string searched in all relevant object attributes.
:type criteria: str
:return:
:rtype: dict
"""
args = [location, automount_map]
if criteria:
args.append(criteria)
params = {
"all": True,
"raw": False,
}
if key:
params["automountkey"] = key
params.update(kwargs)
data = self._request("automountkey_find", args, params)
return data["result"]
def automountkey_add(self, key, mount_info, location, automount_map, **kwargs):
"""
Create a new automount key.
:param key: Automount key name
:type key: str
:param mount_info: Mount information
:type mount_info: str
:param location: Automount location name
:type location: str
:param automount_map: Automount map name
:type automount_map: str
:return: automount key data
:rtype: dict
"""
if self.automountkey_find(location, automount_map, key):
raise DuplicateEntry()
args = [location, automount_map]
params = {
"all": True,
"raw": False,
"automountkey": key,
"automountinformation": mount_info,
}
params.update(kwargs)
data = self._request("automountkey_add", args, params)
return data
def automountkey_mod(self, key, mount_info, automount_location, automount_map):
"""
Modify an automount key.
:param key: Automount key name
:type key: str
:param mount_info: Mount information
:type mount_info: str
:param automount_location: Automount location name
:param: type string
:param automount_map: Automount map name
:type automount_map: str
:return: automount key data
:rtype: dict
"""
args = [automount_location, automount_map]
params = {
"all": True,
"raw": False,
"rights": False,
"automountkey": key,
"automountinformation": mount_info,
}
data = self._request("automountkey_mod", args, params)
return data
def automountlocation_add(self, location, **kwargs):
"""
Create a new automount location.
:param location: Automount location name.
:type location: str
"""
params = {"all": True, "raw": False}
params.update(kwargs)
data = self._request("automountlocation_add", location, params)
return data
def automountlocation_del(self, location, skip_errors=False):
"""
Delete an automount location.
:param location: Automount location name.
:type location: str
"""
params = {"continue": skip_errors}
data = self._request("automountlocation_del", location, params)
return data
def automountlocation_find(self, criteria=None, **kwargs):
"""
Search for an automount location.
:param criteria: A string searched in all relevant object attributes.
:type criteria: str
"""
params = {"all": True, "raw": False, "sizelimit": 0}
params.update(kwargs)
data = self._request("automountlocation_find", criteria, params)
return data["result"]
def automountlocation_show(self, location, **kwargs):
"""
Display an automount location.
:param location: Automount location name.
:type location: str
"""
params = {"all": True, "raw": False, "rights": False}
data = self._request("automountlocation_show", location, params)
return data["result"]
def automountlocation_tofiles(self, location):
"""
Generate automount files for a specific location.
:param location: Automount location name
:type location: str
"""
data = self._request("automountlocation_tofiles", location)
return data["result"]
def automountmap_add(self, location, automount_map, **kwargs):
"""
Display an automount map.
:param location: Automount location name
:type location: str
:param automount_map: Automount map name
:type automount_map: str
"""
args = [location, automount_map]
params = {"all": True, "raw": False}
params.update(kwargs)
data = self._request("automountmap_add", args, params)
return data
def automountmap_del(self, location, automount_map, skip_errors=False):
"""
Delete an automount map.
:param location: Automount location name
:type location: str
:param automount_map: Automount map name
:type automount_map: str
"""
args = [location, automount_map]
params = {"continue": skip_errors}
data = self._request("automountmap_del", args, params)
return data
def automountmap_find(self, location, criteria=None, **kwargs):
"""
Find an automount map.
:param location: Automount location name
:type location: str
:param criteria: A string searched in all relevant object attributes.
:type criteria: str
"""
args = [location]
if criteria:
args.append(criteria)
params = {"all": True, "raw": False, "sizelimit": 0}
params.update(kwargs)
data = self._request("automountmap_find", args, params)
return data["result"]
def automountmap_mod(self, location, automount_map, description=None, **kwargs):
"""
Modify an automount map.
:param location: Automount location name
:type location: str
:param automount_map: Automount map name
:type automount_map: str
"""
args = [location, automount_map]
params = {
"all": True,
"raw": False,
"rights": False,
}
if description:
params["description"] = description
params.update(kwargs)
data = self._request("automountmap_mod", args, params)
return data
def automountmap_show(self, location, automount_map, **kwargs):
"""
Display an automount map.
:param location: Automount location name
:type location: str
:param automount_map: Automount map name
:type automount_map: str
"""
args = [location, automount_map]
params = {"all": True, "raw": False, "rights": False}
params.update(kwargs)
data = self._request("automountmap_show", args, params)
return data["result"]
def host_add(self, host, **kwargs):
"""
Create a new host.
:param host: Host name which should be alphanumeric and maximum length is 255
:type host: str