-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation for DBaaS Kafka support (#826)
* Add Kafka to database options and update example to current API response. * Add kafka to engine enum. * Add Kafka user details. * Add Kafka topic operations. * Make the linter happy. * topic update body is wrapped. * Add some additional detail to topic config model * compact_delete is a vaild cleanup_policy
- Loading branch information
1 parent
6f7c147
commit a5a2b6a
Showing
30 changed files
with
1,157 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
specification/resources/databases/databases_create_kafka_topic.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
operationId: databases_create_kafka_topic | ||
|
||
summary: Create Topic for a Kafka Cluster | ||
|
||
description: | | ||
To create a topic attached to a Kafka cluster, send a POST request to | ||
`/v2/databases/$DATABASE_ID/topics`. | ||
The result will be a JSON object with a `topic` key. | ||
tags: | ||
- Databases | ||
|
||
parameters: | ||
- $ref: 'parameters.yml#/database_cluster_uuid' | ||
|
||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: 'models/kafka_topic_create.yml' | ||
required: | ||
- name | ||
example: | ||
name: customer-events | ||
partitions: 3 | ||
replication: 2 | ||
config: | ||
retention_bytes: -1 | ||
retention_ms: 100000 | ||
|
||
responses: | ||
'201': | ||
$ref: 'responses/kafka_topic.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/databases_create_topic.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'write' |
44 changes: 44 additions & 0 deletions
44
specification/resources/databases/databases_delete_kafka_topic.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
operationId: databases_delete_kafka_topic | ||
|
||
summary: Delete Topic for a Kafka Cluster | ||
|
||
description: | | ||
To delete a single topic within a Kafka cluster, send a DELETE request | ||
to `/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`. | ||
A status of 204 will be given. This indicates that the request was | ||
processed successfully, but that no response body is needed. | ||
tags: | ||
- Databases | ||
|
||
parameters: | ||
- $ref: 'parameters.yml#/database_cluster_uuid' | ||
- $ref: 'parameters.yml#/kafka_topic_name' | ||
|
||
responses: | ||
'204': | ||
$ref: '../../shared/responses/no_content.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/databases_delete_topic.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'write' | ||
|
43 changes: 43 additions & 0 deletions
43
specification/resources/databases/databases_get_kafka_topic.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
operationId: databases_get_kafka_topic | ||
|
||
summary: Get Topic for a Kafka Cluster | ||
|
||
description: | | ||
To retrieve a given topic by name from the set of a Kafka cluster's topics, | ||
send a GET request to `/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`. | ||
The result will be a JSON object with a `topic` key. | ||
tags: | ||
- Databases | ||
|
||
parameters: | ||
- $ref: 'parameters.yml#/database_cluster_uuid' | ||
- $ref: 'parameters.yml#/kafka_topic_name' | ||
|
||
responses: | ||
'200': | ||
$ref: 'responses/kafka_topic.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/databases_get_topic.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'read' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
specification/resources/databases/databases_list_kafka_topics.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
operationId: databases_list_kafka_topics | ||
|
||
summary: List Topics for a Kafka Cluster | ||
|
||
description: | | ||
To list all of a Kafka cluster's topics, send a GET request to | ||
`/v2/databases/$DATABASE_ID/topics`. | ||
The result will be a JSON object with a `topics` key. | ||
tags: | ||
- Databases | ||
|
||
parameters: | ||
- $ref: 'parameters.yml#/database_cluster_uuid' | ||
|
||
responses: | ||
'200': | ||
$ref: 'responses/kafka_topics.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/databases_list_topics.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'read' | ||
|
60 changes: 60 additions & 0 deletions
60
specification/resources/databases/databases_update_kafka_topic.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
operationId: databases_update_kafka_topic | ||
|
||
summary: Update Topic for a Kafka Cluster | ||
|
||
description: | | ||
To update a topic attached to a Kafka cluster, send a PUT request to | ||
`/v2/databases/$DATABASE_ID/topics/$TOPIC_NAME`. | ||
The result will be a JSON object with a `topic` key. | ||
tags: | ||
- Databases | ||
|
||
parameters: | ||
- $ref: 'parameters.yml#/database_cluster_uuid' | ||
- $ref: 'parameters.yml#/kafka_topic_name' | ||
|
||
requestBody: | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: 'models/kafka_topic_update.yml' | ||
required: | ||
- topic | ||
example: | ||
topic: | ||
name: customer-events | ||
partitions: 3 | ||
replication: 2 | ||
config: | ||
retention_bytes: -1 | ||
retention_ms: 100000 | ||
|
||
responses: | ||
'200': | ||
$ref: 'responses/kafka_topic.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/databases_update_topic.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'write' | ||
|
7 changes: 7 additions & 0 deletions
7
specification/resources/databases/examples/curl/databases_create_topic.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X POST \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
-d '{"name":"customer-events", "partition_count":3, "replication_factor": 3, "config": {"retentionMS": 1000000}}' \ | ||
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/topics" |
6 changes: 6 additions & 0 deletions
6
specification/resources/databases/examples/curl/databases_delete_topic.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X DELETE \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/topics/customer-events" |
6 changes: 6 additions & 0 deletions
6
specification/resources/databases/examples/curl/databases_get_topic.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/topics/customer-events" |
6 changes: 6 additions & 0 deletions
6
specification/resources/databases/examples/curl/databases_list_topics.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/topics" |
7 changes: 7 additions & 0 deletions
7
specification/resources/databases/examples/curl/databases_update_topic.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X PUT \ | ||
-H "Content-Type: application/json" \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
-d '{"topic":{"name":"customer-events", "partition_count":3, "replication_factor": 3, "config": {"retentionMS": 1000000}}}' \ | ||
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/topics/customer-events" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.