OGG 12.3 MA中最大的变化就是使用了restful api,在前面介绍的各个服务模块,其实就是引用restful api开发而来,这些API同时也提供对外的集成接口,详细接口可参考:

http://docs.oracle.com/goldengate/c1230/gg-winux/OGGRA/QuickStart.html

服务分类

 

从上面可以看出,主要按服务模块分类,各服务模块又根据包含的功能分类

通过提供的API,可以在定制程序中实现对OGG的完全控制。

使用示例

创建用户

curl -i -X POST -u admin:admin -H "Accept: application/json" -d "{\"credential\":\"test\",\"info\":\"fullname\"}" http://192.168.89.132:9101/services/v2/authorizations/user/test

或者把数据保存到文件后引用

curl -i -X POST -u admin:admin -H "Accept: application/json" --data @Q:\data.json http://192.168.89.132:9101/services/v2/authorizations/user/caidl

data.json:

{

"credential":"test",

"info":"test user #3"

}

删除用户

curl -i -X DELETE -u admin:admin -H "Accept: application/json" http://192.168.89.132:9101/services/v2/authorizations/user/test

response

HTTP/1.1 401 Unauthorized

Content-Security-Policy: script-src 'self' 'unsafe-eval' 'unsafe-inline'

X-Frame-Options: SAMEORIGIN

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

Cache-Control: max-age=0, no-cache, no-store, must-revalidate

Pragma: no-cache

Expires: 0

Set-Cookie: ogg.sca…;

Domain=192.168.89.132; Path=/; HttpOnly

Content-Type: application/json

Content-Length: 559

{"$schema":"api:standardResponse","links":[{"href":"http://192.168.89.132:9101/services/v2/authorizations/user/test","mediaType":"application/json","rel":"canonical"},{"href":"http://192.168.89.132:9101/services/v2/authorizations/user/test","mediaType":"application/json","rel":"self"}],"messages":[{"$schema":"ogg:message","code":"OGG-12070","issued":"2017-12-23T12:06:42Z","severity":"ERROR","title":"'test' cannot be located in the user database for the specified role. 'user'.","type":http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2}]}

创建extract

ogg_ext.json

{

"config":[

"Extract EXT2",

"ExtTrail X2 Format Release 12.3",

"UseridAlias ggsrc",

"Table tkggadmin.*;"

],

"source":{

"tranlogs":"classic"

},

"credentials":{

"alias":"ggsrc"

},

"registration":"default",

"begin":"now",

"targets":[

{

"name":"X2"

}

]

}

curl -i -X POST -u admin:admin -H "Accept: application/json" --data @Q:\ogg_ext.json http://192.168.89.132:9101/services/v2/extracts/EXT2


获取各个服务的信息

[oracle@ol73 ~]$ curl -i -X GET -u admin:admin -H "Content-Type: application/json" http://192.168.89.132:9100/services/v2/deployments/demo1/services

HTTP/1.1 200 OK

Content-Security-Policy: script-src 'self' 'unsafe-eval' 'unsafe-inline'

X-Frame-Options: SAMEORIGIN

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

Cache-Control: max-age=0, no-cache, no-store, must-revalidate

Pragma: no-cache

Expires: 0

Set-Cookie: =; Domain=192.168.89.132; Path=/; HttpOnly

Content-Type: application/json

Content-Length: 1764

{"$schema":"api:standardResponse","links":[{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services","mediaType":"application/json","rel":"canonical"},{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services","mediaType":"application/json","rel":"self"},{"href":"http://192.168.89.132:9100/services/v2/metadata-catalog/services","mediaType":"application/schema+json","rel":"describedby"}],"messages":[],"response":{"$schema":"ogg:collection","items":[{"$schema":"ogg:collectionItem","links":[{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services","mediaType":"application/json","rel":"parent"},{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services/adminsrvr","mediaType":"application/json","rel":"canonical"}],"name":"adminsrvr"},{"$schema":"ogg:collectionItem","links":[{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services","mediaType":"application/json","rel":"parent"},{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services/distsrvr","mediaType":"application/json","rel":"canonical"}],"name":"distsrvr"},{"$schema":"ogg:collectionItem","links":[{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services","mediaType":"application/json","rel":"parent"},{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services/pmsrvr","mediaType":"application/json","rel":"canonical"}],"name":"pmsrvr"},{"$schema":"ogg:collectionItem","links":[{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services","mediaType":"application/json","rel":"parent"},{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services/recvsrvr","mediaType":"application/json","rel":"canonical"}],"name":"recvsrvr"}]}}

获取admin server 信息

[oracle@ol73 ~]$ curl -i -X GET -u admin:admin -H "Content-Type: application/json" http://192.168.89.132:9100/services/v2/deployments/demo1/services/adminsrvr

HTTP/1.1 200 OK

Content-Security-Policy: script-src 'self' 'unsafe-eval' 'unsafe-inline'

X-Frame-Options: SAMEORIGIN

X-XSS-Protection: 1; mode=block

X-Content-Type-Options: nosniff

Cache-Control: max-age=0, no-cache, no-store, must-revalidate

Pragma: no-cache

Expires: 0

Set-Cookie: sruY=; Domain=192.168.89.132; Path=/; HttpOnly

Content-Type: application/json

Content-Length: 798

