sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

add API example for installing public ssh key for project & account #2292

Open DrXyzzy opened 7 years ago

DrXyzzy commented 7 years ago

See also #2285.

DrXyzzy commented 4 years ago

Sample API query to get ssh public keys for account:

curl -u sk_...: \
  -H "Content-Type: application/json" \
  -d '{"query":{"accounts":{"account_id":"..uuid..","ssh_keys":null}}}' \
  https://cocalc.com/api/v1/query
==>
{"query":{"accounts":{"account_id":"...",
  "ssh_keys":
    {"..fingerprint..":{
      "title":"TITLE",
      "value":"ssh-ed25519 AAAAxxxx user@example.com",
      "creation_date":12345,"last_use_date":12346},
    "..fingerprint..":{}
  }
}},"multi_response":false,"event":"query","id":"3c5bb7fb-4c9b-4379-9f9e-b427486f9a71"}