hcs-cli 0.1.317__py3-none-any.whl → 0.1.319__py3-none-any.whl

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 (112) hide show
  1. hcs_cli/__init__.py +1 -1
  2. hcs_cli/cmds/advisor/html_utils.py +30 -26
  3. hcs_cli/cmds/advisor/recommendation_engine.py +7 -10
  4. hcs_cli/cmds/api.py +5 -3
  5. hcs_cli/cmds/daas/tenant/plan.py +1 -1
  6. hcs_cli/cmds/debug/start.py +2 -3
  7. hcs_cli/cmds/dev/fs/helper/credential_helper.py +2 -0
  8. hcs_cli/cmds/dev/fs/helper/k8s_util.py +0 -1
  9. hcs_cli/cmds/dev/fs/helper/license_info.py +36 -12
  10. hcs_cli/cmds/dev/fs/init.py +38 -5
  11. hcs_cli/cmds/dev/fs/profiler.py +0 -1
  12. hcs_cli/cmds/dev/fs/provided_files/akka.plan.yml +94 -250
  13. hcs_cli/cmds/dev/fs/provided_files/azsim.plan.yml +27 -34
  14. hcs_cli/cmds/dev/fs/provided_files/azure.plan.yml +294 -322
  15. hcs_cli/cmds/dev/fs/provided_files/mqtt-secret.yaml +188 -93
  16. hcs_cli/cmds/dev/fs/provided_files/mqtt-server-external.yaml +4 -5
  17. hcs_cli/cmds/dev/fs/provided_files/patch-mqtt-hostname.yml +3 -3
  18. hcs_cli/cmds/dev/fs/provided_files/patch-vernemq-ssl-depth.json +1 -1
  19. hcs_cli/cmds/dev/fs/tailor.py +7 -12
  20. hcs_cli/cmds/dev/mqtt.py +1 -2
  21. hcs_cli/cmds/dev/onboard.py +35 -1
  22. hcs_cli/cmds/dev/util/mqtt_helper.py +0 -1
  23. hcs_cli/cmds/hoc/search.py +39 -9
  24. hcs_cli/cmds/hst/clean.py +2 -1
  25. hcs_cli/cmds/inventory/assign.py +72 -28
  26. hcs_cli/cmds/inventory/deassign.py +35 -18
  27. hcs_cli/cmds/inventory/logoff.py +86 -8
  28. hcs_cli/cmds/inventory/session.py +2 -2
  29. hcs_cli/cmds/scm/operator.py +2 -2
  30. hcs_cli/cmds/scm/plan.py +131 -3
  31. hcs_cli/cmds/task.py +2 -4
  32. hcs_cli/cmds/template/expand.py +65 -0
  33. hcs_cli/cmds/template/list_usage.py +2 -2
  34. hcs_cli/cmds/template/usage.py +20 -7
  35. hcs_cli/cmds/vm/list.py +0 -1
  36. hcs_cli/config/hcs-deployments.yaml +52 -52
  37. hcs_cli/main.py +0 -2
  38. hcs_cli/payload/akka.blueprint.yml +95 -243
  39. hcs_cli/payload/app/manual.json +19 -19
  40. hcs_cli/payload/edge/akka.json +6 -6
  41. hcs_cli/payload/edge/vsphere.json +6 -6
  42. hcs_cli/payload/hoc/lcm-capcalc.json.template +43 -0
  43. hcs_cli/payload/hoc/no-spare.json.template +1 -1
  44. hcs_cli/payload/inventory/assign.json +14 -16
  45. hcs_cli/payload/inventory/deassign.json +11 -11
  46. hcs_cli/payload/lcm/akka.json +31 -33
  47. hcs_cli/payload/lcm/azure-dummy-nt.json +64 -66
  48. hcs_cli/payload/lcm/azure-dummy.json +64 -66
  49. hcs_cli/payload/lcm/azure-real.json +13 -11
  50. hcs_cli/payload/lcm/edge-proxy.json +34 -36
  51. hcs_cli/payload/lcm/zero-dedicated.json +34 -36
  52. hcs_cli/payload/lcm/zero-delay-1m-per-vm.json +53 -69
  53. hcs_cli/payload/lcm/zero-fail-delete-template.json +43 -0
  54. hcs_cli/payload/lcm/zero-fail-destroy-onthread.json +38 -40
  55. hcs_cli/payload/lcm/zero-fail-destroy.json +38 -40
  56. hcs_cli/payload/lcm/zero-fail-prepare-onthread.json +38 -40
  57. hcs_cli/payload/lcm/zero-fail-prepare.json +38 -40
  58. hcs_cli/payload/lcm/zero-fail-vm-onthread.json +58 -74
  59. hcs_cli/payload/lcm/zero-fail-vm.json +58 -74
  60. hcs_cli/payload/lcm/zero-floating.json +34 -36
  61. hcs_cli/payload/lcm/zero-manual.json +33 -35
  62. hcs_cli/payload/lcm/zero-multisession.json +34 -36
  63. hcs_cli/payload/lcm/zero-nanw.json +31 -33
  64. hcs_cli/payload/lcm/zero-new-5k-delay.json +69 -78
  65. hcs_cli/payload/lcm/zero-new-5k.json +36 -38
  66. hcs_cli/payload/lcm/zero-new-snapshot.json +37 -39
  67. hcs_cli/payload/lcm/zero-new.json +37 -39
  68. hcs_cli/payload/lcm/zero-reuse-vm-id.json +33 -35
  69. hcs_cli/payload/lcm/zero-with-max-id-offset.json +32 -34
  70. hcs_cli/payload/lcm/zero.json +59 -73
  71. hcs_cli/payload/provider/ad-stes-vsphere.json +26 -26
  72. hcs_cli/payload/provider/akka.json +12 -12
  73. hcs_cli/payload/provider/azure.json +14 -14
  74. hcs_cli/payload/provider/edgeproxy.json +12 -12
  75. hcs_cli/payload/provider/vsphere.json +14 -14
  76. hcs_cli/payload/scm/starter.json +22 -23
  77. hcs_cli/payload/synt/core/p01-dummy-success.json +11 -15
  78. hcs_cli/payload/synt/core/p02-dummy-fail.json +12 -15
  79. hcs_cli/payload/synt/core/p03-dummy-exception.json +12 -15
  80. hcs_cli/payload/synt/core/p04-dummy-success-repeat.json +12 -15
  81. hcs_cli/payload/synt/core/p05-dummy-fail-repeat.json +13 -16
  82. hcs_cli/payload/synt/core/p06-dummy-exception-repeat.json +13 -16
  83. hcs_cli/payload/synt/core/p07-dummy-delay.json +12 -15
  84. hcs_cli/payload/synt/core/p08-dummy-property.json +12 -15
  85. hcs_cli/payload/synt/ext/p20-connect-success.json +12 -15
  86. hcs_cli/payload/synt/ext/p21-connect-fail.json +12 -15
  87. hcs_cli/payload/synt/ext/p30-ssl-success.json +12 -15
  88. hcs_cli/payload/synt/ext/p31-ssl-fail.json +13 -16
  89. hcs_cli/payload/synt/ext/p40-http-success.json +12 -15
  90. hcs_cli/payload/synt/ext/p41-http-fail.json +12 -15
  91. hcs_cli/payload/synt/ext/p42-http-status-code.json +14 -20
  92. hcs_cli/payload/synt/ext1/p10-ping-success.json +13 -16
  93. hcs_cli/payload/synt/ext1/p11-ping-fail.json +12 -15
  94. hcs_cli/payload/synt/ext1/p12-ping-success-repeat.json +14 -17
  95. hcs_cli/provider/hcs/cert.py +0 -1
  96. hcs_cli/provider/hcs/edge.py +1 -1
  97. hcs_cli/provider/hcs/uag.py +6 -1
  98. hcs_cli/service/hoc/diagnostic.py +0 -3
  99. hcs_cli/service/inventory/__init__.py +1 -1
  100. hcs_cli/service/inventory/session.py +23 -7
  101. hcs_cli/service/lcm/vm.py +0 -1
  102. hcs_cli/service/task.py +0 -1
  103. hcs_cli/support/debug_util.py +0 -1
  104. hcs_cli/support/plan_util.py +0 -1
  105. hcs_cli/support/predefined_payload.py +4 -1
  106. hcs_cli/support/template_util.py +0 -1
  107. hcs_cli/support/test_utils.py +2 -2
  108. hcs_cli/support/test_utils2.py +536 -0
  109. {hcs_cli-0.1.317.dist-info → hcs_cli-0.1.319.dist-info}/METADATA +24 -17
  110. {hcs_cli-0.1.317.dist-info → hcs_cli-0.1.319.dist-info}/RECORD +112 -108
  111. {hcs_cli-0.1.317.dist-info → hcs_cli-0.1.319.dist-info}/WHEEL +0 -0
  112. {hcs_cli-0.1.317.dist-info → hcs_cli-0.1.319.dist-info}/entry_points.txt +0 -0
