• File: api.pyo
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/redhat_support_lib/api.pyo
  • Date Modified: 03/28/2024 3:28 PM
  • File size: 8.42 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

fc@sdZddlmZddlmZddlmZddlmZddl	m
Z
ddl	mZddl	mZdd	l	m
Z
dd
l	mZddl	mZddl	mZdd
l	mZddl	mZddl	mZddl	mZddl	mZddl	mZddl	mZddlmZddlmZddljjZddlm Z ddl!j"Z"ddl#Z#dZ$dZ%de"j"Z&e#j'dZ(de)fdYZ*dS(sK
The main interface through which you should interact with the Strata API.
i(tcontextmanager(tConnectionsPool(tProxy(tMode(t	solutions(tarticles(tcases(tgroups(tusers(tcomments(tattachments(tproblems(tentitlements(tproducts(tvalues(t
InstanceMaker(tsymptoms(tsearch(t	AuthClass(treporthelperN(treports%Keith Robertson <kroberts@redhat.com>s%(levelname)s: %(message)ssredhat-support-lib-%ss'redhat_support_lib.infrastructure.proxytAPIcBseZdd
d
d
d
d
ddd
d
dd
d
ed
ddd
d
d
d
d
edZdZed
ejd
dZ	ed	Z
RS(
shttps://api.access.redhat.comssftp.access.redhat.comis	/incomingii<cKsttjjdkr1tjdtjnt}tjjtjkr[t	}nd |_|rzi|d6}n
itd6}t
j}||_||_||_||_||_||_||_||_|	|_|
|_||_||_|
|_||_||_||_||_||_ |j!d|_"|j!d|_#|j!d|_$|j!d|_%|j!d|_&|j!d	|_'|j!d
|_(|j!d|_)|j!d|_*|j!d
|_+||_,||_-||_.||_/||_0||_1||_2||_3i|jd6|j.d6|j/d6|d6|d6}|j2sxt4|nd |_5||_6t7j8dt9t:d|jd|jd|jd|jd|jd|jd|jd|jd|jd|jd|jd|j d|j5
|jt;j<t=|_=t>|_>t?|_?t@|_@tA|_AtB|_BtC|_CtD|_DtE|_EtF|_FtG|_GtH|_HtI|_ItJ|_Kd S(!s
        Initialize an instance of the Red Hat Support Library

        :param username: User name for Red Hat Customer Portal
        :type username: string
        :param password: Password for Red Hat Customer Portal
        :type password: string
        :param url:
            Strata REST URL (by default this is https://api.access.redhat.com)

        :type url: string
        :param key_file:
            SSL key location for SSL authentication (not implemented)

        :type key_file: string
        :param cert_file:
            SSL certificate location for SSL authentication (not implemented)

        :type cert_file: string
        :param proxy_url: URL for HTTP/HTTPS proxy server (optional)
        :type proxy_url: string
        :param proxy_user: User name for HTTP/HTTPS proxy server (optional)
        :type proxy_user: string
        :param proxy_pass: Password for HTTP/HTTPS proxy server (optional)
        :type proxy_pass: string
        :param timeout: Request timeout (optional)
        :type timeout: string
        :param userAgent: User agent to set for API communications (optional)
        :type userAgent: string
        :param no_verify_ssl: If True, don't verify server identity (optional)
        :type no_verify_ssl: boolean
        :param ssl_ca: Path to an alternative certificate authority to trust
        :type ssl_ca: string/filepath
        :returns: Strata API object
        itlevels
User-Agentts3_aws_hostts3_use_threadsts3_max_workersts3_refresh_frequencyts3_multipart_thresholdts3_part_sizets3_endpoint_urlts3_max_status_retriest
s3_aws_verifyts3_failure_retriesturlt	client_idt
client_secrettclient_identifier_urlttoken_endpointtproxytkey_filet	cert_filettimeouttusernametpasswordt	proxy_urlt
proxy_usert
proxy_passtdebugtnoverifytssl_catauthN(Ltlentloggingt	getLoggerthandlerstbasicConfigtCRITICALtFalsetgetEffectiveLeveltDEBUGtTruetNonet_uat
USER_AGENTtconfighelpertget_config_helperR*R+R!R'R(R,R-R.t	sftp_hosttftp_porttftp_usertftp_passtftp_dirR)t	userAgentt
http_debugt
no_verify_sslR1tgetRRRRRRRRRR t	sftp_porttsftp_timeoutR"R#R%R$tuse_basic_autht
save_tokenRR2tconfigRtaddRRRtRRRRRRR	R
RRR
RRRRtim(tselfR*R+R!R'R(R,R-R.RBRCRDRERFR)RGRIR1RKRLR"R#R%R$RMRNtkwargst	httpdebugtuaROtauth_kwargs((s:/usr/lib/python2.7/site-packages/redhat_support_lib/api.pyt__init__7sA		
																										



															
cCstjddtdS(s  terminates server connection/s R&tforceN(Rt_removeR<(RS((s:/usr/lib/python2.7/site-packages/redhat_support_lib/api.pyt
disconnectscCstj||||S(sk
        A Report file is made from a path which can either be a single file or
        a directory.  The name and content params allow for customer name/value
        entry into xml.  Typical use is to only use the path name.

        :param path: the file or folder from which a report should be made
        :type path: string
        :param custom:
            A dictionary of bindings.  Key will be name and value will
            binding's value.

        :type custom: dict
        :param max_file_size:
            The max size (in bytes) of a file which should be included in
            content.xml.

        :type max_file_size: int
        :param report_dir:
            Path to save the generated report to, a subdirectory will be
            created by :func:`tempfile.mkdtemp`.  This value will be /tmp
            by default.

        :type report_dir: string

        Example:

            .. code-block:: python

                api.make_report("/var/spool/abrt/ccpp-2013-03-15-15:26:39-2202")

        :returns:
            The path to an XML file or a TGZ depending on the size of 'path'

        :rtype: string(Rtmake_report(tclstpathtcustomt
max_file_sizet
report_dir((s:/usr/lib/python2.7/site-packages/redhat_support_lib/api.pyR\s(	cCstj|tS(sj
        A utility function which returns a redhat_support_lib.xml.report object
        given a report file's content.xml.  The report object can then be
        inspected to see what was in the content.xml.

        :param path: A path to a report file's content.xml
        :type path: string

        :returns: A redhat_support_lib.xml.report object
        (RtparseR9(R]R^((s:/usr/lib/python2.7/site-packages/redhat_support_lib/api.pytprocess_report_files
Nixi (t__name__t
__module__R=R9RXR[tclassmethodRtMAX_FILE_SIZE_BYTESR\Rc(((s:/usr/lib/python2.7/site-packages/redhat_support_lib/api.pyR6s:	((+t__doc__t!redhat_support_lib.infrastructureRt1redhat_support_lib.infrastructure.connectionspoolRt'redhat_support_lib.infrastructure.proxyRt0redhat_support_lib.infrastructure.contextmanagerRt)redhat_support_lib.infrastructure.brokersRRRRRR	R
RRR
RRRRt,redhat_support_lib.infrastructure.token_authRtredhat_support_lib.utilsRt%redhat_support_lib.utils.confighelpertutilsR@tredhat_support_lib.xmlRtredhat_support_lib.versiontversionR4t
__author__tSTREAM_LOG_FORMATR?R5tloggertobjectR(((s:/usr/lib/python2.7/site-packages/redhat_support_lib/api.pyt<module>s: