sbcli-dev 6.2.0__tar.gz → 6.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/PKG-INFO +1 -1
  2. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/env_var +1 -1
  3. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/sbcli_dev.egg-info/PKG-INFO +1 -1
  4. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/constants.py +1 -1
  5. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/tasks_controller.py +3 -1
  6. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/kv_store.py +0 -5
  7. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/models/base_model.py +62 -15
  8. sbcli_dev-6.2.2/simplyblock_core/models/caching_node.py +52 -0
  9. sbcli_dev-6.2.2/simplyblock_core/models/cluster.py +96 -0
  10. sbcli_dev-6.2.2/simplyblock_core/models/events.py +45 -0
  11. sbcli_dev-6.2.2/simplyblock_core/models/iface.py +20 -0
  12. sbcli_dev-6.2.2/simplyblock_core/models/job_schedule.py +35 -0
  13. sbcli_dev-6.2.2/simplyblock_core/models/lvol_model.py +63 -0
  14. sbcli_dev-6.2.2/simplyblock_core/models/mgmt_node.py +14 -0
  15. sbcli_dev-6.2.2/simplyblock_core/models/nvme_device.py +82 -0
  16. sbcli_dev-6.2.2/simplyblock_core/models/pool.py +47 -0
  17. sbcli_dev-6.2.2/simplyblock_core/models/snapshot.py +19 -0
  18. sbcli_dev-6.2.2/simplyblock_core/models/stats.py +115 -0
  19. sbcli_dev-6.2.2/simplyblock_core/models/storage_node.py +83 -0
  20. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/tasks_runner_migration.py +2 -2
  21. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/storage_node_ops.py +4 -110
  22. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/app.py +6 -0
  23. sbcli_dev-6.2.0/simplyblock_core/models/caching_node.py +0 -109
  24. sbcli_dev-6.2.0/simplyblock_core/models/cluster.py +0 -107
  25. sbcli_dev-6.2.0/simplyblock_core/models/events.py +0 -60
  26. sbcli_dev-6.2.0/simplyblock_core/models/iface.py +0 -30
  27. sbcli_dev-6.2.0/simplyblock_core/models/job_schedule.py +0 -52
  28. sbcli_dev-6.2.0/simplyblock_core/models/lvol_model.py +0 -97
  29. sbcli_dev-6.2.0/simplyblock_core/models/mgmt_node.py +0 -54
  30. sbcli_dev-6.2.0/simplyblock_core/models/nvme_device.py +0 -132
  31. sbcli_dev-6.2.0/simplyblock_core/models/pool.py +0 -59
  32. sbcli_dev-6.2.0/simplyblock_core/models/snapshot.py +0 -29
  33. sbcli_dev-6.2.0/simplyblock_core/models/stats.py +0 -134
  34. sbcli_dev-6.2.0/simplyblock_core/models/storage_node.py +0 -147
  35. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/README.md +0 -0
  36. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/pyproject.toml +0 -0
  37. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/sbcli_dev.egg-info/SOURCES.txt +0 -0
  38. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/sbcli_dev.egg-info/dependency_links.txt +0 -0
  39. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/sbcli_dev.egg-info/entry_points.txt +0 -0
  40. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/sbcli_dev.egg-info/requires.txt +0 -0
  41. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/sbcli_dev.egg-info/top_level.txt +0 -0
  42. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/setup.cfg +0 -0
  43. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/setup.py +0 -0
  44. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_cli/cli.py +0 -0
  45. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_cli/main.py +0 -0
  46. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/__init__.py +0 -0
  47. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/cluster_ops.py +0 -0
  48. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/cnode_client.py +0 -0
  49. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/compute_node_ops.py +0 -0
  50. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/__init__.py +0 -0
  51. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/caching_node_controller.py +0 -0
  52. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/cluster_events.py +0 -0
  53. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/device_controller.py +0 -0
  54. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/device_events.py +0 -0
  55. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/events_controller.py +0 -0
  56. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/health_controller.py +0 -0
  57. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/lvol_controller.py +0 -0
  58. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/lvol_events.py +0 -0
  59. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/mgmt_events.py +0 -0
  60. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/pool_controller.py +0 -0
  61. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/pool_events.py +0 -0
  62. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/snapshot_controller.py +0 -0
  63. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/snapshot_events.py +0 -0
  64. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/storage_events.py +0 -0
  65. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/controllers/tasks_events.py +0 -0
  66. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/distr_controller.py +0 -0
  67. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/mgmt_node_ops.py +0 -0
  68. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/models/__init__.py +0 -0
  69. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/models/compute_node.py +0 -0
  70. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/models/deployer.py +0 -0
  71. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/models/global_settings.py +0 -0
  72. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/models/port_stat.py +0 -0
  73. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/pci_utils.py +0 -0
  74. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/rpc_client.py +0 -0
  75. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/__init__.py +0 -0
  76. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/alerting/alert_resources.yaml.j2 +0 -0
  77. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/alerting/alert_rules.yaml +0 -0
  78. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/clean_local_storage_deploy.sh +0 -0
  79. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/config_docker.sh +0 -0
  80. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/dashboard.yml +0 -0
  81. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/dashboards/cluster.json +0 -0
  82. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/dashboards/devices.json +0 -0
  83. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/dashboards/lvols.json +0 -0
  84. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/dashboards/node-exporter.json +0 -0
  85. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/dashboards/nodes.json +0 -0
  86. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/dashboards/pools.json +0 -0
  87. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/datasource.yml +0 -0
  88. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/db_config_double.sh +0 -0
  89. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/db_config_single.sh +0 -0
  90. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/deploy_fdb.sh +0 -0
  91. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/deploy_stack.sh +0 -0
  92. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/docker-compose-swarm-monitoring.yml +0 -0
  93. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/docker-compose-swarm.yml +0 -0
  94. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/foundation.yml +0 -0
  95. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/haproxy.cfg +0 -0
  96. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/install_deps.sh +0 -0
  97. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/objstore.yml +0 -0
  98. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/prepare_fdb.sh +0 -0
  99. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/prometheus.yml +0 -0
  100. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/run_ssh.sh +0 -0
  101. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/set_db_config.sh +0 -0
  102. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/scripts/stack_deploy_wait.sh +0 -0
  103. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/__init__.py +0 -0
  104. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/cached_lvol_stat_collector.py +0 -0
  105. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/caching_node_monitor.py +0 -0
  106. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/cap_monitor.py +0 -0
  107. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/capacity_and_stats_collector.py +0 -0
  108. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/device_monitor.py +0 -0
  109. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/health_check_service.py +0 -0
  110. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/install_service.sh +0 -0
  111. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/log_agg_service.py +0 -0
  112. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/lvol_monitor.py +0 -0
  113. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/lvol_stat_collector.py +0 -0
  114. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/main_distr_event_collector.py +0 -0
  115. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/mgmt_node_monitor.py +0 -0
  116. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/new_device_discovery.py +0 -0
  117. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/port_stat_collector.py +0 -0
  118. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/remove_service.sh +0 -0
  119. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/service_template.service +0 -0
  120. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/spdk_http_proxy_server.py +0 -0
  121. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/storage_node_monitor.py +0 -0
  122. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/tasks_runner_failed_migration.py +0 -0
  123. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/tasks_runner_new_dev_migration.py +0 -0
  124. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/tasks_runner_node_add.py +0 -0
  125. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/services/tasks_runner_restart.py +0 -0
  126. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/shell_utils.py +0 -0
  127. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/snode_client.py +0 -0
  128. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_core/utils.py +0 -0
  129. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/__init__.py +0 -0
  130. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/auth_middleware.py +0 -0
  131. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/__init__.py +0 -0
  132. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/caching_node_ops.py +0 -0
  133. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/caching_node_ops_k8s.py +0 -0
  134. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/node_api_basic.py +0 -0
  135. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/node_api_caching_docker.py +0 -0
  136. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/node_api_caching_ks.py +0 -0
  137. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/snode_ops.py +0 -0
  138. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/snode_ops_k8s.py +0 -0
  139. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_caching_node.py +0 -0
  140. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_cluster.py +0 -0
  141. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_deployer.py +0 -0
  142. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_device.py +0 -0
  143. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_lvol.py +0 -0
  144. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_mgmt_node.py +0 -0
  145. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_pool.py +0 -0
  146. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_snapshot.py +0 -0
  147. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/blueprints/web_api_storage_node.py +0 -0
  148. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/caching_node_app.py +0 -0
  149. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/caching_node_app_k8s.py +0 -0
  150. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/node_utils.py +0 -0
  151. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/node_webapp.py +0 -0
  152. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/snode_app.py +0 -0
  153. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/snode_app_k8s.py +0 -0
  154. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/static/delete.py +0 -0
  155. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/static/deploy.py +0 -0
  156. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/static/deploy_cnode.yaml +0 -0
  157. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/static/deploy_spdk.yaml +0 -0
  158. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/static/is_up.py +0 -0
  159. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/static/list_deps.py +0 -0
  160. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/static/rpac.yaml +0 -0
  161. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/static/tst.py +0 -0
  162. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/templates/caching_deploy_spdk.yaml.j2 +0 -0
  163. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/templates/storage_deploy_spdk.yaml.j2 +0 -0
  164. {sbcli_dev-6.2.0 → sbcli_dev-6.2.2}/simplyblock_web/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sbcli-dev