@@ -1,17 +1,14 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "exception": "simulated-error"
3
8
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "exception": "simulated-error"
10
- },
11
- "enabled": true,
12
- "labels": {
13
- },
14
- "name": "probe03-dummy-exception",
15
- "type": "TEST_DUMMY"
16
- }
17
- }
9
+ "enabled": true,
10
+ "labels": {},
11
+ "name": "probe03-dummy-exception",
12
+ "type": "TEST_DUMMY"
13
+ }
14
+ }
@@ -1,17 +1,14 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "repeat": "PT2S"
3
8
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "repeat": "PT2S"
10
- },
11
- "enabled": true,
12
- "labels": {
13
- },
14
- "name": "probe04-dummy-success-repeat",
15
- "type": "TEST_DUMMY"
16
- }
17
- }
9
+ "enabled": true,
10
+ "labels": {},
11
+ "name": "probe04-dummy-success-repeat",
12
+ "type": "TEST_DUMMY"
13
+ }
14
+ }
@@ -1,18 +1,15 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "returnCode": "123",
8
+ "repeat": "PT2S"
3
9
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "returnCode": "123",
10
- "repeat": "PT2S"
11
- },
12
- "enabled": true,
13
- "labels": {
14
- },
15
- "name": "probe05-dummy-fail-repeat",
16
- "type": "TEST_DUMMY"
17
- }
18
- }
10
+ "enabled": true,
11
+ "labels": {},
12
+ "name": "probe05-dummy-fail-repeat",
13
+ "type": "TEST_DUMMY"
14
+ }
15
+ }
@@ -1,18 +1,15 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "exception": "simulated-error",
8
+ "repeat": "PT2S"
3
9
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "exception": "simulated-error",
10
- "repeat": "PT2S"
11
- },
12
- "enabled": true,
13
- "labels": {
14
- },
15
- "name": "probe06-dummy-exception-repeat",
16
- "type": "TEST_DUMMY"
17
- }
18
- }
10
+ "enabled": true,
11
+ "labels": {},
12
+ "name": "probe06-dummy-exception-repeat",
13
+ "type": "TEST_DUMMY"
14
+ }
15
+ }
@@ -1,17 +1,14 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "delay": "PT5S"
3
8
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "delay": "PT5S"
10
- },
11
- "enabled": true,
12
- "labels": {
13
- },
14
- "name": "probe07-dummy-delay",
15
- "type": "TEST_DUMMY"
16
- }
17
- }
9
+ "enabled": true,
10
+ "labels": {},
11
+ "name": "probe07-dummy-delay",
12
+ "type": "TEST_DUMMY"
13
+ }
14
+ }
@@ -1,17 +1,14 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "my-message": "hello"
3
8
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "my-message": "hello"
10
- },
11
- "enabled": true,
12
- "labels": {
13
- },
14
- "name": "probe08-dummy-property",
15
- "type": "TEST_DUMMY"
16
- }
17
- }
9
+ "enabled": true,
10
+ "labels": {},
11
+ "name": "probe08-dummy-property",
12
+ "type": "TEST_DUMMY"
13
+ }
14
+ }
@@ -1,17 +1,14 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "www.omnissa.com:443"
3
8
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "www.omnissa.com:443"
10
- },
11
- "enabled": true,
12
- "labels": {
13
- },
14
- "name": "probe20-connect-success",
15
- "type": "TEST_CONNECT"
16
- }
17
- }
9
+ "enabled": true,
10
+ "labels": {},
11
+ "name": "probe20-connect-success",
12
+ "type": "TEST_CONNECT"
13
+ }
14
+ }
@@ -1,17 +1,14 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "www.vmware123456.com:12345"
3
8
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "www.vmware123456.com:12345"
10
- },
11
- "enabled": true,
12
- "labels": {
13
- },
14
- "name": "probe21-connect-fail",
15
- "type": "TEST_CONNECT"
16
- }
17
- }
9
+ "enabled": true,
10
+ "labels": {},
11
+ "name": "probe21-connect-fail",
12
+ "type": "TEST_CONNECT"
13
+ }
14
+ }
@@ -1,18 +1,15 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "https://www.omnissa.com/",
8
+ "verify_ssl": true
3
9
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "https://www.omnissa.com/",
10
- "verify_ssl": true
11
- },
12
- "enabled": true,
13
- "labels": {
14
- },
15
- "name": "probe30-ssl-success",
16
- "type": "TEST_SSL"
17
- }
10
+ "enabled": true,
11
+ "labels": {},
12
+ "name": "probe30-ssl-success",
13
+ "type": "TEST_SSL"
14
+ }
18
15
  }
@@ -1,18 +1,15 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "https://self-signed.badssl.com/",
8
+ "verify_ssl": true
3
9
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "https://self-signed.badssl.com/",
10
- "verify_ssl": true
11
- },
12
- "enabled": true,
13
- "labels": {
14
- },
15
- "name": "probe31-ssl-fail",
16
- "type": "TEST_SSL"
17
- }
18
- }
10
+ "enabled": true,
11
+ "labels": {},
12
+ "name": "probe31-ssl-fail",
13
+ "type": "TEST_SSL"
14
+ }
15
+ }
@@ -1,17 +1,14 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "https://www.omnissa.com/"
3
8
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "https://www.omnissa.com/"
10
- },
11
- "enabled": true,
12
- "labels": {
13
- },
14
- "name": "probe40-http-success",
15
- "type": "TEST_HTTP"
16
- }
17
- }
9
+ "enabled": true,
10
+ "labels": {},
11
+ "name": "probe40-http-success",
12
+ "type": "TEST_HTTP"
13
+ }
14
+ }
@@ -1,17 +1,14 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "https://www.omnissa.com/some-inexist-url"
3
8
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "https://www.omnissa.com/some-inexist-url"
10
- },
11
- "enabled": true,
12
- "labels": {
13
- },
14
- "name": "probe41-http-fail",
15
- "type": "TEST_HTTP"
16
- }
17
- }
9
+ "enabled": true,
10
+ "labels": {},
11
+ "name": "probe41-http-fail",
12
+ "type": "TEST_HTTP"
13
+ }
14
+ }
@@ -1,21 +1,15 @@
1
1
  {
2
- "alertPolicy": {},
3
- "notificationConfig": {},
4
- "outpostIds": [],
5
- "testConfig": {
6
- "data": {
7
- "target": "https://www.omnissa.com/some-inexist-url",
8
- "expected_status_codes": [
9
- 404,
10
- 403,
11
- 202,
12
- 200,
13
- 301
14
- ]
15
- },
16
- "enabled": true,
17
- "labels": {},
18
- "name": "probe42-http-status-code",
19
- "type": "TEST_HTTP"
20
- }
21
- }
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "https://www.omnissa.com/some-inexist-url",
8
+ "expected_status_codes": [404, 403, 202, 200, 301]
9
+ },
10
+ "enabled": true,
11
+ "labels": {},
12
+ "name": "probe42-http-status-code",
13
+ "type": "TEST_HTTP"
14
+ }
15
+ }
@@ -1,18 +1,15 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "localhost",
8
+ "count": 1
3
9
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "localhost",
10
- "count": 1
11
- },
12
- "enabled": true,
13
- "labels": {
14
- },
15
- "name": "probe10-ping-success",
16
- "type": "TEST_PING"
17
- }
18
- }
10
+ "enabled": true,
11
+ "labels": {},
12
+ "name": "probe10-ping-success",
13
+ "type": "TEST_PING"
14
+ }
15
+ }
@@ -1,18 +1,15 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "127.0.0.333",
8
+ "count": 1
3
9
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "127.0.0.333",
10
- "count": 1
11
- },
12
- "enabled": true,
13
- "labels": {
14
- },
15
- "name": "probe11-ping-fail",
16
- "type": "TEST_PING"
17
- }
10
+ "enabled": true,
11
+ "labels": {},
12
+ "name": "probe11-ping-fail",
13
+ "type": "TEST_PING"
14
+ }
18
15
  }
