@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Microcks API v1.7
@base http://microcks.example.com/api
@version 1.7.1
@auth OAuth2
@endpoints 44
@hint download_for_search
@toc services(8), tests(7), jobs(9), artifact(1), secrets(6), keycloak(1), resources(2), features(1), import(1), export(1), metrics(7)

@group services
@endpoint GET /services
@optional {page: int, size: int}
@returns(200) {id: str, name: str, version: str, type: str, operations: [map], xmlNS: str, metadata: map{createdOn: int, lastUpdate: int, annotations: map, labels: map}}

@endgroup

@group tests
@endpoint POST /tests
@required {serviceId: str, testEndpoint: str, runnerType: str(HTTP/SOAP_HTTP/SOAP_UI/POSTMAN/OPEN_API_SCHEMA/ASYNC_API_SCHEMA/GRPC_PROTOBUF/GRAPHQL_SCHEMA), timeout: int}
@optional {filteredOperations: [str], operationHeaders: map, secretName: str}
@returns(201) {id: str, version: num, testNumber: num, testDate: int(int64), testedEndpoint: str, serviceId: str, elapsedTime: num, success: bool, inProgress: bool, runnerType: str, testCaseResults: [any], secretRef: any, operationHeaders: map, timeout: int}

@endgroup

@group services
@endpoint GET /services/count
@returns(200) {counter: int(int32)}

@endgroup

@group jobs
@endpoint GET /jobs
@optional {page: int, size: int, name: str}
@returns(200)

@endpoint POST /jobs
@required {name: str, repositoryUrl: str}
@optional {id: str, repositoryDisableSSLValidation: bool, frequency: str, createdDate: str(date-time), lastImportDate: str(date-time), lastImportError: str, active: bool, etag: str, serviceRefs: [any], metadata: map{createdOn!: int, lastUpdate!: int, annotations: map, labels: map}, secretRef: any, mainArtifact: bool}
@returns(201) {id: str, name: str, repositoryUrl: str, repositoryDisableSSLValidation: bool, frequency: str, createdDate: str(date-time), lastImportDate: str(date-time), lastImportError: str, active: bool, etag: str, serviceRefs: [any], metadata: map{createdOn: int, lastUpdate: int, annotations: map, labels: map}, secretRef: any, mainArtifact: bool}

@endpoint GET /jobs/{id}
@returns(200) {id: str, name: str, repositoryUrl: str, repositoryDisableSSLValidation: bool, frequency: str, createdDate: str(date-time), lastImportDate: str(date-time), lastImportError: str, active: bool, etag: str, serviceRefs: [any], metadata: map{createdOn: int, lastUpdate: int, annotations: map, labels: map}, secretRef: any, mainArtifact: bool}

@endpoint POST /jobs/{id}
@required {name: str, repositoryUrl: str}
@optional {id: str, repositoryDisableSSLValidation: bool, frequency: str, createdDate: str(date-time), lastImportDate: str(date-time), lastImportError: str, active: bool, etag: str, serviceRefs: [any], metadata: map{createdOn!: int, lastUpdate!: int, annotations: map, labels: map}, secretRef: any, mainArtifact: bool}
@returns(200) {id: str, name: str, repositoryUrl: str, repositoryDisableSSLValidation: bool, frequency: str, createdDate: str(date-time), lastImportDate: str(date-time), lastImportError: str, active: bool, etag: str, serviceRefs: [any], metadata: map{createdOn: int, lastUpdate: int, annotations: map, labels: map}, secretRef: any, mainArtifact: bool}

@endpoint DELETE /jobs/{id}
@returns(200)

@endpoint PUT /jobs/{id}/activate
@returns(200) {id: str, name: str, repositoryUrl: str, repositoryDisableSSLValidation: bool, frequency: str, createdDate: str(date-time), lastImportDate: str(date-time), lastImportError: str, active: bool, etag: str, serviceRefs: [any], metadata: map{createdOn: int, lastUpdate: int, annotations: map, labels: map}, secretRef: any, mainArtifact: bool}

@endpoint PUT /jobs/{id}/start
@returns(200) {id: str, name: str, repositoryUrl: str, repositoryDisableSSLValidation: bool, frequency: str, createdDate: str(date-time), lastImportDate: str(date-time), lastImportError: str, active: bool, etag: str, serviceRefs: [any], metadata: map{createdOn: int, lastUpdate: int, annotations: map, labels: map}, secretRef: any, mainArtifact: bool}

@endpoint PUT /jobs/{id}/stop
@returns(200) {id: str, name: str, repositoryUrl: str, repositoryDisableSSLValidation: bool, frequency: str, createdDate: str(date-time), lastImportDate: str(date-time), lastImportError: str, active: bool, etag: str, serviceRefs: [any], metadata: map{createdOn: int, lastUpdate: int, annotations: map, labels: map}, secretRef: any, mainArtifact: bool}