3
- Version: 6.2.0
3
+ Version: 6.2.2
4
4
  Summary: CLI for managing SimplyBlock cluster
5
5
  Home-page: https://www.simplyblock.io/
6
6
  Author: Hamdy
@@ -1,5 +1,5 @@
1
1
  SIMPLY_BLOCK_COMMAND_NAME=sbcli-dev
2
- SIMPLY_BLOCK_VERSION=6.2.0
2
+ SIMPLY_BLOCK_VERSION=6.2.2
3
3
 
4
4
  SIMPLY_BLOCK_DOCKER_IMAGE=simplyblock/simplyblock:main
5
5
  DOCKER_USER=hamdysimplyblock
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sbcli-dev
3
- Version: 6.2.0
3
+ Version: 6.2.2
4
4
  Summary: CLI for managing SimplyBlock cluster
5
5
  Home-page: https://www.simplyblock.io/
6
6
  Author: Hamdy
@@ -108,4 +108,4 @@ SPDK_PROXY_MULTI_THREADING_ENABLED=True
108
108
  SPDK_PROXY_TIMEOUT=60*5
109
109
  LVOL_NVME_CONNECT_RECONNECT_DELAY=3
110
110
  LVOL_NVME_CONNECT_CTRL_LOSS_TMO=-1
