openapi: 3.0.0 info: title: rh-trex Service API description: rh-trex Service API version: 0.0.1 servers: - url: http://localhost:8000 description: current domain - url: https://api.openshift.com description: Main (production) server - url: https://api.stage.openshift.com description: Staging server paths: /api/rh-trex/v1/dinosaurs: get: summary: Returns a list of dinosaurs security: - Bearer: [] responses: '200': description: A JSON array of dinosaur objects content: application/json: schema: $ref: '#/components/schemas/DinosaurList' '401': description: Auth token is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Unauthorized to perform operation content: application/json: schema: $ref: '#/components/schemas/Error' '500': description: Unexpected error occurred content: application/json: schema: $ref: '#/components/schemas/Error' parameters: - $ref: '#/components/parameters/page' - $ref: '#/components/parameters/size' - $ref: '#/components/parameters/search' - $ref: '#/components/parameters/orderBy' - $ref: '#/components/parameters/fields' post: summary: Create a new dinosaur security: - Bearer: [] requestBody: description: Dinosaur data required: true content: application/json: schema: $ref: '#/components/schemas/Dinosaur' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/Dinosaur' '400': description: Validation errors occurred content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Auth token is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Unauthorized to perform operation content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Dinosaur already exists content: application/json: schema: $ref: '#/components/schemas/Error' '500': description: An unexpected error occurred creating the dinosaur content: application/json: schema: $ref: '#/components/schemas/Error' /api/rh-trex/v1/dinosaurs/{id}: get: summary: Get an dinosaur by id security: - Bearer: [] responses: '200': description: Dinosaur found by id content: application/json: schema: $ref: '#/components/schemas/Dinosaur' '401': description: Auth token is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Unauthorized to perform operation content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: No dinosaur with specified id exists content: application/json: schema: $ref: '#/components/schemas/Error' '500': description: Unexpected error occurred content: application/json: schema: $ref: '#/components/schemas/Error' patch: summary: Update an dinosaur security: - Bearer: [] requestBody: description: Updated dinosaur data required: true content: application/json: schema: $ref: '#/components/schemas/DinosaurPatchRequest' responses: '200': description: Dinosaur updated successfully content: application/json: schema: $ref: '#/components/schemas/Dinosaur' '400': description: Validation errors occurred content: application/json: schema: $ref: '#/components/schemas/Error' '401': description: Auth token is invalid content: application/json: schema: $ref: '#/components/schemas/Error' '403': description: Unauthorized to perform operation content: application/json: schema: $ref: '#/components/schemas/Error' '404': description: No dinosaur with specified id exists content: application/json: schema: $ref: '#/components/schemas/Error' '409': description: Dinosaur already exists content: application/json: schema: $ref: '#/components/schemas/Error' '500': description: Unexpected error updating dinosaur content: application/json: schema: $ref: '#/components/schemas/Error' parameters: - $ref: '#/components/parameters/id' # AUTO-ADD NEW PATHS components: securitySchemes: Bearer: type: http scheme: bearer bearerFormat: JWT schemas: ObjectReference: type: object properties: id: type: string kind: type: string href: type: string created_at: type: string format: date-time updated_at: type: string format: date-time List: type: object properties: kind: type: string page: type: integer size: type: integer total: type: integer required: - kind - page - size - total - items Error: allOf: - $ref: '#/components/schemas/ObjectReference' - type: object properties: code: type: string reason: type: string operation_id: type: string ErrorList: allOf: - $ref: '#/components/schemas/List' - type: object properties: items: type: array items: $ref: '#/components/schemas/Error' Dinosaur: allOf: - $ref: '#/components/schemas/ObjectReference' - type: object properties: species: type: string created_at: type: string format: date-time updated_at: type: string format: date-time DinosaurList: allOf: - $ref: '#/components/schemas/List' - type: object properties: items: type: array items: $ref: '#/components/schemas/Dinosaur' DinosaurPatchRequest: type: object properties: species: type: string # AUTO-ADD NEW SCHEMAS parameters: id: name: id in: path description: The id of record required: true schema: type: string page: name: page in: query description: Page number of record list when record list exceeds specified page size schema: type: integer default: 1 minimum: 1 required: false size: name: size in: query description: Maximum number of records to return schema: type: integer default: 100 minimum: 0 required: false search: name: search in: query required: false description: |- Specifies the search criteria. The syntax of this parameter is similar to the syntax of the _where_ clause of an SQL statement, using the names of the json attributes / column names of the account. For example, in order to retrieve all the accounts with a username starting with `my`: ```sql username like 'my%' ``` The search criteria can also be applied on related resource. For example, in order to retrieve all the subscriptions labeled by `foo=bar`, ```sql subscription_labels.key = 'foo' and subscription_labels.value = 'bar' ``` If the parameter isn't provided, or if the value is empty, then all the accounts that the user has permission to see will be returned. schema: type: string orderBy: name: orderBy in: query required: false description: |- Specifies the order by criteria. The syntax of this parameter is similar to the syntax of the _order by_ clause of an SQL statement, but using the names of the json attributes / column of the account. For example, in order to retrieve all accounts ordered by username: ```sql username asc ``` Or in order to retrieve all accounts ordered by username _and_ first name: ```sql username asc, firstName asc ``` If the parameter isn't provided, or if the value is empty, then no explicit ordering will be applied. schema: type: string fields: name: fields in: query required: false description: |- Supplies a comma-separated list of fields to be returned. Fields of sub-structures and of arrays use . notation. .* means all field of a structure Example: For each Subscription to get id, href, plan(id and kind) and labels (all fields) ``` ocm get subscriptions --parameter fields=id,href,plan.id,plan.kind,labels.* --parameter fetchLabels=true ``` schema: type: string