@endgroup

@group services
@endpoint GET /services/{id}
@optional {messages: bool}
@returns(200)

@endpoint DELETE /services/{id}
@returns(200)

@endgroup

@group artifact
@endpoint POST /artifact/upload
@required {mainArtifact: bool}
@returns(201)
@returns(204)
@errors {400}

@endgroup

@group jobs
@endpoint GET /jobs/count
@returns(200) {counter: int(int32)}

@endgroup

@group secrets
@endpoint GET /secrets
@optional {page: int, size: int}
@returns(200)

@endpoint POST /secrets
@required {name: str, description: str}
@optional {id: str, username: str, password: str, token: str, tokenHeader: str, caCertPem: str}
@returns(201) {id: str, name: str, username: str, password: str, token: str, tokenHeader: str, caCertPem: str, description: str}

@endpoint GET /secrets/{id}
@returns(200) {id: str, name: str, username: str, password: str, token: str, tokenHeader: str, caCertPem: str, description: str}

@endpoint PUT /secrets/{id}
@returns(200)

@endpoint DELETE /secrets/{id}
@returns(200)

@endpoint GET /secrets/count
@returns(200) {counter: int(int32)}

@endgroup

@group tests
@endpoint GET /tests/service/{serviceId}
@returns(200)

@endpoint GET /tests/service/{serviceId}/count
@returns(200) {counter: int(int32)}

@endpoint GET /tests/{id}
@returns(200) {id: str, version: num, testNumber: num, testDate: int(int64), testedEndpoint: str, serviceId: str, elapsedTime: num, success: bool, inProgress: bool, runnerType: str, testCaseResults: [any], secretRef: any, operationHeaders: map, timeout: int}

@endpoint GET /tests/{id}/messages/{testCaseId}
@returns(200)

@endpoint POST /tests/{id}/testCaseResult
@required {operationName: str}
@returns(200) {success: bool, elapsedTime: num, operationName: str, testStepResults: [any]}

@endgroup

@group keycloak
@endpoint GET /keycloak/config
@returns(200) {realm: str, auth-server-url: str, public-client: bool, ssl-required: any, resource: str, enabled: bool}

@endgroup

@group services
@endpoint PUT /services/{id}/operation
@required {operationName: str}
@optional {dispatcher: str, dispatcherRules: str, defaultDelay: int, parameterConstraints: [map{name!: str, required: bool, recopy: bool, mustMatchRegexp: str, in: str}]}
@returns(200)
@errors {500}

@endpoint PUT /services/{id}/metadata
@required {createdOn: int, lastUpdate: int}
@optional {annotations: map, labels: map}
@returns(200)
@errors {500}

@endpoint GET /services/labels
@returns(200)

@endpoint GET /services/search
@required {queryMap: map}
@returns(200)

@endgroup

@group tests
@endpoint GET /tests/{id}/events/{testCaseId}
@returns(200)

@endgroup

@group resources
@endpoint GET /resources/{name}
@returns(200) {id: str, name: str, content: str, type: str, serviceId: str, path: str, sourceArtifact: str}

@endpoint GET /resources/service/{serviceId}
@returns(200)

@endgroup

@group features
@endpoint GET /features/config
@returns(200)

@endgroup

@group import
@endpoint POST /import
@returns(201)

@endgroup

@group export
@endpoint GET /export
@required {serviceIds: [str]}
@returns(200)

@endgroup

@group metrics
@endpoint GET /metrics/invocations/global
@optional {day: str}
@returns(200) {id: str, day: str, serviceName: str, serviceVersion: str, dailyCount: num, hourlyCount: map, minuteCount: map}

@endpoint GET /metrics/conformance/aggregate
@returns(200)

@endpoint GET /metrics/conformance/service/{serviceId}
@returns(200) {id: str, serviceId: str, aggregationLabelValue: str, maxPossibleScore: num(double), currentScore: num(double), lastUpdateDay: str, latestTrend: str, latestScores: map}

@endpoint GET /metrics/invocations/top
@optional {day: str, limit: int}
@returns(200)

@endpoint GET /metrics/invocations/{serviceName}/{serviceVersion}
@optional {day: str}
@returns(200) {id: str, day: str, serviceName: str, serviceVersion: str, dailyCount: num, hourlyCount: map, minuteCount: map}

@endpoint GET /metrics/invocations/global/latest
@optional {limit: int}
@returns(200)

@endpoint GET /metrics/tests/latest
@optional {limit: int}
@returns(200)

@endgroup

@end
