%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/uaclient/api/u/pro/security/fix/cve/plan/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/uaclient/api/u/pro/security/fix/cve/plan/__pycache__/v1.cpython-312.pyc

�

�(�f��
�>�ddlmZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZddlmZddlmZmZmZmZGd�d	e�ZGd
�de�ZGd�d
ee�Zdedefd�Z dededefd�Z!edde!e��Z"dddeege	e
eeeeeeggddd�	Z#y)�)�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�B�eZdZedee�d��gZdeefd�Z	y)�CVEFixPlanOptions�cvesz)A list of CVE (i.e. CVE-2023-2650) titles��docc��||_y�N)r)�selfrs  �M/usr/lib/python3/dist-packages/uaclient/api/u/pro/security/fix/cve/plan/v1.py�__init__zCVEFixPlanOptions.__init__&s	����	�N)
�__name__�
__module__�__qualname__rrr�fieldsr�strr"�r#r!rrs/��
���o�&�;�	
��F��T�#�Y�r#rc�Z�eZdZeded��edee�d��gZdede	efd�Z
y)�CVEFixPlanResult�expected_statusz&The expected status of fixing the CVEsrrz#A list of ``FixPlanResult`` objectsc� �||_||_yr�r,r)r r,rs   r!r"zCVEFixPlanResult.__init__8s��.�����	r#N)r$r%r&rrrrr'r(rr"r)r#r!r+r+*sJ��
���8�	
�
	���m�$�5�	
�
�F��3��d�=�6I�r#r+c�0�eZdZeded��gZdefd�Zy)�CVESFixPlanResult�	cves_dataz&A list of ``CVEFixPlanResult`` objectsrc��||_yr�r1)r r1s  r!r"zCVESFixPlanResult.__init__Fs	��"��r#N)r$r%r&rr+r'r"r)r#r!r0r0=s'��
���8�	
��F�#�%5�#r#r0�options�returnc�*�t|t��Sr)�_planr)r4s r!�planr8Js����(�*�%�%r#�cfgc���g}d}|jD]6}t||��}t||j�}|j	|��8tt
||����S)z~
    This endpoint shows the necessary steps required to fix CVEs in the system
    without executing any of those steps.
    �)r9r.r3)rrrr,�appendr0r+)r4r9rr,�cve�cve_plans      r!r7r7Nsm��
�D��O��|�|������-��5��X�5�5�
��	
���H����"�+��
��r#�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.v1rrr	r
rrr
rrrrrr�uaclient.configr�uaclient.data_typesrrrrrr+r0r8r7�endpoint�_docr)r#r!�<module>rXs����(�2�O�
����%�M�M�
�
�
��z��&
#�
�N�
#�&�#�&�(9�&��$��8��8I��,��	��!�	�����&�(�\�������$�!�	��v��/2�r#

Zerion Mini Shell 1.0