in functions/source/api/api.py [0:0]
def upload_manifest(event, context):
print(event)
"""Create the DevKit Thing, Policy, and Certificates."""
try:
cert = load_verify_cert_by_file("./MCHP_manifest_signer.crt")
manifest = json.loads(event["body"])
print(manifest)
_invoke_import_manifest(POLICY_NAME, manifest, cert)
return {"statusCode": 200, "body": json.dumps({"success": True})}
except ManifestImportException as error:
print(error)
return {
"statusCode": 500,
"body": json.dumps({"type": type(error).__name__, "error": error,}),
}