Skip to content

Instantly share code, notes, and snippets.

@mmajchrzycki
Created May 23, 2023 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmajchrzycki/23e3cb6daf986b7ac1d0aeef08592228 to your computer and use it in GitHub Desktop.
Save mmajchrzycki/23e3cb6daf986b7ac1d0aeef08592228 to your computer and use it in GitHub Desktop.
Simple script to list available deployments for Edge Impulse project
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