Skip to content

Commit

Permalink
fix(device-unique): Do not change core-app registration query
Browse files Browse the repository at this point in the history
  • Loading branch information
sfikastheo committed Jan 3, 2025
1 parent 7dcaea2 commit ac3e20a
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions scripts/gen-device-unique/gen-orb-id.sh
Original file line number Diff line number Diff line change
Expand Up @@ -276,28 +276,14 @@ register_orb() {
usage; exit 1 ;;
esac

log_info "Registering Orb ID=${orb_id} with Core-App"
# !! DO NOT CHANGE !!
curl --fail --location --request POST "${CORE_APP_REGISTRATION_URL}" \
--header "Authorization: Bearer ${bearer}" \
--header 'Content-Type: application/json' \
--data-raw '{
"query": "mutation InsertOrb($deviceId: String, $name: String!) {
insert_orb(
objects: [{
name: $name,
deviceId: $deviceId,
status: FLASHED,
deviceType: '"${hardware_version}"',
isDevelopment: '"${is_dev}"'
}],
on_conflict: {constraint: orb_pkey}
) {
affected_rows
}
}",
"query":"mutation InsertOrb($deviceId: String, $name: String!) { insert_orb(objects: [{name: $name, deviceId: $deviceId, status: FLASHED, deviceType: '"${hardware_version}"', isDevelopment: '"${is_dev}"'}], on_conflict: {constraint: orb_pkey}) {affected_rows}}",
"variables": {"deviceId": "'"${orb_id}"'", "name": "'"${orb_name}"'"}
}' \
| jq -re 'if .data.insert_orb.affected_rows == 1 then true else error("Failed to register Orb") end'
}' | jq -re 'if .data.insert_orb.affected_rows == 1 then true else error("Failed to register Orb") end'

log_info "Orb ${orb_id} registered successfully."
}
Expand Down

0 comments on commit ac3e20a

Please sign in to comment.