wo4h ddlZddlmZmZddlmcmcmZ ddl m Z m Z ddl mZmZmZddlmZddlmZGddejZGd d ejZdS) N)ListOptional)MyImunifyConfigis_mi_freemium_license) MyImunify#set_protection_status_for_all_usersupdate_users_protection)lookup)ScopeceZdZejZejdddee de fdZ ejdddZ ejddd Z d S) MyImunifyEndpoints myimunifyupdateitems protectioncJKt|j||dkd{ViS)Nenabled)r _sink)selfrrs Y/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/simple_rpc/myimunify.pyrzMyImunifyEndpoints.updatesK% JzY6          z enable-allc@Kt|jdd{VdS)NTrrrs r enable_allzMyImunifyEndpoints.enable_alls01$*dCCCCCCCCCCCrz disable-allc@Kt|jdd{VdS)NFrrs r disable_allzMyImunifyEndpoints.disable_all s01$*eDDDDDDDDDDDrN) __name__ __module__ __qualname__r IM360SCOPEr bindrstrrrrrrr r s KEV[h''$s)(' V[l++DD,+DV[m,,EE-,EEErr cteZdZejZejddddee de e fdZ dS)MyImunifyCommonEndpointsrstatusNruserc Ktj}tj}||g}tjr|d{V|g}tt|d}tjdztj ddd||| dz}tjtj|}tj|t'd|DdS)Nz/?cloudlinux_advantage provisioningmy_imunify_account_protection)mactionsuiteusernamedomain server_ipc0g|]}|d|ddS)r)r)r1rr%).0items r z3MyImunifyCommonEndpoints.status..Hs9"&\l9KLLr)myimunify_enabledpurchase_page_url is_freemiumr)rPURCHASE_PAGE_URLhp HostingPanelENABLEDget_domains_per_usergetnextiterurllibparse urlencode get_server_iprselectwherer)in_dictsr)rrr) purchase_url panel_manager user_domainsr2responses rr(zMyImunifyCommonEndpoints.status(sM&8 ))  FE& '<<>>>>>>>>#dB--d<00$77#5l,,!7&4%D(,&,)6)D)D)F)F    #%%++IN,>,>u,E,EFFLLNN!0!8!-133$    r)N) rrr r r!r"r r#rr$rr(r%rrr'r'%sc KEV[h''# # $s)# 8C=# # # ('# # # rr') urllib.parserCtypingrr+defence360agent.subsys.panels.hosting_panelsubsyspanels hosting_panelr< defence360agent.contracts.configrrdefence360agent.myimunify.modelrrr defence360agent.rpc_toolsr defence360agent.utilsr RootEndpointsr CommonEndpointsr'r%rrr[s9!!!!!!!!888888888888 -,,,,,''''''EEEEE-EEE&' ' ' ' ' v5' ' ' ' ' r