From 69c89b305ca40ccfb3203e581316999abf64e489 Mon Sep 17 00:00:00 2001 From: rbhatia Date: Tue, 1 Sep 2026 14:39:42 -0700 Subject: [PATCH 1/2] updated specs for byoip --- .../load_balancers/models/attributes.yml | 13 ++++++++++ .../load_balancers/models/load_balancer.yml | 10 ++++++++ .../models/load_balancer_base.yml | 8 ------ .../models/load_balancer_create.yml | 8 ++++++ .../models/vpc_nat_gateway_create.yml | 25 +++++++++++++++++++ 5 files changed, 56 insertions(+), 8 deletions(-) diff --git a/specification/resources/load_balancers/models/attributes.yml b/specification/resources/load_balancers/models/attributes.yml index dfc562b87..5fc2cd3fa 100644 --- a/specification/resources/load_balancers/models/attributes.yml +++ b/specification/resources/load_balancers/models/attributes.yml @@ -15,3 +15,16 @@ load_balancer_droplet_tag: example: prod:web description: The name of a Droplet tag corresponding to Droplets assigned to the load balancer. + +load_balancer_ip: + ip: + type: string + pattern: '^$|^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + example: '203.0.113.42' + description: >- + An optional IP address to assign to the load balancer from one of your + Bring Your Own IP (BYOIP) prefixes. The address must be an unassigned + BYOIP address on your account in the same region as the load balancer. + If omitted, DigitalOcean assigns a public IP address automatically. This + field is only applied when creating the load balancer, cannot be changed + afterward, and is not supported for `GLOBAL` or `INTERNAL` load balancers. diff --git a/specification/resources/load_balancers/models/load_balancer.yml b/specification/resources/load_balancers/models/load_balancer.yml index de7440bac..70020bba9 100644 --- a/specification/resources/load_balancers/models/load_balancer.yml +++ b/specification/resources/load_balancers/models/load_balancer.yml @@ -1,6 +1,16 @@ allOf: - $ref: 'load_balancer_base.yml' +- type: object + properties: + ip: + type: string + pattern: '^$|^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + readOnly: true + example: '104.131.186.241' + description: An attribute containing the public-facing IP address of the + load balancer. + - type: object properties: region: diff --git a/specification/resources/load_balancers/models/load_balancer_base.yml b/specification/resources/load_balancers/models/load_balancer_base.yml index 747e9a57a..9efa54917 100644 --- a/specification/resources/load_balancers/models/load_balancer_base.yml +++ b/specification/resources/load_balancers/models/load_balancer_base.yml @@ -22,14 +22,6 @@ properties: default project. If an invalid project ID is provided, the load balancer will not be created. - ip: - type: string - pattern: '^$|^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' - readOnly: true - example: '104.131.186.241' - description: An attribute containing the public-facing IP address of the - load balancer. - ipv6: type: string readOnly: true diff --git a/specification/resources/load_balancers/models/load_balancer_create.yml b/specification/resources/load_balancers/models/load_balancer_create.yml index 5bf71db0f..419826530 100644 --- a/specification/resources/load_balancers/models/load_balancer_create.yml +++ b/specification/resources/load_balancers/models/load_balancer_create.yml @@ -10,6 +10,10 @@ oneOf: region: $ref: '../../../shared/attributes/region_slug.yml' + - type: object + properties: + $ref: 'attributes.yml#/load_balancer_ip' + - $ref: 'load_balancer_base.yml' required: @@ -27,6 +31,10 @@ oneOf: region: $ref: '../../../shared/attributes/region_slug.yml' + - type: object + properties: + $ref: 'attributes.yml#/load_balancer_ip' + - $ref: 'load_balancer_base.yml' required: diff --git a/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_create.yml b/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_create.yml index d8cc3fe35..cf23d652d 100644 --- a/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_create.yml +++ b/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_create.yml @@ -71,6 +71,31 @@ properties: example: 30 description: The TCP timeout in seconds for the VPC NAT gateway. + egresses: + type: object + description: >- + An optional object specifying the public egress IP address to assign to + the VPC NAT gateway. Provide this only to use a specific address. If + omitted, DigitalOcean allocates a public IP address automatically. + properties: + public_gateways: + type: array + description: >- + An array containing a single public gateway object that sets the + gateway's public egress IP address. + items: + type: object + properties: + ip: + type: string + example: 203.0.113.42 + description: >- + The public egress IP address to assign to the VPC NAT gateway. + Provide an unassigned Bring Your Own IP (BYOIP) address on your + account in the same region to use your own IP address. This + field is only applied when creating the gateway and cannot be + changed afterward. + required: - name - type From dbadb05fc87f7f8be81318f5341e1b7f261400c9 Mon Sep 17 00:00:00 2001 From: rbhatia Date: Wed, 2 Sep 2026 23:09:55 -0700 Subject: [PATCH 2/2] review comments --- .../load_balancers/loadBalancers_update.yml | 2 +- .../models/load_balancer_create.yml | 49 ++++--------------- .../models/load_balancer_update.yml | 34 +++++++++++++ .../models/vpc_nat_gateway_create.yml | 25 ++++++++-- .../models/vpc_nat_gateway_get.yml | 5 +- 5 files changed, 68 insertions(+), 47 deletions(-) create mode 100644 specification/resources/load_balancers/models/load_balancer_update.yml diff --git a/specification/resources/load_balancers/loadBalancers_update.yml b/specification/resources/load_balancers/loadBalancers_update.yml index 28295043f..e6398c9c5 100644 --- a/specification/resources/load_balancers/loadBalancers_update.yml +++ b/specification/resources/load_balancers/loadBalancers_update.yml @@ -22,7 +22,7 @@ requestBody: content: application/json: schema: - $ref: 'models/load_balancer_create.yml' + $ref: 'models/load_balancer_update.yml' examples: load_balancer_update_request: diff --git a/specification/resources/load_balancers/models/load_balancer_create.yml b/specification/resources/load_balancers/models/load_balancer_create.yml index 419826530..091a8a328 100644 --- a/specification/resources/load_balancers/models/load_balancer_create.yml +++ b/specification/resources/load_balancers/models/load_balancer_create.yml @@ -1,42 +1,11 @@ -oneOf: - - title: Assign Droplets by ID - allOf: - - type: object - properties: - $ref: 'attributes.yml#/load_balancer_droplet_ids' +description: >- + The request schema for creating a load balancer. This is the same as the + update schema with the addition of the create-only `ip` field, which assigns + a Bring Your Own IP (BYOIP) address to the load balancer. - - type: object - properties: - region: - $ref: '../../../shared/attributes/region_slug.yml' +allOf: + - $ref: 'load_balancer_update.yml' - - type: object - properties: - $ref: 'attributes.yml#/load_balancer_ip' - - - $ref: 'load_balancer_base.yml' - - required: - - droplet_ids - - region - - - title: Assign Droplets by Tag - allOf: - - type: object - properties: - $ref: 'attributes.yml#/load_balancer_droplet_tag' - - - type: object - properties: - region: - $ref: '../../../shared/attributes/region_slug.yml' - - - type: object - properties: - $ref: 'attributes.yml#/load_balancer_ip' - - - $ref: 'load_balancer_base.yml' - - required: - - tag - - region \ No newline at end of file + - type: object + properties: + $ref: 'attributes.yml#/load_balancer_ip' diff --git a/specification/resources/load_balancers/models/load_balancer_update.yml b/specification/resources/load_balancers/models/load_balancer_update.yml new file mode 100644 index 000000000..9a801a51b --- /dev/null +++ b/specification/resources/load_balancers/models/load_balancer_update.yml @@ -0,0 +1,34 @@ +oneOf: + - title: Assign Droplets by ID + allOf: + - type: object + properties: + $ref: 'attributes.yml#/load_balancer_droplet_ids' + + - type: object + properties: + region: + $ref: '../../../shared/attributes/region_slug.yml' + + - $ref: 'load_balancer_base.yml' + + required: + - droplet_ids + - region + + - title: Assign Droplets by Tag + allOf: + - type: object + properties: + $ref: 'attributes.yml#/load_balancer_droplet_tag' + + - type: object + properties: + region: + $ref: '../../../shared/attributes/region_slug.yml' + + - $ref: 'load_balancer_base.yml' + + required: + - tag + - region diff --git a/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_create.yml b/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_create.yml index cf23d652d..70e039561 100644 --- a/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_create.yml +++ b/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_create.yml @@ -85,16 +85,31 @@ properties: gateway's public egress IP address. items: type: object + description: >- + Specify the address using either `ip` or `ipv4`. Both fields accept + the same value and `ip` takes precedence if both are provided. The + assigned address is returned in the `ipv4` field of GET and list + responses. properties: ip: type: string example: 203.0.113.42 description: >- - The public egress IP address to assign to the VPC NAT gateway. - Provide an unassigned Bring Your Own IP (BYOIP) address on your - account in the same region to use your own IP address. This - field is only applied when creating the gateway and cannot be - changed afterward. + The public egress IP address to assign to the VPC NAT gateway, + and the preferred field for setting it. Provide an unassigned + Bring Your Own IP (BYOIP) address on your account in the same + region to use your own IP address. This field is only applied + when creating the gateway and cannot be changed afterward. The + assigned address is returned as `ipv4` in GET and list + responses. + ipv4: + type: string + example: 203.0.113.42 + description: >- + An alternative to `ip` for setting the public egress IP address + on create. Accepts the same value as `ip`, which takes + precedence if both are provided. This field is only applied when + creating the gateway and cannot be changed afterward. required: - name diff --git a/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_get.yml b/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_get.yml index 8cedcf880..949c5b925 100644 --- a/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_get.yml +++ b/specification/resources/vpc_nat_gateways/models/vpc_nat_gateway_get.yml @@ -83,7 +83,10 @@ properties: ipv4: type: string example: 174.138.113.197 - description: IPv4 address of the public gateway. + description: >- + The public egress IPv4 address of the VPC NAT gateway. This is + the address assigned to the gateway, which you can optionally + set when creating the gateway using the `ip` or `ipv4` field. description: An object containing egress information for the VPC NAT gateway. udp_timeout_seconds: