33
ibm-bluemix #ibm- bluemix

ibm-bluemix - RIP Tutorial1: ibm-bluemix Bluemix , , IBM (PaaS) . Bluemix . Java, Node.js, Swift, Go, PHP, Python Ruby . IBM Bluemix Cloud Foundry . iOS Docker

  • Upload
    others

  • View
    17

  • Download
    0

Embed Size (px)

Citation preview

ibm-bluemix

#ibm-

bluemix

1

1: ibm-bluemix 2

2

Examples 2

2

IBM Bluemix 2

1 : bluemix 2

2 : Bluemix Cloud Foundry 2

2a : Bluemix 2

2b : Bluemix 3

IBM Bluemix Toolchain GitHub RESTful API (Node.js) 3

1 : GitHub 3

2 : IBM Bluemix 3

3 : GitHub Rest API 4

4 : Toolchain (Continuous Deployment Tool) IBM Bluemix GitHub 4

5 : PostMan API 25

: 25

2: Bluemix 27

27

Examples 27

Bluemix iOS 27

3: 29

Examples 29

VCAP_SERVICES 29

31

You can share this PDF with anyone you feel could benefit from it, downloaded the latest version from: ibm-bluemix

It is an unofficial and free ibm-bluemix ebook created for educational purposes. All the content is extracted from Stack Overflow Documentation, which is written by many hardworking individuals at Stack Overflow. It is neither affiliated with Stack Overflow nor official ibm-bluemix.

The content is released under Creative Commons BY-SA, and the list of contributors to each chapter are provided in the credits section at the end of this book. Images may be copyright of their respective owners unless otherwise specified. All trademarks and registered trademarks are the property of their respective company owners.

Use the content presented in this book at your own risk; it is not guaranteed to be correct nor accurate, please send your feedback and corrections to [email protected]

https://riptutorial.com/ko/home 1

1: ibm-bluemix Bluemix , , IBM (PaaS) . Bluemix . Java, Node.js, Swift, Go, PHP, Python Ruby .

IBM Bluemix Cloud Foundry . iOS Docker . Bluemix . , VM , .

Bluemix . Dallas, London Sydney Bluemix 100 .

Compute - , Docker , •- VPN •- •- •Watson - •- API , , •DevOps - , , , •- , •- , , , •- , , •Internet of Things - IoT •

Bluemix - •ID - Bluemix FAQ•Bluemix - •Bluemix •Bluemix - US-South , EU-GB , AU-SYD•

Examples

ibm-bluemix .

IBM Bluemix

1 : bluemix

https://console.ng.bluemix.net/registration/ .

30 . ( ).

2 : Bluemix Cloud Foundry

. 1 . CLI https://new-console.ng.bluemix.net/docs/starters/install_cli.html cli cli.

2a : Bluemix

https://riptutorial.com/ko/home 2

$ bluemix api https://api.ng.bluemix.net

2b : Bluemix

$ bluemix login -u username -o org_name -s space_name

1 , org_name space_name .

bluemix . http://clis.ng.bluemix.net/ui/home.html CLI .

IBM Bluemix Toolchain GitHub RESTful API (Node.js)

1 : GitHub

GitHub 2 . .

1.a Github .

1.b , . GitHub .

https://riptutorial.com/ko/home 3

" " .

https://riptutorial.com/ko/home 5

4.c . .

https://riptutorial.com/ko/home 6

4.d

4.e Toolchain Name . URL API .

https://riptutorial.com/ko/home 7

4.f Bluemix . .

https://riptutorial.com/ko/home 8

4.g GitHub

https://riptutorial.com/ko/home 9

4.h GitHub Toolchain . . API URL . Toolchain . .

https://riptutorial.com/ko/home 10

4.i Rest API . .

https://riptutorial.com/ko/home 11

4.j .

https://riptutorial.com/ko/home 12

Build and Deploy .

https://riptutorial.com/ko/home 13

. .

https://riptutorial.com/ko/home 14

4.k . .

4.l . .

https://riptutorial.com/ko/home 15

npm install JOB .

https://riptutorial.com/ko/home 16

.

https://riptutorial.com/ko/home 17

Builder npm . npm install .

https://riptutorial.com/ko/home 18

.

4.m . .

https://riptutorial.com/ko/home 19

.

https://riptutorial.com/ko/home 20

(JOBS) (Add Job) .

https://riptutorial.com/ko/home 21

.

Deployer Type Cloud Foundry (IBM Bluemix ) .

https://riptutorial.com/ko/home 22

dev . . .

https://riptutorial.com/ko/home 23

4.n . . Play like .

4.o ToolChain IBM Bluemix RESTful API Continuous Deployment .

https://riptutorial.com/ko/home 24

2: Bluemix IBM Bluemix Mobile Analytics . Mobile Analytics SDK , .

Examples

Bluemix iOS

Bluemix .1. iOS Bluemix Mobile Services SDK .2. SDK AppDelegate.swift import .3.

import BMSCore import BMSAnalytics

didFinishLaunchingWithOptions .

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Set api key, Bluemix region. These are available in the Mobile Analytics console after you create an instance let api_key="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" let bmixRegion=BMSClient.Region.usSouth //Provide a name for your app that will appear in the Mobile Analytics console. let appName="MyAppName" //Initialize Mobile Analytics in your Bluemix region BMSClient.sharedInstance.initialize(bluemixRegion: bmixRegion) Analytics.initialize(appName: appName, apiKey: api_key, hasUserContext: false, deviceEvents: DeviceEvent.LIFECYCLE) //Send analytics //Analytics.send() //Alternately send analytics and log to your xCode console Analytics.send { (response: Response?, error: NSError?) in if response?.statusCode == 201 { print("Successfully sent analytics: \(response?.responseText)") } else { print("Failed to send analytics: \(response?.responseText). Error: \(error?.localizedDescription)") } } return true }

4.

Bluemix Analytics.send() .5.

. .6.

https://riptutorial.com/ko/home 27

3:

Examples

VCAP_SERVICES

VCAP_SERVICES .

JSON .

VCAP_SERVICES

{ "push-reappt": [ { "name": "Reappt from Push Technology", "label": "push_reappt", "plan": "reappt:pushtechnology:free", "credentials": { "principal": "service-binding-abcd1234", "credentials": "XYZlmnop456", "host": "sniffingitchyPythagoras.eu.bluemix.reappt.io", "port": 443 } } ] }

.

.

var reappt_credentials = JSON.parse(process.env.VCAP_SERVICES)["push-reappt"][0].credentials; diffusion.connect({ host : reappt_credentials.host, principal : reappt_credentials.principal, credentials : reappt_credentials.credentials }).then(connected, error);

Java .

private static final JsonParser PARSER = new JsonParser(); private static final JsonObject VCAP_SERVICES = PARSER.parse(System.getenv("VCAP_SERVICES")).getAsJsonObject(); private static final JsonObject REAPPT_CREDENTIALS = VCAP_SERVICES.getAsJsonArray("push-reappt").get(0) .getAsJsonObject().getAsJsonObject("credentials"); protected static final String HOST = REAPPT_CREDENTIALS.getAsJsonPrimitive("host").getAsString(); protected static final String PRINCIPAL = REAPPT_CREDENTIALS.getAsJsonPrimitive("principal").getAsString();

https://riptutorial.com/ko/home 29

protected static final String CREDENTIALS = REAPPT_CREDENTIALS.getAsJsonPrimitive("credentials").getAsString();

: https://riptutorial.com/ko/ibm-bluemix/topic/2542/

https://riptutorial.com/ko/home 30