微服务引擎 CSE-创建微服务静态信息:请求示例

时间:2023-11-01 16:20:04

请求示例

创建一个微服务的静态信息,其微服务名为test,微服务版本为1.0.0,rule的类型为白名单,实例的主机信息为instanceTest,访问地址为rest:127.0.0.1:8080。

POST https://{endpoint}/v4/{project_id}/registry/microservices{"service": {"appId": "default","serviceName": "test","version": "1.0.0","description": "this is a test"},"rules": [{"ruleType": "WHITE","attribute": "tag_123","pattern": "aaa"}],"instances": [{"hostName": "instanceTest","endpoints": ["rest:127.0.0.1:8080"]}],"tags": {"test_tag1": "test_tag1","test_tag2": "test_tag2","test_tag3": "test_tag3"}}
support.huaweicloud.com/api-cse/servicecomb_api_0007.html