Updated on 2026-02-09 GMT+08:00

Querying a Case

Function

This API is used to query a case.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    codeartsperftest:cpts:getPerfTestProject

    Read

    cpts *

    g:ResourceTag/<tag-key>

    -

    -

URI

GET /v2/{project_id}/test-cases/{case_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

case_id

Yes

Integer

Case ID, which is the value of json.test_case_id in the response body of the API for creating a case.

project_id

Yes

String

Project ID. For details, see Method of obtaining instructions.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

code

String

Status code.

message

String

Response.

test_case

CaseInfoDetail object

Case details.

Table 3 CaseInfoDetail

Parameter

Type

Description

name

String

Case name.

case_type

Integer

Case type (0: normal case).

contents

Array of Contents objects

Case script information.

for_loop_params

Array of objects

Logic controller field of the old edition. This parameter is currently deprecated.

increase_setting

Array of objects

Gradient increment.

stages

Array of TestCaseStage objects

Phase information.

status

Integer

Status (0: deleted; 1: enabled; 2: disabled).

temp_id

Integer

Case ID, which is the value of json.test_case_id in the response body of the API for creating a case.

sort

Integer

Sorting field.

directory_id

Integer

Directory ID of the case. This parameter is optional for APIs of earlier versions.

setup_contents

Array of Contents objects

Preparations.

user_replicas

Integer

Actuators.

collect_log_policy

Integer

Log collection policy (0: request mode; 1: case mode).

link_app_list

Array of integers

Associated full-link application list.

case_info

CaseDoc object

Text case information.

Table 4 TestCaseStage

Parameter

Type

Description

operate_mode

Integer

Pressure phase mode (0: by duration; 1: by count).

name

String

Phase name.

time

Integer

Duration, in seconds.

start_time

Integer

Start time.

end_time

Integer

End time.

issue_num

Integer

Maximum concurrency.

count

Integer

Total transmission times.

pressure_mode

Integer

Pressure mode (0: concurrency; 1: TPS; 2: peakload; 3: surge; 5: oscillation; 7: intelligent peakload).

tps_value

Integer

TPS value in TPS mode.

current_user_num

Integer

Start concurrency.

current_tps

Integer

Start TPS value.

voltage_regulating_mode

Integer

Load adjustment mode (0: auto; 1: manual).

maximum

Integer

Maximum concurrency in the surge mode.

minimum

Integer

Minimum concurrency in the surge mode.

loop_count

Integer

Oscillation/surge times.

max_duration

Integer

Peak duration in the surge mode.

ramp_up

Integer

Ramp up (in seconds) in the peakload mode.

peak_load_kpis

StageKpiItems object

Expected KPI.

step_duration

Integer

Single-step execution duration in the intelligent peakload mode.

step_size

Integer

Increase concurrency in the intelligent peakload mode.

Table 5 StageKpiItems

Parameter

Type

Description

average_response_time

StageKpiItem object

Average response time.

success_rate

StageKpiItem object

Success rate.

Table 6 StageKpiItem

Parameter

Type

Description

comparison

String

Comparison operator.

value

Integer

Comparison value.

Table 7 Contents

Parameter

Type

Description

content_id

Integer

Transaction ID. This maps to the tempId value returned in the response body of the transaction creation API. A non-zero value indicates that the card is a transaction, whereas a value of 0 indicates it is not.

content

Array of Content objects

Content.

index

Integer

Sorting index.

selected_temp_name

String

Name of the selected transaction or case.

data

Object

Data to which the loop and condition controller apply.

data_type

Integer

Type (0: default request; 1: data instruction; 201: cycle instruction; 202: condition instruction; 301: rendezvous point).

conditions

Object

If the type is 202 (condition instruction), this field configures the condition.

is_disabled

Boolean

Whether to disable the AW.

Table 8 Content

Parameter

Type

Description

content_type

Integer

Case card type (1: think time; 2: packet; 3: checkpoint; 4: variable extraction).

content

ContentInfo object

Content.

Table 9 ContentInfo

Parameter

Type

Description

body_type

Integer

Body type (0: string; 1: form-data format; 3: x-www-form-urlencoded format).

bodys

Array of objects

Request body.

check_end_length

Object

Length of the data returned through TCP/UDP.

check_end_str

Object

End character returned through TCP/UDP.

check_end_type

Object

End type (1: data length; 2: end character) returned through TCP/UDP.

connect_timeout

Integer

Timeout duration.

connect_type

Integer

Connection settings. This parameter is deprecated in the current edition.

headers

Array of ContentHeader objects

Request header.

http_version

String

HTTP version.

method

String

HTTP method.

name

String

Case name.

protocol_type

Integer

Protocol type (1: HTTP; 2: HTTPS; 3: TCP; 4: UDP; 7: HLS/RTMP; 9: WebSocket; 10: HTTP-FLV; 11: MQTT).

return_timeout

Integer

Response timeout.

return_timeout_param

String

Response timeout parameter.

url

String

Request URL.

rtmp_url

String

RTMP address.

flv_url

String

FLV address.

bitrate_type

Integer

Resolution policy.

duration

Integer

Duration.

retry_delay

Integer

HLS retry delay.

retry_time

Integer

HLS retries.

Table 10 ContentHeader

Parameter

Type

Description

key

String

Key.

value

String

Value.

Table 11 CaseDoc

Parameter

Type

Description

description

String

Case description.

label_names

Array of strings

Tags.

preparation

String

Preparations.

rank

Integer

Case level (0: L0; 1: L1; 2: L2; 3: L3; 4: L4).

status_code

Integer

Status (0: new; 5: designing; 6: testing; 7: completed).

steps

Array of steps objects

Procedure.

Table 12 steps

Parameter

Type

Description

expect_result

String

Step description.

test_step

String

Expected result.

Example Requests

Querying details about a case whose ID is 1.

/v2/{project_id}/test-cases/1

Example Responses

None

Status Codes

Status Code

Description

200

Response object for the case details.

Error Codes

See Error Codes.