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/security/package_manifest/__pycache__/v1.cpython-38.pyc
U

��Jh_�@s�ddlmZmZddlmZddlmZddlmZddl	m
Z
mZmZGdd�de
e�Z
e
Ze
d�d	d
�Zee
d�dd
�Zeddedd�Zddde
gddd�ZdS)�)�apt�snap)�APIEndpoint)�AdditionalInfo)�UAConfig)�
DataObject�Field�StringDataValuec@s*eZdZededd�gZed�dd�ZdS)�PackageManifestResult�
manifest_datazAManifest of ``apt`` and ``snap`` packages installed on the system)�doc�rcCs
||_dS�Nr
)�selfr�r�M/usr/lib/python3/dist-packages/uaclient/api/u/security/package_manifest/v1.py�__init__szPackageManifestResult.__init__N)�__name__�
__module__�__qualname__rr	Zfields�strrrrrrr
s��r
)�returncCs
tt��Sr)�_package_manifestrrrrr�package_manifestsr)�cfgrcCszd}t��}|D]2}|jdkr"dnd|j}|d�|j||j�7}qt��}|D]}|dj|j|j|j	d�7}qPt
|d�S)z�
    This endpoint returns the status of installed packages (``apt`` and
    ``snap``), formatted as a manifest file (i.e., ``package_name\tversion``).
    ��all�:z{}{}	{}
z!snap:{name}	{channel}	{revision}
)�name�channel�revisionr
)rZget_installed_packages�arch�formatr�versionrZget_installed_snapsrr r
)rZmanifestZapt_pkgs�apt_pkgr!Zpkgs�pkgrrrr!s�
rZv1ZPackagesN)r#r�fnZoptions_clsz27.12Fzg
from uaclient.api.u.security.package_manifest.v1 import package_manifest

result = package_manifest()
z&pro api u.security.package_manifest.v1z=
{
    "package_manifest":"package1\t1.0\npackage2\t2.3\n"
}
)Z
introduced_inZrequires_networkZexample_pythonZresult_class�
exceptionsZexample_cliZexample_json)ZuaclientrrZuaclient.api.apirZuaclient.api.data_typesrZuaclient.configrZuaclient.data_typesrrr	r
ZPackageManifestResultsrrZendpointZ_docrrrr�<module>s,��