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

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

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"}