From 138147a2791e90f2ffea1b3c76fbebfe4c026f99 Mon Sep 17 00:00:00 2001 From: Dustin Wilson <127760450+dwilsondo@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:05:11 -0400 Subject: [PATCH] Add documentation for /monitoring/sinks/** (#933) * add tailfinapi * whitespace + resource_id query param * fix issues in make lint * edits to obj descriptions * updates to examples + OpenSearch casing * update path on update_destination * update path on update_destination * Use enum in destination create request. --------- Co-authored-by: Anna Lushnikova Co-authored-by: Andrew Starr-Bochicchio --- specification/DigitalOcean-public.v2.yaml | 26 ++++++++ .../curl/monitoring_create_destination.yml | 7 ++ .../examples/curl/monitoring_create_sink.yml | 7 ++ .../curl/monitoring_delete_destination.yml | 6 ++ .../examples/curl/monitoring_delete_sink.yml | 6 ++ .../curl/monitoring_get_destination.yml | 6 ++ .../examples/curl/monitoring_get_sink.yml | 6 ++ .../curl/monitoring_list_destinations.yml | 6 ++ .../examples/curl/monitoring_list_sinks.yml | 6 ++ .../curl/monitoring_update_destination.yml | 7 ++ .../monitoring/models/destination.yml | 22 +++++++ .../models/destination_omit_credentials.yml | 20 ++++++ .../monitoring/models/destination_request.yml | 18 ++++++ .../monitoring/models/opensearch_config.yml | 38 +++++++++++ .../opensearch_config_omit_credentials.yml | 28 ++++++++ .../models/opensearch_config_request.yml | 37 +++++++++++ .../monitoring/models/sink_resource.yml | 14 ++++ .../monitoring/models/sinks_response.yml | 11 ++++ .../monitoring_create_destination.yml | 64 +++++++++++++++++++ .../monitoring/monitoring_create_sink.yml | 52 +++++++++++++++ .../monitoring_delete_destination.yml | 37 +++++++++++ .../monitoring/monitoring_delete_sink.yml | 37 +++++++++++ .../monitoring/monitoring_get_destination.yml | 37 +++++++++++ .../monitoring/monitoring_get_sink.yml | 37 +++++++++++ .../monitoring_list_destinations.yml | 34 ++++++++++ .../monitoring/monitoring_list_sinks.yml | 37 +++++++++++ .../monitoring_update_destination.yml | 44 +++++++++++++ .../resources/monitoring/parameters.yml | 26 ++++++++ .../monitoring/responses/destination.yml | 16 +++++ .../monitoring/responses/list_sinks.yml | 19 ++++++ .../monitoring_list_destinations.yml | 18 ++++++ .../resources/monitoring/responses/sinks.yml | 16 +++++ 32 files changed, 745 insertions(+) create mode 100644 specification/resources/monitoring/examples/curl/monitoring_create_destination.yml create mode 100644 specification/resources/monitoring/examples/curl/monitoring_create_sink.yml create mode 100644 specification/resources/monitoring/examples/curl/monitoring_delete_destination.yml create mode 100644 specification/resources/monitoring/examples/curl/monitoring_delete_sink.yml create mode 100644 specification/resources/monitoring/examples/curl/monitoring_get_destination.yml create mode 100644 specification/resources/monitoring/examples/curl/monitoring_get_sink.yml create mode 100644 specification/resources/monitoring/examples/curl/monitoring_list_destinations.yml create mode 100644 specification/resources/monitoring/examples/curl/monitoring_list_sinks.yml create mode 100644 specification/resources/monitoring/examples/curl/monitoring_update_destination.yml create mode 100644 specification/resources/monitoring/models/destination.yml create mode 100644 specification/resources/monitoring/models/destination_omit_credentials.yml create mode 100644 specification/resources/monitoring/models/destination_request.yml create mode 100644 specification/resources/monitoring/models/opensearch_config.yml create mode 100644 specification/resources/monitoring/models/opensearch_config_omit_credentials.yml create mode 100644 specification/resources/monitoring/models/opensearch_config_request.yml create mode 100644 specification/resources/monitoring/models/sink_resource.yml create mode 100644 specification/resources/monitoring/models/sinks_response.yml create mode 100644 specification/resources/monitoring/monitoring_create_destination.yml create mode 100644 specification/resources/monitoring/monitoring_create_sink.yml create mode 100644 specification/resources/monitoring/monitoring_delete_destination.yml create mode 100644 specification/resources/monitoring/monitoring_delete_sink.yml create mode 100644 specification/resources/monitoring/monitoring_get_destination.yml create mode 100644 specification/resources/monitoring/monitoring_get_sink.yml create mode 100644 specification/resources/monitoring/monitoring_list_destinations.yml create mode 100644 specification/resources/monitoring/monitoring_list_sinks.yml create mode 100644 specification/resources/monitoring/monitoring_update_destination.yml create mode 100644 specification/resources/monitoring/responses/destination.yml create mode 100644 specification/resources/monitoring/responses/list_sinks.yml create mode 100644 specification/resources/monitoring/responses/monitoring_list_destinations.yml create mode 100644 specification/resources/monitoring/responses/sinks.yml diff --git a/specification/DigitalOcean-public.v2.yaml b/specification/DigitalOcean-public.v2.yaml index f477db6b3..ff8df2f42 100644 --- a/specification/DigitalOcean-public.v2.yaml +++ b/specification/DigitalOcean-public.v2.yaml @@ -1402,6 +1402,32 @@ paths: get: $ref: 'resources/monitoring/monitoring_get_lb_droplets_downtime.yml' + /v2/monitoring/sinks/destinations: + post: + $ref: 'resources/monitoring/monitoring_create_destination.yml' + get: + $ref: 'resources/monitoring/monitoring_list_destinations.yml' + + /v2/monitoring/sinks/destinations/{destination_uuid}: + get: + $ref: 'resources/monitoring/monitoring_get_destination.yml' + post: + $ref: 'resources/monitoring/monitoring_update_destination.yml' + delete: + $ref: 'resources/monitoring/monitoring_delete_destination.yml' + + /v2/monitoring/sinks: + post: + $ref: 'resources/monitoring/monitoring_create_sink.yml' + get: + $ref: 'resources/monitoring/monitoring_list_sinks.yml' + + /v2/monitoring/sinks/{sink_uuid}: + get: + $ref: 'resources/monitoring/monitoring_get_sink.yml' + delete: + $ref: 'resources/monitoring/monitoring_delete_sink.yml' + /v2/projects: get: $ref: 'resources/projects/projects_list.yml' diff --git a/specification/resources/monitoring/examples/curl/monitoring_create_destination.yml b/specification/resources/monitoring/examples/curl/monitoring_create_destination.yml new file mode 100644 index 000000000..905f0391a --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_create_destination.yml @@ -0,0 +1,7 @@ +lang: cURL +source: |- + curl -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + "https://api.digitalocean.com/v2/monitoring/sinks/destinations" \ + --data '{"name":"cluster", "type":"opensearch_dbaas", "config": {"endpoint": "example.com", "credentials": {"username": "username", "password": "password"}}}' diff --git a/specification/resources/monitoring/examples/curl/monitoring_create_sink.yml b/specification/resources/monitoring/examples/curl/monitoring_create_sink.yml new file mode 100644 index 000000000..b3d54e91f --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_create_sink.yml @@ -0,0 +1,7 @@ +lang: cURL +source: |- + curl -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + "https://api.digitalocean.com/v2/monitoring/sinks" \ + --data '{"destination_uuid": "f2fcd5d9-f410-4f3a-8015-130ada94b1fe", "resources": [{"name": "fra_kubernetes_cluster", "urn":"do:kubernetes:8463c9db-150c-4b44-830c-fca7f68d005b"}]}' diff --git a/specification/resources/monitoring/examples/curl/monitoring_delete_destination.yml b/specification/resources/monitoring/examples/curl/monitoring_delete_destination.yml new file mode 100644 index 000000000..fe70e1733 --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_delete_destination.yml @@ -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/monitoring/sinks/destinations/01f30bfa-319a-4769-ba95-9d43971fb514" \ No newline at end of file diff --git a/specification/resources/monitoring/examples/curl/monitoring_delete_sink.yml b/specification/resources/monitoring/examples/curl/monitoring_delete_sink.yml new file mode 100644 index 000000000..765413813 --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_delete_sink.yml @@ -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/monitoring/sinks/aef7ff4a-f1be-4d9e-b886-650fcb5bdfe3" diff --git a/specification/resources/monitoring/examples/curl/monitoring_get_destination.yml b/specification/resources/monitoring/examples/curl/monitoring_get_destination.yml new file mode 100644 index 000000000..760018bc6 --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_get_destination.yml @@ -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/monitoring/sinks/destinations/01f30bfa-319a-4769-ba95-9d43971fb514" \ No newline at end of file diff --git a/specification/resources/monitoring/examples/curl/monitoring_get_sink.yml b/specification/resources/monitoring/examples/curl/monitoring_get_sink.yml new file mode 100644 index 000000000..bf83d49d7 --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_get_sink.yml @@ -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/monitoring/sinks/f945d774-86e8-4dc8-8f60-cfc76dd3d098" diff --git a/specification/resources/monitoring/examples/curl/monitoring_list_destinations.yml b/specification/resources/monitoring/examples/curl/monitoring_list_destinations.yml new file mode 100644 index 000000000..0fc30e1e5 --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_list_destinations.yml @@ -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/monitoring/sinks/destinations" diff --git a/specification/resources/monitoring/examples/curl/monitoring_list_sinks.yml b/specification/resources/monitoring/examples/curl/monitoring_list_sinks.yml new file mode 100644 index 000000000..e5a2bb30b --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_list_sinks.yml @@ -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/monitoring/sinks?resource_id=do:kubernetes:f2fcd5d9-f410-4f3a-8015-130ada94b1fe" \ No newline at end of file diff --git a/specification/resources/monitoring/examples/curl/monitoring_update_destination.yml b/specification/resources/monitoring/examples/curl/monitoring_update_destination.yml new file mode 100644 index 000000000..ffda20fcd --- /dev/null +++ b/specification/resources/monitoring/examples/curl/monitoring_update_destination.yml @@ -0,0 +1,7 @@ +lang: cURL +source: |- + curl -X PATCH \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ + "https://api.digitalocean.com/v2/monitoring/sinks/destinations/01f30bfa-319a-4769-ba95-9d43971fb514" \ + --data '{"index_name": "logs", "retention_days": 30}' \ No newline at end of file diff --git a/specification/resources/monitoring/models/destination.yml b/specification/resources/monitoring/models/destination.yml new file mode 100644 index 000000000..e7a5a8c88 --- /dev/null +++ b/specification/resources/monitoring/models/destination.yml @@ -0,0 +1,22 @@ +type: object +required: + - config +properties: + id: + type: string + description: "A unique identifier for a destination." + example: "01f30bfa-319a-4769-ba95-9d43971fb514" + name: + type: string + description: "destination name" + example: "managed_opensearch_cluster" + type: + enum: + - opensearch_dbaas + - opensearch_ext + description: | + The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearch + cluster or `opensearch_ext` for an externally managed one. + example: "opensearch_dbaas" + config: + $ref: 'opensearch_config.yml' diff --git a/specification/resources/monitoring/models/destination_omit_credentials.yml b/specification/resources/monitoring/models/destination_omit_credentials.yml new file mode 100644 index 000000000..26967db56 --- /dev/null +++ b/specification/resources/monitoring/models/destination_omit_credentials.yml @@ -0,0 +1,20 @@ +type: object +properties: + id: + type: string + description: "A unique identifier for a destination." + example: "01f30bfa-319a-4769-ba95-9d43971fb514" + name: + type: string + description: "destination name" + example: "managed_opensearch_cluster" + type: + enum: + - opensearch_dbaas + - opensearch_ext + description: | + The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearch + cluster or `opensearch_ext` for an externally managed one. + example: opensearch_dbaas + config: + $ref: 'opensearch_config_omit_credentials.yml' diff --git a/specification/resources/monitoring/models/destination_request.yml b/specification/resources/monitoring/models/destination_request.yml new file mode 100644 index 000000000..e4f121778 --- /dev/null +++ b/specification/resources/monitoring/models/destination_request.yml @@ -0,0 +1,18 @@ +type: object +required: + - config + - type +properties: + name: + type: string + description: "destination name" + example: "managed_opensearch_cluster" + type: + enum: + - opensearch_dbaas + - opensearch_ext + description: | + The destination type. `opensearch_dbaas` for a DigitalOcean managed OpenSearch + cluster or `opensearch_ext` for an externally managed one. + config: + $ref: 'opensearch_config_request.yml' diff --git a/specification/resources/monitoring/models/opensearch_config.yml b/specification/resources/monitoring/models/opensearch_config.yml new file mode 100644 index 000000000..0817e0505 --- /dev/null +++ b/specification/resources/monitoring/models/opensearch_config.yml @@ -0,0 +1,38 @@ +type: object +required: + - endpoint +properties: + id: + type: string + description: "A unique identifier for a configuration." + example: "41078d41-165c-4cff-9f0a-19536e3e3d49" + credentials: + type: object + description: "Credentials for an OpenSearch cluster user. Optional if `cluster_uuid` is passed." + properties: + username: + type: string + example: "username" + password: + type: string + example: "password" + endpoint: + type: string + example: "example.com" + description: "host of the OpenSearch cluster" + cluster_uuid: + type: string + example: "85148069-7e35-4999-80bd-6fa1637ca385" + description: "A unique identifier for a managed OpenSearch cluster." + cluster_name: + type: string + example: "managed_dbaas_cluster" + description: "Name of a managed OpenSearch cluster." + index_name: + type: string + description: "OpenSearch index to send logs to." + example: "logs" + retention_days: + type: integer + description: "Number of days to retain logs in OpenSearch (default: 14)" + example: 14 diff --git a/specification/resources/monitoring/models/opensearch_config_omit_credentials.yml b/specification/resources/monitoring/models/opensearch_config_omit_credentials.yml new file mode 100644 index 000000000..0c99546df --- /dev/null +++ b/specification/resources/monitoring/models/opensearch_config_omit_credentials.yml @@ -0,0 +1,28 @@ +type: object +description: "OpenSearch destination configuration with `credentials` omitted." +properties: + id: + type: string + description: "A unique identifier for a configuration." + example: "41078d41-165c-4cff-9f0a-19536e3e3d49" + endpoint: + type: string + example: "example.com" + description: "host of the OpenSearch cluster" + cluster_uuid: + type: string + example: "85148069-7e35-4999-80bd-6fa1637ca385" + description: "A unique identifier for a managed OpenSearch cluster." + cluster_name: + type: string + example: "managed_dbaas_cluster" + description: "Name of a managed OpenSearch cluster." + index_name: + type: string + description: "OpenSearch index to send logs to." + example: "logs" + retention_days: + type: integer + description: "Number of days to retain logs in OpenSearch." + example: 14 + default: 14 diff --git a/specification/resources/monitoring/models/opensearch_config_request.yml b/specification/resources/monitoring/models/opensearch_config_request.yml new file mode 100644 index 000000000..19f9581e9 --- /dev/null +++ b/specification/resources/monitoring/models/opensearch_config_request.yml @@ -0,0 +1,37 @@ +type: object +required: + - endpoint +properties: + credentials: + type: object + description: "Credentials for an OpenSearch cluster user. Optional if `cluster_uuid` is passed." + properties: + username: + type: string + example: "username" + password: + type: string + example: "password" + endpoint: + type: string + example: "example.com" + description: "host of the OpenSearch cluster" + cluster_uuid: + type: string + example: "85148069-7e35-4999-80bd-6fa1637ca385" + description: "A unique identifier for a managed OpenSearch cluster." + cluster_name: + type: string + example: "managed_dbaas_cluster" + description: "Name of a managed OpenSearch cluster." + index_name: + type: string + description: "OpenSearch index to send logs to." + example: "logs" + retention_days: + type: integer + description: "Number of days to retain logs in an OpenSearch cluster." + example: 14 + default: 14 + + diff --git a/specification/resources/monitoring/models/sink_resource.yml b/specification/resources/monitoring/models/sink_resource.yml new file mode 100644 index 000000000..91bd80c6c --- /dev/null +++ b/specification/resources/monitoring/models/sink_resource.yml @@ -0,0 +1,14 @@ +type: object +required: + - urn +properties: + urn: + type: string + pattern: ^do:kubernetes:.* + example: do:kubernetes:f453aa14-646e-4cf8-8c62-75a19fb24ec2 + description: The uniform resource name (URN) for the resource in the format + do:resource_type:resource_id. + name: + type: string + description: "resource name" + example: "managed_kubernetes_cluster" diff --git a/specification/resources/monitoring/models/sinks_response.yml b/specification/resources/monitoring/models/sinks_response.yml new file mode 100644 index 000000000..81aa4be7a --- /dev/null +++ b/specification/resources/monitoring/models/sinks_response.yml @@ -0,0 +1,11 @@ +type: object +required: + - urn +properties: + destination: + $ref: '../models/destination.yml' + resources: + type: array + description: "List of resources identified by their URNs." + items: + $ref: '../models/sink_resource.yml' diff --git a/specification/resources/monitoring/monitoring_create_destination.yml b/specification/resources/monitoring/monitoring_create_destination.yml new file mode 100644 index 000000000..bc89890e2 --- /dev/null +++ b/specification/resources/monitoring/monitoring_create_destination.yml @@ -0,0 +1,64 @@ +operationId: monitoring_create_destination + +summary: Create Logging Destination + +description: To create a new destination, send a POST request to `/v2/monitoring/sinks/destinations`. + +tags: + - Monitoring + +requestBody: + required: true + content: + application/json: + schema: + $ref: 'models/destination_request.yml' + + examples: + Managed OpenSearch Cluster: + value: + name: managed_opensearch_cluster + type: opensearch_dbaas + config: + endpoint: db-opensearch-nyc3-123456-do-user-123456-0.g.db.ondigitalocean.com + cluster_uuid: 85148069-7e35-4999-80bd-6fa1637ca385 + cluster_name: managed_dbaas_cluster + index_name: logs + retention_days: 14 + External OpenSearch Cluster: + value: + name: external_opensearch + type: opensearch_ext + config: + endpoint: example.com + credentials: + username: username + password: password + index_name: logs + retention_days: 14 + +responses: + '200': + $ref: 'responses/destination.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/monitoring_create_destination.yml' + +security: + - bearer_auth: + - 'monitoring:create' diff --git a/specification/resources/monitoring/monitoring_create_sink.yml b/specification/resources/monitoring/monitoring_create_sink.yml new file mode 100644 index 000000000..6acdeedee --- /dev/null +++ b/specification/resources/monitoring/monitoring_create_sink.yml @@ -0,0 +1,52 @@ +operationId: monitoring_create_sink + +summary: Create Sink + +description: | + To create a new sink, send a POST request to `/v2/monitoring/sinks`. Forwards logs from the + resources identified in `resources` to the specified pre-existing destination. + +tags: + - Monitoring + +responses: + '202': + $ref: '../../shared/responses/accepted.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' + +requestBody: + required: true + content: + application/json: + schema: + properties: + destination_uuid: + type: string + example: "9df2b7e9-3fb2-4577-b60a-e9c0d53f9a99" + description: "A unique identifier for an already-existing destination." + resources: + type: array + description: "List of resources identified by their URNs." + items: + $ref: 'models/sink_resource.yml' + +x-codeSamples: + - $ref: 'examples/curl/monitoring_create_sink.yml' + +security: + - bearer_auth: + - 'monitoring:create' diff --git a/specification/resources/monitoring/monitoring_delete_destination.yml b/specification/resources/monitoring/monitoring_delete_destination.yml new file mode 100644 index 000000000..96c7ace6e --- /dev/null +++ b/specification/resources/monitoring/monitoring_delete_destination.yml @@ -0,0 +1,37 @@ +operationId: monitoring_delete_destination + +summary: Delete Logging Destination + +description: To delete a destination and all associated sinks, send a DELETE request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + +tags: + - Monitoring + +parameters: + - $ref: 'parameters.yml#/destination_uuid' + +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/monitoring_delete_destination.yml' + +security: + - bearer_auth: + - 'monitoring:delete' diff --git a/specification/resources/monitoring/monitoring_delete_sink.yml b/specification/resources/monitoring/monitoring_delete_sink.yml new file mode 100644 index 000000000..82348581c --- /dev/null +++ b/specification/resources/monitoring/monitoring_delete_sink.yml @@ -0,0 +1,37 @@ +operationId: monitoring_delete_sink + +summary: Delete Sink + +description: To delete a sink, send a DELETE request to `/v2/monitoring/sinks/${sink_uuid}`. + +tags: + - Monitoring + +parameters: + - $ref: 'parameters.yml#/sink_uuid' + +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/monitoring_delete_sink.yml' + +security: + - bearer_auth: + - 'monitoring:delete' diff --git a/specification/resources/monitoring/monitoring_get_destination.yml b/specification/resources/monitoring/monitoring_get_destination.yml new file mode 100644 index 000000000..13504f5d7 --- /dev/null +++ b/specification/resources/monitoring/monitoring_get_destination.yml @@ -0,0 +1,37 @@ +operationId: monitoring_get_destination + +summary: Get Logging Destination + +description: To get the details of a destination, send a GET request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + +tags: + - Monitoring + +parameters: + - $ref: 'parameters.yml#/destination_uuid' + +responses: + '200': + $ref: 'responses/destination.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/monitoring_get_destination.yml' + +security: + - bearer_auth: + - 'monitoring:read' diff --git a/specification/resources/monitoring/monitoring_get_sink.yml b/specification/resources/monitoring/monitoring_get_sink.yml new file mode 100644 index 000000000..127b76517 --- /dev/null +++ b/specification/resources/monitoring/monitoring_get_sink.yml @@ -0,0 +1,37 @@ +operationId: monitoring_get_sink + +summary: Get Sink + +description: To get the details of a sink (resources and destination), send a GET request to `/v2/monitoring/sinks/${sink_uuid}`. + +tags: + - Monitoring + +parameters: + - $ref: 'parameters.yml#/sink_uuid' + +responses: + '200': + $ref: 'responses/sinks.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/monitoring_get_sink.yml' + +security: + - bearer_auth: + - 'monitoring:read' diff --git a/specification/resources/monitoring/monitoring_list_destinations.yml b/specification/resources/monitoring/monitoring_list_destinations.yml new file mode 100644 index 000000000..1ad91fa88 --- /dev/null +++ b/specification/resources/monitoring/monitoring_list_destinations.yml @@ -0,0 +1,34 @@ +operationId: monitoring_list_destinations + +summary: List Logging Destinations + +description: To list all logging destinations, send a GET request to `/v2/monitoring/sinks/destinations`. + +tags: + - Monitoring + +responses: + '200': + $ref: 'responses/monitoring_list_destinations.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/monitoring_list_destinations.yml' + +security: + - bearer_auth: + - 'monitoring:read' diff --git a/specification/resources/monitoring/monitoring_list_sinks.yml b/specification/resources/monitoring/monitoring_list_sinks.yml new file mode 100644 index 000000000..de317187f --- /dev/null +++ b/specification/resources/monitoring/monitoring_list_sinks.yml @@ -0,0 +1,37 @@ +operationId: monitoring_list_sinks + +summary: Lists all sinks + +description: To list all sinks, send a GET request to `/v2/monitoring/sinks`. + +tags: + - Monitoring + +parameters: + - $ref: 'parameters.yml#/resource_id' + +responses: + '200': + $ref: 'responses/list_sinks.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/monitoring_list_sinks.yml' + +security: + - bearer_auth: + - 'monitoring:read' diff --git a/specification/resources/monitoring/monitoring_update_destination.yml b/specification/resources/monitoring/monitoring_update_destination.yml new file mode 100644 index 000000000..3cbddb069 --- /dev/null +++ b/specification/resources/monitoring/monitoring_update_destination.yml @@ -0,0 +1,44 @@ +operationId: monitoring_update_destination + +summary: Update Logging Destination + +description: To update the details of a destination, send a PATCH request to `/v2/monitoring/sinks/destinations/${destination_uuid}`. + +tags: + - Monitoring + +parameters: + - $ref: 'parameters.yml#/destination_uuid' + +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' + +requestBody: + required: true + content: + application/json: + schema: + $ref: 'models/destination_request.yml' + +x-codeSamples: + - $ref: 'examples/curl/monitoring_update_destination.yml' + +security: + - bearer_auth: + - 'monitoring:update' diff --git a/specification/resources/monitoring/parameters.yml b/specification/resources/monitoring/parameters.yml index 4cba95de1..f39555717 100644 --- a/specification/resources/monitoring/parameters.yml +++ b/specification/resources/monitoring/parameters.yml @@ -25,6 +25,14 @@ load_balancer_id: type: string example: 4de7ac8b-495b-4884-9a69-1050c6793cd6 +resource_id: + in: query + name: resource_id + description: A unique URN for a resource. + schema: + $ref: '../../shared/attributes/urn.yml' + example: do:kubernetes:5ba4518b-b9e2-4978-aa92-2d4c727e8824 + app_component: in: query name: app_component @@ -82,3 +90,21 @@ alert_uuid: schema: type: string example: 4de7ac8b-495b-4884-9a69-1050c6793cd6 + +destination_uuid: + in: path + name: destination_uuid + description: A unique identifier for a destination. + required: true + schema: + type: string + example: 1a64809f-1708-48ee-a742-dec8d481b8d1 + +sink_uuid: + in: path + name: sink_uuid + description: A unique identifier for a sink. + required: true + schema: + type: string + example: 78b172b6-52c3-4a4b-96d5-78d3f1a0b18c diff --git a/specification/resources/monitoring/responses/destination.yml b/specification/resources/monitoring/responses/destination.yml new file mode 100644 index 000000000..25475607e --- /dev/null +++ b/specification/resources/monitoring/responses/destination.yml @@ -0,0 +1,16 @@ +description: The response is a JSON object with a `destination` key. + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + +content: + application/json: + schema: + properties: + destination: + $ref: '../models/destination_omit_credentials.yml' diff --git a/specification/resources/monitoring/responses/list_sinks.yml b/specification/resources/monitoring/responses/list_sinks.yml new file mode 100644 index 000000000..7e8500926 --- /dev/null +++ b/specification/resources/monitoring/responses/list_sinks.yml @@ -0,0 +1,19 @@ +description: The response is a JSON object with a `sinks` key. + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + +content: + application/json: + schema: + properties: + sinks: + type: array + description: "List of sinks identified by their URNs." + items: + $ref: '../models/sinks_response.yml' diff --git a/specification/resources/monitoring/responses/monitoring_list_destinations.yml b/specification/resources/monitoring/responses/monitoring_list_destinations.yml new file mode 100644 index 000000000..bd8cebf04 --- /dev/null +++ b/specification/resources/monitoring/responses/monitoring_list_destinations.yml @@ -0,0 +1,18 @@ +description: The response is a JSON object with a `destinations` key. + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + +content: + application/json: + schema: + properties: + destinations: + type: array + items: + $ref: '../models/destination_omit_credentials.yml' diff --git a/specification/resources/monitoring/responses/sinks.yml b/specification/resources/monitoring/responses/sinks.yml new file mode 100644 index 000000000..bca0859e8 --- /dev/null +++ b/specification/resources/monitoring/responses/sinks.yml @@ -0,0 +1,16 @@ +description: The response is a JSON object with a `sink` key. + +headers: + ratelimit-limit: + $ref: '../../../shared/headers.yml#/ratelimit-limit' + ratelimit-remaining: + $ref: '../../../shared/headers.yml#/ratelimit-remaining' + ratelimit-reset: + $ref: '../../../shared/headers.yml#/ratelimit-reset' + +content: + application/json: + schema: + properties: + sink: + $ref: '../models/sinks_response.yml'