hcs-cli 0.1.320__py3-none-any.whl → 0.1.321__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.
hcs_cli/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
- __version__ = "0.1.320"
1
+ __version__ = "0.1.321"
2
2
 
3
3
  from . import service as service # noqa: F401
@@ -75,7 +75,7 @@ stringData:
75
75
  JcSvTMU2HOuQ/q6vFZq3PRbvroMeXlw2WJrqO3vu04SZwYiP8dcrlHTXQJh+Mp9T
76
76
  mQ==
77
77
  -----END CERTIFICATE-----
78
- mqtt.ca-key: |-
78
+ mqtt.ca-key: |-
79
79
  -----BEGIN PRIVATE KEY-----
80
80
  MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDUNJx2Cf0noNHc
81
81
  DXB9AFPSFMkkpwxb0wtqaCLiB7v5zkF7CVBl5LnecVk7CM8bJY62H90Lv8Zv/2sl
@@ -104,7 +104,7 @@ stringData:
104
104
  boPQ+RK1VKj5UFkUKz5LiohLmCBEQ7sh1HBS2Vje8MFtg0P138sRlbMCvdAEARTZ
105
105
  uQfAKLns7QFf9W1C60AVAQ==
106
106
  -----END PRIVATE KEY-----
107
- mqtt.client-cert: |-
107
+ mqtt.client-cert: |-
108
108
  -----BEGIN CERTIFICATE-----
109
109
  MIIFKDCCAxCgAwIBAgIFALjj4O4wDQYJKoZIhvcNAQELBQAwdTELMAkGA1UEBhMC
110
110
  VVMxCzAJBgNVBAgMAkNBMR8wHQYDVQQKDBZIb3Jpem9uIENsb3VkIFNlcnZpY2Vz
@@ -204,7 +204,7 @@ stringData:
204
204
  JcSvTMU2HOuQ/q6vFZq3PRbvroMeXlw2WJrqO3vu04SZwYiP8dcrlHTXQJh+Mp9T
205
205
  mQ==
206
206
  -----END CERTIFICATE-----
207
- mqtt.client-key: |-
207
+ mqtt.client-key: |-
208
208
  -----BEGIN PRIVATE KEY-----
209
209
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC40aC4pyy0+++D
210
210
  kD1cPRsMWO4ANZ8L4LaaHcg/e/1NbiExd/QlZESNJnnIyD29qY1h9WGEVDHtInsl
hcs_cli/cmds/hoc/stats.py CHANGED
@@ -1,6 +1,8 @@
1
1
  import click
2
- import time
2
+ import datetime
3
3
  import json
4
+ import time
5
+
4
6
  from hcs_cli.service.hoc import diagnostic
5
7
  from hcs_cli.service import tsctl
6
8
 
@@ -22,25 +24,49 @@ def aggregate_connects(from_: int, to: int, wait: bool, verbose: bool):
22
24
  return "", 1
23
25
 
24
26
  if wait:
25
- print("Waiting for task to complete...")
26
- totalWaitTime = 0
27
- while True:
28
- time.sleep(10)
29
- taskStatus = tsctl.task.lastlog(result.namespace, result.group, result.taskKey)
30
- if "state" in taskStatus and taskStatus.state == "Error":
31
- print(f"Task is in {taskStatus.state} state - {taskStatus.error} ")
32
- print(json.dumps(taskStatus, indent=2))
33
- break
34
- if "state" in taskStatus and taskStatus.state == "Success":
35
- print("Task completed successfully.")
36
- print(json.dumps(taskStatus, indent=2))
37
- break
38
- if ("state" in taskStatus and taskStatus.state == "") or "state" not in taskStatus:
39
- print("Task is still in progress...")
40
- totalWaitTime += 10
41
- if totalWaitTime >= 600:
42
- print("Waited for 10 minutes, exiting.")
43
- break
44
- continue
27
+ wait_for_task(result)
28
+
29
+
30
+ @click.command(name="stats-aggregate-connects-day-before")
31
+ @click.option("--wait", type=bool, required=False, is_flag=True, default=False)
32
+ @click.option("--verbose", type=bool, required=False, is_flag=True, default=False)
33
+ def aggregate_connects_day_before(wait: bool, verbose: bool):
34
+ dt = datetime.datetime.utcnow().replace(hour=0, minute=0, second=0, microsecond=0)
35
+ dt_2_days_ago = dt - datetime.timedelta(days=2)
36
+ dt_1_day_ago = dt - datetime.timedelta(days=1)
37
+
38
+ print(f"Aggregating connect events from {dt_2_days_ago} to {dt_1_day_ago}")
39
+ from_ = int(dt_2_days_ago.timestamp())
40
+ to = int(dt_1_day_ago.timestamp())
41
+ payload = {"from": from_, "to": to}
42
+ result = diagnostic.aggregateConnects(payload, verbose=verbose)
43
+ click.echo(result)
44
+ if not result:
45
+ return "", 1
46
+ if wait:
47
+ wait_for_task(result)
48
+
49
+
50
+ def wait_for_task(result: dict):
51
+ print("Waiting for task to complete...")
52
+ totalWaitTime = 0
53
+ while True:
54
+ time.sleep(10)
55
+ taskStatus = tsctl.task.lastlog(result.namespace, result.group, result.taskKey)
56
+ if "state" in taskStatus and taskStatus.state == "Error":
57
+ print(f"Task is in {taskStatus.state} state - {taskStatus.error} ")
45
58
  print(json.dumps(taskStatus, indent=2))
