MDATA-PUT(1)

πŸ’– MDATA-PUT β€” the metadata glow-up page πŸ’–

okay bestie, welcome to mdata-put(1), straight outta the Metadata Commands crew πŸŽ€


✨ NAME ✨

mdata-put β€” sets the value of a metadata key-value pair. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

/usr/sbin/mdata-put keyname [ value ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so like… mdata-put lets you β€” or a lil script of yours, no judgement β€” modify the metadata for a guest instance that's running in a SmartDataCenter (SDC) cloud ☁️✨

fr fr, metadata values are generally set programmatically via CloudAPI, or during interactive provisioning via a Web Portal. but if you wanna grab the value of a key-value pair yourself? just pass its name to the mdata-get command, and she'll hand it over 🫢

here's the tea: the key-value pair named keyname gets updated in the metadata store for this instance. and where does the new value come from? okay so:

  • if a value argument is provided on the command-line, then that value will be used βœ…
  • otherwise, if stdin is not a tty, the value will be read from stdin πŸ“₯

and if the metadata service is unavailable at the time of the request? she doesn't panic, she doesn't ghost β€” this command will block, waiting for it to become available. patient queen behavior πŸ‘‘

Non-transient failures, like the non-existence of the requested keyname, will cause the program to exit with a non-zero status πŸ’€ and depending on the nature of the error, some diagnostic output may be printed to stderr. so yeah, read your stderr, bestie.


⭐ EXIT STATUS ⭐

the following exit values are returned, no cap:

  • 0 β€” Successful completion.

the requested keyname was valid, and its value was updated. slay, ate, periodt πŸ’–

  • 2 β€” An error occurred.

an unexpected error condition occurred, which is believed to be a non-transient condition. retrying the request is not expected to resolve the error condition; either a software bug or a misconfiguration exists. so like… don't just spam it, okay? 😭

  • 3 β€” A usage error occurred.

malformed arguments were passed to the program. check the usage instructions to ensure valid arguments are supplied. we've all been there, no shame πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

go read the whole friend group, they're all iconic 🌈


quick vibe check reminder: non-transient = retrying won't save you, so don't waste your main character energy on it πŸ’…

and that's the page, babe πŸŽ€ this was brought to you by Joyent SmartDataCenter β€” version stamped October 2013 β€” tysm for reading, mwah 🫢✨

πŸ“¦ where this page comes from