@@ -1,19 +1,16 @@
1
1
  {
2
- "alertPolicy": {
2
+ "alertPolicy": {},
3
+ "notificationConfig": {},
4
+ "outpostIds": [],
5
+ "testConfig": {
6
+ "data": {
7
+ "target": "localhost",
8
+ "count": 1,
9
+ "repeat": "PT2S"
3
10
  },
4
- "notificationConfig": {
5
- },
6
- "outpostIds": [],
7
- "testConfig": {
8
- "data": {
9
- "target": "localhost",
10
- "count": 1,
11
- "repeat": "PT2S"
12
- },
13
- "enabled": true,
14
- "labels": {
15
- },
16
- "name": "probe12-ping-success-repeat",
17
- "type": "TEST_PING"
18
- }
19
- }
11
+ "enabled": true,
12
+ "labels": {},
13
+ "name": "probe12-ping-success-repeat",
14
+ "type": "TEST_PING"
15
+ }
16
+ }
@@ -22,7 +22,6 @@ from hcs_core.util import pki_util
22
22
 
23
23
 
24
24
  def deploy(data: dict, state: dict, save_state) -> dict:
25
-
26
25
  cn = data["cn"]
27
26
 
28
27
  temp_dir = tempfile.gettempdir()
@@ -150,7 +150,7 @@ def refresh(data: dict, state: dict) -> dict:
150
150
  if id:
