调用DisableMockRule接口关闭Mock规则。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。

请求语法

POST|GET /pop/sp/api/mock/disableMockRule HTTP/1.1

请求参数

名称 类型 位置 是否必选 示例值 描述
Id Long Query 275

Mock规则ID。

返回数据

名称 类型 示例值 描述
Code Integer 200

响应码。

Data Struct

返回值。

AccountId String 178432728867xxxx

账户ID。

ConsumerAppId String hkhon1po62@a000601b265xxxx

消费者应用ID。

ConsumerAppName String demo-xxxx

消费者应用名称。

Enable Boolean true

开启或关闭。

  • true:开启。
  • false:关闭。
ExtraJson String {}

描述。

Id Long 275

规则ID。

Name String 规则名称

规则名称。

NamespaceId String cn-shanghai

微服务空间ID。

ProviderAppId String hkhon1po62@a000601b265xxxx

服务提供者应用ID。

ProviderAppName String demo-xxxx

服务提供者应用名称。

Region String cn-shanghai

地域。

ScMockItemJson String [{"oper":"return+json","Path":"/mock","Value":"{\n \"date\": \"2021-09-10T07:45:12.357+0000\",\n \"name\": \"name\",\n \"id\": \"1\"\n}","Method":"GET","Condition":"AND","Timeout":1,"ArgumentMockItems":[{"type":"param","name":"id","value":"1","cond":"==","operator":"rawvalue"},{"type":"param","name":"name","value":"aliyun","cond":"==","operator":"rawvalue"}]}]

HTTP协议Mock规则。

Source String edasmsc

来源。

Message String success

返回信息。

RequestId String 210f470316315038639725978eb3b8

请求ID。

Success Boolean true

返回结果。

  • true:返回成功。
  • false:返回失败。

示例

请求示例

POST /pop/sp/api/mock/disableMockRule HTTP/1.1
公共请求头
{
"Id": "275"
}

正常返回示例

XML格式

<DisableMockRuleResponse>
  <RequestId>210f470316315038639725978eb3b8</RequestId>
  <Message>success</Message>
  <Data>
        <ConsumerAppName>demo-xxxx</ConsumerAppName>
        <AccountId>178432728867xxxx</AccountId>
        <ProviderAppId>hkhon1po62@a000601b265xxxx</ProviderAppId>
        <ProviderAppName>demo-xxxx</ProviderAppName>
        <ScMockItemJson>[{"oper":"return+json","Path":"/mock","Value":"{\n \"date\": \"2021-09-10T07:45:12.357+0000\",\n \"name\": \"name\",\n \"id\": \"1\"\n}","Method":"GET","Condition":"AND","Timeout":1,"ArgumentMockItems":[{"type":"param","name":"id","value":"1","cond":"==","operator":"rawvalue"},{"type":"param","name":"name","value":"aliyun","cond":"==","operator":"rawvalue"}]}]</ScMockItemJson>
        <ConsumerAppId>hkhon1po62@a000601b265xxxx</ConsumerAppId>
        <Region>cn-shanghai</Region>
        <Enable>true</Enable>
        <NamespaceId>cn-shanghai</NamespaceId>
        <Id>275</Id>
        <ExtraJson>{}</ExtraJson>
        <Source>edasmsc</Source>
        <Name>规则名称</Name>
  </Data>
  <Code>200</Code>
  <Success>true</Success>
</DisableMockRuleResponse>

JSON格式

{
    "RequestId": "210f470316315038639725978eb3b8",
    "Message": "success",
    "Data": {
        "ConsumerAppName": "demo-xxxx",
        "AccountId": "178432728867xxxx",
        "ProviderAppId": "hkhon1po62@a000601b265xxxx",
        "ProviderAppName": "demo-xxxx",
        "ScMockItemJson": "[{\"oper\":\"return+json\",\"Path\":\"/mock\",\"Value\":\"{\\n \\\"date\\\": \\\"2021-09-10T07:45:12.357+0000\\\",\\n \\\"name\\\": \\\"name\\\",\\n \\\"id\\\": \\\"1\\\"\\n}\",\"Method\":\"GET\",\"Condition\":\"AND\",\"Timeout\":1,\"ArgumentMockItems\":[{\"type\":\"param\",\"name\":\"id\",\"value\":\"1\",\"cond\":\"==\",\"operator\":\"rawvalue\"},{\"type\":\"param\",\"name\":\"name\",\"value\":\"aliyun\",\"cond\":\"==\",\"operator\":\"rawvalue\"}]}]",
        "ConsumerAppId": "hkhon1po62@a000601b265xxxx",
        "Region": "cn-shanghai",
        "Enable": true,
        "NamespaceId": "cn-shanghai",
        "Id": 275,
        "ExtraJson": "{}",
        "Source": "edasmsc",
        "Name": "规则名称"
    },
    "Code": 200,
    "Success": true
}