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

��Jh��@s�ddlmZddlmZddlmZddlmZmZm	Z	ddl
mZGdd�de�ZGdd	�d	ee�Z
e
d
�dd�Zee
d
�dd�Zeddedd�Zddde
gddd�ZdS)�)�APIEndpoint)�AdditionalInfo)�UAConfig)�
DataObject�Field�IntDataValue)� get_installed_packages_by_originc
@s�eZdZededd�ededd�ededd�eded	d�ed
edd�eded
d�ededd�ededd�ededd�g	Zeeeeeeeeed�	dd�ZdS)�PackageSummary�num_installed_packagesz!Total count of installed packages��doc�num_esm_apps_packagesz-Count of packages installed from ``esm-apps``�num_esm_infra_packagesz.Count of packages installed from ``esm-infra``�num_main_packagesz)Count of packages installed from ``main``�num_multiverse_packagesz/Count of packages installed from ``multiverse``�num_restricted_packagesz/Count of packages installed from ``restricted``�num_third_party_packagesz4Count of packages installed from third party sources�num_universe_packagesz-Count of packages installed from ``universe``�num_unknown_packagesz0Count of packages installed from unknown sources�	r
r
rrrrrrrc

Cs:||_||_||_||_||_||_||_||_|	|_dS�Nr)
�selfr
r
rrrrrrr�r�H/usr/lib/python3/dist-packages/uaclient/api/u/pro/packages/summary/v1.py�__init__9szPackageSummary.__init__N)�__name__�
__module__�__qualname__rr�fields�intrrrrrr	sp����������2�r	c@s$eZdZededd�gZdd�ZdS)�PackageSummaryResult�summaryz!Summary of all installed packagesrcCs
||_dSr�r!)rr!rrrrYszPackageSummaryResult.__init__N)rrrrr	rrrrrrr Ps��r )�returncCs
tt��Sr)�_summaryrrrrrr!]sr!)�cfgr#cCsrt�}tt|d�t|d�t|d�t|d�t|d�t|d�t|d�t|d�t|d	�d
�	}t|d�S)zg
    This endpoint shows a summary of installed packages in the system,
    categorised by origin.
    �allzesm-appsz	esm-infra�mainZ
multiverseZ
restrictedzthird-partyZuniverse�unknownrr")rr	�lenr )r%Zpackagesr!rrrr$as








�r$Zv1N)�version�name�fnZoptions_clsz27.12FzP
from uaclient.api.u.pro.packages.summary.v1 import summary

result = summary()
z!pro api u.pro.packages.summary.v1ad
{
    "summary":{
        "num_installed_packages": 1,
        "num_esm_apps_packages": 2,
        "num_esm_infra_packages": 3,
        "num_main_packages": 4,
        "num_multiverse_packages": 5,
        "num_restricted_packages": 6,
        "num_third_party_packages": 7,
        "num_universe_packages": 8,
        "num_unknown_packages": 9,
    },
}
)Z
introduced_inZrequires_networkZexample_pythonZresult_class�
exceptionsZexample_cliZexample_json)Zuaclient.api.apirZuaclient.api.data_typesrZuaclient.configrZuaclient.data_typesrrrZuaclient.security_statusrr	r r!r$ZendpointZ_docrrrr�<module>s,H
��