outerbounds 0.3.52rc4__py3-none-any.whl → 0.3.52rc6__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- outerbounds/command_groups/local_setup_cli.py +3 -3
- outerbounds/command_groups/workstations_cli.py +32 -12
- outerbounds/utils/schema.py +1 -1
- {outerbounds-0.3.52rc4.dist-info → outerbounds-0.3.52rc6.dist-info}/METADATA +1 -1
- {outerbounds-0.3.52rc4.dist-info → outerbounds-0.3.52rc6.dist-info}/RECORD +7 -7
- {outerbounds-0.3.52rc4.dist-info → outerbounds-0.3.52rc6.dist-info}/WHEEL +0 -0
- {outerbounds-0.3.52rc4.dist-info → outerbounds-0.3.52rc6.dist-info}/entry_points.txt +0 -0
@@ -788,7 +788,7 @@ def configure(
|
|
788
788
|
help="Show output in the specified format.",
|
789
789
|
type=click.Choice(["json", ""]),
|
790
790
|
)
|
791
|
-
@click.option("--id", default="", help="Perimeter name to switch to")
|
791
|
+
@click.option("--id", default="", type=str, help="Perimeter name to switch to")
|
792
792
|
@click.option(
|
793
793
|
"-f",
|
794
794
|
"--force",
|
@@ -868,10 +868,10 @@ def switch_perimeter(output="", id=None, force=False):
|
|
868
868
|
err=True,
|
869
869
|
)
|
870
870
|
|
871
|
-
ob_config_dict = {"OB_CURRENT_PERIMETER": id}
|
871
|
+
ob_config_dict = {"OB_CURRENT_PERIMETER": str(id)}
|
872
872
|
|
873
873
|
# Now that we have the lock, we can safely write to the file
|
874
|
-
with
|
874
|
+
with open(path_to_config, "w") as file:
|
875
875
|
json.dump(ob_config_dict, file, indent=4)
|
876
876
|
|
877
877
|
click.secho("Perimeter switched to {}".format(id), fg="green", err=True)
|
@@ -196,11 +196,25 @@ def configure_cloud_workstation(config_dir=None, profile=None, binary=None, outp
|
|
196
196
|
default="",
|
197
197
|
help="The named metaflow profile in which your workstation exists",
|
198
198
|
)
|
199
|
-
|
199
|
+
@click.option(
|
200
|
+
"-o",
|
201
|
+
"--output",
|
202
|
+
default="json",
|
203
|
+
help="Show output in the specified format.",
|
204
|
+
type=click.Choice(["json"]),
|
205
|
+
)
|
206
|
+
def list_workstations(config_dir=None, profile=None, output="json"):
|
207
|
+
list_response = OuterboundsCommandResponse()
|
208
|
+
list_step = CommandStatus(
|
209
|
+
"listWorkstations",
|
210
|
+
OuterboundsCommandStatus.OK,
|
211
|
+
"Workstation list successfully fetched!",
|
212
|
+
)
|
213
|
+
list_response.add_or_update_data("workstations", [])
|
214
|
+
|
200
215
|
try:
|
201
216
|
if not profile:
|
202
217
|
profile = metaflowconfig.get_metaflow_profile()
|
203
|
-
|
204
218
|
metaflow_token = metaflowconfig.get_metaflow_token_from_config(
|
205
219
|
config_dir, profile
|
206
220
|
)
|
@@ -210,17 +224,23 @@ def list_workstations(config_dir=None, profile=None):
|
|
210
224
|
workstations_response = requests.get(
|
211
225
|
f"{api_url}/v1/workstations", headers={"x-api-key": metaflow_token}
|
212
226
|
)
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
click.
|
219
|
-
"Error: {}".format(json.dumps(workstations_response.json(), indent=4))
|
220
|
-
)
|
227
|
+
workstations_response.raise_for_status()
|
228
|
+
list_response.add_or_update_data(
|
229
|
+
"workstations", workstations_response.json()["workstations"]
|
230
|
+
)
|
231
|
+
if output == "json":
|
232
|
+
click.echo(json.dumps(list_response.as_dict(), indent=4))
|
221
233
|
except Exception as e:
|
222
|
-
|
223
|
-
|
234
|
+
list_step.update(
|
235
|
+
OuterboundsCommandStatus.FAIL, "Failed to list workstations", ""
|
236
|
+
)
|
237
|
+
list_response.add_step(list_step)
|
238
|
+
if output == "json":
|
239
|
+
list_response.add_or_update_data("error", str(e))
|
240
|
+
click.echo(json.dumps(list_response.as_dict(), indent=4))
|
241
|
+
else:
|
242
|
+
click.secho("Failed to list workstations", fg="red", err=True)
|
243
|
+
click.secho("Error: {}".format(str(e)), fg="red", err=True)
|
224
244
|
|
225
245
|
|
226
246
|
@cli.command(help="Hibernate workstation", hidden=True)
|
outerbounds/utils/schema.py
CHANGED
@@ -63,11 +63,11 @@ class OuterboundsCommandResponse:
|
|
63
63
|
self._message = "We found one or more warnings with your installation."
|
64
64
|
|
65
65
|
def as_dict(self):
|
66
|
+
self._data["steps"] = [step.as_dict() for step in self._steps]
|
66
67
|
return {
|
67
68
|
"status": self.status.value,
|
68
69
|
"code": self._code,
|
69
70
|
"message": self._message,
|
70
|
-
"steps": [step.as_dict() for step in self._steps],
|
71
71
|
"metadata": self.metadata,
|
72
72
|
"data": self._data,
|
73
73
|
}
|
@@ -2,13 +2,13 @@ outerbounds/__init__.py,sha256=GPdaubvAYF8pOFWJ3b-sPMKCpyfpteWVMZWkmaYhxRw,32
|
|
2
2
|
outerbounds/cli_main.py,sha256=e9UMnPysmc7gbrimq2I4KfltggyU7pw59Cn9aEguVcU,74
|
3
3
|
outerbounds/command_groups/__init__.py,sha256=QPWtj5wDRTINDxVUL7XPqG3HoxHNvYOg08EnuSZB2Hc,21
|
4
4
|
outerbounds/command_groups/cli.py,sha256=61VsBlPG2ykP_786eCyllqeM8DMhPAOfj2FhktrSd7k,207
|
5
|
-
outerbounds/command_groups/local_setup_cli.py,sha256=
|
6
|
-
outerbounds/command_groups/workstations_cli.py,sha256=
|
5
|
+
outerbounds/command_groups/local_setup_cli.py,sha256=7U4mZbAXBDsY-ghKAzcfgMkuwnTExDW0nyJ52nVCg-g,40694
|
6
|
+
outerbounds/command_groups/workstations_cli.py,sha256=f3gwHMZPHzeOcGj5VfC5tZZA18JQhFzy2LRGzqAosOk,19286
|
7
7
|
outerbounds/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
outerbounds/utils/kubeconfig.py,sha256=l1mUP1j9VIq3fsffi5bJ1Nk-hYlwd1dIqkpj7DvVS1E,7936
|
9
9
|
outerbounds/utils/metaflowconfig.py,sha256=_Khqzu0KE6X05KkVbb39GXN6CFpG2WRr6Xs35pT2l7A,3299
|
10
|
-
outerbounds/utils/schema.py,sha256=
|
11
|
-
outerbounds-0.3.
|
12
|
-
outerbounds-0.3.
|
13
|
-
outerbounds-0.3.
|
14
|
-
outerbounds-0.3.
|
10
|
+
outerbounds/utils/schema.py,sha256=Ht_Yf5uoKO0m36WXHZLSPmWPH6EFWXfZDQsiAUquc5k,2160
|
11
|
+
outerbounds-0.3.52rc6.dist-info/METADATA,sha256=RZn_J3Jy1JYymPhAygV-QcheRb-GEVN_VPx8jzFzRSw,1367
|
12
|
+
outerbounds-0.3.52rc6.dist-info/WHEEL,sha256=vVCvjcmxuUltf8cYhJ0sJMRDLr1XsPuxEId8YDzbyCY,88
|
13
|
+
outerbounds-0.3.52rc6.dist-info/entry_points.txt,sha256=7ye0281PKlvqxu15rjw60zKg2pMsXI49_A8BmGqIqBw,47
|
14
|
+
outerbounds-0.3.52rc6.dist-info/RECORD,,
|
File without changes
|
File without changes
|