{"$schema":"api:standardResponse","links":[{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services/adminsrvr","mediaType":"application/json","rel":"canonical"},{"href":"http://192.168.89.132:9100/services/v2/deployments/demo1/services/adminsrvr","mediaType":"application/json","rel":"self"},{"href":"http://192.168.89.132:9100/services/v2/metadata-catalog/service","mediaType":"application/schema+json","rel":"describedby"}],"messages":[],"response":{"$schema":"ogg:service","config":{"authorizationDetails":{"common":{"allow":["Basic","x-Cert"]}},"authorizationEnabled":true,"legacyProtocolEnabled":true,"network":{"serviceListeningPort":9101},"security":false,"taskManagerEnabled":true,"workerThreadCount":5},"configForce":true,"enabled":true,"quiet":true,"status":"running"}}

至此,有关goldengate 12.3 micorservice architect的介绍到此结束。

GoldenGate 12.3 MA架构介绍系列(4)–Restful API介绍的更多相关文章

  1. GoldenGate 12.3 MA架构介绍系列(1) - 安装

    GoldenGate 12.3微服务架构与传统架构的区别可参考: http://www.cnblogs.com/margiex/p/7439574.html 下载地址:http://www.oracl ...

  2. GoldenGate 12.3 MA架构介绍系列(2) - 数据同步测试

    安装配置可参考上一篇:http://www.cnblogs.com/margiex/p/8071957.html 安装完成之后,会自动启动ServiceManager服务,此时,可以通过浏览器访问. ...

  3. GoldenGate 12.3 MA架构介绍系列(5) - 静默安装

    软件下载地址 http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html 下载基于MicroService ...

  4. GoldenGate 12.3 MA架构介绍系列(3) - 各功能模块介绍

    在新版的ogg 12.3 microservice architect中,提供了4个不同的服务模块和命令行模块. Admin Server: 负责连接用户.trandata, checkpoint的添 ...

  5. RESTful API - 介绍

    目录 RESTful API 介绍 RESTful介绍 RESTful API设计指南 API与用户的通信协议 域名 版本(Versioning) 路径(Endpoint) 浏览器请求方式(metho ...

  6. Spring Boot 2.x 编写 RESTful API (一) RESTful API 介绍 & RestController

    用Spring Boot编写RESTful API 学习笔记 RESTful API 介绍 REST 是 Representational State Transfer 的缩写 所有的东西都是资源,所 ...

  7. python 全栈开发,Day95(RESTful API介绍,基于Django实现RESTful API,DRF 序列化)

    昨日内容回顾 1. rest framework serializer(序列化)的简单使用 QuerySet([ obj, obj, obj]) --> JSON格式数据 0. 安装和导入: p ...

  8. nova创建虚拟机源码分析系列之一 restful api

    开始学习openstack源码,源码文件多,分支不少.按照学习的方法走通一条线是最好的,而网上推荐的最多的就是nova创建虚机的过程.从这一条线入手,能够贯穿openstack核心服务.写博文仅做学习 ...

  9. Restful api介绍

    网络应用程序,分为前端和后端两个部分.当前的发展趋势,就是前端设备层出不穷(手机.平板.桌面电脑.其他专用设备......). 因此,必须有一种统一的机制,方便不同的前端设备与后端进行通信.这导致AP ...

随机推荐

  1. 20165236 2017-2018-2 《Java程序设计》结对编程练习_四则运算

    20165236 2017-2018-2 <Java程序设计>结对编程练习_四则运算 结对小组:叶佺.郭金涛 一.需求分析: 1.能随机生成n道四则运算题目,n由使用者输入: 2.支持多种 ...

  2. 小程序图片保存的相册授权失败问题,原接口wx.openSeting()已经废弃了的解决办法

    项目中使用的是wepy框架开发的小程序,,, 使用场景是,用户点击下载图片的时候,要调起授权button(小程序拉起授权的功能都集成在了button组件,所以这里需要用到button组件里的一个ope ...

  3. linux find grep tail

    如果在只是想匹配模式的上下几行,grep可以实现. $grep -5 'parttern' inputfile //打印匹配行的前后5行 $grep -C 5 'parttern' inputfile ...

  4. [转]如何快速转载CSDN中的博客

    原文:https://blog.csdn.net/bolu1234/article/details/51867099 前言   对于喜欢逛CSDN的人来说,看别人的博客确实能够对自己有不小的提高,有时 ...

  5. 开发十年,只剩下这套Java开发体系了

    蓦然回首自己做开发已经十年了,这十年中我获得了很多,技术能力.培训.出国.大公司的经历,还有很多很好的朋友.但再仔细一想,这十年中我至少浪费了五年时间,这五年可以足够让自己成长为一个优秀的程序员,可惜 ...

  6. (转)SpringBoot之退出服务(exit)时调用自定义的销毁方法

    我们在工作中有时候可能会遇到这样场景,需要在退出容器的时候执行某些操作.SpringBoot中有两种方法可以供我们来选择(其实就是spring中我们常用的方式.只是destory-method是在XM ...

  7. centos7 下 apache nginx squid https正向代理 代理服务器

    apache yum install httpd mod_ssl -y vim /etc/httpd/conf.d/ssl.conf Listen https <VirtualHost *:&g ...

  8. [Java in NetBeans] Lesson 09. Switch / If-Else Ladder

    这个课程的参考视频和图片来自youtube. 主要学到的知识点有: 1. Nested If-else statement (if-else ladder) /** * 90 and above == ...

  9. cocos2d-x JS 纯代码实现人物头像裁剪

    有时候为了方便会直接用颜色层和过渡层来显示一些信息,但层只有方角没有圆角不太美观,于是我用剪切节点实现了一个圆角层.方便以后使用.   当然,如果使用Cosos Studio 操作会更好一些,省去了坐 ...

  10. Javascript-数据类型转换 、 运算符和表达式

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...