调用ModifyPtsScene接口修改一个PTS场景。

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String ModifyPtsScene

系统规定参数。取值:ModifyPtsScene

Scene String {"loadConfig":{"agentCount":1,"apiLoadConfigList":[{"rpsBegin":10,"rpsLimit":100}],"configuration":{"allRpsBegin":10,"allRpsLimit":100},"maxRunningTime":1,"testMode":"tps_mode"},"relationList":[{"apiList":[{"apiName":"链路1的第一个API","body":{"bodyValue":"{\"key1\":\"111\",\"key2\":\"222\"}","contentType":"application/x-www-form-urlencoded"},"checkPointList":[{"checkPoint":"userId","checkType":"EXPORTED_PARAM","expectValue":"111","operator":"ctn"}],"exportList":[{"exportName":"userId","exportType":"STATUS_CODE"}],"headerList":[{"headerName":"userName","headerValue":"张三"}],"method":"GET","url":"https://www.aliyundoc.com"}],"fileParameterExplainList":[{"baseFile":true,"cycleOnce":false,"fileParamName":"city,name"}],"relationName":"链路1"}],"sceneName":"xing-测试OpenAPI-1"}

场景信息。更多信息,请参见参数说明

返回数据

名称 类型 示例值 描述
Message String

错误提示消息。

RequestId String 449ADAFB-8DA4-4317-A284-4922D04DE828

请求ID。

HttpStatusCode Integer 200

请求状态码。

Code String 200

系统状态码。

Success Boolean true

是否成功。

  • true:成功
  • false:失败

示例

请求示例

public static void main(String[] args) {

        // 账号的AccessKey ID和AccessKey Secret。
        String accessKeyId = "xxx";
        String accessKeySecret = "xxx";
        DefaultProfile profile = DefaultProfile.getProfile("cn-hangzhou", accessKeyId, accessSecret);
        IAcsClient client = new DefaultAcsClient(profile);

        Scene scene = BuildSceneEntity.getSceneEntity();
        String sceneJson = JSONObject.toJSONString(scene);
        ModifyPtsSceneResponse response = modifyPtsScene(sceneJson, client);
        if (response.getSuccess()) {
            System.out.println("修改成功");
        } else {
            System.out.println("修改失败,失败原因:" + response.getMessage());
        }
    }

    /**
     * 修改场景结构。
     */
    public static ModifyPtsSceneResponse modifyPtsScene(String scene, IAcsClient client) {
        ModifyPtsSceneResponse response = new ModifyPtsSceneResponse();
        if (null == scene || null == client) {
            response.setMessage("修改场景结构,入参不能为空");
            return response;
        }
        ModifyPtsSceneRequest request = new ModifyPtsSceneRequest();
        request.setScene(scene);
        try {
            response = client.getAcsResponse(request);
        } catch (ServerException e) {
            response.setMessage(e.getErrMsg());
            response.setCode(e.getErrCode());
            response.setRequestId(e.getRequestId());
        } catch (ClientException e) {
            response.setMessage(e.getErrMsg());
            response.setCode(e.getErrCode());
            response.setRequestId(e.getRequestId());
        }
        return response;
    }

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyPtsSceneResponse>
    <Message/>
    <RequestId>449ADAFB-8DA4-4317-A284-4922D04DE828</RequestId>
    <HttpStatusCode>200</HttpStatusCode>
    <Code>200</Code>
    <Success>true</Success>
</ModifyPtsSceneResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "",
  "RequestId" : "449ADAFB-8DA4-4317-A284-4922D04DE828",
  "HttpStatusCode" : 200,
  "Code" : "200",
  "Success" : true
}

错误码

访问错误中心查看更多错误码。