MDATA-GET(1)

✨ MDATA-GET ✨

ok so bestie, let me put you onto mdata-get β€” it's a lil metadata-fetching icon from the Metadata Commands squad πŸ’…


πŸŽ€ NAME πŸŽ€

mdata-get β€” go grab the value of a metadata key-value pair. that's it, that's the job 🫢


🌸 SYNOPSIS 🌸

/usr/sbin/mdata-get keyname

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: mdata-get lets you β€” or a script, scripts are valid too πŸ’– β€” query the metadata for a guest instance that's living its best life inside a SmartDataCenter (SDC) cloud. it's giving main character energy for automation, fr fr.

where does this metadata even come from, you ask? great question bestie:

  • generally it's set programmatically via CloudAPI ✨
  • or during interactive provisioning through a Web Portal πŸŽ€
  • and you can also set it from inside the instance itself with the mdata-put command πŸ‘‘

the value of the keyname you asked for gets printed to stdout β€” no cap. now here's the part you gotta know:

if the metadata service is unavailable when you make the request, this command will block, just sitting there waiting for it to become available. patient queen. πŸ§˜β€β™€οΈ

non-transient failures β€” like, say, the keyname you asked for literally doesn't exist β€” will make the program exit with a non-zero status. and depending on the nature of the error, some diagnostic output may get printed to stderr. not me being messy on stderr 😭


πŸ’€ EXIT STATUS πŸ’€

the following exit values are returned β€” memorize these, iykyk:

  • 0 β€” Successful completion. the keyname you wanted was available and its value was emitted to stdout. slay! πŸŽ‰
  • 1 β€” Metadata value not found. the requested keyname was not found in the metadata. it's simply not there, bestie πŸ™ˆ
  • 2 β€” An error occurred. an unexpected error condition happened, and it's believed to be a non-transient condition. retrying the request is not expected to resolve it β€” either a software bug or a misconfiguration exists. so like… it's not a you-problem you can retry your way out of πŸ”₯
  • 3 β€” A usage error occurred. malformed arguments were passed to the program. go check the usage instructions and make sure you're supplying valid arguments, bestie, because that one's on you 🫠

πŸ‘€ SEE ALSO πŸ‘€

mdata-delete(1), mdata-list(1), mdata-put(1) β€” the whole friend group, go say hi πŸ’œ


and that's the tea, bestie πŸ“ this page came to you courtesy of Joyent SmartDataCenter, dated October 2013 β€” a vintage queen serving looks since forever πŸ‘‘βœ¨πŸ’–

πŸ“¦ where this page comes from