Con el auge de los microservicios y la necesidad de funcionalidades autocontenidas, se vuelve imprescindible generar APIs para la exposición de estos servicios. Oracle nos proporciona distintas plataformas para la generación y configuración de estas APIs.
En este webinar analizamos dos de estas plataformas, disponibles en Oracle Cloud Infrastructure: API Platform y API Gateway. Repasamos las posibilidades que nos aporta cada una de ellas y mostramos la sencillez con la que se pueden publicar APIs en ambas.
1. Apificación de servicios en Oracle
Cloud
9 de julio de 2020
Alberto Cubillo Peinado
Arquitecto SOA
Webinar
2. Agenda
Apificación de servicios en Oracle Cloud 2
• Características y ventajas de las APIs
• Documentación de APIs - Apiary
• API Platform
Características
Funcionalidades OOTB
Generación de una API REST
• API Gateway
Características
Funcionalidades OOTB
Generación de una API REST
• Evolución/Roadmap
• Turno de preguntas
4. Apificación de servicios en Oracle Cloud 4
¿Qué es una API?
Características y ventajas de las APIs
• Una API es un conjunto de subrutinas, funciones y
procedimientos que ofrece cierta biblioteca para ser utilizado
por otro software como una capa de abstracción.
• Las APIs permiten que sus productos y servicios se
comuniquen con otros, sin necesidad de saber cómo están
implementados.
• Las APIs se pueden considerar como contratos, con
documentación que representa un acuerdo entre las partes.
5. Apificación de servicios en Oracle Cloud 5
¿Qué es una API?
Características y ventajas de las APIs
Palabras usadas para definir una API
• Endpoint – “a point that marks the end of a ray, line segment, or interval”
• Service – “the action of helping or doing work for someone”
• Interface – “a point where two systems meet and interact”
6. Apificación de servicios en Oracle Cloud 6
¿Qué es una API?
Características y ventajas de las APIs
An API…
• is located at a particular endpoint.
• is used to access a service.
• enforces a defined interface to a service.
7. Apificación de servicios en Oracle Cloud 7
¿Qué es una API?
Características y ventajas de las APIs
Las APIs son las puertas hacia un mundo digital
Social
Financial
Health
Productivity
Transportation
Devices
8. Apificación de servicios en Oracle Cloud 8
Ventajas
Características y ventajas de las APIs
• Independencia del lenguaje y de tecnologías
• Simplicidad
• Separación cliente / servidor
• Personalización y reutilización
• Escalabilidad
• Flexibilidad y portabilidad
• Aumento velocidad de desarrollo
9. Apificación de servicios en Oracle Cloud 9
Localización de las APIs
Características y ventajas de las APIs
10. Apificación de servicios en Oracle Cloud 10
Características
Características y ventajas de las APIs
11. Apificación de servicios en Oracle Cloud 11
Definiciones importantes
Características y ventajas de las APIs
• API Management
The process of publishing, documenting and overseeing application programming interfaces
(APIs) in a secure, scalable environment.
• API-First Development
API-first is a fundamental paradigm shift where APIs are designed, tested, and built before
applications and mirror the goals and objectives of the company
• API Design
The process of engaging all stakeholders to define in human language the APIs to create a
“contract” of what will be delivered before expensive development begins.
16. Apificación de servicios en Oracle Cloud 16
Características
Oracle API Platform
Next-gen, hybrid architecture
• End-to-end capabilities to
Design. Publish.
Build. Consume.
Secure. Monitor.
Deploy.
Easy to use
• Completely new, simplified API management experience
• Support changing business demands
• Clear visibility into who is using APIs
• Operational flexibility –gateways can be deployed in the Cloud or on-premises
21. Apificación de servicios en Oracle Cloud 21
Funcionalidades OOTB – Request policies
Oracle API Platform
22. Apificación de servicios en Oracle Cloud 22
Funcionalidades OOTB – Security Policies
Oracle API Platform
Policies that determine who can send requests to your services.
23. Apificación de servicios en Oracle Cloud 23
Funcionalidades OOTB – Traffic Management Policies
Oracle API Platform
Policies that manage the volume of traffic sent to your services.
24. Apificación de servicios en Oracle Cloud 24
Funcionalidades OOTB – Interface Management Policies
Oracle API Platform
Policies that manage the service interfaces clients are permitted to access.
25. Apificación de servicios en Oracle Cloud 25
Funcionalidades OOTB – Routing Policies
Oracle API Platform
Policies that route requests to different service URLs depending on the requesting application, the
resource requested, and other conditions.
26. Apificación de servicios en Oracle Cloud 26
Funcionalidades OOTB – Other policies
Oracle API Platform
Policies not belonging to already described categories.
27. Apificación de servicios en Oracle Cloud 27
Funcionalidades OOTB – Response policies
Oracle API Platform
52. Apificación de servicios en Oracle Cloud 52
Características
Oracle API Gateway
• REST APIs for OCI Services
• Oracle Functions, OKE, HTTP(s)
• Routing
• Rate-limiting
• Cross-origin Resource Sharing
(CORS)
• Custom Authentication
• Metrics/Logging
• Fully Oracle Managed
• Terraform
• Regional OCI Service
53. Apificación de servicios en Oracle Cloud 53
Características
Oracle API Gateway
How to use in OCI?
• RESTful APIs for Functions
• Extend applications
• Manages security context
• No SDK required
• APIs for purpose-built HTTP(s) Services
• Oracle Kubernetes Engine (OKE) and other services running on
Compute
• APIs for SaaS
• Protect SaaS end-points
• Native service to extend ATP/ADW
54. Apificación de servicios en Oracle Cloud 54
Características
Oracle API Gateway
API Gateway Functions
Clients
Oracle Functions as a RESTful API
55. Apificación de servicios en Oracle Cloud 55
Características - RESTful API Façade Pattern
Oracle API Gateway
API Gateway Functions
Clients
OKE OCIR
Container Database
System
Bare Metal
Compute
Virtual
Machine
SaaS
56. Apificación de servicios en Oracle Cloud 56
Características - Oracle Cloud Infrastructure API Gateway
Oracle API Gateway
TENANCY
COMPARTMENT
VCN
Internet
API Gateway
PUBLIC SUBNET
Internet
Gateway
ID & Access
Management
Auditing
Policies
Encryption
WAF
DNS
CDN
Firewall
DDoS
Protection
PRIVATE SUBNET
PRIVATE SUBNET
Oracle Identity
Cloud Service
Firewall
Firewall
Load Balancer
57. Apificación de servicios en Oracle Cloud 57
Características - Public and Private APIs
Oracle API Gateway
TENANCY
COMPARTMENT
VCN
Internet
PUBLIC SUBNET
Internet
Gateway
API Gateway
ID & Access
Management
Auditing
Policies
Encryption
Firewall
PRIVATE SUBNET
PRIVATE SUBNET
Firewall
Firewall
Load Balancer
PRIVATE SUBNET
API Gateway
Internal
Clients
58. Apificación de servicios en Oracle Cloud 58
Características - Cloud to Ground
Oracle API Gateway
TENANCY
COMPARTMENT
VCN
PUBLIC SUBNET
Internet
Gateway
API Gateway
ID & Access
Management
Auditing
Policies
Encryption
Firewall
PRIVATE SUBNET
PRIVATE SUBNET
Firewall
Firewall
Load Balancer
API Gateway
Internal
Clients
Customer
Data CenterDynamic
Routing
Gateway
Internet
76. Apificación de servicios en Oracle Cloud 76
Path to OCI API Management
Evolución/Roadmap
Apiary
API Platform
OCI API Management
Summer 2020 Winter 2020 2021
Validate
Transform
Native JWT
DNS/Cert
Developer
Portal
Usage
Plans
Satellite
Gateways
Migration
API Spec API Docs
Team
Management
Editor
Experience
Semantic
Validation
77. Apificación de servicios en Oracle Cloud 77
Roadmap
Evolución/Roadmap
• Native JWT
Validator
• Custom
DNS/SSL Cert
Management
• Request
Validation
• Integration
with Logging
Service
• Published SLA
• HTTP header-
based routing
Spring 2020
• Developer Portals
• Usage Plans
• OAS 3.x Support
• PCI Compliance
• Header-based routing
• Request/Response
Transformation
• Gov Regions
• Log Redaction
Summer 2020
• FedRAMP
• Integration with OKE
• Function extensions
• HTTP/2
• Circuit-breaker
• Hedged-requests
• Autoscaling
• FreeTier
• Scaffold/SDK
Fall 2020
• Result Caching
• Unified API Design
Experience
• Satellite Gateways
• HIPAA
• mTLS Support for
HTTPS Backends
• Integrate with VCS
(GitHub)
• Quota Alerts
• Usage Plans
Winter 2020/21
78. Apificación de servicios en Oracle Cloud 78
Elements of API Management
Evolución/Roadmap
Clients Policy
Enforcement
Alerts
Design
Analytics
Documentation
Onboarding
Monetization
Servers
Implementation
KEY
Apiary
API Platform
OCI API
Gateway
Independencia del lenguaje y de tecnologías: Las APIs nos permiten abstraernos del lenguaje en el que esté desarrollado el código de la funcionalidad que cubren, exponiendo una única interfaz.
Simplicidad: Esta abstracción del lenguaje de programación que haya por debajo, simplifica la forma en la que las aplicaciones se comunican con las APIs. Normalmente estas APIs son de tipo REST y utilizan objetos JSON muy estandarizados.
Separación cliente / servidor: Las APIs nos permiten separar la capa de presentación de la de la lógica de la aplicación, lo que permite que bloqueos en una capa no afecte a la otra capa.
Personalización: a través las APIs cualquier usuario o empresa pueden personalizar los contenidos y servicios que más utilizan.
Escalabilidad: Gracias a la separación entre el cliente y el servidor, el producto se puede escalar con un equipo de desarrollo sin que ello represente muchas dificultades.
Flexibilidad y portabilidad: es posible realizar una migración de un servidor a otro o practicar cambios en la base de datos en todo momento.
Aumento velocidad de desarrollo: Al basar los aplicativos en el consumo de APIs, se pueden abordar diversos desarrollos en paralelo ya que las interfaces de las APIs estarán generadas.
API Management
Proceso de publicación, documentación y seguimiento en un entorno seguro y escalable.
API-First Development
Es un paradigma por el que se indica que las APIs han de ser probadas, testadas y construidas antes que las aplicaciones, con lo que se reducirán los costes de desarrollo. La teoría indica que de este modo se pueden paralelizar tareas y no hay que esperar a que una funcionalidad esté generara para poder ser incluida en nuestras aplicaciones.
API – Design
El proceso de involucrar a todas las partes interesadas para definir en lenguaje humano las API para crear un "contrato" de lo que se entregará antes de que comience el costoso desarrollo.
Apiary permite la documentación de nuestras APIs tanto en lenguaje:
Swagger
Blueprint
Apiary permite la documentación de nuestras APIs tanto en lenguaje:
Swagger
Blueprint
OAuth 2.0
Enforces using the OAuth 2.0 protocol, that access to this API is only available to request on behalf of one of the listed accounts.
•Key Validation
Enforces that a valid key is provided in the request. The key must be valid and the application must be in the "Registered" state for this API.
•Inbound WSS Username Token
Use an inbound WSS username token policy to enforce verification of credentials sent within the SOAP payload and allow only authorized users to access APIs
•Basic Authentication
Enforces using the Basic Auth protocol, that access to this API is only available to request on behalf of one of the listed accounts.
•Outbound WSS Username Token
Use an outbound WSS username token policy to enable an end-user identity to be passed over multiple hops before reaching the destination Web Service.
•IP Filter Validation
Validates the IP address of the requester. Based on the value of IP theaddress, determine whether to pass or reject value.
•CORS
Controls which domains are allowed to invoke this API.
Traffic Management Policies
Policies that manage the volume of traffic sent to your services.
•API Throttling–Delay
Enforces a limit on the number of requests to this API before introducing additional latency.
•Application Rate Limiting
Enforces a limit on the total number of requests to this API per application. Rejects any requests above the defined limit.
•API Rate Limiting
Enforces a limit on the total number of requests to this API. Rejects any requests above the defined limit. NOTE: this is different than the application-based rate limiting.
Interface Management Policies
Policies that manage the service interfaces clients are permitted to access.
•Header Field Filtering
Use the header field filtering policy to filter the request headers for length and format.
•Interface Filtering
Use an interface filtering policy to filter requests based on the resources and methods specified in the request.
•Redaction
Manages the fields and headers in the request or response payload. You can either explicitly include, or exclude, the headersand fields sent to the backend service (from the request flow) or sent to the client (from the response flow).
•Header Validation
Validates the presence and values of http headers. Can be used for security or to reduce the occurrence of failures/errors atthe service layer.
•Request Payload Validation
Use the Request Payload Validation policy to validate the request message body for length and format.
•Method Mapping
Use the method mapping policy to change the HTTP method of a request to another method you specify before passing it to the service.
•REST API to SOAP Service
Use the REST to SOAP to expose a SOAP service as a JSON REST service.
Routing Policies
Policies that route requests to different service URLs depending on the requesting application, the resource requested, and other conditions.
•Header-Based Routing
The request will be routed based on the header. Can be used for security or to reduce the occurrence of failures/errors at the service layer.
•Application-Based Routing
The request will be routed based on the application.
•Gateway-Based Routing
The request will be routed based on the gateway.
•Resource-Based Routing
The request will be routed based on the resource path. Can be used for security or to reduce the occurrence of failures/errors at the service layer.
•Other Policies
Policies not belonging to already described categories.
•Service Callout
Invokes the configured external service with or without payload, with the provided headers and process the incoming request on the basis of response HTTP Status Code from the external service.
•Logging
Writes a message to the log.
•Groovy Script
Executes Groovy script.