hcs-cli 0.1.331__py3-none-any.whl → 0.1.332__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.331"
1
+ __version__ = "0.1.332"
2
2
 
3
3
  from . import service as service # noqa: F401
hcs_cli/cmds/task.py CHANGED
@@ -495,12 +495,15 @@ def list_tasks(
495
495
  @cli.org_id
496
496
  @click.option("--namespace", "-n", type=str, required=False)
497
497
  @click.option("--group", "-g", type=str, required=False)
498
+ @click.option(
499
+ "--location", hidden=True, type=str, required=False, help="Task location, only for global scheduler. E.g. US, JP, IN, AU, DE, IE."
500
+ ) # to be removed later
498
501
  @click.argument("smart_path", type=str, required=False)
499
- def get(org: str, namespace: str, group: str, smart_path: str, **kwargs):
502
+ def get(org: str, namespace: str, group: str, location: str, smart_path: str, **kwargs):
500
503
  """Get a task. E.g. 'task get [[<namespace>/]<group>/]<key>'."""
501
504
  namespace, group, key = _parse_task_param(namespace, group, smart_path)
502
505
  org_id = cli.get_org_id(org)
503
- return task.get(org_id, namespace, group, key, **kwargs)
506
+ return task.get(org_id, namespace, group, key, location=location, **kwargs)
504
507
 
505
508
 
506
509
  @task_cmd_group.command()
@@ -551,7 +554,9 @@ def get_logs(org: str, namespace: str, group: str, smart_path: str, last: bool,
551
554
  if state and last:
552
555
  return "--state cannot be used with --last.", 1
553
556
 
554
- if org == "all" or org is None:
557
+ if last and org is None:
558
+ org_id = cli.get_org_id(org)
559
+ elif org == "all" or org is None:
555
560
  org_id = None
556
561
  else:
557
562
  org_id = cli.get_org_id(org)
@@ -568,7 +573,7 @@ def get_logs(org: str, namespace: str, group: str, smart_path: str, last: bool,
568
573
  search = state_search
569
574
 
570
575
  if last:
571
- t = task.last(org_id, namespace, group, key, **kwargs)
576
+ t = task.last(org_id, namespace, group, key)
572
577
  if t:
573
578
  return t.log
574
579
  else:
hcs_cli/service/task.py CHANGED
@@ -312,7 +312,7 @@ def _get_v1(namespace: str, group: str, key: str) -> Optional[TaskModel]:
312
312
  return t
313
313
 
314
314
 
315
- def _get_v2(org_id: str, namespace: str, group: str, key: str) -> Optional[TaskModel]:
315
+ def _get_v2(org_id: str, namespace: str, group: str, key: str, location: str = None) -> Optional[TaskModel]:
316
316
  url = f"/v1/tasks/{key}?"
317
317
  if org_id:
318
318
  url += f"&orgId={org_id}"
@@ -320,6 +320,8 @@ def _get_v2(org_id: str, namespace: str, group: str, key: str) -> Optional[TaskM
320
320
  url += f"&namespace={namespace}"
321
321
  if group:
322
322
  url += f"&group={group}"
323
+ if location:
324
+ url += f"&location={location}"
323
325
  t = _scm_client.get(url, type=TaskModel)
324
326
  if not t:
325
327
  return
@@ -333,14 +335,14 @@ def get(org_id: str, namespace: str, group: str, key: str, **kwargs) -> Optional
333
335
  t = _get_v1(namespace, group, key)
334
336
  t.log = _lastlog(org_id, namespace, group, key)
335
337
  elif version == "v2":
336
- t = _get_v2(org_id, namespace, group, key)
338
+ t = _get_v2(org_id, namespace, group, key, location=kwargs.get("location"))
337
339
  else:
338
340
  t = _get_v1(namespace, group, key)
339
341
  if t:
340
342
  t.log = _lastlog(org_id, namespace, group, key)
341
343
  _task_temp_lru[_k] = "v1"
342
344
  else:
343
- t = _get_v2(org_id, namespace, group, key)
345
+ t = _get_v2(org_id, namespace, group, key, location=kwargs.get("location"))
344
346
  if t:
345
347
  _task_temp_lru[_k] = "v2"
346
348
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hcs-cli
3
- Version: 0.1.331
3
+ Version: 0.1.332
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.331
17
+ Requires-Dist: hcs-core>=0.1.332
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=W4Qc1KCSM6Ls-5-EZ-6U4PGhwKirQYirjp25NNYqdR0,72
1
+ hcs_cli/__init__.py,sha256=nPvtkDDB3R6Uz-e6LUQVWGRnxx8UYe4qTvGgMXtbZow,72
2
2
  hcs_cli/__main__.py,sha256=mReIxxxuvlcxzSdPfIgptZ_Qkrg0MPOgT37utukr65g,125
3
3
  hcs_cli/main.py,sha256=CzGoya6yabf5akJ3l0gEzxBmMKznIhxGRXbsngtuPWc,3014
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=0j2VA4cy2pgy6-Rm3ys9JMKHbyrdvCS8tw3LdijM9gk,10606
8
8
  hcs_cli/cmds/logout.py,sha256=FDYXnie1jytnEsFj-XuVSU4sZL9VPzaLO1KHFProX4g,185
9
9
  hcs_cli/cmds/query.py,sha256=hh1TVeSkvRiB07fqIA3GGpEBtP3XMz5XCmAGTXD7FOM,9302
10
- hcs_cli/cmds/task.py,sha256=pHyJNn6YXIW0l1KQBwwWma-YH2b455AXEuCi5h7VsZw,28770
10
+ hcs_cli/cmds/task.py,sha256=N9EYRGoTtCVF2yktD0bmSlugGykRaysdwjNoT2al9jY,29037
11
11
  hcs_cli/cmds/test.py,sha256=rBFbcpUtwxxm6thl7uZGqmZTyCyFRpMO-xa7wExEhuM,755
12
12
  hcs_cli/cmds/upgrade.py,sha256=p1QKlacY5kPIQecN6sFRDXgS-_HrsGu_0Hjb1DXbjgI,377
13
13
  hcs_cli/cmds/ad/__init__.py,sha256=oB4WrRdC96cMS2OXs-1ITr8U_3ylI3QQNKZk51KsMJI,82
@@ -398,7 +398,7 @@ hcs_cli/service/edge.py,sha256=YN5uWrXKARfuOnqCKZQYCVP2BrNiAEDdS2AIIAgQdEo,3714
398
398
  hcs_cli/service/graphql.py,sha256=Vqt4wMeRSPV_2YhGvb9vs0vlac0_fMAhg1BijKX6reg,468
399
399
  hcs_cli/service/pool.py,sha256=aWdW0bRGlE58z95HvdSs7i8kwM79_dzqsrGjtnLv7lA,712
400
400
  hcs_cli/service/site.py,sha256=CMKMAhKaXZ67tFGkg5bPPBHsD3Ud76mOZKh4Vw_nx5g,1014
401
- hcs_cli/service/task.py,sha256=M1P0zwEHSmgg0VH_lxbXwWwUkiZgjBmQLlEjNQMS8Xk,16768
401
+ hcs_cli/service/task.py,sha256=uyewZ4FctrAcdEUbt_mxhcS4iCf3mXz_QAuqdAl8kCE,16912
402
402
  hcs_cli/service/template.py,sha256=qKJ09Toe5NmApgd2H0TcVIoFshz-8fh2j3hDtvMO7z4,2242
403
403
  hcs_cli/service/uag.py,sha256=HabShUiLzZN-VM_UlPbfb4cQiWcgvsn3eB4CVPOzee0,3193
404
404
  hcs_cli/service/vm.py,sha256=Aw1AKvFSPlNTh1VWCdQXf21Yu_tDDao2NhMj5muGzwc,4839
@@ -497,7 +497,7 @@ hcs_cli/support/vm_table.py,sha256=hqNUKLVUuBiuDwlqcAQ7uAT1-4z6ZYOIGRcFWn8lnAo,2
497
497
  hcs_cli/support/scm/html_util.py,sha256=clgMpM90HxRRs3D9ORYYNB57AYh7y_-UzJrB4KX3dsY,458
498
498
  hcs_cli/support/scm/plan-editor.html.template,sha256=HtXMmvIvTixVEYN1gblCeqFTt_F8JF6ltDC11Eb_GMw,46975
499
499
  hcs_cli/support/scm/plan_editor.py,sha256=TxfHyyozoQ_DCyaPrYXFG9n8AnBuUD8753009FUD0GU,8722
500
- hcs_cli-0.1.331.dist-info/METADATA,sha256=US_xIg46rTOm0XF2UyQlgOebnWS-O8xSV0ObwOt3rtA,3222
501
- hcs_cli-0.1.331.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
502
- hcs_cli-0.1.331.dist-info/entry_points.txt,sha256=5uH-af1WUETSBSer2bu4YMGQNY5RriJHsjepb8ACiX8,42
503
- hcs_cli-0.1.331.dist-info/RECORD,,
500
+ hcs_cli-0.1.332.dist-info/METADATA,sha256=HQSDAbv69tNoL5kWve6ZIWmoABWWaPiWx7Yd8zzEfw0,3222
501
+ hcs_cli-0.1.332.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
502
+ hcs_cli-0.1.332.dist-info/entry_points.txt,sha256=5uH-af1WUETSBSer2bu4YMGQNY5RriJHsjepb8ACiX8,42
503
+ hcs_cli-0.1.332.dist-info/RECORD,,