Created
May 23, 2023 10:04
-
-
Save mmajchrzycki/23e3cb6daf986b7ac1d0aeef08592228 to your computer and use it in GitHub Desktop.
Simple script to list available deployments for Edge Impulse project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.client | |
import json | |
API_KEY = 'YOUR_PROJECT_API_KEY' | |
PROJECT_ID = YOUR_PROJECT_ID | |
conn = http.client.HTTPSConnection("studio.edgeimpulse.com") | |
headers = { 'x-api-key': API_KEY } | |
conn.request("GET", f"/v1/api/{PROJECT_ID}/deployment/targets", headers=headers) | |
res = conn.getresponse() | |
data = res.read() | |
response_json = json.loads(data.decode("utf-8")) | |
print("Available libraries:") | |
for target in response_json["targets"]: | |
if target['uiSection'] != 'library' or target['disabledForProject'] == True: | |
continue | |
print(f"Target: {target['name']}") | |
print(f"Format: {target['format']}") | |
print("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment