介绍

route 是一套匹配客户端请求的规则。每个route都会匹配一个service,每个service可定关联多个route。

可以说service:route=1:n。一对多的关系。每个匹配到route的请求都会代理到对应的service上。

路由可以设定不同的协议,不同的协议配置的属性不一样。官网介绍如下:

  • For http, at least one of methodshostsheaders or paths;
  • For https, at least one of methodshostsheaderspaths or snis;
  • For tcp, at least one of sources or destinations;
  • For tls, at least one of sourcesdestinations or snis;
  • For grpc, at least one of hostsheaders or paths;
  • For grpcs, at least one of hostsheaderspaths or snis.

在kong网关服务中,可以和路由route匹配的有两类:service和plugin

在操作route的命令中也可以依赖这两类进行操作。命令格式和service相似,都是使用restful api风格,区分再不同的http方法。

接下来简单介绍

1,add routes

post 方法

(1)http://127.0.0.1:8001/routes

(2)http://127.0.0.1:8001//services/{service name or id}/routes  给指定的service 添加路由

主要参数包括:name ,path(匹配该路由的路径),host(匹配该路由的域名列表),protocols(http、https),methods,service.id

2,list routes ,Retrieve Route

get 方法

(1) http://127.0.0.1:8001/routes 展示所有routes

(2)/services/{service name or id}/routes

/routes/{route name or id}

/services/{service name or id}/routes/{route name or id}

/plugins/{plugin id}/route

以上展示指定的route信息

3,update routes 修改

方法:patch

(1)/routes/{route name or id}

(2)/services/{service name or id}/routes/{route name or id}

/plugins/{plugin id}/route

4,create or update routes  存在时更新,不存在时创建

方法:put

(1)/routes/{route name or id}

(2)/services/{service name or id}/routes/{route name or id}

/plugins/{plugin id}/route

5,delete route删除

(1)/routes/{route name or id}

(2)/services/{service name or id}/routes/{route name or id}


人生在世,杂事七八;饭要少吃,事要多知;抽个时间,总结一下;乐在分享,自在提升

kong命令(三)route的更多相关文章

  1. linux常用命令三

    linux常用命令三 系统信息 arch 显示机器的处理器架构(1) uname -m 显示机器的处理器架构(2) uname -r 显示正在使用的内核版本 dmidecode -q 显示硬件系统部件 ...

  2. 每天一个linux命令:route命令

    Linux系统的route命令用于显示和操作IP路由表(show / manipulate the IP routing table).要实现两个不同的子网之间的通信,需要一台连接两个网络的路由器,或 ...

  3. linux常用命令:route 命令

    Linux系统的route 命令用于显示和操作IP路由表(show / manipulate the IP routing table).要实现两个不同的子网之间的通信,需 要一台连接两个网络的路由器 ...

  4. linux 命令——53 route(转)

    Linux系统的route 命令用于显示和操作IP路由表(show / manipulate the IP routing table).要实现两个不同的子网之间的通信,需 要一台连接两个网络的路由器 ...

  5. kong网关: service+route+upstream

    对于刚开始学习kong网关,总是一脑子浆糊迷迷糊糊.虽然已经安装好,但却不知道接下来如何下手, 因为包含项太多:service.routes.upstream.consumer.plugins等等.一 ...

  6. Linux命令之route - 显示和操作IP路由表

    转自:  http://codingstandards.iteye.com/blog/1125312 用途说明 route命令用于显示和操作IP路由表(show / manipulate the IP ...

  7. kong 命令(五)plugin

    介绍 plugin 插件 是运用在kong网关各模块的功能.在http请求或响应过程中执行的插件: 可以实现认证.负载.加密等功能. kong官网提供了一些插件:https://docs.konghq ...

  8. Kong命令(二)service

    service介绍: service 是声明了一组name.host.port.protocol等配置的函数.可以绑定route.upstream上下游服务.并且对于route.upstream可以绑 ...

  9. [网络配置相关]——ifconfig命令、ip命令、route命令

    ifconfig命令 1. 查看已被激活的网卡的详细信息 # ifconfig eth0 Link encap:Ethernet HWaddr 00:30:67:F2:10:CF inet addr: ...

随机推荐

  1. Centos 7 下 Corosync + Pacemaker + DRBD + psc + crmsh 实现 mysql 服务高可用

    一.介绍 高可用,大家可能会想到比较简单的Keepalived,或者更早一点的 heartbeat,也可能会用到 Corosync+Pacemaker,那么他们之间有什么区别. Heartbeat到了 ...

  2. 【分类算法】朴素贝叶斯(Naive Bayes)

    0 - 算法 给定如下数据集 $$T=\{(x_1,y_1),(x_2,y_2),\cdots,(x_N,y_N)\},$$ 假设$X$有$J$维特征,且各维特征是独立分布的,$Y$有$K$种取值.则 ...

  3. 25.Flutter中的表单 Radio RadioListTile Switch SwitchListTile 以及表单组件实现一个简单的学员登记系统(下)

    四.Radio.RadioListTile单选按钮组件 Radio常用属性: value单选的值. onChanged改变时触发. activeColor:选中的颜色.背景颜色 groupValue: ...

  4. bat批处理 查找替换:批处理如何查找并替换文本里特定字符串中的部分内容

    批处理如何查找并替换文本里特定字符串中的部分内容 摘自:http://www.bathome.net/thread-43349-1-1.html 脚本如下: @if()==() echo off &a ...

  5. 关于mysql索引---联合索引

    结论: mysql联合索引,联合索引以哪个字段开始很重要. 如果  联合索引字段为  1,2,3,4 那么如果查询条件为  6,7,8,1 这样也会走上面的联合索引 但是如果查询条件不是从1开始那么则 ...

  6. Linux 系统中部署 LNMP 高可用负载均衡架构集群实现动态博客

    (一)设计思路 高可用:keepalived 解决方案 负载均衡:(lvs)DR做轮询,需要一个调度器,后端节点两个(部署nginx动态博客),通过一个vip去访问动态博客 后端节点需要部署动态博客作 ...

  7. videojs改变音量大小

    <audio id=example-video preload="auto" class="video-js vjs-default-skin" type ...

  8. PHP和MySQL.Web开发(原书第4版)学习盲点笔记

    1.浏览器输出中文乱码解决: <?php header("Content-type: text/html; charset=utf-8"); ?> 相当于html中的: ...

  9. 【Leetcode_easy】686. Repeated String Match

    problem 686. Repeated String Match solution1: 使用string类的find函数: class Solution { public: int repeate ...

  10. 如何创建一个线程安全的Map?

    1,使用普通的旧的Hashtable HashMap允许null作为key,而Hashtable不可以 2,使用Collections中同步化的包装方法synchronizedMap 3,使用conc ...