Skip to content

Commit

Permalink
fix connectors types list panic
Browse files Browse the repository at this point in the history
  • Loading branch information
lburgazzoli committed Aug 18, 2022
1 parent 447979c commit 900b2eb
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 79 deletions.
17 changes: 15 additions & 2 deletions rhoc/etc/openapi/connector_mgmt-private-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ paths:
/api/connector_mgmt/v1/admin/kafka_connector_namespaces/{namespace_id}:
parameters:
- name: namespace_id
description: The id of the namespace to delete
description: The id of the namespace
schema:
type: string
in: path
Expand Down Expand Up @@ -543,6 +543,19 @@ paths:
delete:
tags:
- Connector Clusters Admin
parameters:
- name: namespace_id
description: The id of the namespace to delete
schema:
type: string
in: path
required: true
- name: force
description: Flag to force deletion of namespace in Fleet manager if true
schema:
type: boolean
in: query
required: false
responses:
"204":
content:
Expand Down Expand Up @@ -765,7 +778,7 @@ paths:
- name: force
description: Flag to force deletion of connector in Fleet manager if true
schema:
type: string
type: boolean
in: query
required: false
responses:
Expand Down
2 changes: 1 addition & 1 deletion rhoc/etc/openapi/connector_mgmt-private.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ components:
type:
type: string
error:
nullable: true
$ref: "connector_mgmt.yaml#/components/schemas/Error"
nullable: true
object:
type: object
nullable: true
Expand Down
93 changes: 59 additions & 34 deletions rhoc/etc/openapi/connector_mgmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ openapi: 3.0.0 # need this as first line to allow some IDEs to know this is an o
# All endpoints defined here will be discoverable by all users. If there is a need to keep some endpoints
# "private", add them to the "connector_mgmt-private.yaml" file
info:
title: Connector Service Fleet Manager
title: Connector Management API
version: 0.1.0
description: Connector Service Fleet Manager is a Rest API to manage connectors.
description: Connector Management API is a REST API to manage connectors.
license:
name: 'Apache 2.0'
url: 'https://www.apache.org/licenses/LICENSE-2.0'
contact:
name: 'Red Hat OpenShift Streams for Apache Kafka Support'
email: '[email protected]'
servers:
- url: https://api.openshift.com
description: Main (production) server
Expand All @@ -23,7 +29,8 @@ tags:
description: ""
- name: Connector Service
description: ""

- name : Connector Namespaces
description: ""
paths:
#
# Connector Service
Expand Down Expand Up @@ -510,6 +517,8 @@ paths:
parameters:
- $ref: "#/components/parameters/page"
- $ref: "#/components/parameters/size"
- $ref: "#/components/parameters/orderBy"
- $ref: "#/components/parameters/search"
responses:
"200":
content:
Expand Down Expand Up @@ -986,18 +995,28 @@ components:
type: integer
total:
type: integer
items:
type: array
items:
$ref: "#/components/schemas/ObjectReference"

Error:
allOf:
- $ref: "#/components/schemas/ObjectReference"
- type: object
properties:
code:
type: string
reason:
type: string
operation_id:
type: string
type: object
nullable: true
required: [id, kind, href, code, reason]
properties:
reason:
type: string
operation_id:
type: string
id:
type: string
kind:
type: string
href:
type: string
code:
type: string

ObjectReference:
type: object
Expand Down Expand Up @@ -1265,17 +1284,11 @@ components:
#

ConnectorType:
description: >-
Represents a connector type supported by the API
oneOf:
- required:
- name
- version
- schema
- required:
- name
- version
- json_schema
description: Represents a connector type supported by the API
required:
- name
- version
- schema
allOf:
- $ref: "#/components/schemas/ObjectReference"
- type: object
Expand Down Expand Up @@ -1312,11 +1325,6 @@ components:
A json schema that can be used to validate a ConnectorRequest
connector field.
type: object
json_schema:
description: >-
A json schema that can be used to validate a ConnectorRequest
connector field.
type: object

ConnectorTypeList:
allOf:
Expand Down Expand Up @@ -1516,7 +1524,7 @@ components:
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.
Each query can be ordered by any of the `ConnectorType` fields.
Each query can be ordered by any of the underlying resource fields supported in the search parameter.
For example, to return all Connector types ordered by their name, use the following syntax:
```sql
Expand Down Expand Up @@ -1546,8 +1554,16 @@ components:
Search criteria.
The syntax of this parameter is similar to the syntax of the `where` clause of a
SQL statement. Allowed fields in the search are `name`, `description`, `version`, `label`, and `channel`.
Allowed operators are `<>`, `=`, or `LIKE`.
SQL statement.
Allowed fields in the search depend on the resource type:
* Cluster: id, created_at, updated_at, owner, organisation_id, name, state, client_id
* Namespace: id, created_at, updated_at, name, cluster_id, owner, expiration, tenant_user_id, tenant_organisation_id, state
* Connector Types: id, created_at, updated_at, version, name, description, label, channel
* Connectors: id, created_at, updated_at, name, owner, organisation_id, connector_type_id, desired_state, state, channel, namespace_id, kafka_id, kafka_bootstrap_server, service_account_client_id, schema_registry_id, schema_registry_url
Allowed operators are `<>`, `=`, `LIKE`, or `ILIKE`.
Allowed conjunctive operators are `AND` and `OR`. However, you can use a maximum of 10 conjunctions in a search query.
Examples:
Expand All @@ -1558,13 +1574,19 @@ components:
name = aws-sqs-source and channel = stable
```[p-]
To return a Kafka instance with a name that starts with `aws`, use the following syntax:
To return a connector instance with a name that starts with `aws`, use the following syntax:
```
name like aws%25
```
If the parameter isn't provided, or if the value is empty, then all the Connector Type
To return a connector type with a name containing `aws` matching any character case combination, use the following syntax:
```
name ilike %25aws%25
```
If the parameter isn't provided, or if the value is empty, then all the resources
that the user has permission to see are returned.
Note. If the query is invalid, an error is returned.
Expand Down Expand Up @@ -1719,6 +1741,9 @@ components:
error_handling:
dead_letter_queue:
topic: "dlq"
service_account:
client_id: "SA-121212"
client_secret: "secret"
ConnectorNamespaceCreateExample:
value:
name: "MyNamespace"
Expand Down
Loading

0 comments on commit 900b2eb

Please sign in to comment.