151
151
  edge = admin.edge.get(id, org_id)
152
152
  if not edge:
153
- edges = admin.edge.list(org_id, search=f'name $eq {data["name"]}')
153
+ edges = admin.edge.list(org_id, search=f"name $eq {data['name']}")
154
154
  if edges:
155
155
  edge = edges[0]
156
156
 
@@ -26,6 +26,11 @@ def deploy(data: dict, state: dict, save_state) -> dict:
26
26
  else:
27
27
  deployment = state
28
28
  id = deployment["id"]
29
+
30
+ _wait = data.get("_wait", True)
31
+ if not _wait:
32
+ return deployment
33
+
29
34
  try:
30
35
  deployment = admin.uag.wait_for_ready(id, org_id, "10m")
31
36
  except Exception as e:
@@ -43,7 +48,7 @@ def refresh(data: dict, state: dict) -> dict:
43
48
  ret = admin.uag.get(id, org_id)
44
49
  if ret:
45
50
  return ret
46
- search = f'name $eq {data["name"]}'
51
+ search = f"name $eq {data['name']}"
47
52
  uags = admin.uag.list(org_id, search=search)
48
53
  if uags:
49
54
  return uags[0]
@@ -11,13 +11,11 @@ _client = hdc_service_client("hoc-diagnostic")
11
11
 
12
12
 
13
13
  def search(payload: dict, size: int = 100):
14
-
15
14
  pointer_timestamp = timeutil.iso_date_to_timestamp(payload["from"])
16
15
  end_timestamp = timeutil.iso_date_to_timestamp(payload["to"])
17
16
 
18
17
  count = 0
19
18
  while pointer_timestamp < end_timestamp and count < size:
20
-
21
19
  payload["from"] = timeutil.timestamp_to_iso_date(pointer_timestamp)
22
20
  # log.info(f"range: from={payload['from']}, to={payload['to']}")
23
21
 
@@ -33,7 +31,6 @@ def search(payload: dict, size: int = 100):
33
31
 
34
32
  # _old = count
35
33
  for item in page:
36
-
37
34
  data = item["data"]
38
35
 
39
36
  count += 1
