PHP WebShell

Текущая директория: /usr/lib/python3/dist-packages/uaclient/api/u/pro/security/fix/cve/plan/__pycache__

Просмотр файла: v1.cpython-310.pyc

o

Uٵg��
@s(ddlmZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZddlmZddlmZmZmZmZGdd	�d	e�ZGd
d�de�ZGdd
�d
ee�Zdedefdd�Z dededefdd�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�gZdeefdd�Z	dS)�CVEFixPlanOptions�cvesz)A list of CVE (i.e. CVE-2023-2650) titles��doccC�
||_dS�N)r)�selfr�r�M/usr/lib/python3/dist-packages/uaclient/api/u/pro/security/fix/cve/plan/v1.py�__init__&�
zCVEFixPlanOptions.__init__N)
�__name__�
__module__�__qualname__rrr�fieldsr�strr!rrrr rs��rc@sBeZdZededd�edee�dd�gZdede	efdd�Z
dS)	�CVEFixPlanResult�expected_statusz&The expected status of fixing the CVEsrrz#A list of ``FixPlanResult`` objectscCs||_||_dSr�r)r)rr)rrrr r!8s
zCVEFixPlanResult.__init__N)r#r$r%rrrr
r&r'rr!rrrr r(*s���
r(c@s*eZdZededd�gZdefdd�ZdS)�CVESFixPlanResult�	cves_dataz&A list of ``CVEFixPlanResult`` objectsrcCrr�r,)rr,rrr r!Fr"zCVESFixPlanResult.__init__N)r#r$r%rr(r&r!rrrr r+=s��r+�options�returncCst|t��Sr)�_planr)r.rrr �planJsr1�cfgcCsHg}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.
    �)r2r*r-)rrrr)�appendr+r()r.r2rr)�cve�cve_planrrr r0Ns
���r0�v1�
CVEFixPlan)�version�name�fn�options_cls�29Tz�
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": {}
            }
        ]
    }
}
)	�
introduced_in�requires_network�example_python�result_class�ignore_result_classes�extra_result_classes�
exceptions�example_cli�example_jsonN)$�typingr�uaclient.api.apir�uaclient.api.data_typesr�'uaclient.api.u.pro.security.fix._commonr�/uaclient.api.u.pro.security.fix._common.plan.v1rrrr	r
rrr
rrrrr�uaclient.configr�uaclient.data_typesrrrrrr(r+r1r0�endpoint�_docrrrr �<module>sH<

��

�

Выполнить команду


Для локальной разработки. Не используйте в интернете!