SlideShare a Scribd company logo
CloudAPI
MiCloud Team: 振偉 / Simon
Got the PPT - http://goo.gl/DZH2Zp
Outline
● About API, SDK, REST
● SmartDataCenter CloudAPI
○ Connect CloudAPI
○ Machine managements
○ Machine create options
○ Cloud Analysis
● After Class
○ Create a machine with pre-install joomla
○ Give your machine a domain
API and SDK
● Application Programming Interface
○ Is a set of routines, protocols, and tools for
building software applications
● Software Development Kit
○ Is typically a set of software development tools
System code
non-standard language API
SDKSpecific programming language
REST
● Representational State Transfer
○ Resource
○ URL(Uniform Resource Locator)
○ method : POST, GET, PUT, DELETE
CloudAPI
What is CloudAPI?
CloudAPI
● We can use cloudapi to ….
○ Provision new machines (both SmartMachines and
traditional Virtual Machines)
○ Manage your account credentials
○ Create custom analytics for monitoring your
inferastructure
Connect CloudAPI - curl
● curl: linux/unix command to view http(s)
requests
● REST API - curl
○ curl -sS -k
-H 'Accept:application/json'
-H 'x-Api-version:~6.5'
-u 'account:password' https://api.micloud.
tw/charles/machines
-X GET
Data input use JSON
Sepcify the API version
Sepcify the username
and password info
API route for action
API route method
Connect CloudAPI -
Command Line Interface(CLI)
● Command line interface(CLI) - node.js SDK
○ Install node.js
○ Install smartdc: npm install smartdc -g
○ Upload your ssh key to key store and set env value
CloudAPI Version 6.5.x
Connect CloudAPI - Java SDK
● Provider: Muzee (http://www.muzee.net/)
● Github: https://github.com/qrtt1/joyent.
cloudapi
● Piece of code:
SmartDCClient client =
new SmartDCClient(
":api-server:",
":user-account:",
":key-name:",
new File(":private-key:"));
Systme.out.println(client.listDatasets());
● Node.js - the core tech of MiCloud CloudAPI
● Github: https://github.com/joyent/node-
smartdc
● Documentation: http://apidocs.joyent.
com/cloudapi/
● Installation:
$ npm install smartdc -g
● Piece of Code
Connect CloudAPI - Node.js SDK
var smartdc = require('smartdc');
var client = smartdc.createClient(...);
client.listMachines(function(err, machines) {
machines.forEach(function(m) {
console.log('Machine: ' + JSON.stringify(m, null, 2));
});
});
Management your cloud!
Initialize your environment
● Create your MiCloud account
● Generate your own ssh key:
$ ssh-keygen -t rsa
Import Key to Key Store -
The REST way / Use curl
● CreateKey (POST /:login/keys)
● curl -sS -k -H 'Accept:application/json' 
https://api.micloud.tw/$account/keys -X POST 
-H 'x-Api-version:~6.5' 
-u '$account:$password' 
-F 'key=<$publickeyPATH' 
-F 'name=$keyname’
Use your credential
Use your key path
Give key a name
PS: We will skip “-H 'x-Api-version:~6.5' -u '$account:$password'“ in the following slides,
and the “https://api.micloud.tw” will skip, too.
In this example, the api will be: [POST] /:login/keys, and will have parameters “key” and
“name” need to provide.
Import Key to Key Store - Use CLI
● smartdc ~6.5
Use CLI command: sdc-setup
select “no” to import new key
select you key file path
do export like this...
● ListKeys (GET /:login/keys)
● $ curl -sS -k -H 'Accept:application/json' 
-H 'x-Api-version:~6.5' 
-u $AUTH https://api.micloud.tw/charles/keys -X GET
Check your Key Store - curl
Check your Key Store - CLI
$ sdc-listkeys
We assump user use Java & Node.js SDK already import key...
● Account
● Regist Credit Card
● SSH Key
● Dataset:
The machine type, include OS or a
service preloaded system
● Package:
The size information of a machine,
include CPU, memory, disk size...
● Alias/Name:
The name of your machine
Before create machine
List the public dataset & packages
● $ sdc-listdatasets
ListDatasets (GET /:login/datasets)
● $ sdc-listpackages
ListPackages (GET /:login/packages)
● Tips:
○ use help to see more parameters
ex: sdc-listdatasets --help
○ check the document for more help
List Datasets Example
List Packages Example
Machine Management API - List
List Machines
● CLI:
sdc-listmachines
● REST:
ListMachines (GET /:login/machines)
Get Machine
● CLI:
sdc-getmachine [machine uuid]
● REST:
GetMachine (GET /:login/machines/:id)
List Machines under my account
Get the detail info of one machine
Machine Management API - Create
● CLI:
sdc-createmachines 
-dataset [dataset] 
-package [package] [machine alias]
● REST:
CreateMachine (POST /:login/machines)
Create a 512M SmartOSPlus64 machine
Machine Management API -
Stop & Delete a Machine
● sdc-stopmachine [machine uuid]
StopMachine (POST /:login/machines/:id?action=stop)
● sdc-deletemachine [machine uuid]
DeleteMachine (DELETE /:login/machines/:id)
Advance Use of CloudAPI -
Create a Machine with User-Script
sdc-createmachine 
--dataset "sdc:sdc:smartosplus64:3.0.7" 
--package "XS 512MB RAM (4CORE)" 
--script ./install.sh 
--tag hadoop-namenode=me
curl -k https://raw.github.
com/peihsinsu/installer/master/smartos-
standard64/install-joomla.sh | sh
The Script: ./install.sh
Specify a script file to let machine
execute after boot
Cloud Analysis - Dtrace
Dtrace -- MiCloud繼承
Joyent的雲端平台,提供
有一個進階的服務監控
方式,這是個非常進階
的狀態監控系統,原生
於Solaris Unix上,已有
Mac與SmartOS的實作
套件,亦可於MiCloud環
境上直接使用。
Cloud Analysis - Instruments 1/3
$ sdc-describeanalytics
可使用的監控模組:此
部份為所有監控項目的
大略說明
欄位說明:此部份為每
種欄位的設定說明
Cloud Analysis - Instruments 2/3
型別說明:此部份說明
於分析上定義的基本資
料型態有哪些...
可用監控設定說明: 這
個是主要監控要設定的
參考值...
Cloud Analysis - Instruments 3/3
轉換說明:此部份可以
透過IP轉換地理位置,
來進階顯示於世界地圖
上…
Cloud Analysis - Create Instrument
● 建立監控點
Cloud Analysis - Get instruments
● 取回監控值
監控的結果值,不過...這邊是整
合的數值,尚未能顯示每台主機
的個別值...
Cloud Analysis - Use decomposition
● 使用decomposition分類結果值
加入decomposition可以有
效分類結果值...
Cloud Analysis -
Get decomposition data
● 使用decomposition的取值結果
按照zonename做分類的監控數
值...
Cloud Analysis -
Use jsontool to format data
● use jsontool
透過jsontool,透過主機的uuid,
直接取出某台主機的記憶體使
用量...
END - Q&A

More Related Content

What's hot

PHP London Dec 2013 - Varnish - The 9 circles of hell
PHP London Dec 2013 - Varnish - The 9 circles of hellPHP London Dec 2013 - Varnish - The 9 circles of hell
PHP London Dec 2013 - Varnish - The 9 circles of hell
luis-ferro
 
The jsdom
The jsdomThe jsdom
The jsdom
Domenic Denicola
 
TDD With Typescript - Noam Katzir
TDD With Typescript - Noam KatzirTDD With Typescript - Noam Katzir
TDD With Typescript - Noam Katzir
Wix Engineering
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?
Felix Geisendörfer
 
Why Grails?
Why Grails?Why Grails?
Why Grails?
Yiguang Hu
 
わかった気になるgitit-0.8
わかった気になるgitit-0.8わかった気になるgitit-0.8
わかった気になるgitit-0.8
Kiwamu Okabe
 
Home Improvement: Architecture & Kotlin
Home Improvement: Architecture & KotlinHome Improvement: Architecture & Kotlin
Home Improvement: Architecture & Kotlin
Jorge Ortiz
 

What's hot (8)

PHP London Dec 2013 - Varnish - The 9 circles of hell
PHP London Dec 2013 - Varnish - The 9 circles of hellPHP London Dec 2013 - Varnish - The 9 circles of hell
PHP London Dec 2013 - Varnish - The 9 circles of hell
 
The jsdom
The jsdomThe jsdom
The jsdom
 
TDD With Typescript - Noam Katzir
TDD With Typescript - Noam KatzirTDD With Typescript - Noam Katzir
TDD With Typescript - Noam Katzir
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?
 
Why Grails?
Why Grails?Why Grails?
Why Grails?
 
わかった気になるgitit-0.8
わかった気になるgitit-0.8わかった気になるgitit-0.8
わかった気になるgitit-0.8
 
Home Improvement: Architecture & Kotlin
Home Improvement: Architecture & KotlinHome Improvement: Architecture & Kotlin
Home Improvement: Architecture & Kotlin
 
Tp web
Tp webTp web
Tp web
 

Viewers also liked

De 03 Introduction To V Cloud Api V1
De 03 Introduction To V Cloud Api V1De 03 Introduction To V Cloud Api V1
De 03 Introduction To V Cloud Api V1ikewu83
 
Cloud API introduction from Infosec 2012
Cloud API introduction from Infosec 2012Cloud API introduction from Infosec 2012
Cloud API introduction from Infosec 2012
Andreas Krohn
 
V c loudapi_coffeetalk__pimplaskar_may2010
V c loudapi_coffeetalk__pimplaskar_may2010V c loudapi_coffeetalk__pimplaskar_may2010
V c loudapi_coffeetalk__pimplaskar_may2010
Pablo Roesch
 
ProfitBricks-cloud-computing-2.0-webinar 5-1-13
ProfitBricks-cloud-computing-2.0-webinar 5-1-13ProfitBricks-cloud-computing-2.0-webinar 5-1-13
ProfitBricks-cloud-computing-2.0-webinar 5-1-13
ProfitBricks
 
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishingLegacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishing
kumar gaurav
 
V sphere overview srm-your cloud-3-1-2011
V sphere overview srm-your cloud-3-1-2011V sphere overview srm-your cloud-3-1-2011
V sphere overview srm-your cloud-3-1-2011
Kris Walsh
 

Viewers also liked (6)

De 03 Introduction To V Cloud Api V1
De 03 Introduction To V Cloud Api V1De 03 Introduction To V Cloud Api V1
De 03 Introduction To V Cloud Api V1
 
Cloud API introduction from Infosec 2012
Cloud API introduction from Infosec 2012Cloud API introduction from Infosec 2012
Cloud API introduction from Infosec 2012
 
V c loudapi_coffeetalk__pimplaskar_may2010
V c loudapi_coffeetalk__pimplaskar_may2010V c loudapi_coffeetalk__pimplaskar_may2010
V c loudapi_coffeetalk__pimplaskar_may2010
 
ProfitBricks-cloud-computing-2.0-webinar 5-1-13
ProfitBricks-cloud-computing-2.0-webinar 5-1-13ProfitBricks-cloud-computing-2.0-webinar 5-1-13
ProfitBricks-cloud-computing-2.0-webinar 5-1-13
 
Legacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishingLegacy modernization, cloud orchestration, api publishing
Legacy modernization, cloud orchestration, api publishing
 
V sphere overview srm-your cloud-3-1-2011
V sphere overview srm-your cloud-3-1-2011V sphere overview srm-your cloud-3-1-2011
V sphere overview srm-your cloud-3-1-2011
 

Similar to Cloud api之應用與實例

GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic TrainingGCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
Simon Su
 
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhereNew Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
Rodrique Heron
 
smartdc by Ruby
smartdc by Rubysmartdc by Ruby
smartdc by Ruby
ogom_
 
Tools for building your identity application
Tools for building your identity applicationTools for building your identity application
Tools for building your identity application
Nemanja Patrnogic
 
Sahana introduction to the code v2
Sahana   introduction to the code v2Sahana   introduction to the code v2
Sahana introduction to the code v2AidIQ
 
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsOrchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Cloud Native Day Tel Aviv
 
Nko workshop - node js crud & deploy
Nko workshop - node js crud & deployNko workshop - node js crud & deploy
Nko workshop - node js crud & deploySimon Su
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on Kubernetes
Jimmy Angelakos
 
AWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp VaultAWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp Vault
Grzegorz Adamowicz
 
Integrating ChatGPT with Apache Airflow
Integrating ChatGPT with Apache AirflowIntegrating ChatGPT with Apache Airflow
Integrating ChatGPT with Apache Airflow
Tatiana Al-Chueyr
 
Deploy MediaWiki usgin Fiware Lab Facilities
Deploy MediaWiki usgin Fiware Lab FacilitiesDeploy MediaWiki usgin Fiware Lab Facilities
Deploy MediaWiki usgin Fiware Lab Facilities
José Ignacio Carretero Guarde
 
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
Denis Gundarev
 
Deploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesDeploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab Facilities
FIWARE
 
Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and Maintenance
Jazkarta, Inc.
 
Building an analytics workflow using Apache Airflow
Building an analytics workflow using Apache AirflowBuilding an analytics workflow using Apache Airflow
Building an analytics workflow using Apache Airflow
Yohei Onishi
 
Configuration Kits - DrupalCamp NYC 2021
Configuration Kits - DrupalCamp NYC 2021Configuration Kits - DrupalCamp NYC 2021
Configuration Kits - DrupalCamp NYC 2021
Martin Anderson-Clutz
 
Single Sign On Across Drupal 8 - DrupalCon Global 2020
Single Sign On Across Drupal 8 - DrupalCon Global 2020Single Sign On Across Drupal 8 - DrupalCon Global 2020
Single Sign On Across Drupal 8 - DrupalCon Global 2020
Iwantha Lekamge
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Opersys inc.
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Leo Lorieri
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
Kris Buytaert
 

Similar to Cloud api之應用與實例 (20)

GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic TrainingGCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
 
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhereNew Jersey Red Hat Users Group Presentation: Provisioning anywhere
New Jersey Red Hat Users Group Presentation: Provisioning anywhere
 
smartdc by Ruby
smartdc by Rubysmartdc by Ruby
smartdc by Ruby
 
Tools for building your identity application
Tools for building your identity applicationTools for building your identity application
Tools for building your identity application
 
Sahana introduction to the code v2
Sahana   introduction to the code v2Sahana   introduction to the code v2
Sahana introduction to the code v2
 
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsOrchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
 
Nko workshop - node js crud & deploy
Nko workshop - node js crud & deployNko workshop - node js crud & deploy
Nko workshop - node js crud & deploy
 
Deploying PostgreSQL on Kubernetes
Deploying PostgreSQL on KubernetesDeploying PostgreSQL on Kubernetes
Deploying PostgreSQL on Kubernetes
 
AWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp VaultAWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp Vault
 
Integrating ChatGPT with Apache Airflow
Integrating ChatGPT with Apache AirflowIntegrating ChatGPT with Apache Airflow
Integrating ChatGPT with Apache Airflow
 
Deploy MediaWiki usgin Fiware Lab Facilities
Deploy MediaWiki usgin Fiware Lab FacilitiesDeploy MediaWiki usgin Fiware Lab Facilities
Deploy MediaWiki usgin Fiware Lab Facilities
 
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
How to hack Citrix (So, You Just Inherited Someone Else's Citrix Environment....
 
Deploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesDeploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab Facilities
 
Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and Maintenance
 
Building an analytics workflow using Apache Airflow
Building an analytics workflow using Apache AirflowBuilding an analytics workflow using Apache Airflow
Building an analytics workflow using Apache Airflow
 
Configuration Kits - DrupalCamp NYC 2021
Configuration Kits - DrupalCamp NYC 2021Configuration Kits - DrupalCamp NYC 2021
Configuration Kits - DrupalCamp NYC 2021
 
Single Sign On Across Drupal 8 - DrupalCon Global 2020
Single Sign On Across Drupal 8 - DrupalCon Global 2020Single Sign On Across Drupal 8 - DrupalCon Global 2020
Single Sign On Across Drupal 8 - DrupalCon Global 2020
 
Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013Working with the AOSP - Linaro Connect Asia 2013
Working with the AOSP - Linaro Connect Asia 2013
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 

More from Simon Su

Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic Operation
Simon Su
 
Google IoT Core 初體驗
Google IoT Core 初體驗Google IoT Core 初體驗
Google IoT Core 初體驗
Simon Su
 
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoTJSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
Simon Su
 
GCPUG.TW meetup #28 - GKE上運作您的k8s服務
GCPUG.TW meetup #28 - GKE上運作您的k8s服務GCPUG.TW meetup #28 - GKE上運作您的k8s服務
GCPUG.TW meetup #28 - GKE上運作您的k8s服務
Simon Su
 
Google Cloud Platform Special Training
Google Cloud Platform Special TrainingGoogle Cloud Platform Special Training
Google Cloud Platform Special Training
Simon Su
 
GCE Windows Serial Console Usage Guide
GCE Windows Serial Console Usage GuideGCE Windows Serial Console Usage Guide
GCE Windows Serial Console Usage Guide
Simon Su
 
GCPNext17' Extend 開始GCP了嗎?
GCPNext17' Extend   開始GCP了嗎?GCPNext17' Extend   開始GCP了嗎?
GCPNext17' Extend 開始GCP了嗎?
Simon Su
 
Try Cloud Spanner
Try Cloud SpannerTry Cloud Spanner
Try Cloud Spanner
Simon Su
 
Google Cloud Monitoring
Google Cloud MonitoringGoogle Cloud Monitoring
Google Cloud Monitoring
Simon Su
 
Google Cloud Computing compares GCE, GAE and GKE
Google Cloud Computing compares GCE, GAE and GKEGoogle Cloud Computing compares GCE, GAE and GKE
Google Cloud Computing compares GCE, GAE and GKE
Simon Su
 
JCConf 2016 - Google Dataflow 小試
JCConf 2016 - Google Dataflow 小試JCConf 2016 - Google Dataflow 小試
JCConf 2016 - Google Dataflow 小試
Simon Su
 
JCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop LabsJCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop Labs
Simon Su
 
JCConf2016 - Dataflow Workshop Setup
JCConf2016 - Dataflow Workshop SetupJCConf2016 - Dataflow Workshop Setup
JCConf2016 - Dataflow Workshop Setup
Simon Su
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow Introduction
Simon Su
 
Brocade - Stingray Application Firewall
Brocade - Stingray Application FirewallBrocade - Stingray Application Firewall
Brocade - Stingray Application Firewall
Simon Su
 
使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析
使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析
使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析
Simon Su
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
Simon Su
 
Google I/O 2016 Recap - Google Cloud Platform News Update
Google I/O 2016 Recap - Google Cloud Platform News UpdateGoogle I/O 2016 Recap - Google Cloud Platform News Update
Google I/O 2016 Recap - Google Cloud Platform News Update
Simon Su
 
IThome DevOps Summit - IoT、docker與DevOps
IThome DevOps Summit - IoT、docker與DevOpsIThome DevOps Summit - IoT、docker與DevOps
IThome DevOps Summit - IoT、docker與DevOps
Simon Su
 
Google Cloud Platform Introduction - 2016Q3
Google Cloud Platform Introduction - 2016Q3Google Cloud Platform Introduction - 2016Q3
Google Cloud Platform Introduction - 2016Q3
Simon Su
 

More from Simon Su (20)

Kubernetes Basic Operation
Kubernetes Basic OperationKubernetes Basic Operation
Kubernetes Basic Operation
 
Google IoT Core 初體驗
Google IoT Core 初體驗Google IoT Core 初體驗
Google IoT Core 初體驗
 
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoTJSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
 
GCPUG.TW meetup #28 - GKE上運作您的k8s服務
GCPUG.TW meetup #28 - GKE上運作您的k8s服務GCPUG.TW meetup #28 - GKE上運作您的k8s服務
GCPUG.TW meetup #28 - GKE上運作您的k8s服務
 
Google Cloud Platform Special Training
Google Cloud Platform Special TrainingGoogle Cloud Platform Special Training
Google Cloud Platform Special Training
 
GCE Windows Serial Console Usage Guide
GCE Windows Serial Console Usage GuideGCE Windows Serial Console Usage Guide
GCE Windows Serial Console Usage Guide
 
GCPNext17' Extend 開始GCP了嗎?
GCPNext17' Extend   開始GCP了嗎?GCPNext17' Extend   開始GCP了嗎?
GCPNext17' Extend 開始GCP了嗎?
 
Try Cloud Spanner
Try Cloud SpannerTry Cloud Spanner
Try Cloud Spanner
 
Google Cloud Monitoring
Google Cloud MonitoringGoogle Cloud Monitoring
Google Cloud Monitoring
 
Google Cloud Computing compares GCE, GAE and GKE
Google Cloud Computing compares GCE, GAE and GKEGoogle Cloud Computing compares GCE, GAE and GKE
Google Cloud Computing compares GCE, GAE and GKE
 
JCConf 2016 - Google Dataflow 小試
JCConf 2016 - Google Dataflow 小試JCConf 2016 - Google Dataflow 小試
JCConf 2016 - Google Dataflow 小試
 
JCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop LabsJCConf 2016 - Dataflow Workshop Labs
JCConf 2016 - Dataflow Workshop Labs
 
JCConf2016 - Dataflow Workshop Setup
JCConf2016 - Dataflow Workshop SetupJCConf2016 - Dataflow Workshop Setup
JCConf2016 - Dataflow Workshop Setup
 
GCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow IntroductionGCPUG meetup 201610 - Dataflow Introduction
GCPUG meetup 201610 - Dataflow Introduction
 
Brocade - Stingray Application Firewall
Brocade - Stingray Application FirewallBrocade - Stingray Application Firewall
Brocade - Stingray Application Firewall
 
使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析
使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析
使用 Raspberry pi + fluentd + gcp cloud logging, big query 做iot 資料搜集與分析
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Google I/O 2016 Recap - Google Cloud Platform News Update
Google I/O 2016 Recap - Google Cloud Platform News UpdateGoogle I/O 2016 Recap - Google Cloud Platform News Update
Google I/O 2016 Recap - Google Cloud Platform News Update
 
IThome DevOps Summit - IoT、docker與DevOps
IThome DevOps Summit - IoT、docker與DevOpsIThome DevOps Summit - IoT、docker與DevOps
IThome DevOps Summit - IoT、docker與DevOps
 
Google Cloud Platform Introduction - 2016Q3
Google Cloud Platform Introduction - 2016Q3Google Cloud Platform Introduction - 2016Q3
Google Cloud Platform Introduction - 2016Q3
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 

Cloud api之應用與實例

  • 1. CloudAPI MiCloud Team: 振偉 / Simon Got the PPT - http://goo.gl/DZH2Zp
  • 2. Outline ● About API, SDK, REST ● SmartDataCenter CloudAPI ○ Connect CloudAPI ○ Machine managements ○ Machine create options ○ Cloud Analysis ● After Class ○ Create a machine with pre-install joomla ○ Give your machine a domain
  • 3. API and SDK ● Application Programming Interface ○ Is a set of routines, protocols, and tools for building software applications ● Software Development Kit ○ Is typically a set of software development tools System code non-standard language API SDKSpecific programming language
  • 4. REST ● Representational State Transfer ○ Resource ○ URL(Uniform Resource Locator) ○ method : POST, GET, PUT, DELETE
  • 6. CloudAPI ● We can use cloudapi to …. ○ Provision new machines (both SmartMachines and traditional Virtual Machines) ○ Manage your account credentials ○ Create custom analytics for monitoring your inferastructure
  • 7. Connect CloudAPI - curl ● curl: linux/unix command to view http(s) requests ● REST API - curl ○ curl -sS -k -H 'Accept:application/json' -H 'x-Api-version:~6.5' -u 'account:password' https://api.micloud. tw/charles/machines -X GET Data input use JSON Sepcify the API version Sepcify the username and password info API route for action API route method
  • 8. Connect CloudAPI - Command Line Interface(CLI) ● Command line interface(CLI) - node.js SDK ○ Install node.js ○ Install smartdc: npm install smartdc -g ○ Upload your ssh key to key store and set env value CloudAPI Version 6.5.x
  • 9. Connect CloudAPI - Java SDK ● Provider: Muzee (http://www.muzee.net/) ● Github: https://github.com/qrtt1/joyent. cloudapi ● Piece of code: SmartDCClient client = new SmartDCClient( ":api-server:", ":user-account:", ":key-name:", new File(":private-key:")); Systme.out.println(client.listDatasets());
  • 10. ● Node.js - the core tech of MiCloud CloudAPI ● Github: https://github.com/joyent/node- smartdc ● Documentation: http://apidocs.joyent. com/cloudapi/ ● Installation: $ npm install smartdc -g ● Piece of Code Connect CloudAPI - Node.js SDK var smartdc = require('smartdc'); var client = smartdc.createClient(...); client.listMachines(function(err, machines) { machines.forEach(function(m) { console.log('Machine: ' + JSON.stringify(m, null, 2)); }); });
  • 12. Initialize your environment ● Create your MiCloud account ● Generate your own ssh key: $ ssh-keygen -t rsa
  • 13. Import Key to Key Store - The REST way / Use curl ● CreateKey (POST /:login/keys) ● curl -sS -k -H 'Accept:application/json' https://api.micloud.tw/$account/keys -X POST -H 'x-Api-version:~6.5' -u '$account:$password' -F 'key=<$publickeyPATH' -F 'name=$keyname’ Use your credential Use your key path Give key a name PS: We will skip “-H 'x-Api-version:~6.5' -u '$account:$password'“ in the following slides, and the “https://api.micloud.tw” will skip, too. In this example, the api will be: [POST] /:login/keys, and will have parameters “key” and “name” need to provide.
  • 14. Import Key to Key Store - Use CLI ● smartdc ~6.5 Use CLI command: sdc-setup select “no” to import new key select you key file path do export like this...
  • 15. ● ListKeys (GET /:login/keys) ● $ curl -sS -k -H 'Accept:application/json' -H 'x-Api-version:~6.5' -u $AUTH https://api.micloud.tw/charles/keys -X GET Check your Key Store - curl
  • 16. Check your Key Store - CLI $ sdc-listkeys
  • 17. We assump user use Java & Node.js SDK already import key...
  • 18. ● Account ● Regist Credit Card ● SSH Key ● Dataset: The machine type, include OS or a service preloaded system ● Package: The size information of a machine, include CPU, memory, disk size... ● Alias/Name: The name of your machine Before create machine
  • 19. List the public dataset & packages ● $ sdc-listdatasets ListDatasets (GET /:login/datasets) ● $ sdc-listpackages ListPackages (GET /:login/packages) ● Tips: ○ use help to see more parameters ex: sdc-listdatasets --help ○ check the document for more help
  • 22. Machine Management API - List List Machines ● CLI: sdc-listmachines ● REST: ListMachines (GET /:login/machines) Get Machine ● CLI: sdc-getmachine [machine uuid] ● REST: GetMachine (GET /:login/machines/:id)
  • 23. List Machines under my account
  • 24. Get the detail info of one machine
  • 25. Machine Management API - Create ● CLI: sdc-createmachines -dataset [dataset] -package [package] [machine alias] ● REST: CreateMachine (POST /:login/machines)
  • 26. Create a 512M SmartOSPlus64 machine
  • 27. Machine Management API - Stop & Delete a Machine ● sdc-stopmachine [machine uuid] StopMachine (POST /:login/machines/:id?action=stop) ● sdc-deletemachine [machine uuid] DeleteMachine (DELETE /:login/machines/:id)
  • 28. Advance Use of CloudAPI - Create a Machine with User-Script sdc-createmachine --dataset "sdc:sdc:smartosplus64:3.0.7" --package "XS 512MB RAM (4CORE)" --script ./install.sh --tag hadoop-namenode=me curl -k https://raw.github. com/peihsinsu/installer/master/smartos- standard64/install-joomla.sh | sh The Script: ./install.sh Specify a script file to let machine execute after boot
  • 29. Cloud Analysis - Dtrace Dtrace -- MiCloud繼承 Joyent的雲端平台,提供 有一個進階的服務監控 方式,這是個非常進階 的狀態監控系統,原生 於Solaris Unix上,已有 Mac與SmartOS的實作 套件,亦可於MiCloud環 境上直接使用。
  • 30. Cloud Analysis - Instruments 1/3 $ sdc-describeanalytics 可使用的監控模組:此 部份為所有監控項目的 大略說明 欄位說明:此部份為每 種欄位的設定說明
  • 31. Cloud Analysis - Instruments 2/3 型別說明:此部份說明 於分析上定義的基本資 料型態有哪些... 可用監控設定說明: 這 個是主要監控要設定的 參考值...
  • 32. Cloud Analysis - Instruments 3/3 轉換說明:此部份可以 透過IP轉換地理位置, 來進階顯示於世界地圖 上…
  • 33. Cloud Analysis - Create Instrument ● 建立監控點
  • 34. Cloud Analysis - Get instruments ● 取回監控值 監控的結果值,不過...這邊是整 合的數值,尚未能顯示每台主機 的個別值...
  • 35. Cloud Analysis - Use decomposition ● 使用decomposition分類結果值 加入decomposition可以有 效分類結果值...
  • 36. Cloud Analysis - Get decomposition data ● 使用decomposition的取值結果 按照zonename做分類的監控數 值...
  • 37. Cloud Analysis - Use jsontool to format data ● use jsontool 透過jsontool,透過主機的uuid, 直接取出某台主機的記憶體使 用量...