Axway AMPLIFY Demo
“Ignite Digital Transformation”
Full lifecycle API Management
#amplify #API Builder
#apimanager #apiportal
Objective
• This presentation explains, step by step, how to prepare and run a live demo of
Amplify API Management
• It is based on the Axway AMPLIFY launch demo ”Ignite Digital Transformation”
• Watch the video Axway AMPLIFY Demo - Ignite Digital Transformation (SC1)
• You will be able to do the same demo using the Amplify API Management
reference environment released in August 30th, 2018
© 2016 Axway | CONFIDENTIAL 2
Prerequisites
• Appcelerator account is required
• A virtual or real tablet is required to demo the mobile app.
• This demo can be played using customized API Portal.
• It is managed similarly as standard API Portal, using the startPortalCustom,
stopPortalCustom, statusPortalCustom
• To do this demo, run the following commands at a command prompt of the downloaded
VM:
1. Start API Manager: startAPIM
2. Start custom API Portal: startPortalCustom
3. Use API Builder; instructions are included in this presentation
3
Amplify API
Management
Create Control Consume
4
Full Life cycle API Management
5
AMPLIFY API Management
(Private Cloud/On-Premise)
API Builder
CREATE Console
CLI Policy Studio
AMPLIFY AMPLIFY
Marketplace Dev Community
• Branded self-service portal &
CONSUME API Portal Monetization
API Manager REST API Builder Standalone
• Catalog & client registry
• Micro-services
Apps REST,
MQTT Enterprise Services
WebSockets Mobile Backend Services (Cloud)
REST
SSE
• 20+ prebuilt services
API Gateway
Customers, Suppliers, Partners REST, SOAP
• Runtime API Gateway • Integration Gateway API Provider ecosystem
REST, SOAP
• MQTT Proxy • MQTT Trigger
REST, SOAP
B2Bi (EDI) GOVERN Digital MFT SERVICES & MEDIATION
DevOps Ready
Embedded Scalable
MEASURE Analytics • Abnormal situations AMPLIFY 6 6
Secured Add-ons
Hands-on steps
CONSUME
(API Portal)
App Dev
CONTROL
(API Manager)
API
Admin
CREATE
(API Builder)
API Dev
7
Axway AMPLIFY at FastCars
Interactions diagram
Appcelerator
CAR MANUFACTURER
CAR DEALERS Studio
Spare Parts
develops uses docs
API Portal SUPPLIERS
get API info
orders calls APIs
spare parts calls Map API
API Manager B2Bi EDI
secures and
publishes
APIs calls API
integrates
retrieves EDI files
connector API Builder
creates API
connects to
retrieve data
Backend
Marketplace Order
MySQL System
database
AXWAY CLOUD
8
CREATE
Interface: API Builder
Role : API Developer
9
API Builder 3 key concepts
Read/write data Turn connector data 1. Create API first, then implement
from data sources into data models them OR
or services 2. Expose models into endpoints
that are consumed by the apps
10
Connectors
• 30+ pre-built connectors on the Connector marketplace (Cloud)
• https://marketplace.axway.com/home
• Can be extended if customers need to integrate additional capabilities
• New connectors can be added to the marketplace
• Developed with the Connector SDK
• Published by the organization or any other organization.
• Free or paid
• Enables easy visualization of the connected data in the UI
11
Models
• Turning connector data into an
object model
• An object is a set of properties
stored in memory upon execution. It
also has methods to interact with.
• Visually manage data:
• Remove specific fields
• Change field names
• Add new fields
12
Data APIs
• Expose a model as an HTTP endpoint
• Join multiple models to expose a single API
• Select which REST methods need to be
exposed (GET, PUT, POST, DELETE)…
• Easy extensibility of request / response
processing using pre- and post- “blocks”
• Export API definition format as
swagger.json, or using app SDKs for iOS
and Android apps
• Auto-documenting
• Performance visualization while developing
to debug and optimize each step of the API
call processing.
13
Create an API Builder Project
Open a terminal, to create your API Builder project (run these 3 commands)
axway@api-env:~> cd demo/Builder/
axway@api-env:~/demo/Builder> api-builder init fastcars-parts
Successfully created service: fastcars-parts
Next steps to install and run (using npm):
cd fastcars-parts
npm install --no-optional
npm start
axway@api-env:~/demo/Builder> cd fastcars-parts
You can prepare these steps before doing a live demo,
14
in order to avoid showing command lines and configuration files
Install required components for your project
Open a terminal, to create your API Builder project
axway@api-env:~/demo/Builder/fastcars-parts> npm install --no-optional
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN deprecated nomnom@1.5.2: Package no longer supported. Contact support@npmjs.com for more info.
npm WARN notice [SECURITY] lodash has the following vulnerability: 1 low. Go here for more details:
https://nodesecurity.io/advisories?search=lodash&version=3.10.1 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm
audit` to get more info.
> jsonpath@1.0.0 postinstall /home/axway/demo/Builder/fastcars-parts/node_modules/jsonpath
> node lib/aesprim.js > generated/aesprim-browser.js
> @axway/api-builder-plugin-fn-swagger@1.0.10 postinstall /home/axway/demo/Builder/fastcars-parts/node_modules/@axway/api-builder-
plugin-fn-swagger
> node scripts/plugin-init.js
=======================================================================================================================================
[INFO] @axway/api-builder-plugin-fn-swagger:
A 'swagger' folder has been created in your API Builder project.
=======================================================================================================================================
npm notice created a lockfile as package-lock.json. You should commit this file.
added 761 packages in 15.457s
axway@api-env:~/demo/Builder/fastcars-parts>
You can prepare these steps before doing a live demo,
15
in order to avoid showing command lines and configuration files
Install the MySQL connector from npm
axway@api-env:~/demo/Builder/fastcars-parts> npm install @axway/api-builder-plugin-dc-mysql
> dtrace-provider@0.8.7 install /home/axway/demo/Builder/fastcars-parts/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js
make: Entering directory '/home/axway/demo/Builder/fastcars-parts/node_modules/dtrace-provider/build'
TOUCH Release/obj.target/DTraceProviderStub.stamp
make: Leaving directory '/home/axway/demo/Builder/fastcars-parts/node_modules/dtrace-provider/build'
> @axway/api-builder-plugin-dc-mysql@2.0.1 postinstall /home/axway/demo/Builder/fastcars-parts/node_modules/@axway/api-builder-plugin-dc-
mysql
> node scripts/copyconf.js
=======================================================================================================================================
[INFO] @axway/api-builder-plugin-dc-mysql:
mysql.default.js has been copied to your API Builder conf directory. You must configure the file located in
/home/axway/demo/Builder/fastcars-parts/conf
=======================================================================================================================================
+ @axway/api-builder-plugin-dc-mysql@2.0.1
added 36 packages in 7.784s
╭─────────────────────────────────────╮
│ │
│ Update available 5.5.1 → 6.3.0 │
│ Run npm i -g npm to update │
│ │
╰─────────────────────────────────────╯
axway@api-env:~/demo/Builder/fastcars-parts>
You can prepare these steps before doing a live demo,
16
in order to avoid showing command lines and configuration files
Configure the connector
Provide database connection details by modifying the conf/mysql.default.js file
module.exports = {
connectors: {
mysql: {
connector: '@axway/api-builder-plugin-dc-mysql',
connectionPooling: true,
connectionLimit: 10,
host: 'api-env',
port: 3306,
database: 'fastcars',
user: 'info',
password: 'Digital4+',
// Create models based on your schema that can be used in your API.
generateModelsFromSchema: true,
// Whether or not to generate APIs based on the methods in generated models.
modelAutogen: false
}
}
};
You can prepare these steps before doing a live demo,
17
in order to avoid showing command lines and configuration files
(Optional) Allow remote access to API Builder web UI
Modify the conf/default.js file : delete the line with localhost (or add a list of authorised IP addresses)
and change service port to 8083
// This is the port the service will be bound to
port: 8083,
// Enabling this property will print out the process.env at startup time
printEnvVars: false,
// Your ssl configuration goes here. The options are the same has what is used by
// Node.js https.createServer() method
// https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
// ssl: {
// port: 8443
// },
// The number of milliseconds before timing out a request to the server.
timeout: 120000,
// Log level of the main logger. Can be set to 'debug', 'error', 'fatal', 'info', 'trace', or 'warn'.
logLevel: 'debug',
// Prefix to use for apis
apiPrefix: '/api',
// Control the settings for the api-builder-admin console
admin: {
// Control whether the admin website is available
enabled: true,
// The prefix for the API documentation
apiDocPrefix: '/apidoc',
// If you set disableAPIDoc, in production your swagger API docs will not show up
disableAPIDoc: false,
// The hostnames or IPs from which connections to admin are allowed. Hostnames must be resolvable on the
// server. IP ranges can also be specified. e.g. [ 'localhost', '192.168.1.0/24', '10.1.1.1' ]
// An empty list [] will allow unrestricted access, though this is not recommended due to security concerns.
allowedHosts: [
'localhost', '::1'
]
},
You can prepare these steps before doing a live demo,
18
in order to avoid showing command lines and configuration files
Run your API Builder project
Run API Builder project from the VM term window (make sure you’re in the root dir of your project)
axway@api-env:~/demo/Builder/fastcars-parts> npm start
> fastcars-parts@1.0.0 start /home/axway/demo/Builder/fastcars-parts
> node .
1533563862507 configuration applied in this order: /home/axway/demo/Builder/fastcars-parts/conf/default.js,/home/axway/demo/Builder/fastcars-
parts/conf/greetflow.default.js,/home/axway/demo/Builder/fastcars-parts/conf/mysql.default.js
1533563862513 API Builder/Boston (4.1.1) fastcars-parts/1.0.0
1533563862513 APIKey is: 5aJfrg9tqqzXjpuMBBU5Y51fo3Lcz/Ar
. . . . .
1533563863383 Configured API Builder Console API
1533563863384 Access API Builder Console at http://localhost:8083/console. This will only be available on your dev environment.
1533563863385 server started!
1533563863385 Deprecation: admin.apiDocPrefix has been deprecated, use apidoc.prefix instead. For more info see https://docs.axway.com/bundle/
API_Builder_4x_allOS_en/page/api_builder_deprecations.html#APIBuilderDeprecations-apiDocPrefix
1533563863385 Deprecation: admin.disableAPIDoc has been deprecated, use apidoc.disabled instead. For more info see https://docs.axway.com/bund
le/API_Builder_4x_allOS_en/page/api_builder_deprecations.html#APIBuilderDeprecations-disableAPIDoc
1533563863385 server started on port 8083
You can prepare these steps before doing a live demo,
19
in order to avoid showing command lines and configuration files
Open API Builder
Open http://api-env:8083/console from your web browser
20
Build a Model – 1/3
Open “Models” tab to compose SpareParts into a new Model form the parts inventory database table
21
Build a Model – 2/3
Delete unnecessary fields to expose only the following fields :
22
Build a Model – 3/3
− Keep only Retrieve methods option selected as we do not want the database to be modified for this use-case.
− Change Singular value
− Save
23
Test your API
Once saved, you can test it from the “API Doc and Test” tab
Test the Find All
method here
Right-click to copy the URL
of the Swagger file
24
CONTROL
Interface: API Manager
Role : API Admin
25
API Gateway
Security and Service Enablement at the Edge for API, SOA and XML Traffic
Customers / Mobility /
API Security
Partners Developers Cloud Social Devices
Data Assets Identities Tokens Authorization
API Monitor and Govern
REST, SOAP, XML, JSON, Oauth 2.0, OpenID Connect, SAML….
Dynamic Operational
Policy Monitoring
API Gateway Management
SOAP, XML, JMS, SQL,SAML, X509, Kerberos… Meter Analytics
& Control & Reporting
API Transformation
Configurable Policies
200+ Pre-built Operations, 50+ Pre-built Connectors
Existing IT Applications Legacy Services Data Assets
AuthN Inspect Transform Redact Cache
AuthZ Verify Block / Encrypt Alert
OAuth Enrich Route Signing Log 26
Enterprise IT
Filtering
API Manager
Enable operational users to publish and manage API consumption
• API Registration Lifecycle
• Register and virtualize API
• Manage lifecycle thru to retirement
• API Catalog
• Browseable API documentation
• Partner & Policy Administration
• Onboard and manage partners, developers
and applications
• Configure policies managing API
consumption
• Monitor and report API usage
• Web portal user experience
• Basic API Portal for application developers
27
Open API Manager
Make sure your API Management environment is running (startAPIM)
Login to API Manager as Angel (https://api-env:8075/home)
28
Import Backend API – 1/2
Select Backend API in “API” menu and choose “New API>Import from Swagger API”
29
Import Backend API – 2/2
Select from URL and Paste swagger file URL
30
Note that in real case, we would use swagger definition from the published API –not the local one
Create Frontend API – 1/4
Select Frontend API in “API” menu and choose “New API>from backend API”
31
Create Frontend API – 2/4
Open the new API “SpareParts” and choose “API Key” with default options as Inbound security in “Inbound” tab
32
Create Frontend API – 3/4
API Builder: Copy apikey from default.js
API Manager: Select HTTP Basic for the Outbound profile and paste apikey as User name
API Manager
4
3
API Builder Console
2
© 2016 Axway | CONFIDENTIAL 33
Create Frontend API – 4/4
• Upload the ~/demo/data/images/car-parts.jpg image for the “API” tab
• Update the name to SpareParts Inventory and save the API
34
Publish the API
35
Open controlled access to the API
Grant the API for all organizations
36
CONSUME
Interface: API Portal
Role : APP Dev
37
API Portal
Enable self-service API consumption by client application developers
Engage internal and 3rd party developers to use APIs
Build partner and developer community around APIs
New channel to market brand
API Portal Joomla Application
• Self-register and profile 3rd Party Joomla Plug-ins
management • Content management
• Manage applications credentials • Wikis
• Browse APIs and documentation • Blogs
• Test APIs • Forums
• Monitor application usage of • …
APIs
• Download API Definition and
SDK
Runs on Joomla CMS Platform
• Fully customizable to give unique branded experience
• Separate web tier independent from Gateways and Management
Instances
38
(optional) Fast Cars branded API Portal
Instead of the regular API Portal, Fast Cars branded API Portal can be used:
• Run startPortalCustom from the command line
• Access portal at https://api-env.demo.axway.com
39
Open company API Portal
Log as dave/dave to API Portal (https://api-env.demo.axway.com)
40
Create new Application – 1/3
• Open Application tab
• Click Create Application
• Select image from
~/demo/data/images/fastcars-logo.gif
and give a app name: FastCars Spare Parts
41
Create new Application – 2/3
Select SpareParts Inventory API. Save application.
42
Create new Application – 3/3
Click FastCars Spare Parts
Click Edit the application
And Generate a new API Key in the Authentication tab
© 2016 Axway | CONFIDENTIAL 43
Test API consumption
Click APIs tab and Test SpareParts Inventory
Select the API Key and execute /api/spareparts method
44
Test API consumption results
To have this working (response code 200), API Builder project should still be running on the
VM. 45
Export API for the Mobile App development
Download swagger file (or Client SDK if this option is available)
46
Mobile App developement
Show the API call in the mobile app project – spare parts inventory is retrieved during initialization of the screen for parts selection
Note: Client SDK was not used
The api base path is: /api/spareparts
You need first to import the Mobile project from « ~/demo/MobileApps/fastcars-spareparts-order-
app.zip » in your Appcelerator Studio workspace on Windows or MacOS
47
Mobile App usage
Run the mobile app on an Android tablet, on an Android virtual device or on an iPad simulator
Apply the same filters as below, and show spare parts inventory is actually retrieved
You need first to update the API URL in the Mobile App project and build the app for your target device. Alternatively, you can
48
use the sample Android version connected to shared demo server. NB: only tablet devices are supported
Mobile App usage
Run the mobile app on an Android tablet, on an Android virtual device or on an iPad simulator
Apply the same filters as below, and show spare parts inventory is actually retrieved
You need first to update the API URL in the Mobile App project and build the app for your target device. Alternatively, you can
49
use the sample Android version connected to shared demo server. NB: only tablet devices are supported
Done!
50