| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib64/python3.9/site-packages/sim_plugin/__pycache__/ |
Upload File : |
a
�Mb�? � @ sN d dl mZmZmZmZmZmZmZmZm Z d dl
mZ G dd� dee�ZdS )� ) � uri_parse�VERSION�Capabilities�INfs�IStorageAreaNetwork�search_property�Client�LsmError�ErrorNumber)�SimArrayc @ s� e Zd ZdZdd� Zd�dd�Zd�dd�Zd�d d
�Zd�dd�Ze d
d� �Z
d�dd�Zd�dd�Zd�dd�Z
d�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd�d d!�Zd�d"d#�Zd�d$d%�Zd�d&d'�Zd�d(d)�Zd�d*d+�Zd�d,d-�Zd�d.d/�Zd�d0d1�Zd�d2d3�Zd�d4d5�Zd�d6d7�Zd�d8d9�Zd�d:d;�Z d�d<d=�Z!d�d>d?�Z"d�d@dA�Z#d�dBdC�Z$d�dDdE�Z%d�dFdG�Z&d�dHdI�Z'd�dJdK�Z(d�dLdM�Z)d�dNdO�Z*d�dPdQ�Z+d�dRdS�Z,d�dTdU�Z-d�dVdW�Z.d�dXdY�Z/d�dZd[�Z0d�d]d^�Z1d�d_d`�Z2d�dadb�Z3d�dcdd�Z4d�dedf�Z5d�dgdh�Z6d�didj�Z7d�dkdl�Z8d�dmdn�Z9d�dodp�Z:d�dqdr�Z;d�dsdt�Z<d�dudv�Z=d�dwdx�Z>dde?j@fdydz�ZAe?j@fd{d|�ZBe?j@fd}d~�ZCe?j@fdd��ZDe?j@fd�d��ZEdS )�� SimPluginzU
Simple class that implements enough to allow the framework to be exercised.
c C s d | _ d | _d | _d S �N)�uri�password� sim_array)�self� r �:/usr/lib64/python3.9/site-packages/sim_plugin/simulator.py�__init__ s zSimPlugin.__init__r c C s^ || _ || _t|�}d|v rNd|d v rN|d d d urNt|d d |�| _ntd |�| _d S )N�
parametersZ statefile)r r r r r )r r r Ztimeout�flagsZqpr r r �plugin_register! s �zSimPlugin.plugin_registerc C s d S r
r �r r r r r �plugin_unregister0 s zSimPlugin.plugin_unregisterc C s | j �||�S r
)r �
job_status�r Zjob_idr r r r r 3 s zSimPlugin.job_statusc C s | j �||�S r
)r �job_freer r r r r 6 s zSimPlugin.job_freec C s | S )a
Fake converter. SimArray already do SimData to LSM data convert.
We move data convert to SimArray to make this sample plugin looks
clean.
But in real world, data converting is often handled by plugin itself
rather than array.
r )Zsim_datar r r �_sim_data_2_lsm9 s zSimPlugin._sim_data_2_lsmc C s | j �||� d S r
)r �time_out_set)r Zmsr r r r r D s zSimPlugin.time_out_setc C s | j �|�S r
)r �time_out_getr r r r r H s zSimPlugin.time_out_getc C s� t � }|�� |�t jt j� |�t jt j� |�t jt j� |�t jt j� |�t jt j� |�t j t j� |�t j
t j� |�t jt j� |�t jt j� |�t j
t j� |�t jt j� |S r
)r Z
enable_all�setZPOOLS_QUICK_SEARCHZUNSUPPORTEDZVOLUMES_QUICK_SEARCHZDISKS_QUICK_SEARCHZFS_QUICK_SEARCHZACCESS_GROUPS_QUICK_SEARCHZNFS_EXPORTS_QUICK_SEARCHZTARGET_PORTS_QUICK_SEARCHZ.VOLUME_PHYSICAL_DISK_CACHE_UPDATE_SYSTEM_LEVELZ,VOLUME_WRITE_CACHE_POLICY_UPDATE_IMPACT_READZ0VOLUME_WRITE_CACHE_POLICY_UPDATE_WB_IMPACT_OTHERZ,VOLUME_READ_CACHE_POLICY_UPDATE_IMPACT_WRITE)r �systemr Zrcr r r �capabilitiesK s4 ������zSimPlugin.capabilitiesc C s dt fS )NzStorage simulator)r r r r r �plugin_infoa s zSimPlugin.plugin_infoc C s | j �� }dd� |D �S )Nc S s g | ]}t �|��qS r �r r ��.0�sr r r �
<listcomp>f � z%SimPlugin.systems.<locals>.<listcomp>)r �systems)r r Zsim_syssr r r r* d s
zSimPlugin.systemsc C s | j �||�S r
)r �system_read_cache_pct_update)r r! Zread_pctr r r r r+ h s z&SimPlugin.system_read_cache_pct_updateNc C s"