diff --git a/api/openapi/activities.yaml b/api/openapi/activities.yaml deleted file mode 100644 index 01cfbfc..0000000 --- a/api/openapi/activities.yaml +++ /dev/null @@ -1,223 +0,0 @@ -openapi: 3.0.0 -x-stoplight: - id: my5fvl0xi1ulm -info: - title: activities - version: '1.0' - description: Activities API - license: - url: 'https://www.apache.org/licenses/LICENSE-2.0' - name: Apache 2.0 - contact: - name: ReportPortal Team - url: 'https://reportportal.io' - email: support@reportportal.io -servers: - - url: 'https://demo.reportportal.io' -paths: - /activities/searches: - parameters: [] - post: - summary: '' - operationId: post-activities-search - responses: - '200': - description: OK - content: - application/json: - schema: - allOf: - - $ref: ./models/OffsetPagination.yaml - - type: object - properties: - items: - type: array - items: - $ref: '#/components/schemas/Activity' - description: |- - [GET with body payload](https://opensource.zalando.com/restful-api-guidelines/#get-with-body) - no resources created: - Returns all activities matching the query passed as request input payload. - parameters: - - schema: - type: string - in: query - name: limit - description: The limit used for this page of results. This will be the same as the limit query parameter unless it exceeded the maximum value allowed for this API endpoint - required: true - - schema: - type: string - in: query - name: offset - description: The offset used for this page of results - required: true - - schema: - type: string - in: query - name: sort - description: Indicate sort by field - required: true - - schema: - type: string - enum: - - ASC - - DESC - in: query - name: order - description: Indicate sorting direction - required: true - requestBody: - $ref: '#/components/requestBodies/SearchCriteriaRQ' -components: - schemas: - Activity: - title: Activity - x-stoplight: - id: o6vlu07vubno4 - type: object - description: activity details - properties: - id: - type: integer - x-stoplight: - id: n5nyuo08bl1gy - format: int64 - minimum: 1 - created_at: - type: string - x-stoplight: - id: 3ftqmjgnnuxw7 - format: date-time - event_name: - type: string - x-stoplight: - id: nbqeh7nrhgbn9 - object_id: - type: integer - x-stoplight: - id: kd05o5bwbg6wl - exclusiveMinimum: false - exclusiveMaximum: false - format: int64 - minimum: 1 - object_name: - type: string - x-stoplight: - id: pxcosifywpqkn - object_type: - type: string - x-stoplight: - id: bl5qkiasycg5i - project_id: - type: integer - x-stoplight: - id: byvwz3x6nsyaa - format: int64 - exclusiveMinimum: false - minimum: 1 - project_name: - type: string - x-stoplight: - id: v3ro2mr4suog9 - subject_name: - type: string - x-stoplight: - id: unf6lpxufh2xk - subject_type: - type: string - x-stoplight: - id: y1hoik59fp0ie - details: - type: object - x-stoplight: - id: eygyh7jp5k2wz - properties: - history: - x-stoplight: - id: 9f0iaa69imgaj - type: array - items: - $ref: '#/components/schemas/HistoryField' - HistoryField: - title: HistoryField - x-stoplight: - id: zn71tf8rb2xfu - type: object - properties: - field: - type: string - x-stoplight: - id: kr5ju3d2ftb61 - old_value: - type: string - x-stoplight: - id: 9zzt3diczvwnc - new_value: - type: string - x-stoplight: - id: gcydbgmi7or7q - SearchCriteria: - title: SearchCriteria - x-stoplight: - id: ykpm8curd5ook - type: object - properties: - filter_key: - type: string - description: search by field - operation: - type: string - enum: - - EQ - - NE - - CNT - - NON_CNT - - BTW - - IN - description: operation to perform for the filter - value: - type: string - description: search value - required: - - filter_key - - value - requestBodies: - SearchCriteriaRQ: - content: - application/json: - schema: - type: object - properties: - search_criterias: - type: array - items: - $ref: '#/components/schemas/SearchCriteria' - required: - - search_criterias - examples: - Example 1: - value: - search_criterias: - - filter_key: predefinedFilter - operation: null - value: test - - filter_key: projectName - operation: EQ - value: test - - filter_key: eventName - operation: IN - value: 'createDashboard,deleteWidget' - - filter_key: createdAt - operation: BTW - value: 0;1440;+0300 - - filter_key: objectType - operation: IN - value: 'DEFECT_TYPE,LAUNCH' - - filter_key: objectName - operation: CNT - value: test - - filter_key: subjectType - operation: IN - value: 'USER,RULE' - - filter_key: subjectName - operation: IN - value: 'superadmin,user' diff --git a/api/openapi/api-keys.yaml b/api/openapi/api-keys.yaml deleted file mode 100644 index 18178a4..0000000 --- a/api/openapi/api-keys.yaml +++ /dev/null @@ -1,57 +0,0 @@ -openapi: 3.0.0 -info: - title: API Keys - version: '0.1' - description: API for working with API Keys resources - contact: - name: ReportPortal Team - url: 'https://reportportal.io' - email: support@reportportal.io - license: - url: 'https://www.apache.org/licenses/LICENSE-2.0' - name: Apache 2.0 -servers: - - url: 'https://demo.reportportal.io' -paths: {} -components: - schemas: - ApiKeyMetadata: - title: API Key metadata - type: object - description: ReportPortal only stores metadata and a hash of the API Key. - properties: - id: - type: integer - description: Internal identifier - name: - type: string - description: API Key unique name - user_id: - type: integer - description: API Key owner - created_at: - type: string - format: date-time - description: Date time with milliseconds - example: '2019-07-30T06:43:40.252Z' - last_used_at: - type: string - format: date-time - example: '2019-07-30T06:43:40.252Z' - description: Date time with milliseconds - ApiKey: - allOf: - - $ref: '#/components/schemas/ApiKeyMetadata' - - type: object - properties: - api_key: - type: string - description: Generated API Key - description: 'Generated API key, granted once after creation.' - title: API Key - securitySchemes: - API Key: - type: http - scheme: bearer -security: - - API Key: [] diff --git a/api/openapi/models/activity.yaml b/api/openapi/models/activity.yaml new file mode 100644 index 0000000..2ac39fc --- /dev/null +++ b/api/openapi/models/activity.yaml @@ -0,0 +1,53 @@ +Activity: + title: Activity + type: object + description: activity details + properties: + id: + type: integer + format: int64 + minimum: 1 + created_at: + type: string + format: date-time + event_name: + type: string + object_id: + type: integer + exclusiveMinimum: false + exclusiveMaximum: false + format: int64 + minimum: 1 + object_name: + type: string + object_type: + type: string + project_id: + type: integer + format: int64 + exclusiveMinimum: false + minimum: 1 + project_name: + type: string + subject_name: + type: string + subject_type: + type: string + details: + type: object + properties: + history: + type: array + items: + $ref: "#/HistoryField" + +HistoryField: + title: HistoryField + type: object + properties: + field: + type: string + old_value: + type: string + new_value: + type: string \ No newline at end of file diff --git a/api/openapi/models/apiKey.yaml b/api/openapi/models/apiKey.yaml new file mode 100644 index 0000000..19d9056 --- /dev/null +++ b/api/openapi/models/apiKey.yaml @@ -0,0 +1,35 @@ +ApiKeyMetadata: + title: API Key metadata + type: object + description: ReportPortal only stores metadata and a hash of the API Key. + properties: + id: + type: integer + description: Internal identifier + name: + type: string + description: API Key unique name + user_id: + type: integer + description: API Key owner + created_at: + type: string + format: date-time + description: Date time with milliseconds + example: '2019-07-30T06:43:40.252Z' + last_used_at: + type: string + format: date-time + example: '2019-07-30T06:43:40.252Z' + description: Date time with milliseconds + +ApiKey: + title: API Key + description: 'Generated API key, granted once after creation.' + allOf: + - $ref: '#/ApiKeyMetadata' + - type: object + properties: + api_key: + type: string + description: Generated API Key diff --git a/api/openapi/models/Error.yaml b/api/openapi/models/error.yaml similarity index 73% rename from api/openapi/models/Error.yaml rename to api/openapi/models/error.yaml index 71bb6fc..4336c54 100644 --- a/api/openapi/models/Error.yaml +++ b/api/openapi/models/error.yaml @@ -1,6 +1,4 @@ title: Error -x-stoplight: - id: px0fsay46csgt type: object properties: code: diff --git a/api/openapi/models/OffsetPagination.yaml b/api/openapi/models/offsetPagination.yaml similarity index 96% rename from api/openapi/models/OffsetPagination.yaml rename to api/openapi/models/offsetPagination.yaml index 2488e0f..44ba39c 100644 --- a/api/openapi/models/OffsetPagination.yaml +++ b/api/openapi/models/offsetPagination.yaml @@ -1,6 +1,4 @@ type: object -x-stoplight: - id: osmhtey50l0ov title: Offset-based description: Offset-based pagination properties: diff --git a/api/openapi/models/searchCriteria.yaml b/api/openapi/models/searchCriteria.yaml new file mode 100644 index 0000000..7ef0864 --- /dev/null +++ b/api/openapi/models/searchCriteria.yaml @@ -0,0 +1,22 @@ +title: SearchCriteria +type: object +properties: + filter_key: + type: string + description: search by field + operation: + type: string + enum: + - EQ + - NE + - CNT + - NON_CNT + - BTW + - IN + description: operation to perform for the filter + value: + type: string + description: search value +required: + - filter_key + - value \ No newline at end of file diff --git a/api/openapi/reportportal.yaml b/api/openapi/reportportal.yaml new file mode 100644 index 0000000..14c6371 --- /dev/null +++ b/api/openapi/reportportal.yaml @@ -0,0 +1,212 @@ +openapi: 3.0.3 + +info: + title: ReportPortal API + version: '5.10.1' + description: | + ReportPortal is a service for continuous testing. + It provides a platform for test automation and allows you to analyze + the results of tests in various ways. The service is implemented as a web + application and is available through a web interface or API. + contact: + name: ReportPortal Team + url: https://reportportal.io + email: support@reportportal.io + +servers: + - url: https://demo.reportportal.io + - url: http://localhost + +security: + - apiKey: [] + - bearerAuth: [] + +paths: + /v1/user/{user_id}/api-keys: + parameters: + - schema: + type: string + name: user_id + in: path + required: true + get: + summary: Get user's API Keys + tags: + - users + operationId: get-user-api-keys + description: Retrieve list of user's Api Keys + responses: + '200': + description: List of user api keys + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: ./models/apiKey.yaml#/ApiKeyMetadata + '404': + description: User Not Found + post: + summary: Create Api key + operationId: post-users-user_id-api-keys + tags: + - users + description: Create Api key for user keys collection + responses: + '201': + description: Api key created + content: + application/json: + schema: + $ref: ./models/apiKey.yaml#/ApiKey + requestBody: + content: + application/json: + schema: + type: object + properties: + name: + type: string + + /v1/user/{user_id}/api-keys/{key_id}: + parameters: + - schema: + type: string + name: user_id + in: path + required: true + - schema: + type: string + name: key_id + in: path + required: true + delete: + summary: Delete user Api key + operationId: delete-users-user_id-api-keys-key_id + tags: + - users + description: Delete Api key from user keys collection by id + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + message: + type: string + + /activities/searches: + parameters: [] + post: + summary: Search activities by complex criteria + operationId: activities-search + description: |- + [GET with body payload](https://opensource.zalando.com/restful-api-guidelines/#get-with-body) + - no resources created: + Returns all activities matching the query passed as request input payload. + tags: + - activities + parameters: + - schema: + type: string + in: query + name: limit + description: The limit used for this page of results. This will be the same as the limit query parameter unless it exceeded the maximum value allowed for this API endpoint + required: true + - schema: + type: string + in: query + name: offset + description: The offset used for this page of results + required: true + - schema: + type: string + in: query + name: sort + description: Indicate sort by field + required: true + - schema: + type: string + enum: + - ASC + - DESC + in: query + name: order + description: Indicate sorting direction + required: true + requestBody: + content: + application/json: + schema: + type: object + properties: + search_criterias: + type: array + items: + $ref: ./models/searchCriteria.yaml + required: + - search_criterias + examples: + Example 1: + value: + search_criterias: + - filter_key: predefinedFilter + operation: null + value: test + - filter_key: projectName + operation: EQ + value: test + - filter_key: eventName + operation: IN + value: 'createDashboard,deleteWidget' + - filter_key: createdAt + operation: BTW + value: 0;1440;+0300 + - filter_key: objectType + operation: IN + value: 'DEFECT_TYPE,LAUNCH' + - filter_key: objectName + operation: CNT + value: test + - filter_key: subjectType + operation: IN + value: 'USER,RULE' + - filter_key: subjectName + operation: IN + value: 'superadmin,user' + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: ./models/offsetPagination.yaml + - type: object + properties: + items: + type: array + items: + $ref: './models/activity.yaml#/Activity' + +components: + securitySchemes: + apiKey: + type: http + scheme: bearer + bearerFormat: API Key + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + +tags: + - name: users + description: User management + - name: activities + description: Activities management \ No newline at end of file diff --git a/api/openapi/users.yaml b/api/openapi/users.yaml deleted file mode 100644 index 02395bd..0000000 --- a/api/openapi/users.yaml +++ /dev/null @@ -1,101 +0,0 @@ -openapi: 3.0.0 -info: - title: ReportPortal Users - version: '0.1' - description: API for working with users resources - contact: - name: ReportPortal Team - url: 'https://reportportal.io' - email: support@reportportal.io - license: - url: 'https://www.apache.org/licenses/LICENSE-2.0' - name: Apache 2.0 -servers: - - url: 'https://demo.reportportal.io' -paths: - '/v1/user/{user_id}/api-keys': - parameters: - - schema: - type: string - name: user_id - in: path - required: true - get: - summary: Get user's API Keys - tags: - - users-api-keys - operationId: get-user-api-keys - description: Retrieve list of user's Api Keys - responses: - '200': - description: List of user api keys - content: - application/json: - schema: - type: object - properties: - items: - type: array - items: - $ref: ./api-keys.yaml#/components/schemas/ApiKeyMetadata - '404': - description: User Not Found - post: - summary: Create Api key - operationId: post-users-user_id-api-keys - tags: - - users-api-keys - description: Create Api key for user keys collection - responses: - '201': - description: Api key created - content: - application/json: - schema: - $ref: ./api-keys.yaml#/components/schemas/ApiKey - requestBody: - content: - application/json: - schema: - type: object - properties: - name: - type: string - '/v1/user/{user_id}/api-keys/{key_id}': - parameters: - - schema: - type: string - name: user_id - in: path - required: true - - schema: - type: string - name: key_id - in: path - required: true - delete: - summary: Delete user Api key - operationId: delete-users-user_id-api-keys-key_id - tags: - - users-api-keys - description: Delete Api key from user keys collection by id - responses: - '200': - description: OK - content: - application/json: - schema: - type: object - properties: - message: - type: string -components: - schemas: {} - securitySchemes: - API Key: - type: http - scheme: bearer -security: - - API Key: [] -tags: - - name: users-api-keys