administration apis: rest and jmx for ibm infosphere streams v4.0

21
© 2015 IBM Corporation Administration APIs REST and JMX IBM InfoSphere Streams Version 4.0 Janet Weber InfoSphere Streams Development For questions about this presentation contact Janet Weber [email protected]

Upload: lisanl

Post on 16-Jul-2015

73 views

Category:

Data & Analytics


1 download

TRANSCRIPT

© 2015 IBM Corporation

Administration APIs – REST and JMX

IBM InfoSphere Streams Version 4.0

Janet Weber

InfoSphere Streams Development

For questions about this presentation contact Janet Weber

[email protected]

2 © 2015 IBM Corporation

Important Disclaimer

THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONALPURPOSES ONLY.

WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THEINFORMATION CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTYOF ANY KIND, EXPRESS OR IMPLIED.

IN ADDITION, THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY,WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE.

IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OROTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.

NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:

• CREATING ANY WARRANTY OR REPRESENTATION FROM IBM (OR ITS AFFILIATES OR ITS ORTHEIR SUPPLIERS AND/OR LICENSORS); OR

• ALTERING THE TERMS AND CONDITIONS OF THE APPLICABLE LICENSE AGREEMENTGOVERNING THE USE OF IBM SOFTWARE.

IBM’s statements regarding its plans, directions, and intent are subject to change orwithdrawal without notice at IBM’s sole discretion. Information regarding potentialfuture products is intended to outline our general product direction and it should notbe relied on in making a purchasing decision. The information mentioned regardingpotential future products is not a commitment, promise, or legal obligation to deliverany material, code or functionality. Information about potential future products maynot be incorporated into any contract. The development, release, and timing of anyfuture features or functionality described for our products remains at our solediscretion.

THIS INFORMATION IS BASED ON IBM’S CURRENT PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM WITHOUT NOTICE.

IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.

3 © 2015 IBM Corporation

Agenda

Administration APIs Summary

REST overview and application considerations

JMX overview and application considerations

Demos

– REST

– JMX

API comparisons

Where to get more details

Questions

4 © 2015 IBM Corporation

Administration APIs – Summary

REST– API for monitoring Streams information

– Introduced with Streams Version 3.1

– Access information using an HTTP URI

JMX– New API built on JMX (Java Management Extensions) technology

– Support for monitoring and managing InfoSphere Streams objects

– Includes notification support

Streamtool– Used in the past as an API before REST and JMX support available

– Recommendation is to move away from using streamtool as a programming

interface

5 © 2015 IBM Corporation

REST – Overview

Monitor Streams information using HTTP URIs

https://serverName:8456/streams/rest/resources

Can access from any application that can make an HTTP call to the host

resource running the Streams Web service

Information available for: domain*, instances, hosts, jobs (and job

components), metrics, views, imported/exported streams*

* = new for Streams Version 4.0

6 © 2015 IBM Corporation

REST – Existing Application Considerations

Existing instance URIs still supported

Some URIs and properties have been deprecated, but not removed

Use streamtool exportkeystore to retrieve server certificate

Need to provide a host name verifier– Example: http://www.ibm.com/support/knowledgecenter/api/content/nl/en-

us/SSCRJU_4.0.0/com.ibm.streams.dev.doc/doc/restapi-http.html

7 © 2015 IBM Corporation

JMX – Overview

Java API for monitoring and managing Streams objects

Built on JMX technology which exposes 'beans' that have attributes,

operations, and notifications

Attributes

Access to information about: domain, instances, host resources, jobs (and

job components), permissions, and streams services

Operations

Perform management functions such as: creating/starting/stopping

instances, updating configuration/permissions, submitting/canceling jobs

Notifications

Receive notification for significant events such as: job starting or ending, an

error written to the product log, or a configuration update

8 © 2015 IBM Corporation

JMX – Application Considerations

JMX service can run on multiple resources concurrently– Can connect to any of them

Use streamtool getjmxconnect to retrieve JMX connection string needed

to establish connection to JMX server

service:jmx:jmxmp://server1:8466

Need to register a job before accessing any of the job-related beans– Purpose is to reduce JMX memory requirements

snapshot methods provide a way to get multiple pieces of information in

single call – All metrics for a job

– All attributes for a job and its components

9 © 2015 IBM Corporation

Demo

10 © 2015 IBM Corporation

Comparisons

REST

– Monitoring only API• Cannot modify configuration or perform management tasks (e.g. submit job)

• Provides view support

– Network ports: HTTPs port

– Authentication: • HTTP basic authentication (user/password in Authorization header)

• Client certificate authentication (user in client certificate)

JMX– Most complete API set

• Management and configuration support provided

• Notification support

• No view support

– Network ports: open ports specified by configuration properties: jmx.port and

domain.portRange

– Authentication: SASL (user/password on connect call)

Streamtool– Command line tool that only runs on a Streams node

– Can run commands in scripts

– Not recommended as an API for monitoring Streams information (e.g. move

away from using streamtool capturestate as an API)

11 © 2015 IBM Corporation

Details

Documentation

– REST http://www.ibm.com/support/knowledgecenter/api/content/nl/en-

us/SSCRJU_4.0.0/com.ibm.streams.restapi.doc/doc/restapis.html

– JMX http://www.ibm.com/support/knowledgecenter/api/content/nl/en-

us/SSCRJU_4.0.0/com.ibm.streams.ref.doc/doc/jmxapi.html

StreamsInstallPath/doc/jmx/api/java/api

Sample programs

– REST• http://www.ibm.com/support/knowledgecenter/api/content/nl/en-

us/SSCRJU_4.0.0/com.ibm.streams.dev.doc/doc/restapi-http.html

– JMX• http://www.ibm.com/support/knowledgecenter/SSCRJU_4.0.0/com.ibm.streams.de

v.doc/doc/jmxapi-dev.html

Most child topics contain sample programs

– IBM Streams Developer Community• https://developer.ibm.com/streamsdev

• Look here for new samples being added

12 © 2015 IBM Corporation

Questions?

13 © 2015 IBM Corporation

REST Demo

Firefox extension used to format JSON output

http://jsonview.com

14 © 2015 IBM Corporation

REST Demo

15 © 2015 IBM Corporation

REST Demo

16 © 2015 IBM Corporation

REST Demo

17 © 2015 IBM Corporation

REST Demo

18 © 2015 IBM Corporation

JMX Demo

19 © 2015 IBM Corporation

JMX Demo

20 © 2015 IBM Corporation

JMX Demo

21 © 2015 IBM Corporation

JMX Demo