Skip to content

Commit ae984ee

Browse files
committed
Update examples
1 parent cec14f0 commit ae984ee

File tree

110 files changed

+19341
-8412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+19341
-8412
lines changed

packages/openapi-fetch/test/common/schemas/common.d.ts

Lines changed: 766 additions & 766 deletions
Large diffs are not rendered by default.

packages/openapi-typescript/examples/digital-ocean-api.ts

Lines changed: 5162 additions & 3379 deletions
Large diffs are not rendered by default.

packages/openapi-typescript/examples/digital-ocean-api/DigitalOcean-public.v2.yaml

Lines changed: 133 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,6 @@ paths:
570570
get:
571571
$ref: 'resources/apps/apps_get_logs_active_deployment_aggregate.yml'
572572

573-
/v2/apps/tiers:
574-
get:
575-
$ref: 'resources/apps/apps_list_tiers.yml'
576-
577-
/v2/apps/tiers/{slug}:
578-
get:
579-
$ref: 'resources/apps/apps_get_tier.yml'
580-
581573
/v2/apps/tiers/instance_sizes:
582574
get:
583575
$ref: 'resources/apps/apps_list_instanceSizes.yml'
@@ -743,6 +735,10 @@ paths:
743735
put:
744736
$ref: 'resources/databases/databases_update_maintenanceWindow.yml'
745737

738+
/v2/databases/{database_cluster_uuid}/install_update:
739+
put:
740+
$ref: 'resources/databases/databases_update_installUpdate.yml'
741+
746742
/v2/databases/{database_cluster_uuid}/backups:
747743
get:
748744
$ref: 'resources/databases/databases_list_backups.yml'
@@ -861,7 +857,15 @@ paths:
861857
$ref: 'resources/databases/databases_get_cluster_metrics_credentials.yml'
862858
put:
863859
$ref: 'resources/databases/databases_update_cluster_metrics_credentials.yml'
864-
860+
861+
/v2/databases/{database_cluster_uuid}/indexes:
862+
get:
863+
$ref: 'resources/databases/databases_list_opensearch_indexes.yml'
864+
865+
/v2/databases/{database_cluster_uuid}/indexes/{index_name}:
866+
delete:
867+
$ref: 'resources/databases/databases_delete_opensearch_index.yml'
868+
865869
/v2/domains:
866870
get:
867871
$ref: 'resources/domains/domains_list.yml'
@@ -911,6 +915,18 @@ paths:
911915
get:
912916
$ref: 'resources/droplets/droplets_list_backups.yml'
913917

918+
/v2/droplets/{droplet_id}/backups/policy:
919+
get:
920+
$ref: 'resources/droplets/droplets_get_backup_policy.yml'
921+
922+
/v2/droplets/backups/policies:
923+
get:
924+
$ref: 'resources/droplets/droplets_list_backup_policies.yml'
925+
926+
/v2/droplets/backups/supported_policies:
927+
get:
928+
$ref: 'resources/droplets/droplets_list_supported_backup_policies.yml'
929+
914930
/v2/droplets/{droplet_id}/snapshots:
915931
get:
916932
$ref: 'resources/droplets/droplets_list_snapshots.yml'
@@ -1269,6 +1285,114 @@ paths:
12691285
get:
12701286
$ref: 'resources/monitoring/monitoring_get_appRestartCountMetrics.yml'
12711287

1288+
/v2/monitoring/metrics/load_balancer/frontend_connections_current:
1289+
get:
1290+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_connections_current.yml'
1291+
1292+
/v2/monitoring/metrics/load_balancer/frontend_connections_limit:
1293+
get:
1294+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_connections_limit.yml'
1295+
1296+
/v2/monitoring/metrics/load_balancer/frontend_cpu_utilization:
1297+
get:
1298+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_cpu_utilization.yml'
1299+
1300+
/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_bytes:
1301+
get:
1302+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_firewall_dropped_bytes.yml'
1303+
1304+
/v2/monitoring/metrics/load_balancer/frontend_firewall_dropped_packets:
1305+
get:
1306+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_firewall_dropped_packets.yml'
1307+
1308+
/v2/monitoring/metrics/load_balancer/frontend_http_responses:
1309+
get:
1310+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_http_responses.yml'
1311+
1312+
/v2/monitoring/metrics/load_balancer/frontend_http_requests_per_second:
1313+
get:
1314+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_http_requests_per_second.yml'
1315+
1316+
/v2/monitoring/metrics/load_balancer/frontend_network_throughput_http:
1317+
get:
1318+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_network_throughput_http.yml'
1319+
1320+
/v2/monitoring/metrics/load_balancer/frontend_network_throughput_udp:
1321+
get:
1322+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_network_throughput_udp.yml'
1323+
1324+
/v2/monitoring/metrics/load_balancer/frontend_network_throughput_tcp:
1325+
get:
1326+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_network_throughput_tcp.yml'
1327+
1328+
/v2/monitoring/metrics/load_balancer/frontend_nlb_tcp_network_throughput:
1329+
get:
1330+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_nlb_tcp_network_throughput.yml'
1331+
1332+
/v2/monitoring/metrics/load_balancer/frontend_nlb_udp_network_throughput:
1333+
get:
1334+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_nlb_udp_network_throughput.yml'
1335+
1336+
/v2/monitoring/metrics/load_balancer/frontend_tls_connections_current:
1337+
get:
1338+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_tls_connections_current.yml'
1339+
1340+
/v2/monitoring/metrics/load_balancer/frontend_tls_connections_limit:
1341+
get:
1342+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_tls_connections_limit.yml'
1343+
1344+
/v2/monitoring/metrics/load_balancer/frontend_tls_connections_exceeding_rate_limit:
1345+
get:
1346+
$ref: 'resources/monitoring/monitoring_get_lb_frontend_tls_connections_exceeding_rate_limit.yml'
1347+
1348+
/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_avg:
1349+
get:
1350+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_session_duration_avg.yml'
1351+
1352+
/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_50p:
1353+
get:
1354+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_session_duration_50p.yml'
1355+
1356+
/v2/monitoring/metrics/load_balancer/droplets_http_session_duration_95p:
1357+
get:
1358+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_session_duration_95p.yml'
1359+
1360+
/v2/monitoring/metrics/load_balancer/droplets_http_response_time_avg:
1361+
get:
1362+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_response_time_avg.yml'
1363+
1364+
/v2/monitoring/metrics/load_balancer/droplets_http_response_time_50p:
1365+
get:
1366+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_response_time_50p.yml'
1367+
1368+
/v2/monitoring/metrics/load_balancer/droplets_http_response_time_95p:
1369+
get:
1370+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_response_time_95p.yml'
1371+
1372+
/v2/monitoring/metrics/load_balancer/droplets_http_response_time_99p:
1373+
get:
1374+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_response_time_99p.yml'
1375+
1376+
/v2/monitoring/metrics/load_balancer/droplets_queue_size:
1377+
get:
1378+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_queue_size.yml'
1379+
1380+
/v2/monitoring/metrics/load_balancer/droplets_http_responses:
1381+
get:
1382+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_http_responses.yml'
1383+
1384+
/v2/monitoring/metrics/load_balancer/droplets_connections:
1385+
get:
1386+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_connections.yml'
1387+
1388+
/v2/monitoring/metrics/load_balancer/droplets_health_checks:
1389+
get:
1390+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_health_checks.yml'
1391+
1392+
/v2/monitoring/metrics/load_balancer/droplets_downtime:
1393+
get:
1394+
$ref: 'resources/monitoring/monitoring_get_lb_droplets_downtime.yml'
1395+
12721396
/v2/projects:
12731397
get:
12741398
$ref: 'resources/projects/projects_list.yml'

packages/openapi-typescript/examples/digital-ocean-api/resources/apps/models/app_component_base.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,7 @@ properties:
5959
example: node-js
6060

6161
log_destinations:
62-
$ref: app_log_destination_definition.yml
62+
type: array
63+
items:
64+
$ref: app_log_destination_definition.yml
65+
description: A list of configured log forwarding destinations.

packages/openapi-typescript/examples/digital-ocean-api/resources/apps/models/app_functions_spec.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ properties:
5050
$ref: apps_gitlab_source_spec.yml
5151

5252
log_destinations:
53-
$ref: app_log_destination_definition.yml
53+
type: array
54+
items:
55+
$ref: app_log_destination_definition.yml
56+
description: A list of configured log forwarding destinations.
5457

5558
required:
5659
- name

packages/openapi-typescript/examples/digital-ocean-api/resources/apps/models/apps_update_app_request.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,10 @@ type: object
22
properties:
33
spec:
44
$ref: app_spec.yml
5+
update_all_source_versions:
6+
type: boolean
7+
description: Whether or not to update the source versions (for example fetching a new commit or image digest) of all components. By default (when this is false) only newly added sources will be updated to avoid changes like updating the scale of a component from also updating the respective code.
8+
example: true
9+
default: false
510
required:
611
- spec
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
operationId: databases_delete_opensearch_index
2+
3+
summary: Delete Index for OpenSearch Cluster
4+
5+
description: |
6+
To delete a single index within OpenSearch cluster, send a DELETE request
7+
to `/v2/databases/$DATABASE_ID/indexes/$INDEX_NAME`.
8+
9+
A status of 204 will be given. This indicates that the request was
10+
processed successfully, but that no response body is needed.
11+
12+
tags:
13+
- Databases
14+
15+
parameters:
16+
- $ref: 'parameters.yml#/database_cluster_uuid'
17+
- $ref: 'parameters.yml#/opensearch_index_name'
18+
19+
responses:
20+
'204':
21+
$ref: '../../shared/responses/no_content.yml'
22+
23+
'401':
24+
$ref: '../../shared/responses/unauthorized.yml'
25+
26+
'404':
27+
$ref: '../../shared/responses/not_found.yml'
28+
29+
'429':
30+
$ref: '../../shared/responses/too_many_requests.yml'
31+
32+
'500':
33+
$ref: '../../shared/responses/server_error.yml'
34+
35+
default:
36+
$ref: '../../shared/responses/unexpected_error.yml'
37+
38+
x-codeSamples:
39+
- $ref: 'examples/curl/databases_delete_opensearch_index.yml'
40+
- $ref: 'examples/go/databases_delete_opensearch_index.yml'
41+
42+
security:
43+
- bearer_auth:
44+
- 'database:delete'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
operationId: databases_list_opeasearch_indexes
2+
3+
summary: List Indexes for a OpenSearch Cluster
4+
5+
description: |
6+
To list all of a OpenSearch cluster's indexes, send a GET request to
7+
`/v2/databases/$DATABASE_ID/indexes`.
8+
9+
The result will be a JSON object with a `indexes` key.
10+
11+
tags:
12+
- Databases
13+
14+
parameters:
15+
- $ref: 'parameters.yml#/database_cluster_uuid'
16+
17+
responses:
18+
'200':
19+
$ref: 'responses/opensearch_indexes.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+
x-codeSamples:
37+
- $ref: 'examples/curl/databases_list_opensearch_indexes.yml'
38+
- $ref: 'examples/go/databases_list_opensearch_indexes.yml'
39+
40+
security:
41+
- bearer_auth:
42+
- 'database:read'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
operationId: databases_install_update
2+
3+
summary: Start Database Maintenance
4+
5+
description: >-
6+
To start the installation of updates for a
7+
database cluster, send a PUT request to
8+
`/v2/databases/$DATABASE_ID/install_update`.
9+
10+
A successful request will receive a 204 No Content status code with no body
11+
in response.
12+
13+
tags:
14+
- Databases
15+
16+
parameters:
17+
- $ref: 'parameters.yml#/database_cluster_uuid'
18+
19+
responses:
20+
'204':
21+
$ref: '../../shared/responses/no_content.yml'
22+
23+
'401':
24+
$ref: '../../shared/responses/unauthorized.yml'
25+
26+
'404':
27+
$ref: '../../shared/responses/not_found.yml'
28+
29+
'429':
30+
$ref: '../../shared/responses/too_many_requests.yml'
31+
32+
'500':
33+
$ref: '../../shared/responses/server_error.yml'
34+
35+
default:
36+
$ref: '../../shared/responses/unexpected_error.yml'
37+
38+
x-codeSamples:
39+
- $ref: 'examples/curl/databases_update_installUpdate.yml'
40+
- $ref: 'examples/go/databases_update_installUpdate.yml'
41+
- $ref: 'examples/python/databases_update_installUpdate.yml'
42+
43+
security:
44+
- bearer_auth:
45+
- 'database:update'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X DELETE \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/indexes/sample-index"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X GET \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/indexes"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
lang: cURL
2+
source: |-
3+
curl -X PUT \
4+
-H "Content-Type: application/json" \
5+
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
6+
"https://api.digitalocean.com/v2/databases/9cc10173-e9ea-4176-9dbc-a4cee4c4ff30/install_update"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
lang: Go
2+
source: |-
3+
import (
4+
"context"
5+
"os"
6+
7+
"github.com/digitalocean/godo"
8+
)
9+
10+
func main() {
11+
token := os.Getenv("DIGITALOCEAN_TOKEN")
12+
13+
client := godo.NewFromToken(token)
14+
ctx := context.TODO()
15+
16+
indexName := "sampe-index"
17+
18+
_, err := client.Databases.DeleteIndex(ctx, "9cc10173-e9ea-4176-9dbc-a4cee4c4ff30", indexName)
19+
}

0 commit comments

Comments
 (0)