diff --git a/specification/DigitalOcean-public.v2.yaml b/specification/DigitalOcean-public.v2.yaml index 4eb56c2a6..5c9e658e3 100644 --- a/specification/DigitalOcean-public.v2.yaml +++ b/specification/DigitalOcean-public.v2.yaml @@ -658,6 +658,10 @@ paths: get: $ref: "resources/apps/apps_get_instanceSize.yml" + /v2/apps/templates: + get: + $ref: "resources/apps/apps_list_templates.yml" + /v2/apps/regions: get: $ref: "resources/apps/apps_list_regions.yml" diff --git a/specification/resources/apps/apps_list_templates.yml b/specification/resources/apps/apps_list_templates.yml new file mode 100755 index 000000000..8aa5e164b --- /dev/null +++ b/specification/resources/apps/apps_list_templates.yml @@ -0,0 +1,35 @@ +operationId: apps_list_templates + +summary: Get App Templates + +description: Retrieve a list of app templates. + +tags: +- Apps + +responses: + "200": + $ref: responses/app_templates.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/apps_list_templates.yml' + +security: + - bearer_auth: + - 'app:read' + diff --git a/specification/resources/apps/examples/curl/apps_list_templates.yml b/specification/resources/apps/examples/curl/apps_list_templates.yml new file mode 100644 index 000000000..23e8d6eb9 --- /dev/null +++ b/specification/resources/apps/examples/curl/apps_list_templates.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/apps/templates" diff --git a/specification/resources/apps/models/app_template.yml b/specification/resources/apps/models/app_template.yml new file mode 100644 index 000000000..094428748 --- /dev/null +++ b/specification/resources/apps/models/app_template.yml @@ -0,0 +1,45 @@ +type: object +properties: + name: + type: string + example: Flask with Valkey support + repo_url: + type: string + example: https://github.com/digitalocean/template-flask-app.git + branch: + type: string + example: main + repo_owner: + type: string + example: digitalocean + repo_name: + type: string + example: template-flask-app + environment_slug: + type: string + example: python + component_types: + type: array + items: + type: string + example: + - service + - worker + - static_site + - job + product_docs_page: + type: string + example: https://www.digitalocean.com/docs/app-platform/how-to/create-apps/#create-a-new-app + description: + type: string + example: A Flask app with Valkey support + language: + type: string + example: Python + frameworks: + type: array + items: + type: string + example: + - Flask + diff --git a/specification/resources/apps/models/app_templates_response.yml b/specification/resources/apps/models/app_templates_response.yml new file mode 100644 index 000000000..24484957f --- /dev/null +++ b/specification/resources/apps/models/app_templates_response.yml @@ -0,0 +1,4 @@ +properties: + sample-repos: + "$ref": app_template.yml +type: object diff --git a/specification/resources/apps/responses/app_templates.yml b/specification/resources/apps/responses/app_templates.yml new file mode 100644 index 000000000..b19693e56 --- /dev/null +++ b/specification/resources/apps/responses/app_templates.yml @@ -0,0 +1,17 @@ +description: A JSON object with a `sample_repos`. + +content: + application/json: + schema: + $ref: ../models/app_templates_response.yml + examples: + app_templates: + $ref: examples.yml#/app_templates + +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 diff --git a/specification/resources/apps/responses/examples.yml b/specification/resources/apps/responses/examples.yml index 516ebdc28..bf7187d8c 100644 --- a/specification/resources/apps/responses/examples.yml +++ b/specification/resources/apps/responses/examples.yml @@ -962,6 +962,24 @@ app_health: replicas_desired: 1 replicas_ready: 2 state: HEALTHY +app_templates: + value: + sample_repos: + - name: Flask with Valkey support + description: Build a REST API for session management and real-time data using your own Valkey database. + environment_slug: python + repo_url: https://github.com/digitalocean/template-flask-app.git + branch: main + repo_owner: digitalocean + repo_name: template-flask-app + language: Python + frameworks: + - "Flask" + component_types: + - service + - static_site + - worker + - job app_instances: value: instances: