应用管理与运维平台 SERVICESTAGE-创建微服务静态信息:请求示例

时间:2024-12-04 15:08:16

请求示例

创建一个微服务的静态信息,其微服务名为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-servicestage/cse_06_0040.html