Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚚 Rename hub edge functions #866

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lamindb_setup/core/_hub_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_access_token(
try:
if api_key is not None:
auth_response = hub.functions.invoke(
"create-jwt",
"get-jwt-v1",
invoke_options={"body": {"api_key": api_key}},
)
return json.loads(auth_response)["accessToken"]
Expand Down
9 changes: 5 additions & 4 deletions lamindb_setup/core/_hub_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ def _connect_instance_new(
client: Client,
) -> tuple[dict, dict] | str:
response = client.functions.invoke(
"get-instance-settings", invoke_options={"body": {"owner": owner, "name": name}}
"get-instance-settings-v1",
invoke_options={"body": {"owner": owner, "name": name}},
)
# no instance found, check why is that
if response == b"{}":
Expand Down Expand Up @@ -471,7 +472,7 @@ def _access_aws(*, storage_root: str, client: Client) -> dict[str, dict]:

storage_root_info: dict[str, dict] = {"credentials": {}, "accessibility": {}}
response = client.functions.invoke(
"access-aws",
"get-cloud-access-v1",
invoke_options={"body": {"storage_root": storage_root}},
)
if response is not None and response != b"{}":
Expand Down Expand Up @@ -563,7 +564,7 @@ def sign_in_hub(

def _sign_in_hub_api_key(api_key: str, client: Client):
response = client.functions.invoke(
"create-jwt",
"get-jwt-v1",
invoke_options={"body": {"api_key": api_key}},
)
access_token = json.loads(response)["accessToken"]
Expand Down Expand Up @@ -599,7 +600,7 @@ def sign_in_hub_api_key(

def _create_api_key(body: dict, client: Client) -> str:
response = client.functions.invoke(
"create-api-key",
"create-api-key-v1",
invoke_options={"body": body},
)
api_key = json.loads(response)["apiKey"]
Expand Down
Loading