46
59
  break
60
+ if "state" in taskStatus and taskStatus.state == "Success":
61
+ print("Task completed successfully.")
62
+ print(json.dumps(taskStatus, indent=2))
63
+ break
64
+ if ("state" in taskStatus and taskStatus.state == "") or "state" not in taskStatus:
65
+ print("Task is still in progress...")
66
+ totalWaitTime += 10
67
+ if totalWaitTime >= 600:
68
+ print("Waited for 10 minutes, exiting.")
69
+ break
70
+ continue
71
+ print(json.dumps(taskStatus, indent=2))
72
+ break
hcs_cli/cmds/task.py CHANGED
@@ -222,6 +222,7 @@ def use(namespace: str, group: str, smart_path: str, reset: bool, **kwargs):
222
222
  required=False,
223
223
  help="Filter tasks by state, for one-time tasks only. Comma separated values. E.g. Init,Running,Canceled,Error,Success",
224
224
  )
225
+ @click.option("--v1", is_flag=True, default=False, required=False, help="Use v1 task API.")
225
226
  @click.option("--v1log", is_flag=True, default=False, required=False, help="Fetch last log for v1 tasks.")
226
227
  @cli.limit
227
228
  @cli.search
@@ -62,6 +62,7 @@
62
62
  "properties": {
63
63
  "azureCreateResourceGroup": true,
64
64
  "new-task-engine": true,
65
- "simulateAgentStatus": "AVAILABLE"
65
+ "simulateAgentStatus": "AVAILABLE",
66
+ "countinuousErrorThreshold": 3
66
67
  }
67
68
  }
@@ -56,8 +56,9 @@
56
56
  }
57
57
  },
58
58
  "properties": {
59
- "new-task-engine": false,
59
+ "new-task-engine": true,
60
60
  "sg-lcm-enforced-provision": true,
61
- "autonomous": true
61
+ "autonomous": true,
62
+ "countinuousErrorThreshold": 2
62
63
  }
63
64
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcs-cli
3
- Version: 0.1.320
3
+ Version: 0.1.321
4
4
  Summary: Horizon Cloud Service CLI.
5
5
  Project-URL: Homepage, https://github.com/euc-eng/hcs-cli
6
6
  Project-URL: Bug Tracker, https://github.com/euc-eng/hcs-cli/issues
@@ -14,7 +14,7 @@ Classifier: License :: OSI Approved :: MIT License
14
14
  Classifier: Operating System :: OS Independent
15
15
  Classifier: Programming Language :: Python :: 3
16
16
  Requires-Python: >=3.9
17
- Requires-Dist: hcs-core>=0.1.320
17
+ Requires-Dist: hcs-core>=0.1.321
18
18
  Requires-Dist: inquirerpy>=0.3.4
19
19
  Requires-Dist: matplotlib>=3.8.0
20
20
  Requires-Dist: paho-mqtt>=2.1.0
