HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/uaclient/api/u/pro/security/fix/cve/plan/__pycache__/v1.cpython-38.pyc
U

��Jh��
@s"ddlmZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZddlmZddlmZmZmZmZGdd	�d	e�ZGd
d�de�ZGdd
�d
ee�Zeed�dd�Z eeed�dd�Z!edde!ed�Z"dddeege	e
eeeeeeggddd�	Z#dS)�)�List)�APIEndpoint)�AdditionalInfo)�get_expected_overall_status)
�AptUpgradeData�
AttachData�
EnableData�FixPlanError�
FixPlanResult�FixPlanStep�FixPlanWarning�NoOpAlreadyFixedData�NoOpData�NoOpLivepatchFixData�PackageCannotBeInstalledData�SecurityIssueNotFixedData�fix_plan_cve)�UAConfig)�
DataObject�Field�StringDataValue�	data_listc@s2eZdZedee�dd�gZeed�dd�Z	dS)�CVEFixPlanOptions�cvesz)A list of CVE (i.e. CVE-2023-2650) titles��doc�rcCs
||_dS�Nr)�selfr�r�M/usr/lib/python3/dist-packages/uaclient/api/u/pro/security/fix/cve/plan/v1.py�__init__&szCVEFixPlanOptions.__init__N)
�__name__�
__module__�__qualname__rrr�fieldsr�strr!rrrr rs��rc@s@eZdZededd�edee�dd�gZee	ed�dd�Z
d	S)
�CVEFixPlanResult�expected_statusz&The expected status of fixing the CVEsrrz#A list of ``FixPlanResult`` objects�r(rcCs||_||_dSrr))rr(rrrr r!8szCVEFixPlanResult.__init__N)r"r#r$rrrr
r%r&rr!rrrr r'*s���
r'c@s*eZdZededd�gZed�dd�ZdS)�CVESFixPlanResult�	cves_dataz&A list of ``CVEFixPlanResult`` objectsr�r+cCs
||_dSrr,)rr+rrr r!FszCVESFixPlanResult.__init__N)r"r#r$rr'r%r!rrrr r*=s��r*)�options�returncCst|t��Sr)�_planr)r-rrr �planJsr0)r-�cfgr.cCsHg}d}|jD]&}t||d�}t||j�}|�|�qtt||d�d�S)z~
    This endpoint shows the necessary steps required to fix CVEs in the system
    without executing any of those steps.
    �)r1r)r,)rrrr(�appendr*r')r-r1rr(ZcveZcve_planrrr r/Ns
���r/Zv1Z
CVEFixPlan)�version�name�fnZoptions_clsZ29Tz�
from uaclient.api.u.pro.security.fix.cve.plan.v1 import plan, CVEFixPlanOptions

options = CVEFixPlanOptions(cves=["CVE-1234-1234", "CVE-1234-1235"])
result = plan(options)
z]pro api u.pro.security.fix.cve.plan.v1 --data '{"cves": ["CVE-1234-56789", "CVE-1234-1235"]}'a�
{
    "cves_data": {
        "expected_status": "fixed",
        "cves": [
            {
                "title": "CVE-1234-56789",
                "expected_status": "fixed",
                "plan": [
                    {
                        "operation": "apt-upgrade",
                        "order": 1,
                        "data": {
                            "binary_packages": ["pkg1"],
                            "source_packages": ["pkg1"],
                            "pocket": "standard-updates",
                        }
                    }
                ],
                "warnings": [],
                "error": null,
                "additional_data": {}
            }
        ]
    }
}
)	Z
introduced_inZrequires_networkZexample_pythonZresult_classZignore_result_classesZextra_result_classes�
exceptionsZexample_cliZexample_jsonN)$�typingrZuaclient.api.apirZuaclient.api.data_typesrZ'uaclient.api.u.pro.security.fix._commonrZ/uaclient.api.u.pro.security.fix._common.plan.v1rrrr	r
rrr
rrrrrZuaclient.configrZuaclient.data_typesrrrrrr'r*r0r/ZendpointZ_docrrrr �<module>sF<

��
