= geni-get = A command that runs on (from inside) a GENI node and tells you GENI meta-information about the slivers and slices and experimenter associated with the node. This is a separate tool that must be installed in your disk image. All GENI compute resource providers should make available a version of this client script that can be installed on their compute resources such that the below functionality works. = PG implementation = * https://www.emulab.net/downloads/geni-get.tar.gz * https://www.emulab.net/downloads/geni-get_1.0_all.deb * https://www.emulab.net/downloads/geni-get-1.0-1.fc15.noarch.rpm == Known Issues == - Slice email for GPO SA slices is incorrect = Usage = The client script shall support the options as described below. Notes - 'client version' refers to the version of the geni-get script. - 'no-cache' means the script should re-query the server for the latest information - 'version' refers to the version of the server side of this system {{{ $ geni-get --help Usage: ./geni-get [options] [command] Options: -a, --all dump all information available -c, --client-version display client version -h, --help show this message -n, --no-cache disable reading cached results -p, --port specify server port -v, --version display server version Try "./geni-get commands" for a list of supported commands. }}} = Output = == commands == This gives a list of all commands that you can issue at this server - kinds of information you can get. The return is a JSON list. Each of the commands listed below should be supported, but additional commands are allowed. Example: {{{ $ ./geni-get commands { "client_id": "Return the client-specified sliver ID", "commands": "Show all available commands", "control_mac": "Show the MAC address of the control interface", "geni_user": "Show user accounts and public keys", "getversion": "Report the AM version", "manifest": "Show the sliver manifest", "slice_email": "Retrieve the e-mail address from the slice certificate", "slice_urn": "Show the URN of the slice", "sliverstatus": "Give the current status of the sliver (AM API v2)", "status": "Give the current status of the sliver (AM API v3)", "user_email": "Show the e-mail address of the sliver creator", "user_urn": "Show the URN of the sliver creator" } }}} == client_id == The `client_id` from the RSpec for this node. This can be used to identify which node this is from your RSpec. {{{ $ geni-get client_id bbn-ig-jbs15 }}} == control_mac == The MAC address for the control plane interface on this node. {{{ $ geni-get control_mac 02bed2ecdc92 }}} == geni_user == Return the users and SSH keys installed on this node. Return is in the format of the geni_user argument to the AM API: http://groups.geni.net/geni/wiki/GAPI_AM_API_V3/CommonConcepts#geni_users '''FIXME: Includes updates from later `poa` actions?''' {{{ $ ./geni-get geni_user [{"urn":"urn:publicid:IDN+ch.geni.net+user+ahelsing","keys":["ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwhxWkZuS20ow0MnVeSiiRar55Qgy1GA74HIxgiMSPiqQEL3fjufyO/g6FK7R659oNQRbvLlrN5zpaDQ4MBk/JLTt6NO+9IUsB6HlI2P5q8bVyRpUf6E3SJh2iZWQCLDheyBk1+SjJsmH8ovjrWpfZuABIHYaH2gc3hy0igXiaYeYAF8jH8G+cmDcjd2+lQDwi7PhyOxM5Ai4u+kw16su1HFXBNkDZ0e7+YtPVElDC4TCBmt0O98gPVjcIsD1pDgSbdsTZe6zqLBgujrPQhC72eADtoi3WCMiyo+GPEPeYRrZo4H9vSt2pdIg9E73wJPgCu/LcAql2FJh/glsIqpIhw== ahelsing@hotcocoa2"]},{"urn":"urn:publicid:IDN+ch.geni.net+user+sedwards","keys":["ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwhxWkZuS20ow0MnVeSiiRar55Qgy1GA74HIxgiMSPiqQEL3fjufyO/g6FK7R659oNQRbvLlrN5zpaDQ4MBk/JLTt6NO+9IUsB6HlI2P5q8bVyRpUf6E3SJh2iZWQCLDheyBk1+SjJsmH8ovjrWpfZuABIHYaH2gc3hy0igXiaYeYAF8jH8G+cmDcjd2+lQDwi7PhyOxM5Ai4u+kw16su1HFXBNkDZ0e7+YtPVElDC4TCBmt0O98gPVjcIsD1pDgSbdsTZe6zqLBgujrPQhC72eADtoi3WCMiyo+GPEPeYRrZo4H9vSt2pdIg9E73wJPgCu/LcAql2FJh/glsIqpIhw== ahelsing@hotcocoa2"]},{"urn":"urn:publicid:IDN+ch.geni.net+user+tmitchel","keys":["ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwhxWkZuS20ow0MnVeSiiRar55Qgy1GA74HIxgiMSPiqQEL3fjufyO/g6FK7R659oNQRbvLlrN5zpaDQ4MBk/JLTt6NO+9IUsB6HlI2P5q8bVyRpUf6E3SJh2iZWQCLDheyBk1+SjJsmH8ovjrWpfZuABIHYaH2gc3hy0igXiaYeYAF8jH8G+cmDcjd2+lQDwi7PhyOxM5Ai4u+kw16su1HFXBNkDZ0e7+YtPVElDC4TCBmt0O98gPVjcIsD1pDgSbdsTZe6zqLBgujrPQhC72eADtoi3WCMiyo+GPEPeYRrZo4H9vSt2pdIg9E73wJPgCu/LcAql2FJh/glsIqpIhw== ahelsing@hotcocoa2","ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwhxWkZuS20ow0MnVeSiiRar55Qgy1GA74HIxgiMSPiqQEL3fjufyO/g6FK7R659oNQRbvLlrN5zpaDQ4MBk/JLTt6NO+9IUsB6HlI2P5q8bVyRpUf6E3SJh2iZWQCLDheyBk1+SjJsmH8ovjrWpfZuABIHYaH2gc3hy0igXiaYeYAF8jH8G+cmDcjd2+lQDwi7PhyOxM5Ai4u+kw16su1HFXBNkDZ0e7+YtPVElDC4TCBmt0O98gPVjcIsD1pDgSbdsTZe6zqLBgujrPQhC72eADtoi3WCMiyo+GPEPeYRrZo4H9vSt2pdIg9E73wJPgCu/LcAql2FJh/glsIqpIhw== ahelsing@hotcocoa2"]}] }}} Or in prettier layout: {{{ $ ./geni-get geni_user | python -mjson.tool | sed -e's/ / /g' [ { "keys": [ "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwhxWkZuS20ow0MnVeSiiRar55Qgy1GA74HIxgiMSPiqQEL3fjufyO/g6FK7R659oNQRbvLlrN5zpaDQ4MBk/JLTt6NO+9IUsB6HlI2P5q8bVyRpUf6E3SJh2iZWQCLDheyBk1+SjJsmH8ovjrWpfZuABIHYaH2gc3hy0igXiaYeYAF8jH8G+cmDcjd2+lQDwi7PhyOxM5Ai4u+kw16su1HFXBNkDZ0e7+YtPVElDC4TCBmt0O98gPVjcIsD1pDgSbdsTZe6zqLBgujrPQhC72eADtoi3WCMiyo+GPEPeYRrZo4H9vSt2pdIg9E73wJPgCu/LcAql2FJh/glsIqpIhw== ahelsing@hotcocoa2" ], "urn": "urn:publicid:IDN+ch.geni.net+user+ahelsing"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PhyOxM5Ai4u+kw16su1HFXBNkDZ0e7+YtPVElDC4TCBmt0O98gPVjcIsD1pDgSbdsTZe6zqLBgujrPQhC72eADtoi3WCMiyo+GPEPeYRrZo4H9vSt2pdIg9E73wJPgCu/LcAql2FJh/glsIqpIhw== ahelsing@hotcocoa2" ], "urn": "urn:publicid:IDN+ch.geni.net+user+tmitchel" } ] }}} == manifest == The manifest RSpec for the slice, in standard GENI Rpec XML format. '''FIXME: For only this node? For only this AM?''' Example: {{{ $ ./geni-get manifest }}} == slice_urn == {{{ +$ geni-get slice_urn urn:publicid:IDN+ch.geni.net:JBS+slice+jbs15 }}} == slice_email == The email address of the slice (from the slice certificate). {{{ +$ geni-get slice_email slice-jbs15@example.com }}} == user_urn == This is the URN of the user who reserved the node. FIXME: Right? {{{ +$ geni-get user_urn urn:publicid:IDN+ch.geni.net+user+jbs }}} == user_email == This is the email address of the user who reserved the node (from the user certificate). {{{ +$ geni-get user_email jbs@bbn.com }}} == version == API version? SW Version? {{{ +$ geni-get version 1 }}} == get_version == Returns nothing. == sliverstatus == {{{ +$ geni-get sliverstatus {'geni_urn':'urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+15632','geni_status':'ready','geni_resources':[{'geni_urn':'urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+15631','geni_status':'ready','geni_error':''}]} }}} Bug: This shouldn't use single quotes, that's not legal JSON. Converted to double quotes: {{{ +$ geni-get sliverstatus | sed -e "s/'/\"/g" | python -mjson.tool | sed -e 's/ / /g' { "geni_resources": [ { "geni_error": "", "geni_status": "ready", "geni_urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+15631" } ], "geni_status": "ready", "geni_urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+15632" } }}} == --all == {{{ +$ geni-get --all {"client_id":"bbn-ig-jbs15","slice_urn":"urn:publicid:IDN+ch.geni.net:JBS+slice+jbs15","slice_email":"slice-jbs15@example.com","user_urn":"urn:publicid:IDN+ch.geni.net+user+jbs","user_email":"jbs@bbn.com","geni_user":[{"urn":"urn:publicid:IDN+ch.geni.net+user+jbs","keys":["ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvxWF39ISW4XwXbQ480ZumhPY/t+3hnhS91GxvBU2szCNZa7xvRO56sr7gbZLCD9TvQ+gD3X4W1Iy9pvVNX31EUmT+IKwIu8rwxbGF2Qt1VICw9Y0fbBnhkYSBnNwfwlsQUiGojv7IAyD3fi6gmBNdeKBtmiaJQSJf4iARPwfQE6QaXG8Q3+h9jH5GHW9LnWMpZ8VuStLaNLR0DQ8l/xU+i/1NX0vZHqaxxzbR5OSfQcDOlz+NxVjXa1uz7h3W8E0zVL6ZLn650OhoFAfPWEf+pdjyixHx2bUMMCzjBCTMhxQ2u792f/WD0Nq1bwwbZ93tifta8KiMc7UPJQUm4dw8Q== jbs@gpolab.bbn.com","ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0nK/+rVwI+KMRz5t91eT0AsO+VA+SSkXhtjHO/ReECiOFJOY6qa70OTBTHTBnQtVP2gwzpKDVInqPkqzdoujdV9LrPwxawhZVx3CdSDiKtWbSNvWxdKL2Htnq21vULmAWf7qMhGchvRfGANfLg7mDItH7zLcngPks3FOKP2+xiG4JTGL7z5vF9GaZKi7ujaW0VvXHVxQ6aTbsxo1yx8JlV6IYc3L4PqDprTtpBTFcsh4hgVVahOxRY6dUt+eF6vQcNGEqpBQLf1ndH4z9b+eU9gR7Oe7q01+oTWskLL5VDRIHy9XBx6MV20kufmHd9YXeTQBegDJFDhPWZXa4QowIw== jbs@fenris.infersys.com","ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxRl7mayQ54SDCoQyigPbrgJcwMLbwG47w0aW7bNGHgdjM82emdIi6VXdajI2AK9hJo09UotY1fvCkvCF8bI0zUxF8tvHkTmIAb1pGAsAyjGMly4LR3NhigyB/3GH3scD8YHmDxH5GiCYW+b4dTJ1WbIsksw11w1+bm/jLJfhrvzTkafHJOp3AHu9dwq8COgrlyxEAV2bLnmLOEmpJr6tmX0GNnq0XsISNgcqzvX5UqNa2IFALoro9dlmSkAl+rgZX/QKBI+c3AwoVlVbafT/VRUHbFvcvJGzRX90JEremnB+8UxbPgz1IIfgWgBii4HFyECXb7Yvu3pOTyMsU3DevQ== jbs"]}],"control_mac":"02bed2ecdc92","version":"1","getversion":{'code_tag':'9eec998c9be94ed82cf7e21f5b280368d1af0e59','urn':'urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm','url':'https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am','geni_am_type':'protogeni','geni_single_allocation':true,'geni_allocate':'geni_disjoint','geni_credential_types':{'geni_type':'geni_sfa','geni_version':'2','geni_type':'geni_sfa','geni_version':'3'}},"sliverstatus":{'geni_urn':'urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+15632','geni_status':'ready','geni_resources':[{'geni_urn':'urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+15631','geni_status':'ready','geni_error':''}]}} }}} Bug: This shouldn't use single quotes, that's not legal JSON. Converted to double quotes: {{{ +$ geni-get --all | sed -e "s/'/\"/g" | python -mjson.tool | sed -e 's/ / /g' { "client_id": "bbn-ig-jbs15", "control_mac": "02bed2ecdc92", "geni_user": [ { "keys": [ "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvxWF39ISW4XwXbQ480ZumhPY/t+3hnhS91GxvBU2szCNZa7xvRO56sr7gbZLCD9TvQ+gD3X4W1Iy9pvVNX31EUmT+IKwIu8rwxbGF2Qt1VICw9Y0fbBnhkYSBnNwfwlsQUiGojv7IAyD3fi6gmBNdeKBtmiaJQSJf4iARPwfQE6QaXG8Q3+h9jH5GHW9LnWMpZ8VuStLaNLR0DQ8l/xU+i/1NX0vZHqaxxzbR5OSfQcDOlz+NxVjXa1uz7h3W8E0zVL6ZLn650OhoFAfPWEf+pdjyixHx2bUMMCzjBCTMhxQ2u792f/WD0Nq1bwwbZ93tifta8KiMc7UPJQUm4dw8Q== jbs@gpolab.bbn.com", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0nK/+rVwI+KMRz5t91eT0AsO+VA+SSkXhtjHO/ReECiOFJOY6qa70OTBTHTBnQtVP2gwzpKDVInqPkqzdoujdV9LrPwxawhZVx3CdSDiKtWbSNvWxdKL2Htnq21vULmAWf7qMhGchvRfGANfLg7mDItH7zLcngPks3FOKP2+xiG4JTGL7z5vF9GaZKi7ujaW0VvXHVxQ6aTbsxo1yx8JlV6IYc3L4PqDprTtpBTFcsh4hgVVahOxRY6dUt+eF6vQcNGEqpBQLf1ndH4z9b+eU9gR7Oe7q01+oTWskLL5VDRIHy9XBx6MV20kufmHd9YXeTQBegDJFDhPWZXa4QowIw== jbs@fenris.infersys.com", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxRl7mayQ54SDCoQyigPbrgJcwMLbwG47w0aW7bNGHgdjM82emdIi6VXdajI2AK9hJo09UotY1fvCkvCF8bI0zUxF8tvHkTmIAb1pGAsAyjGMly4LR3NhigyB/3GH3scD8YHmDxH5GiCYW+b4dTJ1WbIsksw11w1+bm/jLJfhrvzTkafHJOp3AHu9dwq8COgrlyxEAV2bLnmLOEmpJr6tmX0GNnq0XsISNgcqzvX5UqNa2IFALoro9dlmSkAl+rgZX/QKBI+c3AwoVlVbafT/VRUHbFvcvJGzRX90JEremnB+8UxbPgz1IIfgWgBii4HFyECXb7Yvu3pOTyMsU3DevQ== jbs" ], "urn": "urn:publicid:IDN+ch.geni.net+user+jbs" } ], "getversion": { "code_tag": "9eec998c9be94ed82cf7e21f5b280368d1af0e59", "geni_allocate": "geni_disjoint", "geni_am_type": "protogeni", "geni_credential_types": { "geni_type": "geni_sfa", "geni_version": "3" }, "geni_single_allocation": true, "url": "https://boss.instageni.gpolab.bbn.com:12369/protogeni/xmlrpc/am", "urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+authority+cm" }, "slice_email": "slice-jbs15@example.com", "slice_urn": "urn:publicid:IDN+ch.geni.net:JBS+slice+jbs15", "sliverstatus": { "geni_resources": [ { "geni_error": "", "geni_status": "ready", "geni_urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+15631" } ], "geni_status": "ready", "geni_urn": "urn:publicid:IDN+instageni.gpolab.bbn.com+sliver+15632" }, "user_email": "jbs@bbn.com", "user_urn": "urn:publicid:IDN+ch.geni.net+user+jbs", "version": "1" } }}} {{{ #!comment To do: - write up in spec format with examples - no methods return nothing by spec - non zero exit code on unknown command - document --status command for APIv3 status (similar to but not identical to sliverstatus) - document --commands for JSON list of commands the server understands - update example of sliverstatus output - note known issue that slice email for GPO SA slices is incorrect at PG }}}