Skip to content

Commit 3937ae2

Browse files
committed
Update examples
1 parent 965d82c commit 3937ae2

File tree

219 files changed

+16080
-7073
lines changed

Some content is hidden

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

219 files changed

+16080
-7073
lines changed

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

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

packages/openapi-typescript/examples/digital-ocean-api/resources/1-clicks/examples/curl/oneClicks.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ lang: cURL
22
source: |-
33
curl -X GET \
44
-H "Content-Type: application/json" \
5-
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
65
"https://api.digitalocean.com/v2/1-clicks"

packages/openapi-typescript/examples/digital-ocean-api/resources/1-clicks/examples/python/oneClicks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ source: |-
33
import os
44
from pydo import Client
55
6-
client = Client(token=os.getenv("$DIGITALOCEAN_TOKEN"))
6+
client = Client(token="")
77
88
one_click_apps = client.one_clicks.list()

packages/openapi-typescript/examples/digital-ocean-api/resources/1-clicks/oneClicks_install_kubernetes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ x-codeSamples:
4040

4141
security:
4242
- bearer_auth:
43-
- '1click:create'
43+
- 'kubernetes:update'

packages/openapi-typescript/examples/digital-ocean-api/resources/1-clicks/oneClicks_list.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,4 @@ x-codeSamples:
3737
- $ref: 'examples/python/oneClicks.yml'
3838

3939
security:
40-
- bearer_auth:
41-
- '1click:read'
42-
40+
- bearer_auth: []

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ x-codeSamples:
4343

4444
security:
4545
- bearer_auth:
46-
- 'app:create'
46+
- 'app:update'

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ summary: Retrieve Exec URL for Deployment
44

55
description:
66
Returns a websocket URL that allows sending/receiving console input and output
7-
to a component of the specified deployment if one exists.
7+
to a component of the specified deployment if one exists. Optionally, the instance_name parameter can be provided to retrieve the exec URL for a specific instance. Note that instances are ephemeral; therefore, we recommended to avoid making persistent changes or such scripting around them.
88

99
tags:
1010
- Apps
@@ -13,6 +13,7 @@ parameters:
1313
- $ref: parameters.yml#/app_id
1414
- $ref: parameters.yml#/deployment_id
1515
- $ref: parameters.yml#/component
16+
- $ref: parameters.yml#/instance_name
1617

1718
responses:
1819
"200":
@@ -39,4 +40,4 @@ x-codeSamples:
3940

4041
security:
4142
- bearer_auth:
42-
- "app:update"
43+
- "app:access_console"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ x-codeSamples:
3838

3939
security:
4040
- bearer_auth:
41-
- "app:update"
41+
- "app:access_console"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
operationId: apps_get_health
2+
3+
summary: Retrieve App Health
4+
5+
description: Retrieve information like health status, cpu and memory utilization of app components.
6+
7+
parameters:
8+
- $ref: parameters.yml#/app_id
9+
10+
tags:
11+
- Apps
12+
13+
responses:
14+
"200":
15+
$ref: responses/apps_health.yml
16+
17+
"401":
18+
$ref: ../../shared/responses/unauthorized.yml
19+
20+
"404":
21+
$ref: "../../shared/responses/not_found.yml"
22+
23+
"429":
24+
$ref: "../../shared/responses/too_many_requests.yml"
25+
26+
"500":
27+
$ref: ../../shared/responses/server_error.yml
28+
29+
default:
30+
$ref: ../../shared/responses/unexpected_error.yml
31+
32+
x-codeSamples:
33+
- $ref: 'examples/curl/apps_get_health.yml'
34+
35+
security:
36+
- bearer_auth:
37+
- 'app:read'
38+
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/apps/{id}/health"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ enum:
88
- DEPLOYMENT_LIVE
99
- DOMAIN_FAILED
1010
- DOMAIN_LIVE
11+
- AUTOSCALE_FAILED
1112
- FUNCTIONS_ACTIVATION_COUNT
1213
- FUNCTIONS_AVERAGE_DURATION_MS
1314
- FUNCTIONS_ERROR_RATE_PER_MINUTE
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
type: object
2+
properties:
3+
name:
4+
type: string
5+
example: sample_app
6+
cpu_usage_percent:
7+
type: number
8+
format: double
9+
example: 30
10+
memory_usage_percent:
11+
type: number
12+
format: double
13+
example: 25
14+
replicas_desired:
15+
type: integer
16+
format: int64
17+
example: 1
18+
replicas_ready:
19+
type: integer
20+
format: int64
21+
example: 1
22+
state:
23+
type: string
24+
enum:
25+
- UNKNOWN
26+
- HEALTHY
27+
- UNHEALTHY
28+
default: UNKNOWN
29+
example: HEALTHY

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ properties:
2929
- MONGODB
3030
- KAFKA
3131
- OPENSEARCH
32+
- VALKEY
3233
description: |-
3334
- MYSQL: MySQL
3435
- PG: PostgreSQL
3536
- REDIS: Redis
3637
- MONGODB: MongoDB
3738
- KAFKA: Kafka
3839
- OPENSEARCH: OpenSearch
40+
- VALKEY: ValKey
3941
example: PG
4042

4143
name:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
type: object
2+
properties:
3+
name:
4+
type: string
5+
example: sample_function
6+
functions_component_health_metrics:
7+
type: array
8+
items:
9+
type: object
10+
properties:
11+
metric_label:
12+
type: string
13+
example: activations_count
14+
metric_value:
15+
type: number
16+
format: double
17+
example: 100
18+
time_window:
19+
type: string
20+
example: 1h
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
type: object
2+
properties:
3+
components:
4+
type: array
5+
items:
6+
"$ref": app_component_health.yml
7+
functions_components:
8+
type: array
9+
items:
10+
"$ref": app_functions_component_health.yml
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
type: object
2+
properties:
3+
failure_threshold:
4+
type: integer
5+
format: int32
6+
description: The number of failed health checks before considered unhealthy.
7+
minimum: 1
8+
maximum: 50
9+
example: 18
10+
11+
port:
12+
type: integer
13+
format: int64
14+
description: The port on which the health check will be performed.
15+
example: 80
16+
maximum: 65535
17+
minimum: 1
18+
19+
http_path:
20+
type: string
21+
description: The route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.
22+
example: /health
23+
24+
initial_delay_seconds:
25+
type: integer
26+
format: int32
27+
description: The number of seconds to wait before beginning health checks.
28+
minimum: 0
29+
maximum: 3600
30+
example: 30
31+
32+
period_seconds:
33+
type: integer
34+
format: int32
35+
description: The number of seconds to wait between health checks.
36+
minimum: 1
37+
maximum: 300
38+
example: 10
39+
40+
success_threshold:
41+
type: integer
42+
format: int32
43+
description: The number of successful health checks before considered healthy.
44+
example: 1
45+
minimum: 1
46+
maximum: 1
47+
48+
timeout_seconds:
49+
type: integer
50+
format: int32
51+
description: The number of seconds after which the check times out.
52+
minimum: 1
53+
maximum: 120
54+
example: 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
properties:
2+
app_health:
3+
"$ref": app_health.yml
4+
type: object
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type: object
22
properties:
33
path:
4-
$ref: app_ingress_spec_rule_string_match.yml
4+
$ref: app_ingress_spec_rule_string_match_prefix.yml
5+
authority:
6+
$ref: app_ingress_spec_rule_string_match_exact.yml
57
description: The match configuration for the rule.
6-
required:
7-
- path
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type: object
2+
properties:
3+
exact:
4+
type: string
5+
maxLength: 256
6+
example: "example.com"
7+
description: The authority to match on.
8+
required:
9+
- exact
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
type: object
2+
properties:
3+
prefix:
4+
type: string
5+
description: Prefix-based match. For example, `/api` will match `/api`, `/api/`, and any nested paths such as `/api/v1/endpoint`.
6+
maxLength: 256
7+
example: /api
8+
description: The path to match on.
9+
required:
10+
- prefix

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ properties:
77
example: true
88
archive:
99
type: boolean
10-
description: Indicates whether the app should be archived. Setting this to true implies that enabled is set to true. Note that this feature is currently in closed beta.
10+
description: Indicates whether the app should be archived. Setting this to true implies that enabled is set to true.
1111
example: true
1212
offline_page_url:
1313
type: string

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ allOf:
1313
health_check:
1414
$ref: app_service_spec_health_check.yml
1515

16+
liveness_health_check:
17+
$ref: app_health_check_spec.yml
18+
1619
protocol:
1720
type: string
1821
description: |

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ allOf:
55
properties:
66
termination:
77
$ref: app_worker_spec_termination.yml
8+
liveness_health_check:
9+
$ref: app_health_check_spec.yml
810
required:
911
- name
1012

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

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ accept:
66
schema:
77
type: string
88
enum:
9-
- application/json
10-
- application/yaml
9+
- application/json
10+
- application/yaml
1111
example: application/json
1212

1313
content-type:
@@ -18,8 +18,8 @@ content-type:
1818
schema:
1919
type: string
2020
enum:
21-
- application/json
22-
- application/yaml
21+
- application/json
22+
- application/yaml
2323
example: application/json
2424

2525
app_id:
@@ -67,7 +67,8 @@ slug_size:
6767
example: apps-s-1vcpu-0.5gb
6868

6969
component:
70-
description: An optional component name. If set, logs will be limited to this component
70+
description:
71+
An optional component name. If set, logs will be limited to this component
7172
only.
7273
in: path
7374
name: component_name
@@ -105,17 +106,18 @@ log_type:
105106
schema:
106107
default: UNSPECIFIED
107108
enum:
108-
- UNSPECIFIED
109-
- BUILD
110-
- DEPLOY
111-
- RUN
112-
- RUN_RESTARTED
109+
- UNSPECIFIED
110+
- BUILD
111+
- DEPLOY
112+
- RUN
113+
- RUN_RESTARTED
113114
type: string
114115
example: BUILD
115116

116117
time_wait:
117-
description: 'An optional time duration to wait if the underlying component instance
118-
is not immediately available. Default: `3m`.'
118+
description:
119+
"An optional time duration to wait if the underlying component instance
120+
is not immediately available. Default: `3m`."
119121
in: query
120122
name: pod_connection_timeout
121123
schema:
@@ -139,3 +141,12 @@ alert_id:
139141
schema:
140142
type: string
141143
example: 5a624ab5-dd58-4b39-b7dd-8b7c36e8a91d
144+
145+
instance_name:
146+
description: The name of the actively running ephemeral compute instance
147+
in: query
148+
name: instance_name
149+
required: false
150+
schema:
151+
type: string
152+
example: go-app-d768568df-zz77d

0 commit comments

Comments
 (0)