Skip to content

Commit 7626d23

Browse files
bhardwajRahulRahul Bhardwaj
andauthored
Add GET/UPDATE kafka schema/subject config (#1069)
* Add connection details for schema registry. * Add GET/UPDATE kafka schema config * Add GET/UPDATE Schema registry subject config for kafka cluster --------- Co-authored-by: Rahul Bhardwaj <rahulbhardwaj@digitalocean.com>
1 parent 445b911 commit 7626d23

10 files changed

+406
-135
lines changed

specification/DigitalOcean-public.v2.yaml

Lines changed: 99 additions & 135 deletions
Large diffs are not rendered by default.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
operationId: databases_get_kafka_schema_config
2+
3+
summary: Retrieve Schema Registry Configuration for a kafka Cluster
4+
5+
description: |
6+
To retrieve the Schema Registry configuration for a Kafka cluster, send a GET request to
7+
`/v2/databases/$DATABASE_ID/schema-registry/config`.
8+
The response is a JSON object with a `compatibility_level` key, which is set to an object
9+
containing any database configuration parameters.
10+
tags:
11+
- Databases
12+
13+
parameters:
14+
- $ref: 'parameters.yml#/database_cluster_uuid'
15+
16+
responses:
17+
'200':
18+
$ref: 'responses/database_schema_registry_config.yml'
19+
20+
'401':
21+
$ref: '../../shared/responses/unauthorized.yml'
22+
23+
'404':
24+
$ref: '../../shared/responses/not_found.yml'
25+
26+
'429':
27+
$ref: '../../shared/responses/too_many_requests.yml'
28+
29+
'500':
30+
$ref: '../../shared/responses/server_error.yml'
31+
32+
default:
33+
$ref: '../../shared/responses/unexpected_error.yml'
34+
35+
36+
security:
37+
- bearer_auth:
38+
- 'database:read'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
operationId: databases_get_kafka_schema_subject_config
2+
3+
summary: Retrieve Schema Registry Configuration for a Subject of kafka Cluster
4+
5+
description: |
6+
To retrieve the Schema Registry configuration for a Subject of a Kafka cluster, send a GET request to
7+
`/v2/databases/$DATABASE_ID/schema-registry/config/$SUBJECT_NAME`.
8+
The response is a JSON object with a `compatibility_level` key, which is set to an object
9+
containing any database configuration parameters.
10+
tags:
11+
- Databases
12+
13+
parameters:
14+
- $ref: 'parameters.yml#/database_cluster_uuid'
15+
- $ref: "parameters.yml#/kafka_schema_subject_name"
16+
17+
responses:
18+
'200':
19+
$ref: 'responses/database_schema_registry_subject_config.yml'
20+
21+
'401':
22+
$ref: '../../shared/responses/unauthorized.yml'
23+
24+
'404':
25+
$ref: '../../shared/responses/not_found.yml'
26+
27+
'429':
28+
$ref: '../../shared/responses/too_many_requests.yml'
29+
30+
'500':
31+
$ref: '../../shared/responses/server_error.yml'
32+
33+
default:
34+
$ref: '../../shared/responses/unexpected_error.yml'
35+
36+
37+
security:
38+
- bearer_auth:
39+
- 'database:read'
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
operationId: databases_update_kafka_schema_config
2+
3+
summary: Update Schema Registry Configuration for a kafka Cluster
4+
5+
description: |
6+
To update the Schema Registry configuration for a Kafka cluster, send a PUT request to
7+
`/v2/databases/$DATABASE_ID/schema-registry/config`.
8+
The response is a JSON object with a `compatibility_level` key, which is set to an object
9+
containing any database configuration parameters.
10+
tags:
11+
- Databases
12+
13+
parameters:
14+
- $ref: "parameters.yml#/database_cluster_uuid"
15+
16+
requestBody:
17+
content:
18+
application/json:
19+
schema:
20+
type: object
21+
properties:
22+
compatibility_level:
23+
type: string
24+
enum:
25+
- NONE
26+
- BACKWARD
27+
- BACKWARD_TRANSITIVE
28+
- FORWARD
29+
- FORWARD_TRANSITIVE
30+
- FULL
31+
- FULL_TRANSITIVE
32+
description: The compatibility level of the schema registry.
33+
required:
34+
- compatibility_level
35+
example:
36+
compatibility_level: BACKWARD
37+
38+
responses:
39+
"200":
40+
$ref: "responses/database_schema_registry_config.yml"
41+
42+
"401":
43+
$ref: "../../shared/responses/unauthorized.yml"
44+
45+
"404":
46+
$ref: "../../shared/responses/not_found.yml"
47+
48+
"429":
49+
$ref: "../../shared/responses/too_many_requests.yml"
50+
51+
"500":
52+
$ref: "../../shared/responses/server_error.yml"
53+
54+
default:
55+
$ref: "../../shared/responses/unexpected_error.yml"
56+
57+
security:
58+
- bearer_auth:
59+
- "database:write"
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
operationId: databases_update_kafka_schema_subject_config
2+
3+
summary: Update Schema Registry Configuration for a Subject of kafka Cluster
4+
5+
description: |
6+
To update the Schema Registry configuration for a Subject of a Kafka cluster, send a PUT request to
7+
`/v2/databases/$DATABASE_ID/schema-registry/config/$SUBJECT_NAME`.
8+
The response is a JSON object with a `compatibility_level` key, which is set to an object
9+
containing any database configuration parameters.
10+
tags:
11+
- Databases
12+
13+
parameters:
14+
- $ref: "parameters.yml#/database_cluster_uuid"
15+
- $ref: "parameters.yml#/kafka_schema_subject_name"
16+
17+
requestBody:
18+
content:
19+
application/json:
20+
schema:
21+
type: object
22+
properties:
23+
compatibility_level:
24+
type: string
25+
enum:
26+
- NONE
27+
- BACKWARD
28+
- BACKWARD_TRANSITIVE
29+
- FORWARD
30+
- FORWARD_TRANSITIVE
31+
- FULL
32+
- FULL_TRANSITIVE
33+
description: The compatibility level of the schema registry.
34+
required:
35+
- compatibility_level
36+
example:
37+
compatibility_level: BACKWARD
38+
39+
responses:
40+
"200":
41+
$ref: "responses/database_schema_registry_subject_config.yml"
42+
43+
"401":
44+
$ref: "../../shared/responses/unauthorized.yml"
45+
46+
"404":
47+
$ref: "../../shared/responses/not_found.yml"
48+
49+
"429":
50+
$ref: "../../shared/responses/too_many_requests.yml"
51+
52+
"500":
53+
$ref: "../../shared/responses/server_error.yml"
54+
55+
default:
56+
$ref: "../../shared/responses/unexpected_error.yml"
57+
58+
security:
59+
- bearer_auth:
60+
- "database:write"

specification/resources/databases/models/database_cluster.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ properties:
102102
- readOnly: true
103103
description: >-
104104
The connection details for OpenSearch dashboard.
105+
schema_registry_connection:
106+
allOf:
107+
- $ref: './schema_registry_connection.yml'
108+
- readOnly: true
109+
description: >-
110+
The connection details for Schema Registry.
105111
connection:
106112
allOf:
107113
- $ref: './database_connection.yml'

specification/resources/databases/models/database_cluster_read.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ properties:
102102
- readOnly: true
103103
description: >-
104104
The connection details for OpenSearch dashboard.
105+
schema_registry_connection:
106+
allOf:
107+
- $ref: './schema_registry_connection.yml'
108+
- readOnly: true
109+
description: >-
110+
The connection details for Schema Registry.
105111
connection:
106112
allOf:
107113
- $ref: './database_connection.yml'
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
type: object
2+
3+
properties:
4+
uri:
5+
type: string
6+
description: >-
7+
This is provided as a convenience and should be able to be constructed by the other attributes.
8+
example: https://doadmin:wv78n3zpz42xezdk@backend-do-user-19081923-0.db.ondigitalocean.com:25060
9+
readOnly: true
10+
host:
11+
type: string
12+
description: The FQDN pointing to the schema registry connection uri.
13+
example: backend-do-user-19081923-0.db.ondigitalocean.com
14+
readOnly: true
15+
port:
16+
type: integer
17+
description: The port on which the schema registry is listening.
18+
example: 20835
19+
readOnly: true
20+
user:
21+
type: string
22+
description: The default user for the schema registry.<br><br>Requires `database:view_credentials` scope.
23+
example: doadmin
24+
readOnly: true
25+
password:
26+
type: string
27+
description: The randomly generated password for the schema registry.<br><br>Requires `database:view_credentials` scope.
28+
example: wv78n3zpz42xezdk
29+
readOnly: true
30+
ssl:
31+
type: boolean
32+
description: A boolean value indicating if the connection should be made over SSL.
33+
example: true
34+
readOnly: true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
description: A JSON object with a key of `compatibility_level`.
2+
3+
headers:
4+
ratelimit-limit:
5+
$ref: '../../../shared/headers.yml#/ratelimit-limit'
6+
ratelimit-remaining:
7+
$ref: '../../../shared/headers.yml#/ratelimit-remaining'
8+
ratelimit-reset:
9+
$ref: '../../../shared/headers.yml#/ratelimit-reset'
10+
11+
content:
12+
application/json:
13+
schema:
14+
type: object
15+
properties:
16+
compatibility_level:
17+
type: string
18+
enum:
19+
- NONE
20+
- BACKWARD
21+
- BACKWARD_TRANSITIVE
22+
- FORWARD
23+
- FORWARD_TRANSITIVE
24+
- FULL
25+
- FULL_TRANSITIVE
26+
description: The compatibility level of the schema registry.
27+
required:
28+
- compatibility_level
29+
example:
30+
compatibility_level: BACKWARD
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
description: A JSON object with a key of `compatibility_level`.
2+
3+
headers:
4+
ratelimit-limit:
5+
$ref: "../../../shared/headers.yml#/ratelimit-limit"
6+
ratelimit-remaining:
7+
$ref: "../../../shared/headers.yml#/ratelimit-remaining"
8+
ratelimit-reset:
9+
$ref: "../../../shared/headers.yml#/ratelimit-reset"
10+
11+
content:
12+
application/json:
13+
schema:
14+
type: object
15+
properties:
16+
subject_name:
17+
type: string
18+
description: The name of the schema subject.
19+
compatibility_level:
20+
type: string
21+
enum:
22+
- NONE
23+
- BACKWARD
24+
- BACKWARD_TRANSITIVE
25+
- FORWARD
26+
- FORWARD_TRANSITIVE
27+
- FULL
28+
- FULL_TRANSITIVE
29+
description: The compatibility level of the schema registry.
30+
required:
31+
- subject_name
32+
- compatibility_level
33+
example:
34+
subject_name: "my-schema-subject"
35+
compatibility_level: BACKWARD

0 commit comments

Comments
 (0)