@@ -1,4 +1,4 @@
1
- hcs_cli/__init__.py,sha256=KGt1FSybqqR9F0iFShUwDeQvzuouHTYizbwM6AZbN64,72
1
+ hcs_cli/__init__.py,sha256=dX6e1kri6Gcqjvlr5u1l5USUlOgjbOKPHS5vP_FG78Y,72
2
2
  hcs_cli/__main__.py,sha256=lwPXLjh1OpOs4doVLJJ6_3XHtC-VqDOXiw45hvAQorM,684
3
3
  hcs_cli/main.py,sha256=0NmRcidxNxtJatS_prEKQ4_6bqu-l8UkLhAPOXW3uyc,3537
4
4
  hcs_cli/cmds/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -7,7 +7,7 @@ hcs_cli/cmds/inspect.py,sha256=QBhBOkf2mHlGhgAhY9FXCfvViL2p4D3BudoKjyADdfE,659
7
7
  hcs_cli/cmds/login.py,sha256=dj42jDrKktt4bUqSD0Xj6Jo9ZSI7M9v9R280YavWpuc,11165
8
8
  hcs_cli/cmds/logout.py,sha256=BxU-K1cIkdBpAAp6SGuwEqECL6g20l9CqEcSX-3pZag,744
9
9
  hcs_cli/cmds/query.py,sha256=hh1TVeSkvRiB07fqIA3GGpEBtP3XMz5XCmAGTXD7FOM,9302
10
- hcs_cli/cmds/task.py,sha256=7w54riLLH-RFiqd-jeDNUsB9pSY3BtrWYD9AJMlD5-g,19472
10
+ hcs_cli/cmds/task.py,sha256=YIZUjDzHZaNCbmAt589Nzp8s7NMsBI7w_a33l109iy8,19564
11
11
  hcs_cli/cmds/test.py,sha256=Kkpe3wV3ViRRAKeMO5IBwjTysEsKzZXP46OXNb-GhxE,1309
12
12
  hcs_cli/cmds/upgrade.py,sha256=iJYSyxyNBhiss0u605nD6jpYUdoDhjfIeJP98zSeDf4,931
13
13
  hcs_cli/cmds/ad/__init__.py,sha256=wC4uftNZRN3bo9SrRHNNE1tzE0x3B1mCXcIzARm73gI,636
@@ -89,7 +89,7 @@ hcs_cli/cmds/dev/fs/provided_files/__init__.py,sha256=AC-hl0F-5R4V2uejk5FzFDlvT7
89
89
  hcs_cli/cmds/dev/fs/provided_files/akka.plan.yml,sha256=IBBuxU-oxiFfEMhpOB7uK9IMoHsRVwlcnKwPPfbPnyw,12486
90
90
  hcs_cli/cmds/dev/fs/provided_files/azsim.plan.yml,sha256=rnjNWSnhaYr19tlKoxGjvKTlhs2pYA2NRC-dC3kIzYE,17220
91
91
  hcs_cli/cmds/dev/fs/provided_files/azure.plan.yml,sha256=4-ghUgskCyeM-G0kvWb_AW1ywlN9wKN_kC3XSWfryY8,31561
92
- hcs_cli/cmds/dev/fs/provided_files/mqtt-secret.yaml,sha256=46O-pJOKhJ5LyPFw6wiqWEFmRrv_9JwTKQPxmbq2Ro4,14945
92
+ hcs_cli/cmds/dev/fs/provided_files/mqtt-secret.yaml,sha256=lJI6N4e3ogiZ9BpyjWUHqj3KfbGs7WUdYuaPt1D8TLw,14939
93
93
  hcs_cli/cmds/dev/fs/provided_files/mqtt-server-external.yaml,sha256=gtYLY9pgMCeJthYmTXrLjd3xITf4b2keesyQ8VBAar8,612
94
94
  hcs_cli/cmds/dev/fs/provided_files/patch-mqtt-hostname.yml,sha256=YuwUPj5QtZo1dKOqNsh72EVXdVBxr2ZQBcW4gyX0agY,212
95
95
  hcs_cli/cmds/dev/fs/provided_files/patch-vernemq-ssl-depth.json,sha256=jDuQLeen8aJ656gfJhk16aGyUCbOLt7VJq9AuUezNE4,441
