https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyc
�
e�Tc@s�dZddlmZddlmZmZddlmZddlm	Z	m
Z
ddlmZddl
mZddlmZmZdd	lmZdd
lmZddlmZddljjZddljjZddlZddlZddlZ ddl!Z!dd
l"m#Z#ej$d�Z%dZ&dej'efd��YZ'defd��YZ(dej)efd��YZ)defd��YZ*dej+efd��YZ+defd��YZ,dej-efd��YZ-defd��YZ.d ej/efd!��YZ/d"efd#��YZ0d$ej1efd%��YZ1d&efd'��YZ2d(ej3efd)��YZ3d*ej4efd+��YZ4d,efd-��YZ5d.ej6efd/��YZ6d0efd1��YZ7d2ej8efd3��YZ8d4efd5��YZ9d6ej:efd7��YZ:d8ej;efd9��YZ;d:efd;��YZ<d<ej=efd=��YZ=d>efd?��YZ>d@ej?efdA��YZ?dBefdC��YZ@dDeAfdE��YZBdS(Fs*
Module that brokers the RESTful methods.
i����(tBase(tConnectionErrortRequestError(tFilterHelper(tParseHelpertReportParseHelper(tSearchHelper(t	UrlHelper(tparamstreport(tquote(turlparse(tescapeN(t
decode_headers)redhat_support_lib.infrastructure.brokerss%Keith Robertson <kroberts@redhat.com>tsolutioncBs�eZd�Zd�Zedddddd��Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�ZRS(cCs
||_dS(N(t
superclass(tselfR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyt__init__.scCs0|dkrdStj|�}|j|�|S(N(tNonetobjectt__new__R(tclsRtobj((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR1s

cKs�|jdd�}|dk	r3tj|d�}n|jdd�}|dk	rftj|d�}n|jdd�}|dk	r�tj|d�}n|jdd�}	|	dk	r�tj|	d�}	n|jdd�}
|
dk	r�tj|
d�}
n|jdd�}|dk	r2tj|d�}n|jdd�}|dk	retj	d|�}ntj
d|d	|d
|d|d||�}
||
�S(Ntissuet
resolutiontenvironmentt	rootCausetinternalDiagnosticStepsttagstduplicateOft	createdByttitletsummarytkcsState(tgetRRt	issueTypetresolutionTypetenvironmentTypet
rootCauseTypetinternalDiagnosticStepsTypettagTypetduplicateOfTypeR(RRRR R!RtkwargsRRRRRRtpsol((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyt	fromProps9s2	cCs,tj|d�}tt|�j|�dS(N(RR#RtsuperRt	set_issue(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR.dscCs,tj|d�}tt|�j|�dS(N(RR$RR-Rtset_resolution(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR/hscCs,tj|d�}tt|�j|�dS(N(RR%RR-Rtset_environment(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR0lscCs,tj|d�}tt|�j|�dS(N(RR&RR-Rt
set_rootCause(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR1pscCs,tj|d�}tt|�j|�dS(N(RR'RR-Rtset_internalDiagnosticSteps(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR2tscCs,tj|d�}tt|�j|�dS(N(RR(RR-Rtset_tag(Rttag((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR3xscCs,tjd|�}tt|�j|�dS(N(RR)RR-Rtset_duplicateOf(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR5|scCshd}|j�dk	rX|j�jdtj||jj��dtj|j��nt	d��dS(sZ
        Update this solution. This solution *must* have an ID.

        .. IMPORTANT::
           The solution must already exist on the Red Hat Customer Portal, if
           you are adding a new solution you should use
           :func:`solutions.add` instead

        raises   -- An exception if there was a connection related issue.
        s
/rs/solutionsturltbodysID cannot be None on updateN(
tget_idRt	_getProxytupdateRtappendRRttoXmlR(RR6((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR:�s
*N(t__name__t
__module__RRtclassmethodRR,R.R/R0R1R2R3R5R:(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR-s 		%							t	solutionscBs2eZd�Zd�Zdd�Zdd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCs�d}|j�jd|dtj|��\}}i}|j|�|d}t|�}|jtjj	|d��|j
|�|S(sX

        Add a new solution

        :param sol: Solution to be added to Customer Portal
        :type sol: solution
        :rtype: solution
        :returns: The solution ID and view_uri will be set if successful.
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s
/rs/solutionsR6R7sview-urii(R9taddRR<R:Rtset_idtostpathtbasenametset_view_uri(RtsolR6tdoctheaderstdtview_uritparsed((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRA�s



cCsWd}|j�jdtj||��\}}t|�}tjd|j��|S(s1
        Queries the API for the given solution ID.

        :param solutionID: Solution ID to be queried from the API
        :type solutionID: Integer
        :rtype: solution
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s
/rs/solutionsR6sREST Response:%s(R9R"RR;RtloggertdebugR<(Rt
solutionIDR6RHRIRG((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR"�s
*cKs�d}|jdi�}||d<|j�jdtj||��\}}tjdtj|��tj	t
tj|j
�|��S(s�
        Queries the solutions RESTful interface with a given set of keywords.

        :param keywords: Search string
        :type keywords: string
        :param searchopts: search options/query filters passed to the API
        :type searchopts: dict
        :param kwargs:
            Additional options passed to FilterHelper

            Example:

            .. code-block:: python

                solutions.list('RHEV', authorSSOName="anonymous")

        :type kwargs: dict
        :returns: A list of solution objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s
/rs/solutionst
searchoptstkeywordR6sREST Response:
%s(tpopR9R"RtappendQueryRMRNRR<ttoCollectionRRtfiltertget_solution(RtkeywordsR*R6RPRHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytlist�s
*	N(R=R>RRARR"RX(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR@�s		tarticlecBs�eZd�Zd�Zedddddd��Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�ZRS(cCs
||_dS(N(R(RRY((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCs0|dkrdStj|�}|j|�|S(N(RRRR(RRYR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�s

cKs�|jdd�}|jdd�r9tj|d�}n|jdd�}|dk	rltj|d�}n|jdd�}	|	dk	r�tj|	d�}	n|jdd�}
|
dk	r�tj|
d�}
n|jdd�}|dk	rtj|d�}n|jdd�}|dk	r8tj|d�}n|jdd�}
|
dk	rktj	d|
�}
ntj
d|d	|d
|d|d||�}||�S(
NRRRRRR4RRRR R!R7(R"RRR#R$R%R&R'R(R)RY(RRRR R!R7R*RRRRRR4RR+((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,�s2cCs)tj|d�}tjj||�dS(N(RR#RRYR.(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR.scCs)tj|d�}tjj||�dS(N(RR$RRYR/(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR/scCs)tj|d�}tjj||�dS(N(RR%RRYR0(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR0!scCs)tj|d�}tjj||�dS(N(RR&RRYR1(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR1%scCs)tj|d�}tjj||�dS(N(RR'RRYR2(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR2)scCs)tj|d�}tjj||�dS(N(RR(RRYtadd_tag(RR4((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRZ-scCs)tjd|�}tjj||�dS(N(RR)RRYtadd_duplicateOf(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR[1scCshd}|j�dk	rX|j�jdtj||jj��dtj|j��nt	d��dS(s�
        Update this article. This article *must* have an ID.

        raises   -- An exception if there was a connection related issue.
        s/rs/articlesR6R7sID cannot be None on updateN(
R8RR9R:RR;RRR<R(RR6((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR:?s
*N(R=R>RRR?RR,R.R/R0R1R2RZR[R:(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRY�s		#							tarticlescBs2eZd�Zd�Zdd�Zdd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRNscCs�d}|j�jd|dtj|��\}}i}|j|�|d}t|�}|jtjj	|d��|j
|�|S(sR
        Add a new article

        :param art: Article to be added to Customer Portal
        :type art: article
        :rtype: article
        :returns: The article ID and view_uri will be set if successful.
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/articlesR6R7sview-urii(R9RARR<R:RRBRCRDRERF(RtartR6RHRIRJRKRL((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRAUs


cCsWd}|j�jdtj||��\}}t|�}tjd|j��|S(s,
        Queries the API for the given article ID.

        :param articleID: Article ID to be queried from the API
        :type articleID: Integer
        :rtype: article
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/articlesR6sREST Response:%s(R9R"RR;RYRMRNR<(Rt	articleIDR6RHRIR]((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR"ls
*cKssd}|j�jdtj|i|d6��\}}tjdtj|��tjt	t
j|j�|��S(s�
        Queries the articles RESTful interface with a given set of keywords.

        :param keywords: Search string
        :type keywords: string
        :param searchopts: search options/query filters passed to the API
        :type searchopts: dict
        :param kwargs:
            Additional options passed to FilterHelper

            Example:

            .. code-block:: python

                articles.list('RHEV', authorSSOName="anonymous")

        :returns: A list of solution objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/articlesR6RQsREST Response:
%s(
R9R"RRSRMRNRR<RTRYRRUtget_article(RRWR*R6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRX~s
1	N(R=R>RRARR"RX(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR\Ms		tcommentcBs;eZd�Zd�Zedded��Zd�ZRS(cCs
||_dS(N(R(RR`((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCs0|dkrdStj|�}|j|�|S(N(RRRR(RR`R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�s

cKs+tjd|d|d||�}||�S(Nt
caseNumberttexttpublic(RR`(RRaRbRcR*R`((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,�s
	cCs�d}|j�dk	r{|j�dk	r{tj|i|j�d6|j�d6�}|j�j|dtj|��nt	d��dS(s�
        Update this comment. This comment must have both an comment ID and a case ID.
        raises   -- An exception if there was a connection related issue.
        s+/rs/cases/{caseNumber}/comments/{commentID}s{caseNumber}s{commentID}R7sID cannot be None on updateN(
R8RRtreplacetget_caseNumberR9R:RR<R(RR6((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR:�s$	N(	R=R>RRR?RtTrueR,R:(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR`�s		tcommentscBs;eZd�Zd�Zddd�Zdddd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCs�d}tj|i|j�d6�}|j�jd|dtj|��\}}i}|j|�|d}t|�}|j	t
jj|d��|j
|d�|S(s<
        Add a new comment

        :param cmnt: The comment to be added
        :type cmnt: comment
        :returns: Comment object with ID and view_uri populated
        :rtype: comment
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/cases/{caseNumber}/commentss{caseNumber}R6R7RKii(RRdReR9RARR<R:Rtset_caseNumberRCRDRERB(RtcmntR6RHRIRJRKRL((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRA�s

cCshd}tj|i|d6|d6�}|j�j|�\}}t|�}tjd|j��|S(s�
        Queries the API for the given solution ID.

        :param caseNumber: Case number to retrieve the comment from.
        :type caseNumber: string
        :param commentID: ID string of the comment to retrieve
        :type commentID: string
        :returns: Comment matching specified case number and comment ID
        :rtype: comment
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s+/rs/cases/{caseNumber}/comments/{commentID}s{caseNumber}s{commentID}sREST Response:%s(RRdR9R"R`RMRNR<(RRat	commentIDR6RHRItcom((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR"�s	

cKs�d}tj|i|d6�}|j�jtj|i|d6|d6��\}}tjdtj	|��tj
ttj
|j�|��S(s-
        Gets all of the comments for a given case number.  You can then
        search/filter the returned comments using any of the properties
        of a 'comment'

        :param caseNumber: Case number to retrieve the comment from.
        :type caseNumber: string
        :param startDate: Date to list comments from
        :type startDate:
            ISO 8601 formatted string, either YYYY-MM-DDThh:mm:ss or YYYY-MM-DD
        :param endDate: Date to list comments until
        :type endDate:
            ISO 8601 formatted string, either YYYY-MM-DDThh:mm:ss or YYYY-MM-DD
        :param kwargs:
            Additional options passed to FilterHelper to filter results based
            on additional criteria.

            Example:

            .. code-block:: python

                comments.list('00595293', createdBy="AnonymousUser")

        :type kwargs: dict
        :returns: A list of comment objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/cases/{caseNumber}/commentss{caseNumber}t	startDatetendDatesREST Response:
%s(RRdR9R"RRSRMRNRR<RTR`RRUtget_comment(RRaRlRmR*R6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRX�s	
	N(R=R>RRARR"RX(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRg�s		t
attachmentcBs5eZd�Zd�Zededdd��ZRS(cCs
||_dS(N(R(RRo((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR+scCs0|dkrdStj|�}|j|�|S(N(RRRR(RRoR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR.s

c
Ks2tjd|d|d|d||�}||�S(NRatprivatetfileNametdescription(RRo(RRaRcRqRrR*t	attachmnt((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,4s		N(R=R>RRR?RRfR,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRo*s
		tattachmentscBsbeZd�Zdeddded�Zddd�Zddddd�Zdddd�Z	RS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR@scCskd}d
}tj�}	|o7tjj|�|	jk}
|sF|
r�tj|||�}|
rg|rgtjj	|�}d||	j
||f}tjd|d|�}
t
�}|j|
�qgn�tj|i|d6�}|j�jtj|i|d6�|||�d}t|�}|j|�|jtj|�dpLd�tjd	|j��|S(s�
        Add a new attachment

        :param caseNumber: The case number to add the attachment to
        :type caseNumber: string
        :param public: If the attachment is public, or Red Hat only
        :type public: boolean
        :param fileName: Path to the file to be uploaded
        :type fileName: string
        :param description:
            Description of the attachment uploaded, for example "sosreport from
            host database01"

        :type description: string
        :returns: The attachment object with the attachment UUID populated
        :rtype: attachment
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s"/rs/cases/{caseNumber}/attachmentsst[RHST] The file %s exceeds the byte limit to attach a file to a case; therefore the file was uploaded to %s as %s-%sRaRbs{caseNumber}Rpisapplication/octet-streamsREST Response:%sN(Rtconfighelpertget_config_helperRCRDtgetsizetattachment_max_sizet	FtpHelpertftp_attachmentREtftp_hostt
InstanceMakertmakeCommentRgRARRdR9tuploadRRSRotset_privatetset_mimeTypet	mimetypest
guess_typeRMRNR<(RRaRcRqt	fileChunkRrtuseFtpR6tamnttconfigtexceeds_max_sizetfilebaseNametcmntTextRitcasecommentRH((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRAGs2"
		#
cCsEd}tj|i|d6|d6�}|j�j|�\}}tS(s�
        Removes the attachment from the case.

        :param caseNumber: The case number to delete the attachment from
        :type caseNumber: string
        :param attachmentUUID: UUID of the attachment to be deleted
        :type attachmentUUID: string (UUID)
        :returns: True if successful
        :rtype: boolean
        :raises:
            Exception if there was a connection related issue, an issue parsing
            headers, or the attachment deletion failed.
        s3/rs/cases/{caseNumber}/attachments/{attachmentUUID}s{caseNumber}s{attachmentUUID}(RRdR9tdeleteRf(RRatattachmentUUIDR6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�|s	

cCs�d}|s|r-td||f��n|rYtjj|�rYtd|��n|r�tjj|�r�td|tjj|�f��ntj|i|d6|d6�}d}d}z�yDtj	d�|j
�j�j�}|j
dd	d
|�}|jdkr�|sN|jjdjd
�}	t|	d�dd}n|rltjj||�}nt|d�}|jd�}
x2t|
�dkr�|j|
�|jd�}
q�Wtj	d|�n5tj	d|||jf�t|j|jd��Wn�tjk
rA}tj	d|�tt|��n_tk
rs}tj	d|j|j f��n-tk
r�}
tj	dt|
���nXWd|r�y|j!�Wq�tk
r�q�Xn|r�y|j!�Wq�tk
r�q�XnX|S(s�
        Queries the API for the given attachment.

        :param caseNumber: The case number to retrieve the attachment from
        :type caseNumber: string
        :param attachmentUUID: UUID of the attachment to be retrieved
        :type attachmentUUID: string (UUID)
        :param fileName: Path to the file to be retrieved
        :type fileName: string
        :param destDir: The directory which the attachment should be saved in
        :type destDir: string
        :returns: The full path to the downloaded file
        :rtype: string
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s3/rs/cases/{caseNumber}/attachments/{attachmentUUID}s2caseNumber(%s) attachmentUUID(%s) cannot be empty.s$destDir(%s) is not a valid directorysdfileName(%s) contains directory info (%s).  Use the destDir parameter for specifying directory info.s{caseNumber}s{attachmentUUID}sDownloading attachment...tmethodtGETR6i�scontent-dispositions"iitwbi sSuccessfully downloaded %s.s'unable to download %s as %s. Reason: %ssSocket error: msg(%s)s!I/O error: errno(%s) strerror(%s)sUnexpected exception: msg(%s)N("t	ExceptionRCRDtisdirtdirnameRRdRRMRNR9tgetConnectionsPoolt
getConnectiont	doRequesttstatustmsgtdicttsplitR
tjointopentreadtlentwritetreasonRtsocketterrorRtstrtIOErrorterrnotstrerrortclose(RRaR�RqtdestDirR6tconntfhtresponsetcontDispArrtbuftsetioete((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR"�sl	



	

cKs�d}tj|i|d6�}|j�jtj|i|d6|d6��\}}tjdtj	|��tj
ttj
|j�|��S(s>
        Gets all of the attachments for a given case number.  You can then
        search/filter the returned comments using any of the properties
        of a 'attachment'

        :param caseNumber: Case number to list the attachments from
        :type caseNumber: string
        :param startDate: Date to list attachments from
        :type startDate:
            ISO 8601 formatted string, either YYYY-MM-DDThh:mm:ss or YYYY-MM-DD
        :param endDate: Date to list attachments until
        :type endDate:
            ISO 8601 formatted string, either YYYY-MM-DDThh:mm:ss or YYYY-MM-DD
        :param kwargs:
            Additional options passed to FilterHelper to filter results based
            on additional criteria.

            Example:

            .. code-block:: python

                attachments.list('00595293', createdBy="AnonymousUser")

        :type kwargs: dict
        :returns: A list of attachment objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s"/rs/cases/{caseNumber}/attachmentss{caseNumber}RlRmsREST Response:
%s(RRdR9R"RRSRMRNRR<RTRoRRUtget_attachment(RRaRlRmR*R6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRX�s	
	N(
R=R>RRRftFalseRAR�R"RX(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRt?s		4UtentitlementcBs,eZd�Zd�Zedd��ZRS(cCs
||_dS(N(R(RR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRscCs0|dkrdStj|�}|j|�|S(N(RRRR(RR�R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRs

cKstjd||�}||�S(Ntname(RR�(RR�R*R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,sN(R=R>RRR?RR,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�s		tentitlementscBs eZd�Zedd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR%scKs�d}|}|j�jdtj|i|d6|d6��\}}tjdtj|��tjt	t
j|j�|��S(s�
        Queries the entitlements RESTful interface with a given set of
        keywords.

        :param activeOnly: Limit results to only active entitlements
        :type activeOnly: boolean
        :param product: Product to limit results to
        :type product: string
        :param kwargs:
            Additional options passed to FilterHelper to filter results based
            on additional criteria.

            Example:

            .. code-block:: python

                entitlements.list(supportLevel='SUPPORTED')

        :type kwargs: dict
        :returns: A list of entitlement objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/entitlementsR6tshowAlltproductsREST Response:
%s(
R9R"RRSRMRNRR<RTR�RRUtget_entitlement(Rt
activeOnlyR�R*R6R�RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRX,s 	N(R=R>RRfRRX(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�$s	tcasecBs_eZd�Zd�Zedddd��Zd�Zd�Zd�Z	d�Z
d�ZRS(	cCs
||_dS(N(R(RR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRQscCs0|dkrdStj|�}|j|�|S(N(RRRR(RR�R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRTs

cKs+tjd|d|d||�}||�S(NR R�tversion(RR�(RR R�R�R*R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,Zs!cCsed}|j�dk	rU|j�jdtj||j��dtj|j��nt	d��dS(s�
        Update this case. This case *must* have an case number.

        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s	/rs/casesR6R7sID cannot be None on updateN(
ReRR9R:RR;RR<RR(RR6((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR:`s
'cCs<y#tjttjj|�j�SWntk
r7gSXdS(s
        Retrieve a list of comments related to the case object

        :returns: A list of comment objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        N(RRTR`RR�tget_commentstAttributeError(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�os

	
cCs\d}tj|it|j��d6�}|j�j|�\}}tjt|j	��S(s
        Retrieve a list of attachments, related to the case object

        :returns: A list of attachment objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s"/rs/cases/{caseNumber}/attachmentss{caseNumber}(
RRdR
ReR9R"RRTRoR�(RR6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytget_attachments�s
%cCs<y#tjttjj|�j�SWntk
r7gSXdS(s
        Retrieve a list of recommendations related to the case object

        :returns: A list of recommendation objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        N(RRTtrecommendationRR�tget_recommendationsR�(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR��s

	
cCsttjj|��S(N(R�RR�R�(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR��sN(R=R>RRR?RR,R:R�R�R�R�(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�Ps						tcasescBsJeZd�Zd�Zdd�Zdeedddd�Zd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCs�d}|j�jd|dtj|��\}}i}|j|�|d}t|�}|jtjj	|d��|j
|�|S(s�
        Add a new case

        :param cs: case object to be submitted to the Customer Portal
        :type cs: case
        :returns:
            The same case object with the case number and associated fields
            populated.

        :rtype: case
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s	/rs/casesR6R7RKi(R9RARR<R:RRhRCRDRERF(RtcsR6RHRIRJRKRL((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRA�s


cCsWd}|j�jdtj||��\}}t|�}tjd|j��|S(sy
        Queries the API for the given case number.

        :param caseNumber: Case Number of case to retrieve from the API
        :type caseNumber: string
        :returns: The case object for the relevant caseNumber provided
        :rtype: case
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s	/rs/casesR6sREST Response:%s(R9R"RR;R�RMRNR<(RRaR6RHRIR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR"�s
*cKs�d}|jdi�}	|	ji|d6|d6|d6|d6|d6�|j�jdtj||	��\}
}tjd	tj	|
��tj
ttj
|
j�|��S(
s�
        Queries the cases RESTful interface with a given set of keywords.

        :param keywords: Keywords to search cases on (space seperated)
        :type keywords: string
        :param detail:
        :type detail: boolean
        :param group: Case group to search for cases in
        :param startDate: Date to start listing cases from
        :type startDate:
            ISO 8601 formatted string, either YYYY-MM-DDThh:mm:ss or YYYY-MM-DD
        :param endDate: Date to list cases until
        :type endDate:
            ISO 8601 formatted string, either YYYY-MM-DDThh:mm:ss or YYYY-MM-DD
        :param searchopts: search options/query filters passed to the API
        :type searchopts: dict
        :param kwargs:
            Additional options passed to FilterHelper to filter results based
            on additional criteria.

            Example:

            .. code-block:: python

                cases.list(status="Closed")

        :type kwargs: dict
        :returns: A list of case objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s	/rs/casesRPtqueryt
includeClosedtgroupRlRmR6sREST Response:
%s(RRR:R9R"RRSRMRNRR<RTR�RRUtget_case(RRWR�tdetailR�RlRmR*R6RPRHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRX�s#	cCsld}|j�jd|dtj|��\}}tjdtj|��tjttj	|j
���S(sB
        Filter case results.

        :param case_filter: a filter object to be submitted
        :type cs: caseFilter
        :returns:
             A list of case objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/cases/filterR6R7sREST Response:
%s(R9RARR<RMRNRTR�RRUR�(Rtcase_filterR6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRUs	N(	R=R>RRARR"R�RXRU(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR��s			7tsymptomc	Bs>eZd�Zd�Zedddddddd��ZRS(cCs
||_dS(N(R(RR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR+scCs0|dkrdStj|�}|j|�|S(N(RRRR(RR�R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR.s

c
KsCtjd|d|d|d|d|d|d||�}	||	�S(NRatcategorytdataRrtlocationR turi(RR�(
RRaR�R�RrR�R R�R*R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,4s
N(R=R>RRR?RR,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�*s		textractedSymptomcBs_eZd�Zd�Zeddddddddddddddddddd��ZRS(cCs
||_dS(N(R(RR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRBscCs0|dkrdStj|�}|j|�|S(N(RRRR(RR�R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyREs

c%Cs�tjd|d|d|d|d|d|d|d|d	|	d
|
d|d|d
|
d|d|d|d|d|�}|t�S(NtlabelRtcreatedDatetlastModifiedBytlastModifiedDatetlinkedtlinkedBytlinkedAtttype_R�toccurrencestverbatimtfieldst
beginIndextendIndexR t	signaturet	timestamp(RR�(RR�RR�R�R�R�R�R�R�R�R�R�R�R�R�R R�R�R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,Ks	N(R=R>RRR?RR,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�As		tsymptomscBs2eZd�Zd�Zdd�Zdd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR\scCs[d}|j�jd|dtj|��\}}i}|j|�|j|d�|S(Ns/rs/symptomsR6R7R�(R9RARR<R:tset_location(RtsymR6RHRIRJ((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRAds
cCsjd}|j�j|dt|�didd6�\}}tjdtj|��tjt|j	��S(s�
        Queries the symptom extractor RESTful interface with a given string.

        :param content:
            The text that you wish to be analyzed by the diagnostics engine

        :type content: string
        :returns: A list of extractedSymptom objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/symptoms/extractorR7RIs
text/plainsContent-TypesREST Response:
%s(
R9tactionRRMRNRR<RTR�tget_extractedSymptom(RtcontentR6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytextractFromStrnsc	Cs5d}d}d}z�yAt|d�}|j�j||j�idd6�\}}Wn�tjk
r�}tjd|�t	t
|��n_tk
r�}tjd|j|j
f��n-tk
r�}tjdt
|���nXWd|r|j�nXtjd	tj|��tjt|j��S(
s
        Queries the symptom extractor RESTful interface with a given string.

        :param fileName:
            The path of the file that you wish to be analyzed
            by the diagnostics engine

        :type fileName: file
        :returns: A list of extractedSymptom objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers

            socket.error or IOError for issues when reading the specified file.
        s/rs/symptoms/extractortrbs
text/plainsContent-TypesSocket error: msg(%s)s!I/O error: errno(%s) strerror(%s)sUnexpected exception: msg(%s)NsREST Response:
%s(RR�R9R�R�R�R�RMRNRR�R�R�R�R�R�RR<RTR�R�(	RRqR6R�RHRIR�R�R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytextractFromFile�s,	N(R=R>RRARR�R�(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�[s		tproblemcBs2eZd�Zd�Zedddd��ZRS(cCs
||_dS(N(R(RR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCs0|dkrdStj|�}|j|�|S(N(RRRR(RR�R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�s

cCs(tjd|d|d|�}||�S(Ntsourcetlinkt
explainSbr(RR�(RR�R�R�R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,�sN(R=R>RRR?RR,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR��s		tproblemscBs5eZd�Zdd�Zdd�Zdd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�sc	Cs�d}tj�}|jtjdddddt|���|j�j|dtj|��\}}tj	dt
j|��t
jt|j
��S(	s�
        Queries the problems RESTful interface with a given string.

        :param content:
            The text that you wish to be analyzed by the diagnostics engine

        :type content: string
        :returns: A list of problem objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/problemsR�RbR�R tvalueOf_R7sREST Response:
%s(R	tadd_bindingtbindingRR9R�RR<RMRNRRTR�tget_problem(RR�R6trptRHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytdiagnoseStr�sc	Cs%d}d}z�y7t|d�}|j�j||j��\}}Wn�tjk
r~}tjd|�t	t
|��n_tk
r�}tjd|j|j
f��n-tk
r�}tjdt
|���nXWd|r�|j�nXtjdtj|��tjt|j��S(s�
        Queries the problems RESTful interface with a given file.

        :param fileName:
            The path of the file that you wish to be analyzed
            by the diagnostics engine

        :type fileName: file
        :returns: A list of problem objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers

            socket.error or IOError for issues when reading the specified file.
        s/rs/problemsR�sSocket error: msg(%s)s!I/O error: errno(%s) strerror(%s)sUnexpected exception: msg(%s)NsREST Response:
%s(RR�R9R�R�R�R�RMRNRR�R�R�R�R�R�RR<RTR�R�(	RRqR6R�RHRIR�R�R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytdiagnoseFile�s(cCsd}y5|j�j||j�didd6�\}}Wn�tjk
rs}tjd|�tt|��n_t	k
r�}tjd|j
|jf��n-tk
r�}tjdt|���nXtjdt
j|��t
jt|j��S(	s�
        Queries the problems RESTful interface with a given file.

        :param diagcase:
            The case to be evaluated by the

        :type diagcase: case object
        :returns: A list of recommendation objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers

            socket.error or IOError for issues when reading the specified file.
        s/rs/problemsRIs&application/vnd.redhat.xml.suggestionstAcceptsSocket error: msg(%s)s!I/O error: errno(%s) strerror(%s)sUnexpected exception: msg(%s)sREST Response:
%s(R9R�R<R�R�RMRNRR�R�R�R�R�RRTR�tget_recommendation(RtdiagcaseR6RHRIR�R�R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytdiagnoseCases$	N(R=R>RRR�R�R�(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR��s	(R�cBs8eZd�Zd�Zeddd��Zd�ZRS(cCs
||_dS(N(R(RR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR6scCs0|dkrdStj|�}|j|�|S(N(RRRR(RR�R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR9s

cCstj||�}||�S(N(RR�(RtcodeR�R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,@scCsPd}tj|it|j��d6�}|j�j|�\}}|j�S(Ns /rs/products/{prodName}/versionss
{prodName}(RRdR
tget_nameR9R"tget_version(RR6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytget_versionsEs%N(R=R>RRR?RR,R�(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�5s
		tproductscBseZd�Zd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRMscKs]d}|j�j|�\}}tjdtj|��tjttj	|j
�|��S(s
        Queries the products RESTful interface with a given set of keywords.

        :param kwargs:
            Properties to be passed to FilterHelper to filter results based
            on additional criteria.

            Example:

            .. code-block:: python

                products.list(name="Fuse ESB")

        :type kwargs: dict
        :returns: A list of product objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s/rs/productssREST Response:
%s(R9R"RMRNRR<RTR�RRUtget_product(RR*R6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRXTs
	(R=R>RRX(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�Ls	R�cBs)eZd�Zd�Zed��ZRS(cCs
||_dS(N(R(RR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRqscCs0|dkrdStj|�}|j|�|S(N(RRRR(RR�R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRts

cKstj|�}||�S(N(RR�(RR*tprec((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,{s(R=R>RRR?R,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�ps		R�cBs5eZd�Zd�Zeddddd��ZRS(cCs
||_dS(N(R(RR�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCs0|dkrdStj|�}|j|�|S(N(RRRR(RR�R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�s

c	Cs.tjd|d|d|d|�}||�S(NtnumberR�R�t	isPrivate(RR�(RR�R�R�R�R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,�s	N(R=R>RRR?RR,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR��s		tgroupscBseZd�Zd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCsZd}|j�j|�\}}tjdtj|��tjttj	|j
���S(s
        Queries the groups RESTful interface for a list of case groups.

        :returns: A list of group objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s
/rs/groupssREST Response:
%s(R9R"RMRNRR<RTR�RRUt	get_group(RR6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRX�s

	(R=R>RRX(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR��s	t
caseFiltercBs\eZd�Zd�Zedddddddddddddddddd��ZRS(cCs
||_dS(N(R(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scCs0|dkrdStj|�}|j|�|S(N(RRRR(RRR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�s

c#Cs�|rtj|�}ntjd|d|d|d|d|d|d|d|d	|	d
|
d|d|d
|
d|d|d|d|�}||�S(NRmt
accountNumberR�tgroupNumberstincludePrivateRQtcounttstartt
onlyUngroupedtownerSSONameR�tseverityt	sortFieldt	sortOrderRlR�R�(RRR(RRmRR�RRRQRRRRR�R	R
RRlR�R�tfilt((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,�s	N(R=R>RRR?RR,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�s					tvaluescBs,eZd�Zd�Zd�Zd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR�scKs[d}|j�j|�\}}tjdtj|��td�|j�D��}|S(s#
        Queries the API for available case type values.
        RESTful method: https://api.access.redhat.com/rs/values/case/types

        Keyword arguments:
        returns   -- A list of case type values.
        raises   -- An exception if there was a connection related issue.
        s/rs/values/case/typessREST Response:
%scss|]}|j�VqdS(N(R�(t.0tvalue((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pys	<genexpr>�s(R9R"RMRNRR<RXt	get_value(RR*R6RHRIttype_values((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytgetType�s
	cKs[d}|j�j|�\}}tjdtj|��td�|j�D��}|S(s.
        Queries the API for available case severity values.
        RESTful method: https://api.access.redhat.com/rs/values/case/severity

        Keyword arguments:
        returns   -- A list of case severity values.
        raises   -- An exception if there was a connection related issue.
        s/rs/values/case/severitysREST Response:
%scss|]}|j�VqdS(N(R�(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pys	<genexpr>�s(R9R"RMRNRR<RXR(RR*R6RHRItseverity_values((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytgetSeverity�s
	cKs[d}|j�j|�\}}tjdtj|��td�|j�D��}|S(s(
        Queries the API for available case status values.
        RESTful method: https://api.access.redhat.com/rs/values/case/status

        Keyword arguments:
        returns   -- A list of case status values.
        raises   -- An exception if there was a connection related issue.
        s/rs/values/case/statussREST Response:
%scss|]}|j�VqdS(N(R�(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pys	<genexpr>s(R9R"RMRNRR<RXR(RR*R6RHRIR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyt	getStatus�s
	(R=R>RRRR(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR
�s			tsearchResultcBs)eZd�Zd�Zed��ZRS(cCs
||_dS(N(R(RR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRscCs0|dkrdStj|�}|j|�|S(N(RRRR(RRR((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRs

cKstj|�}|t�S(N(RR(RR*R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR,s(R=R>RRR?R,(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR
s		tsearchcBseZd�Zdd�ZRS(cCs
||_dS(sConstructor.N(R(R((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRscKssd}|j�jdtj|i|d6��\}}tjdtj|��tjt	t
j|j�|��S(s�
        Queries the search RESTful interface with a given set of keywords.

        :param keywords: Search string
        :type keywords: string
        :param searchopts: search options/query filters passed to the API
        :type searchopts: dict
        :param kwargs:
            Additional options passed to FilterHelper

            Example:

            .. code-block:: python

                api.search.search('RHEV', authorSSOName="anonymous")

        :returns: A list of searchResult objects
        :rtype: list
        :raises:
            Exception if there was a connection related issue or an
            issue parsing headers
        s
/rs/searchR6RQsREST Response:
%s(
R9R"RRSRMRNRR<RTRRRUtget_searchResult(RRWR*R6RHRI((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR"s
1	N(R=R>RRR(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyRs	R|cBs
eZdZed	d	d	d��Zed	d	d	d	d	d��Zed	d	d	d	d	d��Zed	d��Zed	d	e	d��Z
ed	e	d	d	d��Zed	d	d	d	d	d	d	d��Zed	d	d	d	d	d	d	d	d	d	d	d	d	d	d	d	d	d��Z
RS(
s�
    Utility class to make single instances of case, solution, article, entitlement, and comment.
    This is useful so that you only need import API and not all of the helper classes used by
    API to get the job done.
    cKstjd|d|d||�S(NR R�R�(R�R,(RR R�R�R*((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytmakeCaseGscKs+tjd|d|d|d|d||�S(NRRR R!R(RR,(RRRR R!RR*((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytmakeSolutionKscKs+tjd|d|d|d|d||�S(NRRR R!R7(RYR,(RRRR R!R7R*((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytmakeArticleSscKstjd||�S(NR�(R�R,(RR�R*((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytmakeEntitlement[scKstjd|d|d||�S(NRaRbRc(R`R,(RRaRbRcR*((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR}_sc
Ks&tjd|d|d|d||�S(NRaRpRqRr(RoR,(RRaRcRqRrR*((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytmakeAttachmentgs	c	Ks7tjd|d|d|d|d|d|d||�S(NRaR�R�RrR�R R�(R�R,(	RRaR�R�RrR�R R�R*((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytmakeSymptommsc#Csptjd|d|d|d|d|d|d|d|d	|	d
|
d|d|d
|
d|d|d|d|�S(NRmRR�RRRQRRRRR�R	R
RRlR�R�(RR,(RRmRR�RRRQRRRRR�R	R
RRlR�R�((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pytmakeCaseFilterws N(R=R>t__doc__R?RRRRRRfR}RRR(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyR|As@			(CR t(redhat_support_lib.infrastructure.commonRt(redhat_support_lib.infrastructure.errorsRRt%redhat_support_lib.utils.filterhelperRt$redhat_support_lib.utils.parsehelperRRt%redhat_support_lib.utils.searchhelperRt"redhat_support_lib.utils.urlhelperRtredhat_support_lib.xmlRR	turllibR
Rtxml.sax.saxutilsRt"redhat_support_lib.utils.ftphelpertutilst	ftphelperRyt%redhat_support_lib.utils.confighelperRutloggingR�tos.pathRCR�temail.HeaderR
t	getLoggerRMt
__author__RR@RYR\R`RgRoRtR�R�R�R�R�R�R�R�R�R�R�R�R�R�RR
RRRR|(((sM/usr/lib/python2.7/site-packages/redhat_support_lib/infrastructure/brokers.pyt<module>s\fWcP'f�,V�Vr$$9'

https://t.me/AnonymousX5 - 2025