ã¯ãæ¢ é¨ãããã§ãããã³ãã¼ã§ã
çµæ§åããä½ã£ã¦ãããã§ãããã©ãæè¿å ¬éãã¦ãã¦ãããæ¾ç½®ãã¦ããã®ã§ã¡ãã£ã¨ç´¹ä»ããã¦ããã ãã¾ãã
ä½ããããã®ï¼
vultr ã¨ããVPSãµã¼ãã¹ããããã¾ãã詳細ã«é¢ãã¦ã¯ä»¥ä¸ã®è¨äºãåç §ãã¦ããã ãããã
新しいVPSのVULTR、東京リージョンはじまった - uzullaがブログ
ããã§ãã£ã¦ãããã¤ã¯DigitalOceanã®ããã«ã¤ã³ã¹ã¿ã³ã¹ãç«ã¦ããæ¶ãããæä½ããAPIãããã®ã§ããããããã³ãã³ãããç«ãããããã«ããã®ãgo-vultrã§ãã
ã¤ã³ã¹ãã¼ã«æ¹æ³
# ãããããgoã¯å ¥ãã¦ããã¦ãã ãã $ go get github.com/mackee/go-vultr $ go install github.com/mackee/go-vultr/vultr
ä¾åã«ããããå ¥ã£ã¦ããã®ã§ãããã¯é©å®å ¥ããã¨è¯ãã
使ãæ¹
vultrã«ç»é²å¾ã«https://my.vultr.com/settings/ã«ã¢ã¯ã»ã¹ãã¦ããã ãããã°ã¤ã³ãã¦ããä¸ã®æ¹ã«ãã¼ã£ã¨è¡ãã¨ãYour API Keyã¨ãããã¤ãããã®ã§ã½ã¬ãã³ãã£ã¦ããã¾ãã
ã§ãããããã«ã³ãã³ããå©ãã¾ããgocode/binã¨ãã«ãã¹ã¯éãã¦ããã¦ãï¼ï¼
$ vultr list your api key(https://my.vultr.com/settings API Information):********(ãã£ãã³ãã£ã¦ãããAPI Key) 2014/06/07 17:20:49 endpoint: https://api.vultr.com/ 2014/06/07 17:20:50 200 OK []
æã£ã¦ããã¤ã³ã¹ã¿ã³ã¹ããªãã®ã§ãããªãããã§ããããã§æ£å¸¸ã§ãã
ã§ããã®ãã¨çãã課éãã¦é ãã¾ãããï¼èª²éããªãã¦ãä»ã¯$10ã¤ããããããã§ããï¼ï¼ï¼ï¼ã¨ããããã¤ã³ã¹ã¿ã³ã¹ç«ã¦ã¦ã¿ã¾ãããã
$ vultr os ...
ã¨ããã¨ä½¿ããOSã®ãªã¹ããã ãã ãã¼ã£ã¦JSONã§ã¯ãããããã§ããå¤ãããã®ã§ä½ããªãã ããããã¾ããããªã®ã§jqã使ã£ã¦æ¢ãã¦ã¿ã¾ãã
$ vultr os | jq '. | to_entries | map(select(.value.family == "ubuntu" and .value.arch == "x64"))' 2014/06/07 17:29:28 endpoint: https://api.vultr.com/ 2014/06/07 17:29:29 200 OK [ { "value": { "windows": false, "family": "ubuntu", "arch": "x64", "name": "Ubuntu 12.04 x64" }, "key": "128" }, { "value": { "windows": false, "family": "ubuntu", "arch": "x64", "name": "Ubuntu 12.10 x64" }, "key": "129" }, { "value": { "windows": false, "family": "ubuntu", "arch": "x64", "name": "Ubuntu 13.10 x64" }, "key": "131" }, { "value": { "windows": false, "family": "ubuntu", "arch": "x64", "name": "Ubuntu 14.04 x64" }, "key": "160" } ]
vultrã®APIã¯{ "ãªããã®ID" : ï½...} }ã¿ãããªããã¾ãè¦ãªãå½¢å¼ãªã®ã§to_entriesã§ã´ãã§ã£ã¦ããå¿
è¦ãããã¾ãã
ã¨ããããã§ubuntuãã¤x64ã®OSãæ¢ãã¦ãã¾ããã
ææ°çã使ãããã®ã§Ubuntu 14.04 x64ã®keyã®IDã§ãã"160"ãã¡ã¢ã£ã¦ããã¾ã
次ã¯ãªã¼ã¸ã§ã³
$ vultr regions | jq '. | to_entries | map(select(.value.name == "Tokyo"))' 2014/06/07 17:32:26 endpoint: https://api.vultr.com/ 2014/06/07 17:32:27 200 OK [ { "value": { "state": "", "continent": "Asia", "country": "JP", "name": "Tokyo" }, "key": "25" } ]
ãã£ã±è¿ãæãè¯ãã®ã§Tokyoã§ããï¼ãããã"25"ãã¡ã¢ã£ã¦ããã¾ã
æå¾ã«VPSãã©ã³ã§ããã¤ã³ã¹ã¿ã³ã¹ã®æ§è½ã¨ãã§ãã
$ vultr plans | jq '. | to_entries | map(select(.value.price_per_month == "5.00" and .value.ram == "768" and .value.bandwidth == "0.10"))' 2014/06/07 17:34:34 endpoint: https://api.vultr.com/ 2014/06/07 17:34:35 200 OK [ { "value": { "windows": false, "price_per_month": "5.00", "bandwidth_gb": "102.4", "bandwidth": "0.10", "disk": "15", "ram": "768", "vcpu_count": "1", "name": "768 MB RAM,15 GB SSD,0.10 TB BW" }, "key": "31" }, { "value": { "windows": false, "price_per_month": "5.00", "bandwidth_gb": "102.4", "bandwidth": "0.10", "disk": "15", "ram": "768", "vcpu_count": "1", "name": "768 MB RAM,15 GB SSD,0.10 TB BW, Custom ISO" }, "key": "52" } ]
ä¸çªå®ããã¤ï¼æé¡ããã$5ï¼ãã¤ã¡ã¢ãªã768MBã§å¸¯åã0.10Tã®ãã¤ãåºãã¦ãã¦ãã¾ããTokyoãªã¼ã¸ã§ã³ã¯0.10Tã®ãã使ããªãã£ã½ãã®ã§ããããæ¡ä»¶ã§ãã
ä»åã¯CustomISOã§ã¯ãªãã®ã§"31"ãã¡ã¢ã
ãã¦ãæºåãæ´ã£ãã®ã§èµ·åãã¾ãï¼
$ vultr create --osid 160 --dcid 25 --vpsplanid 31 2014/06/07 17:38:42 endpoint: https://api.vultr.com/ 2014/06/07 17:38:43 200 OK { "SUBID": ******* }
ãããªã®ãåºã¾ããã§ãã³ã³ã§å ã»ã©ã®listã³ãã³ããæã¤ã¨
$ vultr list 2014/06/07 17:39:34 endpoint: https://api.vultr.com/ 2014/06/07 17:39:35 200 OK { "******": { "os": "Ubuntu 14.04 x64", "ram": "768 MB", "disk": "Virtual 15 GB", "main_ip": "********", "vcpu_count": "1", "location": "Tokyo", "default_password": "********", "date_created": "2014-06-07 04:38:43", "pending_charges": "0.01", "status": "active", "cost_per_month": "5.00", "current_bandwidth_gb": 0, "allowed_bandwidth_gb": "100", "netmask_v4": "255.255.255.0", "gateway_v4": "****", "power_status": "running", "VPSPLANID": "31" } }
ã¨ããæãã§åºã¦ããããã§ãããã
vultrã ãã¶ç·æ°æº¢ããæãã§public keyãç»é²ããæãã§ã¯ãªããªããrootã®ããã©ã«ããã¹ã¯ã¼ããçºè¡ããããããã§ã©ãã«ãããã¨ããæããªã®ã§ãããã§å
¥ãã¾ãã
ã§ã使ãçµãã£ãã
$ vultr destroy *****(vultrã®listã®ãã¼ã«ãªã£ã¦ããæ°å)
ã§ã¤ã³ã¹ã¿ã³ã¹ãè½ã¨ããã¨ãåºæ¥ã¾ãã
ãã¨vultr sshã¨ããã³ãã³ããããã®ã§ãããããã¤ã¯æåä¸å¯©ãªã®ã§Experimentalã§ãã試ããªãã§ãã ãã
以ä¸VPSã©ã¤ãã§ããï¼ã次ã®è¨äºã¯ã¹ãããã·ã§ããæ©è½ã¨ãCustomISOã使ã£ã話ããã¾ãï¼