summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-02-07 13:36:02 -0500
committerRob Crittenden <rcritten@redhat.com>2011-02-10 11:16:58 -0500
commit121da04579e4f3ce42fcead739cb75b460662bf7 (patch)
tree0cc3b9890f53589a24c3036c45872143d735bd6f
parentc24725ed38dd94c34e4327d1d8c5720d768dcd37 (diff)
downloadfreeipa-121da04579e4f3ce42fcead739cb75b460662bf7.tar.gz
freeipa-121da04579e4f3ce42fcead739cb75b460662bf7.tar.xz
freeipa-121da04579e4f3ce42fcead739cb75b460662bf7.zip
Add the entitlement API to API.txt
It was missed because the whole module was skipped if python-rhsm wasn't loaded. ticket 919
-rw-r--r--API.txt63
-rw-r--r--ipalib/plugins/entitle.py11
2 files changed, 69 insertions, 5 deletions
diff --git a/API.txt b/API.txt
index c15da315..529fba4a 100644
--- a/API.txt
+++ b/API.txt
@@ -809,6 +809,69 @@ option: Str('version?', exclude='webui', flags=['no_option', 'no_output'])
output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), 'User-friendly description of action performed')
output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
output: Output('value', <type 'unicode'>, "The primary_key value of the entry, e.g. 'jdoe' for a user")
+command: entitle_consume
+args: 1,4,3
+arg: Int('quantity', label=Gettext('Quantity', domain='ipa', localedir=None), minvalue=1)
+option: Int('hidden', autofill=True, default=1, flags=['no_option', 'no_output'], label=Gettext('Quantity', domain='ipa', localedir=None), minvalue=1)
+option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui', flags=['no_output'])
+option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui', flags=['no_output'])
+option: Str('version?', exclude='webui', flags=['no_option', 'no_output'])
+output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), 'User-friendly description of action performed')
+output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
+output: Output('value', <type 'unicode'>, "The primary_key value of the entry, e.g. 'jdoe' for a user")
+command: entitle_find
+args: 1,5,4
+arg: Str('criteria?')
+option: Int('timelimit?', autofill=False, flags=['no_display'], label=Gettext('Time Limit', domain='ipa', localedir=None), minvalue=0)
+option: Int('sizelimit?', autofill=False, flags=['no_display'], label=Gettext('Size Limit', domain='ipa', localedir=None), minvalue=0)
+option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui', flags=['no_output'])
+option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui', flags=['no_output'])
+option: Str('version?', exclude='webui', flags=['no_option', 'no_output'])
+output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), 'User-friendly description of action performed')
+output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
+output: Output('count', <type 'int'>, 'Number of entries returned')
+output: Output('truncated', <type 'bool'>, 'True if not all results were returned')
+command: entitle_get
+args: 0,3,4
+option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui', flags=['no_output'])
+option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui', flags=['no_output'])
+option: Str('version?', exclude='webui', flags=['no_option', 'no_output'])
+output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), 'User-friendly description of action performed')
+output: ListOfEntries('result', (<type 'list'>, <type 'tuple'>), Gettext('A list of LDAP entries', domain='ipa', localedir=None))
+output: Output('count', <type 'int'>, 'Number of entries returned')
+output: Output('truncated', <type 'bool'>, 'True if not all results were returned')
+command: entitle_import
+args: 1,3,1
+arg: File('usercertificate*', validate_certificate, cli_name='certificate_file')
+option: Str('addattr*', validate_add_attribute, cli_name='addattr', exclude='webui')
+option: Str('setattr*', validate_set_attribute, cli_name='setattr', exclude='webui')
+option: Str('uuid?', autofill=True, default=u'IMPORTED', flags=['no_create', 'no_update'], label=Gettext('UUID', domain='ipa', localedir=None))
+output: Output('result', <type 'dict'>, Gettext('Dictionary mapping variable name to value', domain='ipa', localedir=None))
+command: entitle_register
+args: 1,7,3
+arg: Str('username', label=Gettext('Username', domain='ipa', localedir=None))
+option: Str('addattr*', validate_add_attribute, cli_name='addattr', exclude='webui')
+option: Str('setattr*', validate_set_attribute, cli_name='setattr', exclude='webui')
+option: Str('ipaentitlementid?', flags=['no_create', 'no_update'], label='UUID')
+option: Password('password', label=Gettext('Password', domain='ipa', localedir=None))
+option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui', flags=['no_output'])
+option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui', flags=['no_output'])
+option: Str('version?', exclude='webui', flags=['no_option', 'no_output'])
+output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), 'User-friendly description of action performed')
+output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
+output: Output('value', <type 'unicode'>, "The primary_key value of the entry, e.g. 'jdoe' for a user")
+command: entitle_status
+args: 0,0,1
+output: Output('result', <type 'dict'>, Gettext('Dictionary mapping variable name to value', domain='ipa', localedir=None))
+command: entitle_sync
+args: 0,4,3
+option: Int('hidden', autofill=True, default=1, flags=['no_option', 'no_output'], label=Gettext('Quantity', domain='ipa', localedir=None), minvalue=1)
+option: Flag('all', autofill=True, cli_name='all', default=False, exclude='webui', flags=['no_output'])
+option: Flag('raw', autofill=True, cli_name='raw', default=False, exclude='webui', flags=['no_output'])
+option: Str('version?', exclude='webui', flags=['no_option', 'no_output'])
+output: Output('summary', (<type 'unicode'>, <type 'NoneType'>), 'User-friendly description of action performed')
+output: Entry('result', <type 'dict'>, Gettext('A dictionary representing an LDAP entry', domain='ipa', localedir=None))
+output: Output('value', <type 'unicode'>, "The primary_key value of the entry, e.g. 'jdoe' for a user")
command: env
args: 1,2,4
arg: Str('variables*')
diff --git a/ipalib/plugins/entitle.py b/ipalib/plugins/entitle.py
index 053de782..aeb325b6 100644
--- a/ipalib/plugins/entitle.py
+++ b/ipalib/plugins/entitle.py
@@ -55,13 +55,12 @@ from ipalib import api, SkipPluginModule
try:
from rhsm.connection import *
from rhsm.certificate import EntitlementCertificate
- from ipapython import ipautil
- import base64
- from ipalib.plugins.service import validate_certificate, normalize_certificate
+ import M2Crypto
if api.env.in_server and api.env.context in ['lite', 'server']:
from ipaserver.install.certs import NSS_DIR
except ImportError, e:
- raise SkipPluginModule(reason=str(e))
+ if not api.env.validate_api:
+ raise SkipPluginModule(reason=str(e))
import os
from ipalib import api, errors
@@ -71,13 +70,15 @@ from ipalib.plugins.virtual import *
from ipalib import _, ngettext
from ipalib.output import Output, standard_list_of_entries
from ipalib.request import context
+from ipapython import ipautil
import tempfile
import shutil
import socket
+import base64
from OpenSSL import crypto
-import M2Crypto
from ipapython.ipautil import run
from ipalib.request import context
+from ipalib.plugins.service import validate_certificate, normalize_certificate
import locale