Skip to content

Commit 1875b66

Browse files
committed
api: update users of api_client
Update users of `api_client` with the new URL and client structure. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent fef7ff9 commit 1875b66

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/infuse_iot/database.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import binascii
55

66
from infuse_iot.api_client import Client
7-
from infuse_iot.api_client.api.default import get_shared_secret
7+
from infuse_iot.api_client.api.key import get_shared_secret
88
from infuse_iot.api_client.models import Key
99
from infuse_iot.credentials import get_api_key, load_network
1010
from infuse_iot.epacket.interface import Address as InterfaceAddress
@@ -98,9 +98,7 @@ def observe_security_state(self, address: int, cloud_key: bytes, device_key: byt
9898
self.devices[address].network_id = network_id
9999
self.devices[address].public_key = device_key
100100

101-
client = Client(base_url="https://api.dev.infuse-iot.com").with_headers(
102-
{"x-api-key": f"Bearer {get_api_key()}"}
103-
)
101+
client = Client(base_url="https://api.infuse-iot.com").with_headers({"x-api-key": f"Bearer {get_api_key()}"})
104102

105103
with client as client:
106104
body = Key(base64.b64encode(device_key).decode("utf-8"))

src/infuse_iot/tools/cloud.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212
from tabulate import tabulate
1313

1414
from infuse_iot.api_client import Client
15-
from infuse_iot.api_client.api.default import (
15+
from infuse_iot.api_client.api.board import (
1616
create_board,
17+
get_boards,
18+
)
19+
from infuse_iot.api_client.api.organisation import (
1720
create_organisation,
1821
get_all_organisations,
19-
get_boards,
2022
)
2123
from infuse_iot.api_client.models import Error, NewBoard, NewOrganisation
2224
from infuse_iot.commands import InfuseCommand
@@ -32,7 +34,7 @@ def run(self):
3234

3335
def client(self):
3436
"""Get API client object ready to use"""
35-
return Client(base_url="https://api.dev.infuse-iot.com").with_headers({"x-api-key": f"Bearer {get_api_key()}"})
37+
return Client(base_url="https://api.infuse-iot.com").with_headers({"x-api-key": f"Bearer {get_api_key()}"})
3638

3739

3840
class Organisations(CloudSubCommand):

src/infuse_iot/tools/provision.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
from pynrfjprog import LowLevel, Parameters
1818

1919
from infuse_iot.api_client import Client
20-
from infuse_iot.api_client.api.default import (
20+
from infuse_iot.api_client.api.board import get_board_by_id, get_boards
21+
from infuse_iot.api_client.api.device import (
2122
create_device,
22-
get_all_organisations,
23-
get_board_by_id,
24-
get_boards,
2523
get_device_by_soc_and_mcu_id,
2624
)
25+
from infuse_iot.api_client.api.organisation import get_all_organisations
2726
from infuse_iot.api_client.models import Board, Error, NewDevice, NewDeviceMetadata
2827
from infuse_iot.commands import InfuseCommand
2928
from infuse_iot.credentials import get_api_key
@@ -180,7 +179,7 @@ def run(self):
180179
soc, uicr_addr, hardware_id = self.nrf_device_info(api)
181180
hardware_id_str = f"{hardware_id:016x}"
182181

183-
client = Client(base_url="https://api.dev.infuse-iot.com").with_headers(
182+
client = Client(base_url="https://api.infuse-iot.com").with_headers(
184183
{"x-api-key": f"Bearer {get_api_key()}"}
185184
)
186185

0 commit comments

Comments
 (0)