111
- QPAIR_COUNT=10
111
+ QPAIR_COUNT=20
@@ -1,4 +1,5 @@
1
1
  # coding=utf-8
2
+ import datetime
2
3
  import json
3
4
  import logging
4
5
  import time
@@ -122,7 +123,8 @@ def list_tasks(cluster_id, is_json=False):
122
123
  "Retry": retry,
123
124
  "Status": task.status,
124
125
  "Result": task.function_result,
125
- "Updated at": time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(task.updated_at)),
126
+ "Updated At": datetime.datetime.strptime(task.updated_at, "%Y-%m-%d %H:%M:%S.%f").strftime(
127
+ "%H:%M:%S, %d/%m/%Y"),
126
128
  })
127
129
  return utils.print_table(data)
128
130
 
@@ -6,7 +6,6 @@ import time
6
6
 
7
7
  from simplyblock_core import constants
8
8
  from simplyblock_core.models.caching_node import CachingNode
9
- from simplyblock_core.models.cluster import ClusterMap
10
9
 
11
10
  from simplyblock_core.models.cluster import Cluster
12
11
  from simplyblock_core.models.deployer import Deployer
@@ -81,10 +80,6 @@ class DBController:
81
80
  def clear_prefix(self, prefix):
82
81
  self.kv_store.db.clear_range_startswith(prefix)
83
82
 
84
- def get_cluster_map(self):
85
- cmap = ClusterMap().read_from_db(self.kv_store)
86
- return cmap[0] if cmap else None
87
-
88
83
  def get_storage_nodes(self):
89
84
  ret = StorageNode().read_from_db(self.kv_store)
90
85
  ret = sorted(ret, key=lambda x: x.create_dt)
@@ -6,23 +6,30 @@ from typing import Mapping
6
6
 
7
7
 
8
8
  class BaseModel(object):
9
- def __init__(self):
10
- self._attribute_map = {
11
- "id": {"type": str, "default": ""},
12
- "name": {"type": str, "default": self.__class__.__name__},
13
- "object_type": {"type": str, "default": ""},
14
- "deleted": {"type": bool, 'default': False},
15
- "updated_at": {"type": str, 'default': ""},
16
- "create_dt": {"type": str, 'default': ""},
17
- "remove_dt": {"type": str, 'default': ""},
18
- }
19
- self.set_attrs({}, {})
9
+
10
+ id: str = ""
11
+ uuid: str = ""
12
+ name: str = ""
13
+ status: str = ""
14
+ deleted: bool = False
15
+ updated_at: str = ""
16
+ create_dt: str= ""
17
+ remove_dt: str= ""
18
+
19
+ _attribute_map = {}
20
+
21
+ def __init__(self, data=None):
22
+ self.name = self.__class__.__name__
23
+ self.set_attrs(data)
20
24
 
21
25
  def get_id(self):
22
- return self.id
26
+ return self.uuid
23
27
 
24
- def set_attrs(self, attributes, data):
25
- self._attribute_map.update(attributes)
28
+ def set_attrs(self, data):
29
+ self._attribute_map = {}
30
+ for s in self.__dir__():
31
+ if not s.startswith("_"):
32
+ self._attribute_map[s]= {"type": getattr(self, s).__class__, "default": getattr(self, s)}
26
33
  self.from_dict(data)
27
34
 
28
35
  def from_dict(self, data):
@@ -89,7 +96,7 @@ class BaseModel(object):
89
96
  def read_from_db(self, kv_store, id="", limit=0, reverse=False):
90
97
  try:
91
98
  objects = []
92
- prefix = "%s/%s/%s" % (self.object_type, self.name, id)
99
+ prefix = "%s/%s/%s" % (self.create_dt.replace(" ", ""), self.name, id)
93
100
  for k, v in kv_store.db.get_range_startswith(prefix.encode('utf-8'), limit=limit, reverse=reverse):
94
101
  objects.append(self.__class__().from_dict(json.loads(v)))
95
102
  return objects
@@ -136,3 +143,43 @@ class BaseModel(object):
136
143
  if isinstance(item, str) and item in self._attribute_map:
137
144
  return getattr(self, item)
138
145
  return False
