diff options
author | Jan Cholasta <jcholast@redhat.com> | 2016-06-30 15:51:29 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2016-07-01 09:40:04 +0200 |
commit | 2cf7c7b4ac2a71457d026d6312cf4fd57b55062b (patch) | |
tree | 577732b8c373e377dd66517b9f0c7f72654ed7c8 /ipaclient/remote_plugins/2_156/realmdomains.py | |
parent | cf713ac28362c40e6414e9bf9701e58e36c07deb (diff) | |
download | freeipa-2cf7c7b4ac2a71457d026d6312cf4fd57b55062b.tar.gz freeipa-2cf7c7b4ac2a71457d026d6312cf4fd57b55062b.tar.xz freeipa-2cf7c7b4ac2a71457d026d6312cf4fd57b55062b.zip |
client: add support for pre-schema servers
Bundle remote plugin interface definitions for servers which lack API
schema support. These server API versions are included:
* 2.49: IPA 3.1.0 on RHEL/CentOS 6.5+,
* 2.114: IPA 4.1.4 on Fedora 22,
* 2.156: IPA 4.2.0 on RHEL/CentOS 7.2 and IPA 4.2.4 on Fedora 23,
* 2.164: IPA 4.3.1 on Fedora 23.
For servers with other API versions, the closest lower API version is used.
https://fedorahosted.org/freeipa/ticket/4739
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipaclient/remote_plugins/2_156/realmdomains.py')
-rw-r--r-- | ipaclient/remote_plugins/2_156/realmdomains.py | 195 |
1 files changed, 195 insertions, 0 deletions
diff --git a/ipaclient/remote_plugins/2_156/realmdomains.py b/ipaclient/remote_plugins/2_156/realmdomains.py new file mode 100644 index 000000000..f8f563a45 --- /dev/null +++ b/ipaclient/remote_plugins/2_156/realmdomains.py @@ -0,0 +1,195 @@ +# +# Copyright (C) 2016 FreeIPA Contributors see COPYING for license +# + +# pylint: disable=unused-import +import six + +from . import Command, Method, Object +from ipalib import api, parameters, output +from ipalib.parameters import DefaultFrom +from ipalib.plugable import Registry +from ipalib.text import _ +from ipapython.dn import DN +from ipapython.dnsutil import DNSName + +if six.PY3: + unicode = str + +__doc__ = _(""" +Realm domains + +Manage the list of domains associated with IPA realm. + +EXAMPLES: + + Display the current list of realm domains: + ipa realmdomains-show + + Replace the list of realm domains: + ipa realmdomains-mod --domain=example.com + ipa realmdomains-mod --domain={example1.com,example2.com,example3.com} + + Add a domain to the list of realm domains: + ipa realmdomains-mod --add-domain=newdomain.com + + Delete a domain from the list of realm domains: + ipa realmdomains-mod --del-domain=olddomain.com +""") + +register = Registry() + + +@register() +class realmdomains(Object): + takes_params = ( + parameters.Str( + 'associateddomain', + multivalue=True, + label=_(u'Domain'), + ), + parameters.Str( + 'add_domain', + required=False, + label=_(u'Add domain'), + ), + parameters.Str( + 'del_domain', + required=False, + label=_(u'Delete domain'), + ), + ) + + +@register() +class realmdomains_mod(Method): + __doc__ = _("Modify realm domains.") + + takes_options = ( + parameters.Str( + 'associateddomain', + required=False, + multivalue=True, + cli_name='domain', + label=_(u'Domain'), + no_convert=True, + ), + parameters.Str( + 'add_domain', + required=False, + label=_(u'Add domain'), + no_convert=True, + ), + parameters.Str( + 'del_domain', + required=False, + label=_(u'Delete domain'), + no_convert=True, + ), + parameters.Str( + 'setattr', + required=False, + multivalue=True, + doc=_(u'Set an attribute to a name/value pair. Format is attr=value.\nFor multi-valued attributes, the command replaces the values already present.'), + exclude=('webui',), + ), + parameters.Str( + 'addattr', + required=False, + multivalue=True, + doc=_(u'Add an attribute/value pair. Format is attr=value. The attribute\nmust be part of the schema.'), + exclude=('webui',), + ), + parameters.Str( + 'delattr', + required=False, + multivalue=True, + doc=_(u'Delete an attribute/value pair. The option will be evaluated\nlast, after all sets and adds.'), + exclude=('webui',), + ), + parameters.Flag( + 'rights', + label=_(u'Rights'), + doc=_(u'Display the access rights of this entry (requires --all). See ipa man page for details.'), + default=False, + autofill=True, + ), + parameters.Flag( + 'force', + label=_(u'Force'), + doc=_(u'Force adding domain even if not in DNS'), + default=False, + autofill=True, + ), + parameters.Flag( + 'all', + doc=_(u'Retrieve and print all attributes from the server. Affects command output.'), + exclude=('webui',), + default=False, + autofill=True, + ), + parameters.Flag( + 'raw', + doc=_(u'Print entries as stored on the server. Only affects output format.'), + exclude=('webui',), + default=False, + autofill=True, + ), + ) + has_output = ( + output.Output( + 'summary', + (unicode, type(None)), + doc=_(u'User-friendly description of action performed'), + ), + output.Entry( + 'result', + ), + output.PrimaryKey( + 'value', + doc=_(u"The primary_key value of the entry, e.g. 'jdoe' for a user"), + ), + ) + + +@register() +class realmdomains_show(Method): + __doc__ = _("Display the list of realm domains.") + + takes_options = ( + parameters.Flag( + 'rights', + label=_(u'Rights'), + doc=_(u'Display the access rights of this entry (requires --all). See ipa man page for details.'), + default=False, + autofill=True, + ), + parameters.Flag( + 'all', + doc=_(u'Retrieve and print all attributes from the server. Affects command output.'), + exclude=('webui',), + default=False, + autofill=True, + ), + parameters.Flag( + 'raw', + doc=_(u'Print entries as stored on the server. Only affects output format.'), + exclude=('webui',), + default=False, + autofill=True, + ), + ) + has_output = ( + output.Output( + 'summary', + (unicode, type(None)), + doc=_(u'User-friendly description of action performed'), + ), + output.Entry( + 'result', + ), + output.PrimaryKey( + 'value', + doc=_(u"The primary_key value of the entry, e.g. 'jdoe' for a user"), + ), + ) |