SlideShare a Scribd company logo
1 of 12
Download to read offline
ruby-smartdc




    Usage CLI and Program
Get Started with SmartDataCenter

•Create Account
 •Get a username and password.


•Customers
  http://www.joyent.com/customers/
  ‣ http://www.joyentcloud.com/
  ‣ http://z-cloud.jp/
  ‣ etc...
CLI
Install and Setup
•Install
 $ gem install smartdc
 Fetching: smartdc-0.3.0.gem (100%)
 Successfully installed smartdc-0.3.0
 1 gem installed


•Setup
 $ sdc-setup https://api.z-cloud.jp
 version:[~6.5] ~6.5
 Username (login): your name
 Password: your password
 Successful configuration.
Register to generate an SSH
•Generate
 $ ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa
 Generating public/private rsa key pair.
 ...


•Register
 $ sdc-createkey your-key ~/.ssh/id_rsa.pub
 {
     "name": "your-key",
       "key": "ssh-rsa ...",
       "created": "2011-11-06T12:43:24+00:00",
       "updated": "2011-11-06T12:43:24+00:00"
 }
Provision a new Machine
• Help
  $ sdc-createmachine -h
  Usage: sdc-createmachine [options]
    -n, --name NAME             friendly name for this machine.
    -e, --dataset URN            dataset URN.
    -p, --package NAME           Name of the package to use on provisioning.
    -h, --help
  Datasets(urn): sdc:sdc:centos6lvm:1.1.3 sdc:sdc:smartos64:1.4.7
  Packages(name): Small_1GB Medium_2GB Medium_4GB Large_8GB


• Create
  $ sdc-createmachine -n your-machine -e sdc:sdc:smartos64:1.4.7 -p Medium_2GB
  {"id": "83c2902a-0093-4ce2-8abe-3b9dd6199d8f",
  "name": "your-machine", "type": "smartmachine", "state": "provisioning",
  "dataset": "sdc:sdc:smartos64:1.4.7", "ips": ["210.152.137.65"],
  "memory": 2048, "disk": 61440, "metadata": {},
  "created": "2011-11-06T13:02:09+00:00",
  "updated": "2011-11-06T13:02:10+00:00"}
State of the machine
•Get
 $ sdc-getmachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f
 {"id": "83c2902a-0093-4ce2-8abe-3b9dd6199d8f",
 "name": "your-machine",
 "type": "smartmachine",
 "state": "running",
 "dataset": "sdc:sdc:smartos64:1.4.7",
 "ips": ["210.152.137.65"],
 "memory": 2048,
 "disk": 61440,
 "metadata": {},
 "created": "2011-11-06T13:02:42+00:00",
 "updated": "2011-11-06T13:02:42+00:00"}
Delete the machine
• Stop
  $ sdc-stopmachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f
  true
  $ sdc-getmachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f
  {"id": "83c2902a-0093-4ce2-8abe-3b9dd6199d8f",
  ...
   "state": "stopped",


• Delete
  $ sdc-deletemachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f
  true
  $ sdc-getmachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f
  {"id": "83c2902a-0093-4ce2-8abe-3b9dd6199d8f",
  ...
   "state": "deleted",
Program
Connect and Machine find
require 'smartdc'
config = { "url" => "https://example.com/", "version" => "~6.5",
          "username" => "auth_user","password" => "auth_pass"}


client = Smartdc.new(config)
machines = client.machines.find
machines.each do |machine|
 puts "machines id: #{machine.id}, state: #{machine.state}"
 machine = client.machines(machine.id)


 puts 'Start the machine.'
 machine.start


 puts "machine id: #{machine.read.id}, state: #{machine.read.state}"
end
Return type of the variable
# Type of a variable to mash. (Default)
client.request.return_variable = 'mash'
puts client.datacenters.find
   #=> #<Hashie::Mash example="example.com">


# Type of a variable to hash.
client.request.return_variable = 'hash'
puts client.datacenters.find
   #=> {"example"=>"https://example.com"}


# Type of a variable to json.
client.request.return_variable = 'json'
puts client.datacenters.find
   #=> {"example": "https://example.com"}
End
•RubyGems
 https://rubygems.org/gems/smartdc


•GitHub
 https://github.com/ogom/ruby-smartdc


•API documentation
 http://apidocs.joyent.com/napi/cloudapi/

More Related Content

What's hot

HTML5 Games with CreateJS
HTML5 Games with CreateJSHTML5 Games with CreateJS
HTML5 Games with CreateJSDave Kelleher
 
Solr integration in Magento Enterprise
Solr integration in Magento EnterpriseSolr integration in Magento Enterprise
Solr integration in Magento EnterpriseTobias Zander
 
NoSQL oder: Freiheit ist nicht schmerzfrei - IT Tage
NoSQL oder: Freiheit ist nicht schmerzfrei - IT TageNoSQL oder: Freiheit ist nicht schmerzfrei - IT Tage
NoSQL oder: Freiheit ist nicht schmerzfrei - IT TageAlexander Hendorf
 
Cache is King: Get the Most Bang for Your Buck From Ruby
Cache is King: Get the Most Bang for Your Buck From RubyCache is King: Get the Most Bang for Your Buck From Ruby
Cache is King: Get the Most Bang for Your Buck From RubyMolly Struve
 
MongoD Essentials
MongoD EssentialsMongoD Essentials
MongoD Essentialszahid-mian
 
DEF CON 23 - amit ashbel and maty siman - game of hacks
DEF CON 23 - amit ashbel and maty siman - game of hacks DEF CON 23 - amit ashbel and maty siman - game of hacks
DEF CON 23 - amit ashbel and maty siman - game of hacks Felipe Prado
 
watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話Kohki Miki
 
Firebase_not_really_yohoho
Firebase_not_really_yohohoFirebase_not_really_yohoho
Firebase_not_really_yohohoRoman Sachenko
 
Responsive Design with WordPress
Responsive Design with WordPressResponsive Design with WordPress
Responsive Design with WordPressJoe Casabona
 
Writing Mirror API and Native Apps for Google Glass
Writing Mirror API and Native Apps for Google GlassWriting Mirror API and Native Apps for Google Glass
Writing Mirror API and Native Apps for Google GlassJean-Luc David
 
PHP Cookies, Sessions and Authentication
PHP Cookies, Sessions and AuthenticationPHP Cookies, Sessions and Authentication
PHP Cookies, Sessions and AuthenticationGerard Sychay
 

What's hot (16)

Redis
RedisRedis
Redis
 
HTML5 Games with CreateJS
HTML5 Games with CreateJSHTML5 Games with CreateJS
HTML5 Games with CreateJS
 
Solr integration in Magento Enterprise
Solr integration in Magento EnterpriseSolr integration in Magento Enterprise
Solr integration in Magento Enterprise
 
Web security
Web securityWeb security
Web security
 
NoSQL oder: Freiheit ist nicht schmerzfrei - IT Tage
NoSQL oder: Freiheit ist nicht schmerzfrei - IT TageNoSQL oder: Freiheit ist nicht schmerzfrei - IT Tage
NoSQL oder: Freiheit ist nicht schmerzfrei - IT Tage
 
Cache is King: Get the Most Bang for Your Buck From Ruby
Cache is King: Get the Most Bang for Your Buck From RubyCache is King: Get the Most Bang for Your Buck From Ruby
Cache is King: Get the Most Bang for Your Buck From Ruby
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
DNSSEC FIRST
DNSSEC FIRSTDNSSEC FIRST
DNSSEC FIRST
 
Figaro
FigaroFigaro
Figaro
 
MongoD Essentials
MongoD EssentialsMongoD Essentials
MongoD Essentials
 
DEF CON 23 - amit ashbel and maty siman - game of hacks
DEF CON 23 - amit ashbel and maty siman - game of hacks DEF CON 23 - amit ashbel and maty siman - game of hacks
DEF CON 23 - amit ashbel and maty siman - game of hacks
 
watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話
 
Firebase_not_really_yohoho
Firebase_not_really_yohohoFirebase_not_really_yohoho
Firebase_not_really_yohoho
 
Responsive Design with WordPress
Responsive Design with WordPressResponsive Design with WordPress
Responsive Design with WordPress
 
Writing Mirror API and Native Apps for Google Glass
Writing Mirror API and Native Apps for Google GlassWriting Mirror API and Native Apps for Google Glass
Writing Mirror API and Native Apps for Google Glass
 
PHP Cookies, Sessions and Authentication
PHP Cookies, Sessions and AuthenticationPHP Cookies, Sessions and Authentication
PHP Cookies, Sessions and Authentication
 

Similar to smartdc by Ruby

Cloud api之應用與實例
Cloud api之應用與實例Cloud api之應用與實例
Cloud api之應用與實例Simon Su
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Jen Andre
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-apiEric Ahn
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterAndrey Kudryavtsev
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptxssuserb4d806
 
Travis and fastlane
Travis and fastlaneTravis and fastlane
Travis and fastlaneSteven Shen
 
Oracle sharding : Installation & Configuration
Oracle sharding : Installation & ConfigurationOracle sharding : Installation & Configuration
Oracle sharding : Installation & Configurationsuresh gandhi
 
Presentation iv implementasi 802x eap tls peap mscha pv2
Presentation iv implementasi  802x eap tls peap mscha pv2Presentation iv implementasi  802x eap tls peap mscha pv2
Presentation iv implementasi 802x eap tls peap mscha pv2Hell19
 
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...BlueHat Security Conference
 
Elk its big log season
Elk its big log seasonElk its big log season
Elk its big log seasonEric Luellen
 
Google Compute Engine Starter Guide
Google Compute Engine Starter GuideGoogle Compute Engine Starter Guide
Google Compute Engine Starter GuideSimon Su
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceIntroduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceBo-Yi Wu
 
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloudOpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloudNetcetera
 
[Z cloud] Create Your First Smartmachine In 10min
[Z cloud] Create Your First Smartmachine In 10min[Z cloud] Create Your First Smartmachine In 10min
[Z cloud] Create Your First Smartmachine In 10minYukihiko SAWANOBORI
 
Architecting Secure and Compliant Applications with MongoDB
Architecting Secure and Compliant Applications with MongoDB        Architecting Secure and Compliant Applications with MongoDB
Architecting Secure and Compliant Applications with MongoDB MongoDB
 
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...PavelKonotopov
 

Similar to smartdc by Ruby (20)

Cloud api之應用與實例
Cloud api之應用與實例Cloud api之應用與實例
Cloud api之應用與實例
 
Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'Codetainer: a Docker-based browser code 'sandbox'
Codetainer: a Docker-based browser code 'sandbox'
 
Terraform Cosmos DB
Terraform Cosmos DBTerraform Cosmos DB
Terraform Cosmos DB
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
Multipath
MultipathMultipath
Multipath
 
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation CenterDUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
DUG'20: 12 - DAOS in Lenovo’s HPC Innovation Center
 
Labs_BT_20221017.pptx
Labs_BT_20221017.pptxLabs_BT_20221017.pptx
Labs_BT_20221017.pptx
 
Travis and fastlane
Travis and fastlaneTravis and fastlane
Travis and fastlane
 
Oracle sharding : Installation & Configuration
Oracle sharding : Installation & ConfigurationOracle sharding : Installation & Configuration
Oracle sharding : Installation & Configuration
 
Presentation iv implementasi 802x eap tls peap mscha pv2
Presentation iv implementasi  802x eap tls peap mscha pv2Presentation iv implementasi  802x eap tls peap mscha pv2
Presentation iv implementasi 802x eap tls peap mscha pv2
 
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
BlueHat v17 || Where, how, and why is SSL traffic on mobile getting intercept...
 
Elk its big log season
Elk its big log seasonElk its big log season
Elk its big log season
 
Monkey man
Monkey manMonkey man
Monkey man
 
Google Compute Engine Starter Guide
Google Compute Engine Starter GuideGoogle Compute Engine Starter Guide
Google Compute Engine Starter Guide
 
Introduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript ConferenceIntroduction to Grunt.js on Taiwan JavaScript Conference
Introduction to Grunt.js on Taiwan JavaScript Conference
 
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloudOpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
OpenCloudDay 2014: Deploying trusted developer sandboxes in Amazon's cloud
 
[Z cloud] Create Your First Smartmachine In 10min
[Z cloud] Create Your First Smartmachine In 10min[Z cloud] Create Your First Smartmachine In 10min
[Z cloud] Create Your First Smartmachine In 10min
 
Architecting Secure and Compliant Applications with MongoDB
Architecting Secure and Compliant Applications with MongoDB        Architecting Secure and Compliant Applications with MongoDB
Architecting Secure and Compliant Applications with MongoDB
 
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
 
Demystifying Apple 'Pie' & TouchID
Demystifying Apple 'Pie' & TouchIDDemystifying Apple 'Pie' & TouchID
Demystifying Apple 'Pie' & TouchID
 

Recently uploaded

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Recently uploaded (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

smartdc by Ruby

  • 1. ruby-smartdc Usage CLI and Program
  • 2. Get Started with SmartDataCenter •Create Account •Get a username and password. •Customers http://www.joyent.com/customers/ ‣ http://www.joyentcloud.com/ ‣ http://z-cloud.jp/ ‣ etc...
  • 3. CLI
  • 4. Install and Setup •Install $ gem install smartdc Fetching: smartdc-0.3.0.gem (100%) Successfully installed smartdc-0.3.0 1 gem installed •Setup $ sdc-setup https://api.z-cloud.jp version:[~6.5] ~6.5 Username (login): your name Password: your password Successful configuration.
  • 5. Register to generate an SSH •Generate $ ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa Generating public/private rsa key pair. ... •Register $ sdc-createkey your-key ~/.ssh/id_rsa.pub { "name": "your-key", "key": "ssh-rsa ...", "created": "2011-11-06T12:43:24+00:00", "updated": "2011-11-06T12:43:24+00:00" }
  • 6. Provision a new Machine • Help $ sdc-createmachine -h Usage: sdc-createmachine [options] -n, --name NAME friendly name for this machine. -e, --dataset URN dataset URN. -p, --package NAME Name of the package to use on provisioning. -h, --help Datasets(urn): sdc:sdc:centos6lvm:1.1.3 sdc:sdc:smartos64:1.4.7 Packages(name): Small_1GB Medium_2GB Medium_4GB Large_8GB • Create $ sdc-createmachine -n your-machine -e sdc:sdc:smartos64:1.4.7 -p Medium_2GB {"id": "83c2902a-0093-4ce2-8abe-3b9dd6199d8f", "name": "your-machine", "type": "smartmachine", "state": "provisioning", "dataset": "sdc:sdc:smartos64:1.4.7", "ips": ["210.152.137.65"], "memory": 2048, "disk": 61440, "metadata": {}, "created": "2011-11-06T13:02:09+00:00", "updated": "2011-11-06T13:02:10+00:00"}
  • 7. State of the machine •Get $ sdc-getmachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f {"id": "83c2902a-0093-4ce2-8abe-3b9dd6199d8f", "name": "your-machine", "type": "smartmachine", "state": "running", "dataset": "sdc:sdc:smartos64:1.4.7", "ips": ["210.152.137.65"], "memory": 2048, "disk": 61440, "metadata": {}, "created": "2011-11-06T13:02:42+00:00", "updated": "2011-11-06T13:02:42+00:00"}
  • 8. Delete the machine • Stop $ sdc-stopmachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f true $ sdc-getmachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f {"id": "83c2902a-0093-4ce2-8abe-3b9dd6199d8f", ... "state": "stopped", • Delete $ sdc-deletemachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f true $ sdc-getmachine 83c2902a-0093-4ce2-8abe-3b9dd6199d8f {"id": "83c2902a-0093-4ce2-8abe-3b9dd6199d8f", ... "state": "deleted",
  • 10. Connect and Machine find require 'smartdc' config = { "url" => "https://example.com/", "version" => "~6.5", "username" => "auth_user","password" => "auth_pass"} client = Smartdc.new(config) machines = client.machines.find machines.each do |machine| puts "machines id: #{machine.id}, state: #{machine.state}" machine = client.machines(machine.id) puts 'Start the machine.' machine.start puts "machine id: #{machine.read.id}, state: #{machine.read.state}" end
  • 11. Return type of the variable # Type of a variable to mash. (Default) client.request.return_variable = 'mash' puts client.datacenters.find #=> #<Hashie::Mash example="example.com"> # Type of a variable to hash. client.request.return_variable = 'hash' puts client.datacenters.find #=> {"example"=>"https://example.com"} # Type of a variable to json. client.request.return_variable = 'json' puts client.datacenters.find #=> {"example": "https://example.com"}