Generating an API Test Suite by Importing Files from the Repository
Function
Generates an API test suite by importing files from the repository.
URI
POST /v1/projects/{project_id}/repository/testsuites
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
DevCloud project ID Minimum: 32 Maximum: 32 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. Call IAM to obtain the user token (value of X-Subject-Token in the response header). Minimum: 1 Maximum: 100000 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
testsuite_name |
Yes |
String |
Name of the test suite to be generated Minimum: 3 Maximum: 128 |
repository_id |
Yes |
String |
Repository ID Minimum: 32 Maximum: 32 |
repository_branch |
Yes |
String |
Repository branch Minimum: 3 Maximum: 100 |
file_path |
Yes |
String |
Relative path of the YAML or JSON file in the repository. Only YAML and JSON files of Swagger 2.0 are supported. Minimum: 6 Maximum: 128 |
Response Parameters
Status code: 201
Parameter |
Type |
Description |
---|---|---|
testsuite_id |
String |
ID of the generated test suite Minimum: 32 Maximum: 32 |
testcase_ids |
Array of strings |
List of generated test case IDs |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code displayed after an API fails to be called Minimum: 16 Maximum: 16 |
error_detail |
Array of CommonResponseDetail objects |
Details about the interface invoking failure. This structure is unavailable for non-parameter verification failures. |
error_msg |
String |
Error message displayed after an API fails to be called Minimum: 3 Maximum: 100 |
Parameter |
Type |
Description |
---|---|---|
step_name |
String |
Records the name of the incorrect step. Minimum: 3 Maximum: 100 |
testcase_name |
String |
Case name Minimum: 3 Maximum: 128 |
fail_content |
String |
Records the actual error content. Minimum: 3 Maximum: 128 |
fail_keys |
String |
Records the AW that contains the error. Minimum: 3 Maximum: 128 |
fail_source |
String |
Records the name of the header that triggers an error. Minimum: 3 Maximum: 100 |
fail_type |
String |
Records the error type. Minimum: 3 Maximum: 100 |
stage |
String |
Records the stage that contains the error. Minimum: 2 Maximum: 50 |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code displayed after an API fails to be called |
error_msg |
String |
Error message displayed after an API fails to be called |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code displayed after an API fails to be called |
error_msg |
String |
Error message displayed after an API fails to be called |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code displayed after an API fails to be called |
error_msg |
String |
Error message displayed after an API fails to be called |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code displayed after an API fails to be called |
error_msg |
String |
Error message displayed after an API fails to be called |
Example Requests
{ "testsuite_name" : "jalor_test_suite", "repository_id" : "aa03aeee96fa48f0acc223f0ab503a1f", "repository_branch" : "master", "file_path" : "apitest.yaml" }
Example Responses
Status code: 201
Created
{ "testsuite_id" : "", "testsuite_ids" : [ "" ] }
Status Codes
Status Code |
Description |
---|---|
201 |
Created |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
500 |
Internal Server Error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot