%global _empty_manifest_terminate_build 0 Name: python-syneto-api Version: 0.2.47 Release: 1 Summary: Syneto Client API library License: Proprietary URL: https://github.com/SynetoNet/syneto-api Source0: https://mirrors.aliyun.com/pypi/web/packages/df/f0/47aba9893179c2674637eff91c4654fa7027793c048ee61400028022fde3/syneto_api-0.2.47.tar.gz BuildArch: noarch Requires: python3-dotenv Requires: python3-requests[secure] Requires: python3-inflection Requires: python3-aiohttp Requires: python3-aiodns Requires: python3-cchardet Requires: python3-tenacity %description # Syneto API Syneto Client API library: authentication, storage, virtualization and protection # Installation ``` $ pip install syneto-api ``` # Basic Usage ``` from syneto_api import Authentication, Virtualization, Storage, Protection auth_api = Authentication(url_base="https://syneto-instance-ip-address/api/auth", insecure_ssl=True) response = auth_api.login(username="admin", password="admin") jwt = response['jwt'] virt_api = Virtualization(url_base="https://syneto-instance-ip-address/api/virtualization", insecure_ssl=True) virt_api.set_auth_jwt(jwt) print(virt_api.get_vms()) storage_api = Storage(url_base="https://syneto-instance-ip-address/api/storage", insecure_ssl=True) storage_api.set_auth_jwt(jwt) print(storage_api.get_pools()) ``` # Environment Variables For conveninence, the base urls for the api endpoints are also accepted as environment variables, please see below. ``` AUTH_SERVICE=https://syneto-instance-ip-address/api/auth VIRTUALIZATION_SERVICE=https://syneto-instance-ip-address/api/virtualization STORAGE_SERVICE=https://syneto-instance-ip-address/api/storage PROTECTION_SERVICE=https://syneto-instance-ip-address/api/protection ``` If you are using self-signed SSL certificates, set the following env. so that the http request library does not perform ssl verification. ``` ALLOW_INSECURE_SSL=True ``` %package -n python3-syneto-api Summary: Syneto Client API library Provides: python-syneto-api BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-syneto-api # Syneto API Syneto Client API library: authentication, storage, virtualization and protection # Installation ``` $ pip install syneto-api ``` # Basic Usage ``` from syneto_api import Authentication, Virtualization, Storage, Protection auth_api = Authentication(url_base="https://syneto-instance-ip-address/api/auth", insecure_ssl=True) response = auth_api.login(username="admin", password="admin") jwt = response['jwt'] virt_api = Virtualization(url_base="https://syneto-instance-ip-address/api/virtualization", insecure_ssl=True) virt_api.set_auth_jwt(jwt) print(virt_api.get_vms()) storage_api = Storage(url_base="https://syneto-instance-ip-address/api/storage", insecure_ssl=True) storage_api.set_auth_jwt(jwt) print(storage_api.get_pools()) ``` # Environment Variables For conveninence, the base urls for the api endpoints are also accepted as environment variables, please see below. ``` AUTH_SERVICE=https://syneto-instance-ip-address/api/auth VIRTUALIZATION_SERVICE=https://syneto-instance-ip-address/api/virtualization STORAGE_SERVICE=https://syneto-instance-ip-address/api/storage PROTECTION_SERVICE=https://syneto-instance-ip-address/api/protection ``` If you are using self-signed SSL certificates, set the following env. so that the http request library does not perform ssl verification. ``` ALLOW_INSECURE_SSL=True ``` %package help Summary: Development documents and examples for syneto-api Provides: python3-syneto-api-doc %description help # Syneto API Syneto Client API library: authentication, storage, virtualization and protection # Installation ``` $ pip install syneto-api ``` # Basic Usage ``` from syneto_api import Authentication, Virtualization, Storage, Protection auth_api = Authentication(url_base="https://syneto-instance-ip-address/api/auth", insecure_ssl=True) response = auth_api.login(username="admin", password="admin") jwt = response['jwt'] virt_api = Virtualization(url_base="https://syneto-instance-ip-address/api/virtualization", insecure_ssl=True) virt_api.set_auth_jwt(jwt) print(virt_api.get_vms()) storage_api = Storage(url_base="https://syneto-instance-ip-address/api/storage", insecure_ssl=True) storage_api.set_auth_jwt(jwt) print(storage_api.get_pools()) ``` # Environment Variables For conveninence, the base urls for the api endpoints are also accepted as environment variables, please see below. ``` AUTH_SERVICE=https://syneto-instance-ip-address/api/auth VIRTUALIZATION_SERVICE=https://syneto-instance-ip-address/api/virtualization STORAGE_SERVICE=https://syneto-instance-ip-address/api/storage PROTECTION_SERVICE=https://syneto-instance-ip-address/api/protection ``` If you are using self-signed SSL certificates, set the following env. so that the http request library does not perform ssl verification. ``` ALLOW_INSECURE_SSL=True ``` %prep %autosetup -n syneto_api-0.2.47 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-syneto-api -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri Jun 09 2023 Python_Bot - 0.2.47-1 - Package Spec generated