@@ -1,2 +1,2 @@
1
- from .session import assign, deassign, logoff, sessions
1
+ from .session import assign, assignV2, create_manual_session, deassign, logoff, logoffV2, sessions, update_session
2
2
  from .vm import count, get, list, raw_list, update
@@ -28,22 +28,38 @@ def sessions(template_id: str, vm_id: str, org_id: str, **kwargs):
28
28
 
29
29
 
30
30
  def assign(payload):
31
- # https://horizonv2-sg.devframe.cp.horizon.vmware.com/inventory/swagger-ui/#/Inventory/assign
31
+ # https://horizonv2-sg.devframe.cp.horizon.omnissa.com/inventory/swagger-ui/#/Inventory/assign
32
32
  url = "/v1/assign"
33
33
  return _client.post(url, payload)
34
34
 
35
35
 
36
36
  def assignV2(payload):
37
- # https://horizonv2-sg.devframe.cp.horizon.vmware.com/inventory/swagger-ui/#/Inventory/assign
37
+ # https://horizonv2-sg.devframe.cp.horizon.omnissa.com/inventory/swagger-ui/#/Inventory/assign
38
38
  url = "/v2/assign"
39
39
  return _client.post(url, payload)
40
40
 
41
41
 
42
- def deassign(payload):
43
- # https://horizonv2-sg.devframe.cp.horizon.vmware.com/inventory/swagger-ui/#/Inventory/deassign
44
- url = "/v1/deassign"
42
+ def deassign(template_id: str, org_id: str, payload):
43
+ # https://horizonv2-sg.devframe.cp.horizon.omnissa.com/inventory/swagger-ui/#/Inventory/deassign
44
+ url = f"/v1/{template_id}/deassign?org_id={org_id}"
45
45
  return _client.post(url, payload)
46
46
 
47
47
 
48
- def logoff(template_id: str, vm_id: str, org_id: str):
49
- return "TODO: hcs_cli.service.inventory.logoff"
48
+ def logoff(template_id: str, org_id: str, payload: dict):
49
+ url = f"/v1/{template_id}/logoff?org_id={org_id}"
50
+ return _client.post(url, payload)
51
+
52
+
53
+ def logoffV2(org_id: str, payload: dict):
54
+ url = f"/v2/logoff?org_id={org_id}"
55
+ return _client.post(url, payload)
56
+
57
+
58
+ def update_session(org_id: str, template_id: str, payload: dict):
59
+ url = f"/v1/{template_id}/sessionUpdate?org_id={org_id}"
60
+ return _client.post(url, payload)
61
+
62
+
63
+ def create_manual_session(org_id: str, template_id: str, edge_id: str, payload: dict):
64
+ url = f"/v1/{template_id}/session?org_id={org_id}&edge_id={edge_id}"
65
+ return _client.post(url, payload)
hcs_cli/service/lcm/vm.py CHANGED
@@ -102,7 +102,6 @@ def wait_for(
102
102
 
103
103
 
104
104
  def wait_for_deleted(template_id: str, vm_id: str, org_id: str, timeout: str):
105
-
106
105
  name = f"{template_id}/{vm_id}"
107
106
 
108
107
  def fn_get():
hcs_cli/service/task.py CHANGED
@@ -114,7 +114,6 @@ _scm_client = hdc_service_client("scm")
114
114
 
115
115
 
116
116
  def query(namespace: str, fn_filter: Callable = None, **kwargs) -> List[TaskModel]:
117
-
118
117
  kwargs["size"] = kwargs.get("size", 50)
119
118
 
120
119
  def _get_page(query_string):
@@ -44,7 +44,6 @@ def restart_service(service_name: str, old_pod_id: str):
44
44
 
45
45
 
46
46
  def kubectl_patch(service_name: str, patch_params: list):
47
-
48
47
  service_full_name = get_service_full_name(service_name)
49
48
  # Formulate the Kubernetes patch command
50
49
  patch_command = ["kubectl", "patch", service_full_name] + patch_params
@@ -22,7 +22,6 @@ from hcs_core.plan import PlanException
22
22
 
23
23
 
24
24
  def load_plan(file):
25
-
26
25
  if not file:
27
26
  file = _try_locating_plan_file()
28
27
  else: