From 88ef8cf46ad42cd17f1eb582356e78b017047c1d Mon Sep 17 00:00:00 2001 From: Zach Eddy Date: Mon, 13 May 2024 11:14:59 -0700 Subject: [PATCH] Add OpenAPI spec for dedicated egress IPs (#875) * Add OpenAPI spec for dedicated egress IPs * Update OpenAPI for app creation and updates --- specification/resources/apps/apps_create.yml | 2 ++ specification/resources/apps/models/app.yml | 6 ++++++ .../resources/apps/models/app_egress_spec.yml | 5 +++++ .../resources/apps/models/app_egress_type_spec.yml | 7 +++++++ specification/resources/apps/models/app_spec.yml | 3 +++ .../apps/models/apps_dedicated_egress_ip.yml | 13 +++++++++++++ .../models/apps_dedicated_egress_ip_status.yml | 10 ++++++++++ .../resources/apps/responses/examples.yml | 14 ++++++++++++++ 8 files changed, 60 insertions(+) create mode 100644 specification/resources/apps/models/app_egress_spec.yml create mode 100644 specification/resources/apps/models/app_egress_type_spec.yml create mode 100755 specification/resources/apps/models/apps_dedicated_egress_ip.yml create mode 100755 specification/resources/apps/models/apps_dedicated_egress_ip_status.yml diff --git a/specification/resources/apps/apps_create.yml b/specification/resources/apps/apps_create.yml index 6fb6e51ef..9a2e90e57 100755 --- a/specification/resources/apps/apps_create.yml +++ b/specification/resources/apps/apps_create.yml @@ -34,6 +34,8 @@ requestBody: instance_size_slug: apps-s-1vcpu-0.5gb routes: - path: /api + egress: + type: DEDICATED_IP required: true responses: diff --git a/specification/resources/apps/models/app.yml b/specification/resources/apps/models/app.yml index 925b55a2a..d08ab726b 100755 --- a/specification/resources/apps/models/app.yml +++ b/specification/resources/apps/models/app.yml @@ -80,6 +80,12 @@ properties: allOf: - description: The deployment that the app is pinned to. - $ref: apps_deployment.yml + dedicated_ips: + readOnly: true + title: The dedicated egress IP addresses associated with the app. + type: array + items: + $ref: apps_dedicated_egress_ip.yml required: - spec type: object diff --git a/specification/resources/apps/models/app_egress_spec.yml b/specification/resources/apps/models/app_egress_spec.yml new file mode 100644 index 000000000..d2b7a8f73 --- /dev/null +++ b/specification/resources/apps/models/app_egress_spec.yml @@ -0,0 +1,5 @@ +type: object +description: Specification for app egress configurations. +properties: + type: + $ref: app_egress_type_spec.yml diff --git a/specification/resources/apps/models/app_egress_type_spec.yml b/specification/resources/apps/models/app_egress_type_spec.yml new file mode 100644 index 000000000..098b31494 --- /dev/null +++ b/specification/resources/apps/models/app_egress_type_spec.yml @@ -0,0 +1,7 @@ +title: The app egress type. +type: string +default: AUTOASSIGN +example: AUTOASSIGN +enum: + - AUTOASSIGN + - DEDICATED_IP diff --git a/specification/resources/apps/models/app_spec.yml b/specification/resources/apps/models/app_spec.yml index 7a3226175..97675a63e 100755 --- a/specification/resources/apps/models/app_spec.yml +++ b/specification/resources/apps/models/app_spec.yml @@ -74,5 +74,8 @@ properties: ingress: $ref: app_ingress_spec.yml + egress: + $ref: app_egress_spec.yml + required: - name diff --git a/specification/resources/apps/models/apps_dedicated_egress_ip.yml b/specification/resources/apps/models/apps_dedicated_egress_ip.yml new file mode 100755 index 000000000..3d9a96caf --- /dev/null +++ b/specification/resources/apps/models/apps_dedicated_egress_ip.yml @@ -0,0 +1,13 @@ +type: object +readOnly: true +properties: + ip: + title: The IP address of the dedicated egress IP. + type: string + example: 192.168.1.1 + id: + title: The ID of the dedicated egress IP. + type: string + example: 9e7bc2ac-205a-45d6-919c-e1ac5e73f962 + status: + $ref: apps_dedicated_egress_ip_status.yml diff --git a/specification/resources/apps/models/apps_dedicated_egress_ip_status.yml b/specification/resources/apps/models/apps_dedicated_egress_ip_status.yml new file mode 100755 index 000000000..23282bbbd --- /dev/null +++ b/specification/resources/apps/models/apps_dedicated_egress_ip_status.yml @@ -0,0 +1,10 @@ +title: The status of the dedicated egress IP. +type: string +readOnly: true +default: UNKNOWN +enum: +- UNKNOWN +- ASSIGNING +- ASSIGNED +- REMOVED +example: ASSIGNED diff --git a/specification/resources/apps/responses/examples.yml b/specification/resources/apps/responses/examples.yml index c07632c58..94fdccfa7 100644 --- a/specification/resources/apps/responses/examples.yml +++ b/specification/resources/apps/responses/examples.yml @@ -192,6 +192,13 @@ apps: name: configuration-alert started_at: '2023-01-30T22:15:46.278987808Z' status: SUCCESS + dedicated_ips: + - ip: 192.168.1.1 + id: c24d8f48-3bc4-49f5-8ca0-58e8164427ac + status: ASSIGNED + - ip: 192.168.1.2 + id: 4768fb15-2837-4dda-9be5-3951df4bc3d0 + status: ASSIGNED links: pages: {} meta: @@ -414,6 +421,13 @@ app: name: configuration-alert started_at: '0001-01-01T00:00:00' status: PENDING + dedicated_ips: + - ip: 192.168.1.1 + id: c24d8f48-3bc4-49f5-8ca0-58e8164427ac + status: ASSIGNED + - ip: 192.168.1.2 + id: 4768fb15-2837-4dda-9be5-3951df4bc3d0 + status: ASSIGNED deployments: