diff --git a/api/openapi.yaml b/api/openapi.yaml index 9ffa19b1cb..f2427899f9 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -825,7 +825,58 @@ paths: application/yaml: schema: type: string + /test/{testId}/run/{runId}/stop: + post: + tags: + - api + parameters: + - in: path + name: testId + schema: + type: string + required: true + - in: path + name: runId + schema: + type: string + required: true + summary: "stops the execution of a test run" + description: "stops the execution of a test run" + operationId: stopTestRun + responses: + 200: + description: successful operation + 422: + description: could not stop execution, probably it's not running anymore + # Test events + /tests/{testId}/run/{runId}/events: + get: + tags: + - api + parameters: + - in: path + name: testId + schema: + type: string + required: true + - in: path + name: runId + schema: + type: string + required: true + summary: "get events from a test run" + description: "get events from a test run" + operationId: getTestRunEvents + responses: + 200: + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: "./testEvents.yaml#/components/schemas/TestRunEvent" # Environments /environments: get: diff --git a/api/testEvents.yaml b/api/testEvents.yaml new file mode 100644 index 0000000000..f60c38a2ef --- /dev/null +++ b/api/testEvents.yaml @@ -0,0 +1,63 @@ +version: 3.0.0 +components: + schemas: + TestRunEvent: + type: object + properties: + type: + type: string + stage: + type: string + enum: + - trigger + - trace + - test + description: + type: string + createdAt: + type: string + format: date-time + testId: + type: string + runId: + type: string + dataStoreConnection: + $ref: "./config.yaml#/components/schemas/ConnectionResult" + polling: + $ref: "#/components/schemas/PollingInfo" + outputs: + type: array + items: + $ref: "#/components/schemas/OutputInfo" + + PollingInfo: + type: object + properties: + type: + type: string + enum: + - periodic + reasonNextIteration: + type: string + isComplete: + type: boolean + periodic: + type: object + properties: + numberSpans: + type: integer + numberIterations: + type: integer + + OutputInfo: + type: object + properties: + logLevel: + type: string + enum: + - warning + - error + message: + type: string + outputName: + type: string diff --git a/cli/openapi/api_api.go b/cli/openapi/api_api.go index 444fbcbfc7..a112c4aab9 100644 --- a/cli/openapi/api_api.go +++ b/cli/openapi/api_api.go @@ -42,8 +42,8 @@ CreateDataStore Create a new Data Store Create a new Data Store - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateDataStoreRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateDataStoreRequest */ func (a *ApiApiService) CreateDataStore(ctx context.Context) ApiCreateDataStoreRequest { return ApiCreateDataStoreRequest{ @@ -53,8 +53,7 @@ func (a *ApiApiService) CreateDataStore(ctx context.Context) ApiCreateDataStoreR } // Execute executes the request -// -// @return DataStore +// @return DataStore func (a *ApiApiService) CreateDataStoreExecute(r ApiCreateDataStoreRequest) (*DataStore, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -150,8 +149,8 @@ CreateEnvironment Create new environment Create new environment action - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateEnvironmentRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateEnvironmentRequest */ func (a *ApiApiService) CreateEnvironment(ctx context.Context) ApiCreateEnvironmentRequest { return ApiCreateEnvironmentRequest{ @@ -161,8 +160,7 @@ func (a *ApiApiService) CreateEnvironment(ctx context.Context) ApiCreateEnvironm } // Execute executes the request -// -// @return Environment +// @return Environment func (a *ApiApiService) CreateEnvironmentExecute(r ApiCreateEnvironmentRequest) (*Environment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -258,8 +256,8 @@ CreateTest Create new test Create new test action - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateTestRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateTestRequest */ func (a *ApiApiService) CreateTest(ctx context.Context) ApiCreateTestRequest { return ApiCreateTestRequest{ @@ -269,8 +267,7 @@ func (a *ApiApiService) CreateTest(ctx context.Context) ApiCreateTestRequest { } // Execute executes the request -// -// @return Test +// @return Test func (a *ApiApiService) CreateTestExecute(r ApiCreateTestRequest) (*Test, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -366,8 +363,8 @@ CreateTransaction Create new transaction Create new transaction - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateTransactionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateTransactionRequest */ func (a *ApiApiService) CreateTransaction(ctx context.Context) ApiCreateTransactionRequest { return ApiCreateTransactionRequest{ @@ -377,8 +374,7 @@ func (a *ApiApiService) CreateTransaction(ctx context.Context) ApiCreateTransact } // Execute executes the request -// -// @return Transaction +// @return Transaction func (a *ApiApiService) CreateTransactionExecute(r ApiCreateTransactionRequest) (*Transaction, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -469,9 +465,9 @@ DeleteDataStore Delete a Data Store Delete a Data Store - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param dataStoreId - @return ApiDeleteDataStoreRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dataStoreId + @return ApiDeleteDataStoreRequest */ func (a *ApiApiService) DeleteDataStore(ctx context.Context, dataStoreId string) ApiDeleteDataStoreRequest { return ApiDeleteDataStoreRequest{ @@ -561,9 +557,9 @@ DeleteEnvironment delete a environment delete a environment - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param environmentId - @return ApiDeleteEnvironmentRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param environmentId + @return ApiDeleteEnvironmentRequest */ func (a *ApiApiService) DeleteEnvironment(ctx context.Context, environmentId string) ApiDeleteEnvironmentRequest { return ApiDeleteEnvironmentRequest{ @@ -653,9 +649,9 @@ DeleteTest delete a test delete a test - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @return ApiDeleteTestRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @return ApiDeleteTestRequest */ func (a *ApiApiService) DeleteTest(ctx context.Context, testId string) ApiDeleteTestRequest { return ApiDeleteTestRequest{ @@ -746,10 +742,10 @@ DeleteTestRun delete a test run delete a test run - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param runId - @return ApiDeleteTestRunRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiDeleteTestRunRequest */ func (a *ApiApiService) DeleteTestRun(ctx context.Context, testId string, runId string) ApiDeleteTestRunRequest { return ApiDeleteTestRunRequest{ @@ -841,9 +837,9 @@ DeleteTransaction delete a transaction delete a transaction - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @return ApiDeleteTransactionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @return ApiDeleteTransactionRequest */ func (a *ApiApiService) DeleteTransaction(ctx context.Context, transactionId string) ApiDeleteTransactionRequest { return ApiDeleteTransactionRequest{ @@ -934,10 +930,10 @@ DeleteTransactionRun Delete a specific run from a particular transaction Delete a specific run from a particular transaction - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @param runId - @return ApiDeleteTransactionRunRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @param runId + @return ApiDeleteTransactionRunRequest */ func (a *ApiApiService) DeleteTransactionRun(ctx context.Context, transactionId string, runId int32) ApiDeleteTransactionRunRequest { return ApiDeleteTransactionRunRequest{ @@ -1036,10 +1032,10 @@ DryRunAssertion run given assertions against the traces from the given run witho use this method to test a definition against an actual trace without creating a new version or persisting anything - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param runId - @return ApiDryRunAssertionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiDryRunAssertionRequest */ func (a *ApiApiService) DryRunAssertion(ctx context.Context, testId string, runId string) ApiDryRunAssertionRequest { return ApiDryRunAssertionRequest{ @@ -1051,8 +1047,7 @@ func (a *ApiApiService) DryRunAssertion(ctx context.Context, testId string, runI } // Execute executes the request -// -// @return AssertionResults +// @return AssertionResults func (a *ApiApiService) DryRunAssertionExecute(r ApiDryRunAssertionRequest) (*AssertionResults, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut @@ -1150,8 +1145,8 @@ ExecuteDefinition Execute a definition Execute a definition - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiExecuteDefinitionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExecuteDefinitionRequest */ func (a *ApiApiService) ExecuteDefinition(ctx context.Context) ApiExecuteDefinitionRequest { return ApiExecuteDefinitionRequest{ @@ -1161,8 +1156,7 @@ func (a *ApiApiService) ExecuteDefinition(ctx context.Context) ApiExecuteDefinit } // Execute executes the request -// -// @return ExecuteDefinitionResponse +// @return ExecuteDefinitionResponse func (a *ApiApiService) ExecuteDefinitionExecute(r ApiExecuteDefinitionRequest) (*ExecuteDefinitionResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -1254,10 +1248,10 @@ ExportTestRun export test and test run information export test and test run information for debugging - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param runId - @return ApiExportTestRunRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiExportTestRunRequest */ func (a *ApiApiService) ExportTestRun(ctx context.Context, testId string, runId string) ApiExportTestRunRequest { return ApiExportTestRunRequest{ @@ -1269,8 +1263,7 @@ func (a *ApiApiService) ExportTestRun(ctx context.Context, testId string, runId } // Execute executes the request -// -// @return ExportedTestInformation +// @return ExportedTestInformation func (a *ApiApiService) ExportTestRunExecute(r ApiExportTestRunRequest) (*ExportedTestInformation, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1366,8 +1359,8 @@ ExpressionResolve resolves an expression and returns the result string resolves an expression and returns the result string - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiExpressionResolveRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiExpressionResolveRequest */ func (a *ApiApiService) ExpressionResolve(ctx context.Context) ApiExpressionResolveRequest { return ApiExpressionResolveRequest{ @@ -1377,8 +1370,7 @@ func (a *ApiApiService) ExpressionResolve(ctx context.Context) ApiExpressionReso } // Execute executes the request -// -// @return ResolveResponseInfo +// @return ResolveResponseInfo func (a *ApiApiService) ExpressionResolveExecute(r ApiExpressionResolveRequest) (*ResolveResponseInfo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -1469,9 +1461,9 @@ GetDataStore Get a Data Store Get a Data Store - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param dataStoreId - @return ApiGetDataStoreRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dataStoreId + @return ApiGetDataStoreRequest */ func (a *ApiApiService) GetDataStore(ctx context.Context, dataStoreId string) ApiGetDataStoreRequest { return ApiGetDataStoreRequest{ @@ -1482,8 +1474,7 @@ func (a *ApiApiService) GetDataStore(ctx context.Context, dataStoreId string) Ap } // Execute executes the request -// -// @return DataStore +// @return DataStore func (a *ApiApiService) GetDataStoreExecute(r ApiGetDataStoreRequest) (*DataStore, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1573,9 +1564,9 @@ GetDataStoreDefinitionFile Get the data store definition as an YAML file Get the data store as an YAML file - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param dataStoreId - @return ApiGetDataStoreDefinitionFileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dataStoreId + @return ApiGetDataStoreDefinitionFileRequest */ func (a *ApiApiService) GetDataStoreDefinitionFile(ctx context.Context, dataStoreId string) ApiGetDataStoreDefinitionFileRequest { return ApiGetDataStoreDefinitionFileRequest{ @@ -1586,8 +1577,7 @@ func (a *ApiApiService) GetDataStoreDefinitionFile(ctx context.Context, dataStor } // Execute executes the request -// -// @return string +// @return string func (a *ApiApiService) GetDataStoreDefinitionFileExecute(r ApiGetDataStoreDefinitionFileRequest) (string, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1711,8 +1701,8 @@ GetDataStores Get all Data Stores Get all Data Stores - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetDataStoresRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDataStoresRequest */ func (a *ApiApiService) GetDataStores(ctx context.Context) ApiGetDataStoresRequest { return ApiGetDataStoresRequest{ @@ -1722,8 +1712,7 @@ func (a *ApiApiService) GetDataStores(ctx context.Context) ApiGetDataStoresReque } // Execute executes the request -// -// @return []DataStore +// @return []DataStore func (a *ApiApiService) GetDataStoresExecute(r ApiGetDataStoresRequest) ([]DataStore, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1827,9 +1816,9 @@ GetEnvironment get environment get environment - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param environmentId - @return ApiGetEnvironmentRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param environmentId + @return ApiGetEnvironmentRequest */ func (a *ApiApiService) GetEnvironment(ctx context.Context, environmentId string) ApiGetEnvironmentRequest { return ApiGetEnvironmentRequest{ @@ -1840,8 +1829,7 @@ func (a *ApiApiService) GetEnvironment(ctx context.Context, environmentId string } // Execute executes the request -// -// @return Environment +// @return Environment func (a *ApiApiService) GetEnvironmentExecute(r ApiGetEnvironmentRequest) (*Environment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1931,9 +1919,9 @@ GetEnvironmentDefinitionFile Get the environment definition as an YAML file Get the environment as an YAML file - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param environmentId - @return ApiGetEnvironmentDefinitionFileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param environmentId + @return ApiGetEnvironmentDefinitionFileRequest */ func (a *ApiApiService) GetEnvironmentDefinitionFile(ctx context.Context, environmentId string) ApiGetEnvironmentDefinitionFileRequest { return ApiGetEnvironmentDefinitionFileRequest{ @@ -1944,8 +1932,7 @@ func (a *ApiApiService) GetEnvironmentDefinitionFile(ctx context.Context, enviro } // Execute executes the request -// -// @return string +// @return string func (a *ApiApiService) GetEnvironmentDefinitionFileExecute(r ApiGetEnvironmentDefinitionFileRequest) (string, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2069,8 +2056,8 @@ GetEnvironments Get Environments Get Environments - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetEnvironmentsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetEnvironmentsRequest */ func (a *ApiApiService) GetEnvironments(ctx context.Context) ApiGetEnvironmentsRequest { return ApiGetEnvironmentsRequest{ @@ -2080,8 +2067,7 @@ func (a *ApiApiService) GetEnvironments(ctx context.Context) ApiGetEnvironmentsR } // Execute executes the request -// -// @return []Environment +// @return []Environment func (a *ApiApiService) GetEnvironmentsExecute(r ApiGetEnvironmentsRequest) ([]Environment, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2219,8 +2205,8 @@ GetResources Get resources get resources - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetResourcesRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetResourcesRequest */ func (a *ApiApiService) GetResources(ctx context.Context) ApiGetResourcesRequest { return ApiGetResourcesRequest{ @@ -2230,8 +2216,7 @@ func (a *ApiApiService) GetResources(ctx context.Context) ApiGetResourcesRequest } // Execute executes the request -// -// @return []Resource +// @return []Resource func (a *ApiApiService) GetResourcesExecute(r ApiGetResourcesRequest) ([]Resource, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2336,10 +2321,10 @@ GetRunResultJUnit get test run results in JUnit xml format get test run results in JUnit xml format - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param runId - @return ApiGetRunResultJUnitRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiGetRunResultJUnitRequest */ func (a *ApiApiService) GetRunResultJUnit(ctx context.Context, testId string, runId string) ApiGetRunResultJUnitRequest { return ApiGetRunResultJUnitRequest{ @@ -2351,8 +2336,7 @@ func (a *ApiApiService) GetRunResultJUnit(ctx context.Context, testId string, ru } // Execute executes the request -// -// @return string +// @return string func (a *ApiApiService) GetRunResultJUnitExecute(r ApiGetRunResultJUnitRequest) (string, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2443,9 +2427,9 @@ GetTest get test get test - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @return ApiGetTestRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @return ApiGetTestRequest */ func (a *ApiApiService) GetTest(ctx context.Context, testId string) ApiGetTestRequest { return ApiGetTestRequest{ @@ -2456,8 +2440,7 @@ func (a *ApiApiService) GetTest(ctx context.Context, testId string) ApiGetTestRe } // Execute executes the request -// -// @return Test +// @return Test func (a *ApiApiService) GetTestExecute(r ApiGetTestRequest) (*Test, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2554,10 +2537,10 @@ GetTestResultSelectedSpans retrieve spans that will be selected by selector get the spans ids that would be selected by a specific selector query - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param runId - @return ApiGetTestResultSelectedSpansRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiGetTestResultSelectedSpansRequest */ func (a *ApiApiService) GetTestResultSelectedSpans(ctx context.Context, testId string, runId string) ApiGetTestResultSelectedSpansRequest { return ApiGetTestResultSelectedSpansRequest{ @@ -2569,8 +2552,7 @@ func (a *ApiApiService) GetTestResultSelectedSpans(ctx context.Context, testId s } // Execute executes the request -// -// @return SelectedSpansResult +// @return SelectedSpansResult func (a *ApiApiService) GetTestResultSelectedSpansExecute(r ApiGetTestResultSelectedSpansRequest) (*SelectedSpansResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2665,10 +2647,10 @@ GetTestRun get test Run get a particular test Run - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param runId - @return ApiGetTestRunRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiGetTestRunRequest */ func (a *ApiApiService) GetTestRun(ctx context.Context, testId string, runId string) ApiGetTestRunRequest { return ApiGetTestRunRequest{ @@ -2680,8 +2662,7 @@ func (a *ApiApiService) GetTestRun(ctx context.Context, testId string, runId str } // Execute executes the request -// -// @return TestRun +// @return TestRun func (a *ApiApiService) GetTestRunExecute(r ApiGetTestRunRequest) (*TestRun, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2757,6 +2738,113 @@ func (a *ApiApiService) GetTestRunExecute(r ApiGetTestRunRequest) (*TestRun, *ht return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetTestRunEventsRequest struct { + ctx context.Context + ApiService *ApiApiService + testId string + runId string +} + +func (r ApiGetTestRunEventsRequest) Execute() ([]TestRunEvent, *http.Response, error) { + return r.ApiService.GetTestRunEventsExecute(r) +} + +/* +GetTestRunEvents get events from a test run + +get events from a test run + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiGetTestRunEventsRequest +*/ +func (a *ApiApiService) GetTestRunEvents(ctx context.Context, testId string, runId string) ApiGetTestRunEventsRequest { + return ApiGetTestRunEventsRequest{ + ApiService: a, + ctx: ctx, + testId: testId, + runId: runId, + } +} + +// Execute executes the request +// @return []TestRunEvent +func (a *ApiApiService) GetTestRunEventsExecute(r ApiGetTestRunEventsRequest) ([]TestRunEvent, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TestRunEvent + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApiApiService.GetTestRunEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tests/{testId}/run/{runId}/events" + localVarPath = strings.Replace(localVarPath, "{"+"testId"+"}", url.PathEscape(parameterValueToString(r.testId, "testId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGetTestRunsRequest struct { ctx context.Context ApiService *ApiApiService @@ -2786,9 +2874,9 @@ GetTestRuns get the runs for a test get the runs from a particular test - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @return ApiGetTestRunsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @return ApiGetTestRunsRequest */ func (a *ApiApiService) GetTestRuns(ctx context.Context, testId string) ApiGetTestRunsRequest { return ApiGetTestRunsRequest{ @@ -2799,8 +2887,7 @@ func (a *ApiApiService) GetTestRuns(ctx context.Context, testId string) ApiGetTe } // Execute executes the request -// -// @return []TestRun +// @return []TestRun func (a *ApiApiService) GetTestRunsExecute(r ApiGetTestRunsRequest) ([]TestRun, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2896,9 +2983,9 @@ GetTestSpecs Get definition for a test Gets definition for a test - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @return ApiGetTestSpecsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @return ApiGetTestSpecsRequest */ func (a *ApiApiService) GetTestSpecs(ctx context.Context, testId string) ApiGetTestSpecsRequest { return ApiGetTestSpecsRequest{ @@ -2909,8 +2996,7 @@ func (a *ApiApiService) GetTestSpecs(ctx context.Context, testId string) ApiGetT } // Execute executes the request -// -// @return []TestSpecs +// @return []TestSpecs func (a *ApiApiService) GetTestSpecsExecute(r ApiGetTestSpecsRequest) ([]TestSpecs, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3001,10 +3087,10 @@ GetTestVersion get a test specific version get a test specific version - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param version - @return ApiGetTestVersionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param version + @return ApiGetTestVersionRequest */ func (a *ApiApiService) GetTestVersion(ctx context.Context, testId string, version int32) ApiGetTestVersionRequest { return ApiGetTestVersionRequest{ @@ -3016,8 +3102,7 @@ func (a *ApiApiService) GetTestVersion(ctx context.Context, testId string, versi } // Execute executes the request -// -// @return Test +// @return Test func (a *ApiApiService) GetTestVersionExecute(r ApiGetTestVersionRequest) (*Test, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3109,10 +3194,10 @@ GetTestVersionDefinitionFile Get the test definition as an YAML file Get the test definition as an YAML file - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param version - @return ApiGetTestVersionDefinitionFileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param version + @return ApiGetTestVersionDefinitionFileRequest */ func (a *ApiApiService) GetTestVersionDefinitionFile(ctx context.Context, testId string, version int32) ApiGetTestVersionDefinitionFileRequest { return ApiGetTestVersionDefinitionFileRequest{ @@ -3124,8 +3209,7 @@ func (a *ApiApiService) GetTestVersionDefinitionFile(ctx context.Context, testId } // Execute executes the request -// -// @return string +// @return string func (a *ApiApiService) GetTestVersionDefinitionFileExecute(r ApiGetTestVersionDefinitionFileRequest) (string, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3250,8 +3334,8 @@ GetTests Get tests get tests - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetTestsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTestsRequest */ func (a *ApiApiService) GetTests(ctx context.Context) ApiGetTestsRequest { return ApiGetTestsRequest{ @@ -3261,8 +3345,7 @@ func (a *ApiApiService) GetTests(ctx context.Context) ApiGetTestsRequest { } // Execute executes the request -// -// @return []Test +// @return []Test func (a *ApiApiService) GetTestsExecute(r ApiGetTestsRequest) ([]Test, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3366,9 +3449,9 @@ GetTransaction get transaction get transaction - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @return ApiGetTransactionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @return ApiGetTransactionRequest */ func (a *ApiApiService) GetTransaction(ctx context.Context, transactionId string) ApiGetTransactionRequest { return ApiGetTransactionRequest{ @@ -3379,8 +3462,7 @@ func (a *ApiApiService) GetTransaction(ctx context.Context, transactionId string } // Execute executes the request -// -// @return Transaction +// @return Transaction func (a *ApiApiService) GetTransactionExecute(r ApiGetTransactionRequest) (*Transaction, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3471,10 +3553,10 @@ GetTransactionRun Get a specific run from a particular transaction Get a specific run from a particular transaction - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @param runId - @return ApiGetTransactionRunRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @param runId + @return ApiGetTransactionRunRequest */ func (a *ApiApiService) GetTransactionRun(ctx context.Context, transactionId string, runId int32) ApiGetTransactionRunRequest { return ApiGetTransactionRunRequest{ @@ -3486,8 +3568,7 @@ func (a *ApiApiService) GetTransactionRun(ctx context.Context, transactionId str } // Execute executes the request -// -// @return TransactionRun +// @return TransactionRun func (a *ApiApiService) GetTransactionRunExecute(r ApiGetTransactionRunRequest) (*TransactionRun, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3592,9 +3673,9 @@ GetTransactionRuns Get all runs from a particular transaction Get all runs from a particular transaction - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @return ApiGetTransactionRunsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @return ApiGetTransactionRunsRequest */ func (a *ApiApiService) GetTransactionRuns(ctx context.Context, transactionId string) ApiGetTransactionRunsRequest { return ApiGetTransactionRunsRequest{ @@ -3605,8 +3686,7 @@ func (a *ApiApiService) GetTransactionRuns(ctx context.Context, transactionId st } // Execute executes the request -// -// @return []TransactionRun +// @return []TransactionRun func (a *ApiApiService) GetTransactionRunsExecute(r ApiGetTransactionRunsRequest) ([]TransactionRun, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3703,10 +3783,10 @@ GetTransactionVersion get a transaction specific version get a transaction specific version - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @param version - @return ApiGetTransactionVersionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @param version + @return ApiGetTransactionVersionRequest */ func (a *ApiApiService) GetTransactionVersion(ctx context.Context, transactionId string, version int32) ApiGetTransactionVersionRequest { return ApiGetTransactionVersionRequest{ @@ -3718,8 +3798,7 @@ func (a *ApiApiService) GetTransactionVersion(ctx context.Context, transactionId } // Execute executes the request -// -// @return Transaction +// @return Transaction func (a *ApiApiService) GetTransactionVersionExecute(r ApiGetTransactionVersionRequest) (*Transaction, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3811,10 +3890,10 @@ GetTransactionVersionDefinitionFile Get the transaction definition as an YAML fi Get the transaction as an YAML file - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @param version - @return ApiGetTransactionVersionDefinitionFileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @param version + @return ApiGetTransactionVersionDefinitionFileRequest */ func (a *ApiApiService) GetTransactionVersionDefinitionFile(ctx context.Context, transactionId string, version int32) ApiGetTransactionVersionDefinitionFileRequest { return ApiGetTransactionVersionDefinitionFileRequest{ @@ -3826,8 +3905,7 @@ func (a *ApiApiService) GetTransactionVersionDefinitionFile(ctx context.Context, } // Execute executes the request -// -// @return string +// @return string func (a *ApiApiService) GetTransactionVersionDefinitionFileExecute(r ApiGetTransactionVersionDefinitionFileRequest) (string, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -3952,8 +4030,8 @@ GetTransactions Get transactions get transactions - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetTransactionsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTransactionsRequest */ func (a *ApiApiService) GetTransactions(ctx context.Context) ApiGetTransactionsRequest { return ApiGetTransactionsRequest{ @@ -3963,8 +4041,7 @@ func (a *ApiApiService) GetTransactions(ctx context.Context) ApiGetTransactionsR } // Execute executes the request -// -// @return []Transaction +// @return []Transaction func (a *ApiApiService) GetTransactionsExecute(r ApiGetTransactionsRequest) ([]Transaction, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -4073,8 +4150,8 @@ ImportTestRun import test and test run information import test and test run information for debugging - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiImportTestRunRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiImportTestRunRequest */ func (a *ApiApiService) ImportTestRun(ctx context.Context) ApiImportTestRunRequest { return ApiImportTestRunRequest{ @@ -4084,8 +4161,7 @@ func (a *ApiApiService) ImportTestRun(ctx context.Context) ApiImportTestRunReque } // Execute executes the request -// -// @return ExportedTestInformation +// @return ExportedTestInformation func (a *ApiApiService) ImportTestRunExecute(r ApiImportTestRunRequest) (*ExportedTestInformation, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -4177,10 +4253,10 @@ RerunTestRun rerun a test run rerun a test run - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @param runId - @return ApiRerunTestRunRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiRerunTestRunRequest */ func (a *ApiApiService) RerunTestRun(ctx context.Context, testId string, runId string) ApiRerunTestRunRequest { return ApiRerunTestRunRequest{ @@ -4192,8 +4268,7 @@ func (a *ApiApiService) RerunTestRun(ctx context.Context, testId string, runId s } // Execute executes the request -// -// @return TestRun +// @return TestRun func (a *ApiApiService) RerunTestRunExecute(r ApiRerunTestRunRequest) (*TestRun, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -4290,9 +4365,9 @@ RunTest run test run a particular test - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @return ApiRunTestRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @return ApiRunTestRequest */ func (a *ApiApiService) RunTest(ctx context.Context, testId string) ApiRunTestRequest { return ApiRunTestRequest{ @@ -4303,8 +4378,7 @@ func (a *ApiApiService) RunTest(ctx context.Context, testId string) ApiRunTestRe } // Execute executes the request -// -// @return TestRun +// @return TestRun func (a *ApiApiService) RunTestExecute(r ApiRunTestRequest) (*TestRun, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -4412,9 +4486,9 @@ RunTransaction run transaction run a particular transaction - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @return ApiRunTransactionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @return ApiRunTransactionRequest */ func (a *ApiApiService) RunTransaction(ctx context.Context, transactionId string) ApiRunTransactionRequest { return ApiRunTransactionRequest{ @@ -4425,8 +4499,7 @@ func (a *ApiApiService) RunTransaction(ctx context.Context, transactionId string } // Execute executes the request -// -// @return TransactionRun +// @return TransactionRun func (a *ApiApiService) RunTransactionExecute(r ApiRunTransactionRequest) (*TransactionRun, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -4503,6 +4576,102 @@ func (a *ApiApiService) RunTransactionExecute(r ApiRunTransactionRequest) (*Tran return localVarReturnValue, localVarHTTPResponse, nil } +type ApiStopTestRunRequest struct { + ctx context.Context + ApiService *ApiApiService + testId string + runId string +} + +func (r ApiStopTestRunRequest) Execute() (*http.Response, error) { + return r.ApiService.StopTestRunExecute(r) +} + +/* +StopTestRun stops the execution of a test run + +stops the execution of a test run + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @param runId + @return ApiStopTestRunRequest +*/ +func (a *ApiApiService) StopTestRun(ctx context.Context, testId string, runId string) ApiStopTestRunRequest { + return ApiStopTestRunRequest{ + ApiService: a, + ctx: ctx, + testId: testId, + runId: runId, + } +} + +// Execute executes the request +func (a *ApiApiService) StopTestRunExecute(r ApiStopTestRunRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApiApiService.StopTestRun") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/test/{testId}/run/{runId}/stop" + localVarPath = strings.Replace(localVarPath, "{"+"testId"+"}", url.PathEscape(parameterValueToString(r.testId, "testId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"runId"+"}", url.PathEscape(parameterValueToString(r.runId, "runId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + type ApiTestConnectionRequest struct { ctx context.Context ApiService *ApiApiService @@ -4523,8 +4692,8 @@ TestConnection Tests the config data store/exporter connection Tests the config data store/exporter connection - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiTestConnectionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestConnectionRequest */ func (a *ApiApiService) TestConnection(ctx context.Context) ApiTestConnectionRequest { return ApiTestConnectionRequest{ @@ -4534,8 +4703,7 @@ func (a *ApiApiService) TestConnection(ctx context.Context) ApiTestConnectionReq } // Execute executes the request -// -// @return TestConnectionResponse +// @return TestConnectionResponse func (a *ApiApiService) TestConnectionExecute(r ApiTestConnectionRequest) (*TestConnectionResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -4632,9 +4800,9 @@ UpdateDataStore Update a Data Store Update a Data Store - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param dataStoreId - @return ApiUpdateDataStoreRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dataStoreId + @return ApiUpdateDataStoreRequest */ func (a *ApiApiService) UpdateDataStore(ctx context.Context, dataStoreId string) ApiUpdateDataStoreRequest { return ApiUpdateDataStoreRequest{ @@ -4732,9 +4900,9 @@ UpdateEnvironment update environment update environment action - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param environmentId - @return ApiUpdateEnvironmentRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param environmentId + @return ApiUpdateEnvironmentRequest */ func (a *ApiApiService) UpdateEnvironment(ctx context.Context, environmentId string) ApiUpdateEnvironmentRequest { return ApiUpdateEnvironmentRequest{ @@ -4832,9 +5000,9 @@ UpdateTest update test update test action - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param testId - @return ApiUpdateTestRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param testId + @return ApiUpdateTestRequest */ func (a *ApiApiService) UpdateTest(ctx context.Context, testId string) ApiUpdateTestRequest { return ApiUpdateTestRequest{ @@ -4932,9 +5100,9 @@ UpdateTransaction update transaction update transaction action - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param transactionId - @return ApiUpdateTransactionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param transactionId + @return ApiUpdateTransactionRequest */ func (a *ApiApiService) UpdateTransaction(ctx context.Context, transactionId string) ApiUpdateTransactionRequest { return ApiUpdateTransactionRequest{ @@ -5031,8 +5199,8 @@ UpsertDefinition Upsert a definition Upsert a definition - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiUpsertDefinitionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUpsertDefinitionRequest */ func (a *ApiApiService) UpsertDefinition(ctx context.Context) ApiUpsertDefinitionRequest { return ApiUpsertDefinitionRequest{ @@ -5042,8 +5210,7 @@ func (a *ApiApiService) UpsertDefinition(ctx context.Context) ApiUpsertDefinitio } // Execute executes the request -// -// @return UpsertDefinitionResponse +// @return UpsertDefinitionResponse func (a *ApiApiService) UpsertDefinitionExecute(r ApiUpsertDefinitionRequest) (*UpsertDefinitionResponse, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut diff --git a/cli/openapi/api_resource_api.go b/cli/openapi/api_resource_api.go index 7578ba6494..7e39e08f49 100644 --- a/cli/openapi/api_resource_api.go +++ b/cli/openapi/api_resource_api.go @@ -42,8 +42,8 @@ CreateDemo Create a Demonstration setting Create a demonstration used on Tracetest as quick start examples. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateDemoRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateDemoRequest */ func (a *ResourceApiApiService) CreateDemo(ctx context.Context) ApiCreateDemoRequest { return ApiCreateDemoRequest{ @@ -53,8 +53,7 @@ func (a *ResourceApiApiService) CreateDemo(ctx context.Context) ApiCreateDemoReq } // Execute executes the request -// -// @return Demo +// @return Demo func (a *ResourceApiApiService) CreateDemoExecute(r ApiCreateDemoRequest) (*Demo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -150,8 +149,8 @@ CreatePollingProfile Create a Polling Profile Create a polling profile used on Tracetest to configure how to fetch traces in a test. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreatePollingProfileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreatePollingProfileRequest */ func (a *ResourceApiApiService) CreatePollingProfile(ctx context.Context) ApiCreatePollingProfileRequest { return ApiCreatePollingProfileRequest{ @@ -161,8 +160,7 @@ func (a *ResourceApiApiService) CreatePollingProfile(ctx context.Context) ApiCre } // Execute executes the request -// -// @return PollingProfile +// @return PollingProfile func (a *ResourceApiApiService) CreatePollingProfileExecute(r ApiCreatePollingProfileRequest) (*PollingProfile, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost @@ -253,9 +251,9 @@ DeleteDemo Delete a Demonstration setting Delete a demonstration used on Tracetest as quick start examples. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param demoId ID of a demonstration used on Tracetest as quick start examples. - @return ApiDeleteDemoRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param demoId ID of a demonstration used on Tracetest as quick start examples. + @return ApiDeleteDemoRequest */ func (a *ResourceApiApiService) DeleteDemo(ctx context.Context, demoId string) ApiDeleteDemoRequest { return ApiDeleteDemoRequest{ @@ -345,9 +343,9 @@ DeletePollingProfile Delete a Polling Profile Delete a polling profile used on Tracetest to configure how to fetch traces in a test. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param pollingProfileId ID of a polling profile used on Tracetest to configure how to fetch traces in a test. - @return ApiDeletePollingProfileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pollingProfileId ID of a polling profile used on Tracetest to configure how to fetch traces in a test. + @return ApiDeletePollingProfileRequest */ func (a *ResourceApiApiService) DeletePollingProfile(ctx context.Context, pollingProfileId string) ApiDeletePollingProfileRequest { return ApiDeletePollingProfileRequest{ @@ -437,9 +435,9 @@ GetConfiguration Get Tracetest configuration Get Tracetest configuration - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param configId ID of the configuration resource used on Tracetest. It should be set as 'current'. - @return ApiGetConfigurationRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param configId ID of the configuration resource used on Tracetest. It should be set as 'current'. + @return ApiGetConfigurationRequest */ func (a *ResourceApiApiService) GetConfiguration(ctx context.Context, configId string) ApiGetConfigurationRequest { return ApiGetConfigurationRequest{ @@ -450,8 +448,7 @@ func (a *ResourceApiApiService) GetConfiguration(ctx context.Context, configId s } // Execute executes the request -// -// @return ConfigurationResource +// @return ConfigurationResource func (a *ResourceApiApiService) GetConfigurationExecute(r ApiGetConfigurationRequest) (*ConfigurationResource, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -541,9 +538,9 @@ GetDemo Get Demonstration setting Get a demonstration used on Tracetest as quick start examples. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param demoId ID of a demonstration used on Tracetest as quick start examples. - @return ApiGetDemoRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param demoId ID of a demonstration used on Tracetest as quick start examples. + @return ApiGetDemoRequest */ func (a *ResourceApiApiService) GetDemo(ctx context.Context, demoId string) ApiGetDemoRequest { return ApiGetDemoRequest{ @@ -554,8 +551,7 @@ func (a *ResourceApiApiService) GetDemo(ctx context.Context, demoId string) ApiG } // Execute executes the request -// -// @return Demo +// @return Demo func (a *ResourceApiApiService) GetDemoExecute(r ApiGetDemoRequest) (*Demo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -645,9 +641,9 @@ GetPollingProfile Get Polling Profile Get a polling profile used on Tracetest to configure how to fetch traces in a test. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param pollingProfileId ID of a polling profile used on Tracetest to configure how to fetch traces in a test. - @return ApiGetPollingProfileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pollingProfileId ID of a polling profile used on Tracetest to configure how to fetch traces in a test. + @return ApiGetPollingProfileRequest */ func (a *ResourceApiApiService) GetPollingProfile(ctx context.Context, pollingProfileId string) ApiGetPollingProfileRequest { return ApiGetPollingProfileRequest{ @@ -658,8 +654,7 @@ func (a *ResourceApiApiService) GetPollingProfile(ctx context.Context, pollingPr } // Execute executes the request -// -// @return PollingProfile +// @return PollingProfile func (a *ResourceApiApiService) GetPollingProfileExecute(r ApiGetPollingProfileRequest) (*PollingProfile, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -776,8 +771,8 @@ ListDemos List Demonstrations List demonstrations used on Tracetest as quick start examples. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListDemosRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListDemosRequest */ func (a *ResourceApiApiService) ListDemos(ctx context.Context) ApiListDemosRequest { return ApiListDemosRequest{ @@ -787,8 +782,7 @@ func (a *ResourceApiApiService) ListDemos(ctx context.Context) ApiListDemosReque } // Execute executes the request -// -// @return []Demo +// @return []Demo func (a *ResourceApiApiService) ListDemosExecute(r ApiListDemosRequest) ([]Demo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -916,8 +910,8 @@ ListPollingProfiles List Polling Profiles List polling profiles used on Tracetest to configure how to fetch traces in a test. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListPollingProfilesRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPollingProfilesRequest */ func (a *ResourceApiApiService) ListPollingProfiles(ctx context.Context) ApiListPollingProfilesRequest { return ApiListPollingProfilesRequest{ @@ -927,8 +921,7 @@ func (a *ResourceApiApiService) ListPollingProfiles(ctx context.Context) ApiList } // Execute executes the request -// -// @return ListPollingProfiles200Response +// @return ListPollingProfiles200Response func (a *ResourceApiApiService) ListPollingProfilesExecute(r ApiListPollingProfilesRequest) (*ListPollingProfiles200Response, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1035,9 +1028,9 @@ UpdateConfiguration Update Tracetest configuration Update Tracetest configuration - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param configId ID of the configuration resource used on Tracetest. It should be set as 'current'. - @return ApiUpdateConfigurationRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param configId ID of the configuration resource used on Tracetest. It should be set as 'current'. + @return ApiUpdateConfigurationRequest */ func (a *ResourceApiApiService) UpdateConfiguration(ctx context.Context, configId string) ApiUpdateConfigurationRequest { return ApiUpdateConfigurationRequest{ @@ -1048,8 +1041,7 @@ func (a *ResourceApiApiService) UpdateConfiguration(ctx context.Context, configI } // Execute executes the request -// -// @return ConfigurationResource +// @return ConfigurationResource func (a *ResourceApiApiService) UpdateConfigurationExecute(r ApiUpdateConfigurationRequest) (*ConfigurationResource, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut @@ -1147,9 +1139,9 @@ UpdateDemo Update a Demonstration setting Update a demonstration used on Tracetest as quick start examples. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param demoId ID of a demonstration used on Tracetest as quick start examples. - @return ApiUpdateDemoRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param demoId ID of a demonstration used on Tracetest as quick start examples. + @return ApiUpdateDemoRequest */ func (a *ResourceApiApiService) UpdateDemo(ctx context.Context, demoId string) ApiUpdateDemoRequest { return ApiUpdateDemoRequest{ @@ -1160,8 +1152,7 @@ func (a *ResourceApiApiService) UpdateDemo(ctx context.Context, demoId string) A } // Execute executes the request -// -// @return Demo +// @return Demo func (a *ResourceApiApiService) UpdateDemoExecute(r ApiUpdateDemoRequest) (*Demo, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut @@ -1259,9 +1250,9 @@ UpdatePollingProfile Update a Polling Profile Update a polling profile used on Tracetest to configure how to fetch traces in a test. - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param pollingProfileId ID of a polling profile used on Tracetest to configure how to fetch traces in a test. - @return ApiUpdatePollingProfileRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pollingProfileId ID of a polling profile used on Tracetest to configure how to fetch traces in a test. + @return ApiUpdatePollingProfileRequest */ func (a *ResourceApiApiService) UpdatePollingProfile(ctx context.Context, pollingProfileId string) ApiUpdatePollingProfileRequest { return ApiUpdatePollingProfileRequest{ @@ -1272,8 +1263,7 @@ func (a *ResourceApiApiService) UpdatePollingProfile(ctx context.Context, pollin } // Execute executes the request -// -// @return PollingProfile +// @return PollingProfile func (a *ResourceApiApiService) UpdatePollingProfileExecute(r ApiUpdatePollingProfileRequest) (*PollingProfile, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPut diff --git a/cli/openapi/model_output_info.go b/cli/openapi/model_output_info.go new file mode 100644 index 0000000000..bbe3950703 --- /dev/null +++ b/cli/openapi/model_output_info.go @@ -0,0 +1,196 @@ +/* +TraceTest + +OpenAPI definition for TraceTest endpoint and resources + +API version: 0.2.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the OutputInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OutputInfo{} + +// OutputInfo struct for OutputInfo +type OutputInfo struct { + LogLevel *string `json:"logLevel,omitempty"` + Message *string `json:"message,omitempty"` + OutputName *string `json:"outputName,omitempty"` +} + +// NewOutputInfo instantiates a new OutputInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOutputInfo() *OutputInfo { + this := OutputInfo{} + return &this +} + +// NewOutputInfoWithDefaults instantiates a new OutputInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOutputInfoWithDefaults() *OutputInfo { + this := OutputInfo{} + return &this +} + +// GetLogLevel returns the LogLevel field value if set, zero value otherwise. +func (o *OutputInfo) GetLogLevel() string { + if o == nil || isNil(o.LogLevel) { + var ret string + return ret + } + return *o.LogLevel +} + +// GetLogLevelOk returns a tuple with the LogLevel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OutputInfo) GetLogLevelOk() (*string, bool) { + if o == nil || isNil(o.LogLevel) { + return nil, false + } + return o.LogLevel, true +} + +// HasLogLevel returns a boolean if a field has been set. +func (o *OutputInfo) HasLogLevel() bool { + if o != nil && !isNil(o.LogLevel) { + return true + } + + return false +} + +// SetLogLevel gets a reference to the given string and assigns it to the LogLevel field. +func (o *OutputInfo) SetLogLevel(v string) { + o.LogLevel = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *OutputInfo) GetMessage() string { + if o == nil || isNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OutputInfo) GetMessageOk() (*string, bool) { + if o == nil || isNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *OutputInfo) HasMessage() bool { + if o != nil && !isNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *OutputInfo) SetMessage(v string) { + o.Message = &v +} + +// GetOutputName returns the OutputName field value if set, zero value otherwise. +func (o *OutputInfo) GetOutputName() string { + if o == nil || isNil(o.OutputName) { + var ret string + return ret + } + return *o.OutputName +} + +// GetOutputNameOk returns a tuple with the OutputName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OutputInfo) GetOutputNameOk() (*string, bool) { + if o == nil || isNil(o.OutputName) { + return nil, false + } + return o.OutputName, true +} + +// HasOutputName returns a boolean if a field has been set. +func (o *OutputInfo) HasOutputName() bool { + if o != nil && !isNil(o.OutputName) { + return true + } + + return false +} + +// SetOutputName gets a reference to the given string and assigns it to the OutputName field. +func (o *OutputInfo) SetOutputName(v string) { + o.OutputName = &v +} + +func (o OutputInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OutputInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.LogLevel) { + toSerialize["logLevel"] = o.LogLevel + } + if !isNil(o.Message) { + toSerialize["message"] = o.Message + } + if !isNil(o.OutputName) { + toSerialize["outputName"] = o.OutputName + } + return toSerialize, nil +} + +type NullableOutputInfo struct { + value *OutputInfo + isSet bool +} + +func (v NullableOutputInfo) Get() *OutputInfo { + return v.value +} + +func (v *NullableOutputInfo) Set(val *OutputInfo) { + v.value = val + v.isSet = true +} + +func (v NullableOutputInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableOutputInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutputInfo(val *OutputInfo) *NullableOutputInfo { + return &NullableOutputInfo{value: val, isSet: true} +} + +func (v NullableOutputInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutputInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cli/openapi/model_polling_info.go b/cli/openapi/model_polling_info.go new file mode 100644 index 0000000000..c3cc46ed2e --- /dev/null +++ b/cli/openapi/model_polling_info.go @@ -0,0 +1,232 @@ +/* +TraceTest + +OpenAPI definition for TraceTest endpoint and resources + +API version: 0.2.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the PollingInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PollingInfo{} + +// PollingInfo struct for PollingInfo +type PollingInfo struct { + Type *string `json:"type,omitempty"` + ReasonNextIteration *string `json:"reasonNextIteration,omitempty"` + IsComplete *bool `json:"isComplete,omitempty"` + Periodic *PollingInfoPeriodic `json:"periodic,omitempty"` +} + +// NewPollingInfo instantiates a new PollingInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPollingInfo() *PollingInfo { + this := PollingInfo{} + return &this +} + +// NewPollingInfoWithDefaults instantiates a new PollingInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPollingInfoWithDefaults() *PollingInfo { + this := PollingInfo{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PollingInfo) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PollingInfo) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PollingInfo) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *PollingInfo) SetType(v string) { + o.Type = &v +} + +// GetReasonNextIteration returns the ReasonNextIteration field value if set, zero value otherwise. +func (o *PollingInfo) GetReasonNextIteration() string { + if o == nil || isNil(o.ReasonNextIteration) { + var ret string + return ret + } + return *o.ReasonNextIteration +} + +// GetReasonNextIterationOk returns a tuple with the ReasonNextIteration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PollingInfo) GetReasonNextIterationOk() (*string, bool) { + if o == nil || isNil(o.ReasonNextIteration) { + return nil, false + } + return o.ReasonNextIteration, true +} + +// HasReasonNextIteration returns a boolean if a field has been set. +func (o *PollingInfo) HasReasonNextIteration() bool { + if o != nil && !isNil(o.ReasonNextIteration) { + return true + } + + return false +} + +// SetReasonNextIteration gets a reference to the given string and assigns it to the ReasonNextIteration field. +func (o *PollingInfo) SetReasonNextIteration(v string) { + o.ReasonNextIteration = &v +} + +// GetIsComplete returns the IsComplete field value if set, zero value otherwise. +func (o *PollingInfo) GetIsComplete() bool { + if o == nil || isNil(o.IsComplete) { + var ret bool + return ret + } + return *o.IsComplete +} + +// GetIsCompleteOk returns a tuple with the IsComplete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PollingInfo) GetIsCompleteOk() (*bool, bool) { + if o == nil || isNil(o.IsComplete) { + return nil, false + } + return o.IsComplete, true +} + +// HasIsComplete returns a boolean if a field has been set. +func (o *PollingInfo) HasIsComplete() bool { + if o != nil && !isNil(o.IsComplete) { + return true + } + + return false +} + +// SetIsComplete gets a reference to the given bool and assigns it to the IsComplete field. +func (o *PollingInfo) SetIsComplete(v bool) { + o.IsComplete = &v +} + +// GetPeriodic returns the Periodic field value if set, zero value otherwise. +func (o *PollingInfo) GetPeriodic() PollingInfoPeriodic { + if o == nil || isNil(o.Periodic) { + var ret PollingInfoPeriodic + return ret + } + return *o.Periodic +} + +// GetPeriodicOk returns a tuple with the Periodic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PollingInfo) GetPeriodicOk() (*PollingInfoPeriodic, bool) { + if o == nil || isNil(o.Periodic) { + return nil, false + } + return o.Periodic, true +} + +// HasPeriodic returns a boolean if a field has been set. +func (o *PollingInfo) HasPeriodic() bool { + if o != nil && !isNil(o.Periodic) { + return true + } + + return false +} + +// SetPeriodic gets a reference to the given PollingInfoPeriodic and assigns it to the Periodic field. +func (o *PollingInfo) SetPeriodic(v PollingInfoPeriodic) { + o.Periodic = &v +} + +func (o PollingInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PollingInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Type) { + toSerialize["type"] = o.Type + } + if !isNil(o.ReasonNextIteration) { + toSerialize["reasonNextIteration"] = o.ReasonNextIteration + } + if !isNil(o.IsComplete) { + toSerialize["isComplete"] = o.IsComplete + } + if !isNil(o.Periodic) { + toSerialize["periodic"] = o.Periodic + } + return toSerialize, nil +} + +type NullablePollingInfo struct { + value *PollingInfo + isSet bool +} + +func (v NullablePollingInfo) Get() *PollingInfo { + return v.value +} + +func (v *NullablePollingInfo) Set(val *PollingInfo) { + v.value = val + v.isSet = true +} + +func (v NullablePollingInfo) IsSet() bool { + return v.isSet +} + +func (v *NullablePollingInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePollingInfo(val *PollingInfo) *NullablePollingInfo { + return &NullablePollingInfo{value: val, isSet: true} +} + +func (v NullablePollingInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePollingInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cli/openapi/model_polling_info_periodic.go b/cli/openapi/model_polling_info_periodic.go new file mode 100644 index 0000000000..730b05799b --- /dev/null +++ b/cli/openapi/model_polling_info_periodic.go @@ -0,0 +1,160 @@ +/* +TraceTest + +OpenAPI definition for TraceTest endpoint and resources + +API version: 0.2.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" +) + +// checks if the PollingInfoPeriodic type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PollingInfoPeriodic{} + +// PollingInfoPeriodic struct for PollingInfoPeriodic +type PollingInfoPeriodic struct { + NumberSpans *int32 `json:"numberSpans,omitempty"` + NumberIterations *int32 `json:"numberIterations,omitempty"` +} + +// NewPollingInfoPeriodic instantiates a new PollingInfoPeriodic object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPollingInfoPeriodic() *PollingInfoPeriodic { + this := PollingInfoPeriodic{} + return &this +} + +// NewPollingInfoPeriodicWithDefaults instantiates a new PollingInfoPeriodic object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPollingInfoPeriodicWithDefaults() *PollingInfoPeriodic { + this := PollingInfoPeriodic{} + return &this +} + +// GetNumberSpans returns the NumberSpans field value if set, zero value otherwise. +func (o *PollingInfoPeriodic) GetNumberSpans() int32 { + if o == nil || isNil(o.NumberSpans) { + var ret int32 + return ret + } + return *o.NumberSpans +} + +// GetNumberSpansOk returns a tuple with the NumberSpans field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PollingInfoPeriodic) GetNumberSpansOk() (*int32, bool) { + if o == nil || isNil(o.NumberSpans) { + return nil, false + } + return o.NumberSpans, true +} + +// HasNumberSpans returns a boolean if a field has been set. +func (o *PollingInfoPeriodic) HasNumberSpans() bool { + if o != nil && !isNil(o.NumberSpans) { + return true + } + + return false +} + +// SetNumberSpans gets a reference to the given int32 and assigns it to the NumberSpans field. +func (o *PollingInfoPeriodic) SetNumberSpans(v int32) { + o.NumberSpans = &v +} + +// GetNumberIterations returns the NumberIterations field value if set, zero value otherwise. +func (o *PollingInfoPeriodic) GetNumberIterations() int32 { + if o == nil || isNil(o.NumberIterations) { + var ret int32 + return ret + } + return *o.NumberIterations +} + +// GetNumberIterationsOk returns a tuple with the NumberIterations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PollingInfoPeriodic) GetNumberIterationsOk() (*int32, bool) { + if o == nil || isNil(o.NumberIterations) { + return nil, false + } + return o.NumberIterations, true +} + +// HasNumberIterations returns a boolean if a field has been set. +func (o *PollingInfoPeriodic) HasNumberIterations() bool { + if o != nil && !isNil(o.NumberIterations) { + return true + } + + return false +} + +// SetNumberIterations gets a reference to the given int32 and assigns it to the NumberIterations field. +func (o *PollingInfoPeriodic) SetNumberIterations(v int32) { + o.NumberIterations = &v +} + +func (o PollingInfoPeriodic) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PollingInfoPeriodic) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.NumberSpans) { + toSerialize["numberSpans"] = o.NumberSpans + } + if !isNil(o.NumberIterations) { + toSerialize["numberIterations"] = o.NumberIterations + } + return toSerialize, nil +} + +type NullablePollingInfoPeriodic struct { + value *PollingInfoPeriodic + isSet bool +} + +func (v NullablePollingInfoPeriodic) Get() *PollingInfoPeriodic { + return v.value +} + +func (v *NullablePollingInfoPeriodic) Set(val *PollingInfoPeriodic) { + v.value = val + v.isSet = true +} + +func (v NullablePollingInfoPeriodic) IsSet() bool { + return v.isSet +} + +func (v *NullablePollingInfoPeriodic) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePollingInfoPeriodic(val *PollingInfoPeriodic) *NullablePollingInfoPeriodic { + return &NullablePollingInfoPeriodic{value: val, isSet: true} +} + +func (v NullablePollingInfoPeriodic) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePollingInfoPeriodic) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/cli/openapi/model_test_run_event.go b/cli/openapi/model_test_run_event.go new file mode 100644 index 0000000000..1b42282f48 --- /dev/null +++ b/cli/openapi/model_test_run_event.go @@ -0,0 +1,413 @@ +/* +TraceTest + +OpenAPI definition for TraceTest endpoint and resources + +API version: 0.2.1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package openapi + +import ( + "encoding/json" + "time" +) + +// checks if the TestRunEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TestRunEvent{} + +// TestRunEvent struct for TestRunEvent +type TestRunEvent struct { + Type *string `json:"type,omitempty"` + Stage *string `json:"stage,omitempty"` + Description *string `json:"description,omitempty"` + CreatedAt *time.Time `json:"createdAt,omitempty"` + TestId *string `json:"testId,omitempty"` + RunId *string `json:"runId,omitempty"` + DataStoreConnection *ConnectionResult `json:"dataStoreConnection,omitempty"` + Polling *PollingInfo `json:"polling,omitempty"` + Outputs []OutputInfo `json:"outputs,omitempty"` +} + +// NewTestRunEvent instantiates a new TestRunEvent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTestRunEvent() *TestRunEvent { + this := TestRunEvent{} + return &this +} + +// NewTestRunEventWithDefaults instantiates a new TestRunEvent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTestRunEventWithDefaults() *TestRunEvent { + this := TestRunEvent{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *TestRunEvent) GetType() string { + if o == nil || isNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetTypeOk() (*string, bool) { + if o == nil || isNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *TestRunEvent) HasType() bool { + if o != nil && !isNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *TestRunEvent) SetType(v string) { + o.Type = &v +} + +// GetStage returns the Stage field value if set, zero value otherwise. +func (o *TestRunEvent) GetStage() string { + if o == nil || isNil(o.Stage) { + var ret string + return ret + } + return *o.Stage +} + +// GetStageOk returns a tuple with the Stage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetStageOk() (*string, bool) { + if o == nil || isNil(o.Stage) { + return nil, false + } + return o.Stage, true +} + +// HasStage returns a boolean if a field has been set. +func (o *TestRunEvent) HasStage() bool { + if o != nil && !isNil(o.Stage) { + return true + } + + return false +} + +// SetStage gets a reference to the given string and assigns it to the Stage field. +func (o *TestRunEvent) SetStage(v string) { + o.Stage = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TestRunEvent) GetDescription() string { + if o == nil || isNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetDescriptionOk() (*string, bool) { + if o == nil || isNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TestRunEvent) HasDescription() bool { + if o != nil && !isNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TestRunEvent) SetDescription(v string) { + o.Description = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *TestRunEvent) GetCreatedAt() time.Time { + if o == nil || isNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || isNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *TestRunEvent) HasCreatedAt() bool { + if o != nil && !isNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *TestRunEvent) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetTestId returns the TestId field value if set, zero value otherwise. +func (o *TestRunEvent) GetTestId() string { + if o == nil || isNil(o.TestId) { + var ret string + return ret + } + return *o.TestId +} + +// GetTestIdOk returns a tuple with the TestId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetTestIdOk() (*string, bool) { + if o == nil || isNil(o.TestId) { + return nil, false + } + return o.TestId, true +} + +// HasTestId returns a boolean if a field has been set. +func (o *TestRunEvent) HasTestId() bool { + if o != nil && !isNil(o.TestId) { + return true + } + + return false +} + +// SetTestId gets a reference to the given string and assigns it to the TestId field. +func (o *TestRunEvent) SetTestId(v string) { + o.TestId = &v +} + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *TestRunEvent) GetRunId() string { + if o == nil || isNil(o.RunId) { + var ret string + return ret + } + return *o.RunId +} + +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetRunIdOk() (*string, bool) { + if o == nil || isNil(o.RunId) { + return nil, false + } + return o.RunId, true +} + +// HasRunId returns a boolean if a field has been set. +func (o *TestRunEvent) HasRunId() bool { + if o != nil && !isNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *TestRunEvent) SetRunId(v string) { + o.RunId = &v +} + +// GetDataStoreConnection returns the DataStoreConnection field value if set, zero value otherwise. +func (o *TestRunEvent) GetDataStoreConnection() ConnectionResult { + if o == nil || isNil(o.DataStoreConnection) { + var ret ConnectionResult + return ret + } + return *o.DataStoreConnection +} + +// GetDataStoreConnectionOk returns a tuple with the DataStoreConnection field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetDataStoreConnectionOk() (*ConnectionResult, bool) { + if o == nil || isNil(o.DataStoreConnection) { + return nil, false + } + return o.DataStoreConnection, true +} + +// HasDataStoreConnection returns a boolean if a field has been set. +func (o *TestRunEvent) HasDataStoreConnection() bool { + if o != nil && !isNil(o.DataStoreConnection) { + return true + } + + return false +} + +// SetDataStoreConnection gets a reference to the given ConnectionResult and assigns it to the DataStoreConnection field. +func (o *TestRunEvent) SetDataStoreConnection(v ConnectionResult) { + o.DataStoreConnection = &v +} + +// GetPolling returns the Polling field value if set, zero value otherwise. +func (o *TestRunEvent) GetPolling() PollingInfo { + if o == nil || isNil(o.Polling) { + var ret PollingInfo + return ret + } + return *o.Polling +} + +// GetPollingOk returns a tuple with the Polling field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetPollingOk() (*PollingInfo, bool) { + if o == nil || isNil(o.Polling) { + return nil, false + } + return o.Polling, true +} + +// HasPolling returns a boolean if a field has been set. +func (o *TestRunEvent) HasPolling() bool { + if o != nil && !isNil(o.Polling) { + return true + } + + return false +} + +// SetPolling gets a reference to the given PollingInfo and assigns it to the Polling field. +func (o *TestRunEvent) SetPolling(v PollingInfo) { + o.Polling = &v +} + +// GetOutputs returns the Outputs field value if set, zero value otherwise. +func (o *TestRunEvent) GetOutputs() []OutputInfo { + if o == nil || isNil(o.Outputs) { + var ret []OutputInfo + return ret + } + return o.Outputs +} + +// GetOutputsOk returns a tuple with the Outputs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TestRunEvent) GetOutputsOk() ([]OutputInfo, bool) { + if o == nil || isNil(o.Outputs) { + return nil, false + } + return o.Outputs, true +} + +// HasOutputs returns a boolean if a field has been set. +func (o *TestRunEvent) HasOutputs() bool { + if o != nil && !isNil(o.Outputs) { + return true + } + + return false +} + +// SetOutputs gets a reference to the given []OutputInfo and assigns it to the Outputs field. +func (o *TestRunEvent) SetOutputs(v []OutputInfo) { + o.Outputs = v +} + +func (o TestRunEvent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TestRunEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Type) { + toSerialize["type"] = o.Type + } + if !isNil(o.Stage) { + toSerialize["stage"] = o.Stage + } + if !isNil(o.Description) { + toSerialize["description"] = o.Description + } + if !isNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !isNil(o.TestId) { + toSerialize["testId"] = o.TestId + } + if !isNil(o.RunId) { + toSerialize["runId"] = o.RunId + } + if !isNil(o.DataStoreConnection) { + toSerialize["dataStoreConnection"] = o.DataStoreConnection + } + if !isNil(o.Polling) { + toSerialize["polling"] = o.Polling + } + if !isNil(o.Outputs) { + toSerialize["outputs"] = o.Outputs + } + return toSerialize, nil +} + +type NullableTestRunEvent struct { + value *TestRunEvent + isSet bool +} + +func (v NullableTestRunEvent) Get() *TestRunEvent { + return v.value +} + +func (v *NullableTestRunEvent) Set(val *TestRunEvent) { + v.value = val + v.isSet = true +} + +func (v NullableTestRunEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableTestRunEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTestRunEvent(val *TestRunEvent) *NullableTestRunEvent { + return &NullableTestRunEvent{value: val, isSet: true} +} + +func (v NullableTestRunEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTestRunEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/server/http/controller.go b/server/http/controller.go index 3c4dea83e7..54bbc562da 100644 --- a/server/http/controller.go +++ b/server/http/controller.go @@ -184,6 +184,10 @@ func (c *controller) GetTestRun(ctx context.Context, testID, runID string) (open return openapi.Response(200, c.mappers.Out.Run(&run)), nil } +func (*controller) GetTestRunEvents(context.Context, string, string) (openapi.ImplResponse, error) { + return openapi.Response(http.StatusOK, []openapi.TestRunEvent{}), nil +} + func (c *controller) DeleteTestRun(ctx context.Context, testID, runID string) (openapi.ImplResponse, error) { rid, err := strconv.Atoi(runID) if err != nil { @@ -310,6 +314,10 @@ func (c *controller) RunTest(ctx context.Context, testID string, runInformation return openapi.Response(200, c.mappers.Out.Run(&run)), nil } +func (*controller) StopTestRun(context.Context, string, string) (openapi.ImplResponse, error) { + return openapi.Response(http.StatusOK, nil), nil +} + func (c *controller) UpdateTest(ctx context.Context, testID string, in openapi.Test) (openapi.ImplResponse, error) { updated, err := c.mappers.In.Test(in) if err != nil { diff --git a/server/openapi/api.go b/server/openapi/api.go index b0054d513b..fb3906d4a4 100644 --- a/server/openapi/api.go +++ b/server/openapi/api.go @@ -43,6 +43,7 @@ type ApiApiRouter interface { GetTest(http.ResponseWriter, *http.Request) GetTestResultSelectedSpans(http.ResponseWriter, *http.Request) GetTestRun(http.ResponseWriter, *http.Request) + GetTestRunEvents(http.ResponseWriter, *http.Request) GetTestRuns(http.ResponseWriter, *http.Request) GetTestSpecs(http.ResponseWriter, *http.Request) GetTestVersion(http.ResponseWriter, *http.Request) @@ -58,6 +59,7 @@ type ApiApiRouter interface { RerunTestRun(http.ResponseWriter, *http.Request) RunTest(http.ResponseWriter, *http.Request) RunTransaction(http.ResponseWriter, *http.Request) + StopTestRun(http.ResponseWriter, *http.Request) TestConnection(http.ResponseWriter, *http.Request) UpdateDataStore(http.ResponseWriter, *http.Request) UpdateEnvironment(http.ResponseWriter, *http.Request) @@ -114,6 +116,7 @@ type ApiApiServicer interface { GetTest(context.Context, string) (ImplResponse, error) GetTestResultSelectedSpans(context.Context, string, string, string) (ImplResponse, error) GetTestRun(context.Context, string, string) (ImplResponse, error) + GetTestRunEvents(context.Context, string, string) (ImplResponse, error) GetTestRuns(context.Context, string, int32, int32) (ImplResponse, error) GetTestSpecs(context.Context, string) (ImplResponse, error) GetTestVersion(context.Context, string, int32) (ImplResponse, error) @@ -129,6 +132,7 @@ type ApiApiServicer interface { RerunTestRun(context.Context, string, string) (ImplResponse, error) RunTest(context.Context, string, RunInformation) (ImplResponse, error) RunTransaction(context.Context, string, RunInformation) (ImplResponse, error) + StopTestRun(context.Context, string, string) (ImplResponse, error) TestConnection(context.Context, DataStore) (ImplResponse, error) UpdateDataStore(context.Context, string, DataStore) (ImplResponse, error) UpdateEnvironment(context.Context, string, Environment) (ImplResponse, error) diff --git a/server/openapi/api_api.go b/server/openapi/api_api.go index 03f27a3dc1..7c39dbf58f 100644 --- a/server/openapi/api_api.go +++ b/server/openapi/api_api.go @@ -200,6 +200,12 @@ func (c *ApiApiController) Routes() Routes { "/api/tests/{testId}/run/{runId}", c.GetTestRun, }, + { + "GetTestRunEvents", + strings.ToUpper("Get"), + "/api/tests/{testId}/run/{runId}/events", + c.GetTestRunEvents, + }, { "GetTestRuns", strings.ToUpper("Get"), @@ -290,6 +296,12 @@ func (c *ApiApiController) Routes() Routes { "/api/transactions/{transactionId}/run", c.RunTransaction, }, + { + "StopTestRun", + strings.ToUpper("Post"), + "/api/test/{testId}/run/{runId}/stop", + c.StopTestRun, + }, { "TestConnection", strings.ToUpper("Post"), @@ -841,6 +853,24 @@ func (c *ApiApiController) GetTestRun(w http.ResponseWriter, r *http.Request) { } +// GetTestRunEvents - get events from a test run +func (c *ApiApiController) GetTestRunEvents(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + testIdParam := params["testId"] + + runIdParam := params["runId"] + + result, err := c.service.GetTestRunEvents(r.Context(), testIdParam, runIdParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // GetTestRuns - get the runs for a test func (c *ApiApiController) GetTestRuns(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) @@ -1187,6 +1217,24 @@ func (c *ApiApiController) RunTransaction(w http.ResponseWriter, r *http.Request } +// StopTestRun - stops the execution of a test run +func (c *ApiApiController) StopTestRun(w http.ResponseWriter, r *http.Request) { + params := mux.Vars(r) + testIdParam := params["testId"] + + runIdParam := params["runId"] + + result, err := c.service.StopTestRun(r.Context(), testIdParam, runIdParam) + // If an error occurred, encode the error with the status code + if err != nil { + c.errorHandler(w, r, err, &result) + return + } + // If no error, encode the body and the result code + EncodeJSONResponse(result.Body, &result.Code, w) + +} + // TestConnection - Tests the config data store/exporter connection func (c *ApiApiController) TestConnection(w http.ResponseWriter, r *http.Request) { dataStoreParam := DataStore{} diff --git a/server/openapi/model_output_info.go b/server/openapi/model_output_info.go new file mode 100644 index 0000000000..db64f1d99d --- /dev/null +++ b/server/openapi/model_output_info.go @@ -0,0 +1,35 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type OutputInfo struct { + LogLevel string `json:"logLevel,omitempty"` + + Message string `json:"message,omitempty"` + + OutputName string `json:"outputName,omitempty"` +} + +// AssertOutputInfoRequired checks if the required fields are not zero-ed +func AssertOutputInfoRequired(obj OutputInfo) error { + return nil +} + +// AssertRecurseOutputInfoRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of OutputInfo (e.g. [][]OutputInfo), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseOutputInfoRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aOutputInfo, ok := obj.(OutputInfo) + if !ok { + return ErrTypeAssertionError + } + return AssertOutputInfoRequired(aOutputInfo) + }) +} diff --git a/server/openapi/model_polling_info.go b/server/openapi/model_polling_info.go new file mode 100644 index 0000000000..752e3d02fd --- /dev/null +++ b/server/openapi/model_polling_info.go @@ -0,0 +1,40 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type PollingInfo struct { + Type string `json:"type,omitempty"` + + ReasonNextIteration string `json:"reasonNextIteration,omitempty"` + + IsComplete bool `json:"isComplete,omitempty"` + + Periodic PollingInfoPeriodic `json:"periodic,omitempty"` +} + +// AssertPollingInfoRequired checks if the required fields are not zero-ed +func AssertPollingInfoRequired(obj PollingInfo) error { + if err := AssertPollingInfoPeriodicRequired(obj.Periodic); err != nil { + return err + } + return nil +} + +// AssertRecursePollingInfoRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PollingInfo (e.g. [][]PollingInfo), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePollingInfoRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPollingInfo, ok := obj.(PollingInfo) + if !ok { + return ErrTypeAssertionError + } + return AssertPollingInfoRequired(aPollingInfo) + }) +} diff --git a/server/openapi/model_polling_info_periodic.go b/server/openapi/model_polling_info_periodic.go new file mode 100644 index 0000000000..27e36f1a02 --- /dev/null +++ b/server/openapi/model_polling_info_periodic.go @@ -0,0 +1,33 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +type PollingInfoPeriodic struct { + NumberSpans int32 `json:"numberSpans,omitempty"` + + NumberIterations int32 `json:"numberIterations,omitempty"` +} + +// AssertPollingInfoPeriodicRequired checks if the required fields are not zero-ed +func AssertPollingInfoPeriodicRequired(obj PollingInfoPeriodic) error { + return nil +} + +// AssertRecursePollingInfoPeriodicRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of PollingInfoPeriodic (e.g. [][]PollingInfoPeriodic), otherwise ErrTypeAssertionError is thrown. +func AssertRecursePollingInfoPeriodicRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aPollingInfoPeriodic, ok := obj.(PollingInfoPeriodic) + if !ok { + return ErrTypeAssertionError + } + return AssertPollingInfoPeriodicRequired(aPollingInfoPeriodic) + }) +} diff --git a/server/openapi/model_test_run_event.go b/server/openapi/model_test_run_event.go new file mode 100644 index 0000000000..7eda1a0e80 --- /dev/null +++ b/server/openapi/model_test_run_event.go @@ -0,0 +1,62 @@ +/* + * TraceTest + * + * OpenAPI definition for TraceTest endpoint and resources + * + * API version: 0.2.1 + * Generated by: OpenAPI Generator (https://openapi-generator.tech) + */ + +package openapi + +import ( + "time" +) + +type TestRunEvent struct { + Type string `json:"type,omitempty"` + + Stage string `json:"stage,omitempty"` + + Description string `json:"description,omitempty"` + + CreatedAt time.Time `json:"createdAt,omitempty"` + + TestId string `json:"testId,omitempty"` + + RunId string `json:"runId,omitempty"` + + DataStoreConnection ConnectionResult `json:"dataStoreConnection,omitempty"` + + Polling PollingInfo `json:"polling,omitempty"` + + Outputs []OutputInfo `json:"outputs,omitempty"` +} + +// AssertTestRunEventRequired checks if the required fields are not zero-ed +func AssertTestRunEventRequired(obj TestRunEvent) error { + if err := AssertConnectionResultRequired(obj.DataStoreConnection); err != nil { + return err + } + if err := AssertPollingInfoRequired(obj.Polling); err != nil { + return err + } + for _, el := range obj.Outputs { + if err := AssertOutputInfoRequired(el); err != nil { + return err + } + } + return nil +} + +// AssertRecurseTestRunEventRequired recursively checks if required fields are not zero-ed in a nested slice. +// Accepts only nested slice of TestRunEvent (e.g. [][]TestRunEvent), otherwise ErrTypeAssertionError is thrown. +func AssertRecurseTestRunEventRequired(objSlice interface{}) error { + return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error { + aTestRunEvent, ok := obj.(TestRunEvent) + if !ok { + return ErrTypeAssertionError + } + return AssertTestRunEventRequired(aTestRunEvent) + }) +} diff --git a/web/src/types/Generated.types.ts b/web/src/types/Generated.types.ts index 1a37852cb9..0d66887203 100644 --- a/web/src/types/Generated.types.ts +++ b/web/src/types/Generated.types.ts @@ -106,6 +106,14 @@ export interface paths { /** Get the test definition as an YAML file */ get: operations["getTestVersionDefinitionFile"]; }; + "/test/{testId}/run/{runId}/stop": { + /** stops the execution of a test run */ + post: operations["stopTestRun"]; + }; + "/tests/{testId}/run/{runId}/events": { + /** get events from a test run */ + get: operations["getTestRunEvents"]; + }; "/environments": { /** Get Environments */ get: operations["getEnvironments"]; @@ -790,6 +798,38 @@ export interface operations { }; }; }; + /** stops the execution of a test run */ + stopTestRun: { + parameters: { + path: { + testId: string; + runId: string; + }; + }; + responses: { + /** successful operation */ + 200: unknown; + /** could not stop execution, probably it's not running anymore */ + 422: unknown; + }; + }; + /** get events from a test run */ + getTestRunEvents: { + parameters: { + path: { + testId: string; + runId: string; + }; + }; + responses: { + /** successful operation */ + 200: { + content: { + "application/json": external["testEvents.yaml"]["components"]["schemas"]["TestRunEvent"][]; + }; + }; + }; + }; /** Get Environments */ getEnvironments: { parameters: { @@ -1749,6 +1789,43 @@ export interface external { }; operations: {}; }; + "testEvents.yaml": { + paths: {}; + components: { + schemas: { + TestRunEvent: { + type?: string; + /** @enum {string} */ + stage?: "trigger" | "trace" | "test"; + description?: string; + /** Format: date-time */ + createdAt?: string; + testId?: string; + runId?: string; + dataStoreConnection?: external["config.yaml"]["components"]["schemas"]["ConnectionResult"]; + polling?: external["testEvents.yaml"]["components"]["schemas"]["PollingInfo"]; + outputs?: external["testEvents.yaml"]["components"]["schemas"]["OutputInfo"][]; + }; + PollingInfo: { + /** @enum {string} */ + type?: "periodic"; + reasonNextIteration?: string; + isComplete?: boolean; + periodic?: { + numberSpans?: number; + numberIterations?: number; + }; + }; + OutputInfo: { + /** @enum {string} */ + logLevel?: "warning" | "error"; + message?: string; + outputName?: string; + }; + }; + }; + operations: {}; + }; "tests.yaml": { paths: {}; components: {