@@ -116,7 +116,7 @@ hcs_cli/cmds/hoc/connect.py,sha256=GvXfbB1JhAZRnl1_H1oxCAhAMCP9jtJgAlhVy9ggYNc,5
116
116
  hcs_cli/cmds/hoc/oncall.py,sha256=yc7s94Ti21QDm6WZAbuzB21GsGwced5jLrfmvkV8J2c,575
117
117
  hcs_cli/cmds/hoc/org.py,sha256=fi2rjO4hLuJuLSinWG3s8-dTdAj9EIrIFcN82LM8mtI,570
118
118
  hcs_cli/cmds/hoc/search.py,sha256=yQk1BTp6sSPer8YdCqNd458CpwuJ5PM50_3yjwv8T7g,5447
119
- hcs_cli/cmds/hoc/stats.py,sha256=dUhTWzj9w2Pwe18Iw5RX4lN6LVG3zgG8fvbwtXQh29s,1794
119
+ hcs_cli/cmds/hoc/stats.py,sha256=QEnAULDIhvsEgMLJg4Ql9cI6wUqd0zQW2QjwBWwXdno,2641
120
120
  hcs_cli/cmds/hoc/template.py,sha256=M9bPYDuPfYQjjR8SYS4r4NknckSAfrMJGW6GeczCZvw,574
121
121
  hcs_cli/cmds/hoc/vm.py,sha256=YjijTxpSbnUKyCtsc9wIYDYZULM4RKo2JfROdilmNvk,664
122
122
  hcs_cli/cmds/hoc/util/__init__.py,sha256=AC-hl0F-5R4V2uejk5FzFDlvT7uKGfjQyWq0quSznQs,14
@@ -317,7 +317,7 @@ hcs_cli/payload/inventory/deassign.json,sha256=evl-Nt-6Sc4Mm-F9YS734H1x0aIrf7N3W
317
317
  hcs_cli/payload/iss/__init__.py,sha256=4kFVMPKtDxlxFWs6qXrhBJjgEJesuGTCjBBm2a4JsBM,600
318
318
  hcs_cli/payload/lcm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
319
319
  hcs_cli/payload/lcm/akka.json,sha256=_PUNdUO2CFj5AimOWkgc1zvVxy1hrWNq99YHYP3hxhA,673
320
- hcs_cli/payload/lcm/azure-dummy.json,sha256=OZ1sDNBkKrM7Yve-D_byrzYdFvvsjX3ITLwv9hefDA0,1583
320
+ hcs_cli/payload/lcm/azure-dummy.json,sha256=fu4hSSGBSoKZD6kHPm62TQ3xSTFhCCD7-NRkDMRHTSI,1619
321
321
  hcs_cli/payload/lcm/azure-real.json,sha256=QF9TdNKdLQRWjDC610LbU1-DWzxbncTBu0MEUPIiVxI,1561
322
322
  hcs_cli/payload/lcm/edge-proxy.json,sha256=PAlwNpkN9HJ-PZ5PEMM8sc_O_eSABcyktAiOoohlTQk,744
323
323
  hcs_cli/payload/lcm/zero-dedicated.json,sha256=U8n2KPjPNLMe0ywyfbpu5gRwYI03CexidJrX_gTMCog,782
@@ -330,16 +330,16 @@ hcs_cli/payload/lcm/zero-fail-prepare.json,sha256=p3uVwSGTwXC6iXhsH66fFjiG6vJeK-
330
330
  hcs_cli/payload/lcm/zero-fail-vm-onthread.json,sha256=vty-OqyRhtItWNj1opWfQwL5HK75KTmjg0uFxnAF5yk,1307
331
331
  hcs_cli/payload/lcm/zero-fail-vm.json,sha256=VSFgt4dAlRu52uz5BZmavvkr1kBarOt2d345AtA00xw,1307
332
332
  hcs_cli/payload/lcm/zero-floating.json,sha256=8fO_5C3eNoBlI8RD8cZPP_XB6ZJeyq_U-7Nw8A8bHO0,780
333
+ hcs_cli/payload/lcm/zero-legacy.json,sha256=E3hA0bCnQx29mQQFtjdKuC2R_-IqaPDGItcL6WPugf4,886
333
334
  hcs_cli/payload/lcm/zero-manual.json,sha256=SLez__1qO1eMLZW-9GOnxEXTWrfd5TQFmNCb-J9SGEI,741
334
335
  hcs_cli/payload/lcm/zero-multisession.json,sha256=OtB7KC5VlrQvWRjtiYQijTwu-jjtoCcaGFQmVBijerM,788
335
336
  hcs_cli/payload/lcm/zero-nanw.json,sha256=ALsXhqTeUN8q4xqiDgWk3RiWZXVUVyyrrUj14_lFisE,720
336
337
  hcs_cli/payload/lcm/zero-new-5k-delay.json,sha256=UOh6E0FUks6Ozo0EjjhCAjhD7R7gyKdT2sTEhMy9DcY,1571
337
338
  hcs_cli/payload/lcm/zero-new-5k.json,sha256=fgiZbLr2cPoLCfLdn2uNFp_GxROHIiadUlbhDqEbESQ,828
338
339
  hcs_cli/payload/lcm/zero-new-snapshot.json,sha256=E3hA0bCnQx29mQQFtjdKuC2R_-IqaPDGItcL6WPugf4,886
339
- hcs_cli/payload/lcm/zero-new.json,sha256=E3hA0bCnQx29mQQFtjdKuC2R_-IqaPDGItcL6WPugf4,886
340
340
  hcs_cli/payload/lcm/zero-reuse-vm-id.json,sha256=WWbPUijukAaS1ADz8AnEhU5U0s6qKUdbBU1v29HbhS4,716
341
341
  hcs_cli/payload/lcm/zero-with-max-id-offset.json,sha256=fo6JO-QHV7ln8rKswhhLZ67v_9skeW1HwZXgaNzPsuc,698
342
- hcs_cli/payload/lcm/zero.json,sha256=RF6pjji0RGjp85UJ32PXrqC3_b8yPPFA1LCiqNAztY0,1353
342
+ hcs_cli/payload/lcm/zero.json,sha256=sS5X5FPkU0mSO-PeGPcJobFoxtC2FJFznqPuXq6ZmW4,1388
343
343
  hcs_cli/payload/provider/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
344
344
  hcs_cli/payload/provider/ad-stes-vsphere.json,sha256=GgjpDxQY4X_fQNY46-fls0248nuhEgPu6qOcA9MbI0Y,717
345
345
  hcs_cli/payload/provider/akka.json,sha256=pKRZT9aOx0irx-28iUFNNwdQ-s1sNgVPCMz7RdASKTM,284
@@ -495,7 +495,7 @@ hcs_cli/support/vm_table.py,sha256=hqNUKLVUuBiuDwlqcAQ7uAT1-4z6ZYOIGRcFWn8lnAo,2
495
495
  hcs_cli/support/scm/html_util.py,sha256=clgMpM90HxRRs3D9ORYYNB57AYh7y_-UzJrB4KX3dsY,458
496
496
  hcs_cli/support/scm/plan-editor.html.template,sha256=qXhHYjBsG8uaVlMkc0gnCePoSV3w5NyTkaLhXV9jlC0,26874
497
497
  hcs_cli/support/scm/plan_editor.py,sha256=pZtm9X_R-vs2JxJ_NX7-wTAoY-nhI-gFqhcyVDdEZVM,3108
498
- hcs_cli-0.1.320.dist-info/METADATA,sha256=e-uiHIvnrihL7rR2qbqQbpO1aZpXIYuZCdrBH5s4dtg,3614
499
- hcs_cli-0.1.320.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
500
- hcs_cli-0.1.320.dist-info/entry_points.txt,sha256=5uH-af1WUETSBSer2bu4YMGQNY5RriJHsjepb8ACiX8,42
501
- hcs_cli-0.1.320.dist-info/RECORD,,
498
+ hcs_cli-0.1.321.dist-info/METADATA,sha256=llYPP2ShA7g1sBAPChU2L8BaF62Yq0ozSKHZ0xFVieQ,3614
499
+ hcs_cli-0.1.321.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
500
+ hcs_cli-0.1.321.dist-info/entry_points.txt,sha256=5uH-af1WUETSBSer2bu4YMGQNY5RriJHsjepb8ACiX8,42
501
+ hcs_cli-0.1.321.dist-info/RECORD,,
File without changes