146
+
147
+
148
+ class BaseNodeObject(BaseModel):
149
+
150
+ STATUS_ONLINE = 'online'
151
+ STATUS_OFFLINE = 'offline'
152
+ STATUS_SUSPENDED = 'suspended'
153
+ STATUS_IN_SHUTDOWN = 'in_shutdown'
154
+ STATUS_REMOVED = 'removed'
155
+ STATUS_RESTARTING = 'in_restart'
156
+
157
+ STATUS_IN_CREATION = 'in_creation'
158
+ STATUS_UNREACHABLE = 'unreachable'
159
+ STATUS_SCHEDULABLE = 'schedulable'
160
+
161
+ STATUS_CODE_MAP = {
162
+ STATUS_ONLINE: 0,
163
+ STATUS_OFFLINE: 1,
164
+ STATUS_SUSPENDED: 2,
165
+ STATUS_REMOVED: 3,
166
+
167
+ STATUS_IN_CREATION: 10,
168
+ STATUS_IN_SHUTDOWN: 11,
169
+ STATUS_RESTARTING: 12,
170
+
171
+ STATUS_UNREACHABLE: 20,
172
+
173
+ STATUS_SCHEDULABLE: 30,
174
+ }
175
+
176
+ def get_status_code(self):
177
+ if self.status in self.STATUS_CODE_MAP:
178
+ return self.STATUS_CODE_MAP[self.status]
179
+ else:
180
+ return -1
181
+
182
+ def get_clean_dict(self):
183
+ data = super(BaseNodeObject, self).get_clean_dict()
184
+ data['status_code'] = self.get_status_code()
185
+ return data
@@ -0,0 +1,52 @@
1
+ # coding=utf-8
2
+
3
+ from typing import List
4
+
5
+ from simplyblock_core.models.base_model import BaseModel, BaseNodeObject
6
+ from simplyblock_core.models.iface import IFace
7
+ from simplyblock_core.models.lvol_model import LVol
8
+ from simplyblock_core.models.nvme_device import NVMeDevice
9
+
10
+
11
+ class CachedLVol(BaseModel):
12
+
13
+ device_path: str = ""
14
+ hostname: str = ""
15
+ local_nqn: str = ""
16
+ lvol: LVol = None
17
+ lvol_id: str = ""
18
+ ocf_bdev: str = ""
19
+
20
+
21
+ class CachingNode(BaseNodeObject):
22
+
23
+ api_endpoint: str = ""
24
+ baseboard_sn: str = ""
25
+ cache_bdev: str = ""
26
+ cache_size: int = 0
27
+ cache_split_factor: int = 0
28
+ cluster_id: str = ""
29
+ cpu: int = 0
30
+ cpu_hz: int = 0
31
+ ctrl_secret: str = ""
32
+ data_nics: List[IFace] = []
33
+ host_nqn: str = ""
34
+ host_secret: str = ""
35
+ hostname: str = ""
36
+ hugepages: int = 0
37
+ ib_devices: List[IFace] = []
38
+ lvols: List[CachedLVol] = []
39
+ memory: int = 0
40
+ mgmt_ip: str = ""
41
+ multipathing: bool = True
42
+ node_lvs: str = "lvs"
43
+ nvme_devices: List[NVMeDevice] = []
44
+ partitions_count: int = 0
45
+ remote_devices: List[NVMeDevice] = []
46
+ rpc_password: str = ""
47
+ rpc_port: int = -1
48
+ rpc_username: str = ""
49
+ sequential_number: int = 0
50
+ services: List[str] = []
51
+ subsystem: str = ""
52
+ system_uuid: str = ""
@@ -0,0 +1,96 @@
1
+ # coding=utf-8
2
+
3
+ from typing import List
4
+
5
+ from simplyblock_core.models.base_model import BaseModel
6
+
7
+
8
+ class Cluster(BaseModel):
9
+
10
+ STATUS_ACTIVE = "active"
11
+ STATUS_READONLY = 'read_only'
12
+ STATUS_INACTIVE = "inactive"
13
+ STATUS_SUSPENDED = "suspended"
14
+ STATUS_DEGRADED = "degraded"
15
+ STATUS_UNREADY = "unready"
16
+ STATUS_IN_ACTIVATION = "in_activation"
17
+
18
+ STATUS_CODE_MAP = {
19
+ STATUS_ACTIVE: 1,
20
+ STATUS_INACTIVE: 2,
21
+ STATUS_READONLY: 3,
22
+
23
+ STATUS_SUSPENDED: 10,
24
+ STATUS_DEGRADED: 11,
25
+
26
+ }
27
+
28
+ auth_hosts_only: bool = False
29
+ blk_size: int = 0
30
+ cap_crit: int = 90
31
+ cap_warn: int = 80
32
+ cli_pass: str = ""
33
+ cluster_max_devices: int = 0
34
+ cluster_max_nodes: int = 0
35
+ cluster_max_size: int = 0
36
+ db_connection: str = ""
37
+ dhchap: str = ""
38
+ distr_bs: int = 0
39
+ distr_chunk_bs: int = 0
40
+ distr_ndcs: int = 0
41
+ distr_npcs: int = 0
42
+ enable_node_affinity: bool = False
43
+ enable_qos: bool = False
44
+ grafana_endpoint: str = ""
45
+ grafana_secret: str = ""
46
+ ha_type: str = "single"
47
+ inflight_io_threshold: int = 4
48
+ iscsi: str = ""
49
+ max_queue_size: int = 128
50
+ model_ids: List[str] = []
51
+ nqn: str = ""
52
+ page_size_in_blocks: int = 2097152
53
+ prov_cap_crit: int = 190
54
+ prov_cap_warn: int = 180
55
+ qpair_count: int = 6
56
+ secret: str = ""
57
+ status: str = ""
58
+ strict_node_anti_affinity: bool = False
59
+ tls: bool = False
60
+ updated_at: str = ""
61
+ uuid: str = ""
62
+
63
+ def __init__(self, data=None):
64
+ super(Cluster, self).__init__(data=data)
65
+
66
+ def get_status_code(self):
67
+ if self.status in self.STATUS_CODE_MAP:
68
+ return self.STATUS_CODE_MAP[self.status]
69
+ else:
70
+ return -1
71
+
72
+ def get_clean_dict(self):
73
+ data = super(Cluster, self).get_clean_dict()
74
+ data['status_code'] = self.get_status_code()
75
+ return data
76
+
77
+
78
+
79
+
80
+ lst = []
81
+ for k, v in Cluster().attributes.items():
82
+ if hasattr(v['type'], "__origin__"):
83
+ if hasattr(v['type'], "__args__"):
84
+ lst.append(f"{k}: {v['type']._name}[{v['type'].__args__[0].__name__}] = {v['default']} ")
85
+ else:
86
+ lst.append(f"{k}: {v['type']._name} = {v['default']} ")
87
+ # print(v['type'].__dict__)
88
+ elif v['type'] == str:
89
+ lst.append(f"{k}: {v['type'].__name__} = \"{v['default']}\"")
90
+
91
+ else:
92
+ lst.append(f"{k}: {v['type'].__name__} = {v['default']}")
93
+
94
+ lst.sort()
95
+ for l in lst:
96
+ print(l)
@@ -0,0 +1,45 @@
1
+ # coding=utf-8
2
+ from datetime import datetime
3
+
4
+ from simplyblock_core.models.base_model import BaseModel
5
+
6
+
7
+ class EventObj(BaseModel):
8
+ LEVEL_DEBUG = "Debug"
9
+ LEVEL_INFO = "Info"
10
+ LEVEL_WARN = "Warning"
11
+ LEVEL_CRITICAL = "Critical"
12
+ LEVEL_ERROR = "Error"
13
+
14
+ """
15
+ uuid:
16
+ cluster_uuid: 1234
17
+ event: STATUS_CHANGE
18
+ domain: Cluster, Management, Storage
19
+ object_name: cluster,
20
+ object_dict:
21
+ caused_by: CLI, API, MONITOR
22
+ message:
23
+ meta_data:
24
+ date:
25
+ """
26
+ caused_by: str = ""
27
+ cluster_uuid: str = ""
28
+ count: int = 1
29
+ date: int = 0
30
+ domain: str = ""
31
+ event: str = ""
32
+ event_level: str = "Info"
33
+ message: str = ""
34
+ meta_data: str = ""
35
+ node_id: str = ""
36
+ object_dict: dict = {}
37
+ object_name: str = ""
38
+ storage_id: int = -1
39
+ vuid: int = -1
40
+
41
+ def get_date_string(self):
42
+ if self.date > 1e10:
43
+ return str(datetime.fromtimestamp(self.date/1000))[:23]
44
+ else:
45
+ return str(datetime.fromtimestamp(self.date))[:23]
@@ -0,0 +1,20 @@
1
+ # coding=utf-8
2
+
3
+ from simplyblock_core.models.base_model import BaseModel
4
+
5
+
6
+ class IFace(BaseModel):
7
+
8
+ if_name: str = ""
9
+ ip4_address: str = ""
10
+ net_type: str = ""
11
+ port_number: int = -1
12
+ status: str = ""
13
+ uuid: str = ""
14
+
15
+ def get_transport_type(self):
16
+ if self.net_type == 'ether':
17
+ return "TCP"
18
+ if self.net_type == 'ib':
19
+ return "RDMA"
20
+ return "TCP"
@@ -0,0 +1,35 @@
1
+ # coding=utf-8
2
+ import datetime
3
+ import time
4
+
5
+ from simplyblock_core.models.base_model import BaseModel
6
+
7
+
8
+ class JobSchedule(BaseModel):
9
+
10
+ STATUS_NEW = 'new'
11
+ STATUS_RUNNING = 'running'
12
+ STATUS_SUSPENDED = 'suspended'
13
+ STATUS_DONE = 'done'
14
+
15
+ FN_DEV_RESTART = "device_restart"
16
+ FN_NODE_RESTART = "node_restart"
17
+ FN_DEV_MIG = "device_migration"
18
+ FN_FAILED_DEV_MIG = "failed_device_migration"
19
+ FN_NEW_DEV_MIG = "new_device_migration"
20
+ FN_NODE_ADD = "node_add"
21
+
22
+ canceled: bool = False
23
+ cluster_id: str = ""
24
+ date: int = 0
25
+ device_id: str = ""
26
+ function_name: str = ""
27
+ function_params: dict = {}
28
+ function_result: str = ""
29
+ max_retry: int = -1
30
+ node_id: str = ""
31
+ retry: int = 0
32
+
33
+ def write_to_db(self, kv_store=None):
34
+ self.updated_at = str(datetime.datetime.now())
35
+ self.write_to_db(kv_store)
@@ -0,0 +1,63 @@
1
+ # coding=utf-8
2
+
3
+ from typing import List
4
+
5
+ from simplyblock_core.models.base_model import BaseModel
6
+ from simplyblock_core.models.nvme_device import NVMeDevice
7
+
8
+
9
+ class LVol(BaseModel):
10
+
11
+ STATUS_ONLINE = 'online'
12
+ STATUS_OFFLINE = 'offline'
13
+ STATUS_IN_DELETION = 'in_deletion'
14
+
15
+ STATUS_CODE_MAP = {
16
+ STATUS_ONLINE: 1,
17
+ STATUS_OFFLINE: 2,
18
+ STATUS_IN_DELETION: 3,
19
+ }
20
+
21
+ base_bdev: str = ""
22
+ bdev_stack: List = []
23
+ blobid: int = 0
24
+ cloned_from_snap: str = ""
25
+ cluster_size: int = 0
26
+ comp_bdev: str = ""
27
+ crypto_bdev: str = ""
28
+ crypto_key1: str = ""
29
+ crypto_key2: str = ""
30
+ crypto_key_name: str = ""
31
+ deletion_status: str = ""
32
+ distr_bs: int = 0
33
+ distr_chunk_bs: int = 0
34
+ distr_page_size: int = 0
35
+ guid: str = ""
36
+ ha_type: str = ""
37
+ health_check: bool = True
38
+ hostname: str = ""
39
+ io_error: bool = False
40
+ lvol_bdev: str = ""
41
+ lvol_name: str = ""
42
+ lvol_priority_class: int = 0
43
+ lvol_type: str = "lvol"
44
+ lvol_uuid: str = ""
45
+ lvs_name: str = ""
46
+ max_size: int = 0
47
+ mem_diff: dict = {}
48
+ mode: str = "read-write"
49
+ ndcs: int = 0
50
+ node_id: str = ""
51
+ nodes: List[str] = []
52
+ npcs: int = 0
53
+ nqn: str = ""
54
+ nvme_dev: NVMeDevice = None
55
+ pool_uuid: str = ""
56
+ r_mbytes_per_sec: int = 0
57
+ rw_ios_per_sec: int = 0
58
+ rw_mbytes_per_sec: int = 0
59
+ size: int = 0
60
+ snapshot_name: str = ""
61
+ top_bdev: str = ""
62
+ vuid: int = 0
63
+ w_mbytes_per_sec: int = 0
@@ -0,0 +1,14 @@
1
+ # coding=utf-8
2
+
3
+ from datetime import datetime
4
+
5
+ from simplyblock_core.models.base_model import BaseNodeObject
6
+
7
+
8
+ class MgmtNode(BaseNodeObject):
9
+
10
+ baseboard_sn: str = ""
11
+ cluster_id: str = ""
12
+ docker_ip_port: str = ""
13
+ hostname: str = ""
14
+ mgmt_ip: str = ""
@@ -0,0 +1,82 @@
1
+ # coding=utf-8
2
+ from typing import List
3
+
4
+ from simplyblock_core.models.base_model import BaseModel
5
+
6
+
7
+ class NVMeDevice(BaseModel):
8
+
9
+ STATUS_JM = "JM_DEV"
10
+
11
+ STATUS_NEW = "new"
12
+ STATUS_ONLINE = 'online'
13
+ STATUS_UNAVAILABLE = 'unavailable'
14
+ STATUS_REMOVED = 'removed'
15
+ STATUS_FAILED = 'failed'
16
+ STATUS_FAILED_AND_MIGRATED = 'failed_and_migrated'
17
+ STATUS_READONLY = 'read_only'
18
+
19
+ STATUS_CODE_MAP = {
20
+ STATUS_ONLINE: 1,
21
+ STATUS_NEW: 2,
22
+ STATUS_UNAVAILABLE: 3,
23
+ STATUS_REMOVED: 4,
24
+ STATUS_FAILED: 5,
25
+ STATUS_READONLY: 6,
26
+ STATUS_JM: 7
27
+
28
+ }
29
+
30
+ alceml_bdev: str = ""
31
+ alceml_name: str = ""
32
+ bdev_stack: List = []
33
+ capacity: int = -1
34
+ cluster_device_order: int = 0
35
+ cluster_id: str = ""
36
+ device_name: str = ""
37
+ health_check: bool = True
38
+ io_error: bool = False
39
+ is_partition: bool = False
40
+ model_id: str = ""
41
+ node_id: str = ""
42
+ nvme_bdev: str = ""
43
+ nvme_controller: str = ""
44
+ nvmf_ip: str = ""
45
+ nvmf_nqn: str = ""
46
+ nvmf_port: int = 0
47
+ overload_percentage: int = 0
48
+ partition_jm_bdev: str = ""
49
+ partition_jm_size: int = 0
50
+ partition_main_bdev: str = ""
51
+ partition_main_size: int = 0
52
+ partitions_count: int = 0
53
+ pcie_address: str = ""
54
+ physical_label: int = 0
55
+ pt_bdev: str = ""
56
+ qos_bdev: str = ""
57
+ remote_bdev: str = ""
58
+ retries_exhausted: bool = False
59
+ sequential_number: int = 0
60
+ serial_number: str = ""
61
+ size: int = -1
62
+ testing_bdev: str = ""
63
+
64
+ def get_status_code(self):
65
+ if self.status in self.STATUS_CODE_MAP:
66
+ return self.STATUS_CODE_MAP[self.status]
67
+ else:
68
+ return -1
69
+
70
+ def get_clean_dict(self):
71
+ data = super(NVMeDevice, self).get_clean_dict()
72
+ data['status_code'] = self.get_status_code()
73
+ return data
74
+
75
+
76
+ class JMDevice(NVMeDevice):
77
+
78
+ device_data_dict: dict = {}
79
+ jm_bdev: str = ""
80
+ jm_nvme_bdev_list: List[str] = []
81
+ raid_bdev: str = ""
82
+
@@ -0,0 +1,47 @@
1
+ # coding=utf-8
2
+
3
+ from typing import List
4
+
5
+ from simplyblock_core import utils
6
+ from simplyblock_core.models.base_model import BaseModel
7
+
8
+
9
+ class Pool(BaseModel):
10
+
11
+ STATUS_ACTIVE = "active"
12
+ STATUS_INACTIVE = "inactive"
13
+
14
+ STATUS_CODE_MAP = {
15
+ STATUS_ACTIVE: 1,
16
+ STATUS_INACTIVE: 2,
17
+ }
18
+
19
+ cluster_id: str = ""
20
+ groups: List[str] = []
21
+ lvol_max_size: int = 0
22
+ lvols: List[str] = []
23
+ max_r_mbytes_per_sec: int = 0
24
+ max_rw_ios_per_sec: int = 0
25
+ max_rw_mbytes_per_sec: int = 0
26
+ max_w_mbytes_per_sec: int = 0
27
+ pool_max_size: int = 0
28
+ pool_name: str = ""
29
+ secret: str = ""
30
+ users: List[str] = []
31
+
32
+
33
+ def get_clean_dict(self):
34
+ data = super(Pool, self).get_clean_dict()
35
+ data['pool_max_size'] = utils.humanbytes(data['pool_max_size'])
36
+ data['lvol_max_size'] = utils.humanbytes(data['lvol_max_size'])
37
+ data['status_code'] = self.get_status_code()
38
+ return data
39
+
40
+ def has_qos(self):
41
+ return 0 < (self.max_rw_ios_per_sec + self.max_rw_mbytes_per_sec + self.max_r_mbytes_per_sec + self.max_w_mbytes_per_sec)
42
+
43
+ def get_status_code(self):
44
+ if self.status in self.STATUS_CODE_MAP:
45
+ return self.STATUS_CODE_MAP[self.status]
46
+ else:
47
+ return -1
@@ -0,0 +1,19 @@
1
+ # coding=utf-8
2
+
3
+ from simplyblock_core.models.base_model import BaseModel
4
+ from simplyblock_core.models.lvol_model import LVol
5
+
6
+
7
+ class SnapShot(BaseModel):
8
+
9
+ base_bdev: str = ""
10
+ cluster_id: str = ""
11
+ created_at: int = 0
12
+ health_check: bool = True
13
+ lvol: LVol = None
14
+ mem_diff: dict = {}
15
+ pool_uuid: str = ""
16
+ ref_count: int = 0
17
+ snap_bdev: str = ""
18
+ snap_name: str = ""
19
+ snap_ref_id: str = ""