Skip to content

Commit

Permalink
Merge branch 'main' into alee/keys-api
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-aaron authored Feb 28, 2025
2 parents 289b0bf + 31fb5b2 commit 6054cfe
Show file tree
Hide file tree
Showing 34 changed files with 940 additions and 7 deletions.
33 changes: 33 additions & 0 deletions specification/DigitalOcean-public.v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,21 @@ tags:
setups or other configurations requiring movable addresses.
Reserved IPs are bound to a specific region.
- name: "[Public Preview] Reserved IPv6"
description: |-
DigitalOcean Reserved IPv6s are publicly-accessible static IP addresses that can be
mapped to one of your Droplets. They can be used to create highly available
setups or other configurations requiring movable addresses.
Reserved IPv6s are bound to a specific region.
- name: "[Public Preview] Reserved IPv6 Actions"
description: |-
Reserved IPv6 actions requests are made on the actions endpoint of a specific
reserved IPv6.
An action object is returned. These objects hold the current status of the
requested action.
- name: Sizes
description: |-
Expand Down Expand Up @@ -1657,6 +1672,24 @@ paths:
get:
$ref: 'resources/reserved_ips/reservedIPsActions_get.yml'

/v2/reserved_ipv6:
get:
$ref: 'resources/reserved_ipv6/reservedIPv6_list.yml'

post:
$ref: 'resources/reserved_ipv6/reservedIPv6_create.yml'

/v2/reserved_ipv6/{reserved_ipv6}:
get:
$ref: 'resources/reserved_ipv6/reservedIPv6_get.yml'

delete:
$ref: 'resources/reserved_ipv6/reservedIPv6_delete.yml'

/v2/reserved_ipv6/{reserved_ipv6}/actions:
post:
$ref: 'resources/reserved_ipv6/reservedIPv6Actions_post.yml'

/v2/sizes:
get:
$ref: 'resources/sizes/sizes_list.yml'
Expand Down
43 changes: 37 additions & 6 deletions specification/resources/gen-ai/definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ apiBatchJobPhase:
- BATCH_JOB_PHASE_SUCCEEDED
- BATCH_JOB_PHASE_FAILED
- BATCH_JOB_PHASE_ERROR
- BATCH_JOB_PHASE_CANCELLED
example: BATCH_JOB_PHASE_UNKNOWN
type: string
apiBillingAttribute:
Expand Down Expand Up @@ -633,6 +634,24 @@ apiChatbot:
example: '"example string"'
type: string
type: object
apiCrawlingOption:
default: UNKNOWN
description: |-
Options for specifying how URLs found on pages should be handled.
- UNKNOWN: Default unknown value
- SCOPED: Only include the base URL.
- PATH: Crawl the base URL and linked pages within the URL path.
- DOMAIN: Crawl the base URL and linked pages within the same domain.
- SUBDOMAINS: Crawl the base URL and linked pages for any subdomain.
enum:
- UNKNOWN
- SCOPED
- PATH
- DOMAIN
- SUBDOMAINS
example: UNKNOWN
type: string
apiCreateAgentAPIKeyInputPublic:
properties:
agent_uuid:
Expand Down Expand Up @@ -1034,12 +1053,6 @@ apiGetAgentOutput:
agent:
$ref: '#/apiAgent'
type: object
apiGetAgentOutputPublic:
description: One Agent
properties:
agent:
$ref: '#/apiAgentPublic'
type: object
apiGetAgentTemplateInputPublic:
properties:
uuid:
Expand Down Expand Up @@ -1495,6 +1508,8 @@ apiKBDataSource:
type: string
spaces_data_source:
$ref: '#/apiSpacesDataSource'
web_crawler_data_source:
$ref: '#/apiWebCrawlerDataSource'
type: object
apiKnowledgeBase:
description: Knowledgebase Description
Expand Down Expand Up @@ -1590,6 +1605,8 @@ apiKnowledgeBaseDataSource:
description: Unique id of knowledge base
example: '"123e4567-e89b-12d3-a456-426614174000"'
type: string
web_crawler_data_source:
$ref: '#/apiWebCrawlerDataSource'
type: object
apiKnowledgeBasePrice:
properties:
Expand Down Expand Up @@ -2706,6 +2723,20 @@ apiUsageMeasurement:
example: '"example string"'
type: string
type: object
apiWebCrawlerDataSource:
description: WebCrawlerDataSource
properties:
base_url:
description: The base url to crawl.
example: '"example string"'
type: string
crawling_option:
$ref: '#/apiCrawlingOption'
embed_media:
description: Whether to ingest and index media (images, etc.) on web pages.
example: true
type: boolean
type: object
dbaasClusterStatus:
default: CREATING
enum:
Expand Down
2 changes: 1 addition & 1 deletion specification/resources/gen-ai/genai_get_agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ responses:
content:
application/json:
schema:
$ref: ./definitions.yml#/apiGetAgentOutputPublic
$ref: ./definitions.yml#/apiGetAgentOutput
description: A successful response.
headers:
ratelimit-limit:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lang: cURL
source: |-
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"region_slug": "nyc3"}' \
"https://api.digitalocean.com/v2/reserved_ipv6"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
lang: cURL
source: |-
curl -X DELETE \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/reserved_ipv6/2409:40d0:f7:1017:74b4:3a96:105e:4c6e"
Original file line number Diff line number Diff line change
@@ -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/reserved_ipv6/2409:40d0:f7:1017:74b4:3a96:105e:4c6e"
Original file line number Diff line number Diff line change
@@ -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/reserved_ipv6?page=1&per_page=20"
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
lang: cURL
source: |-
# Assign a Reserved IPv6 to a Droplet
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"type":"assign","droplet_id":8219222}' \
"https://api.digitalocean.com/v2/reserved_ipv6/2409:40d0:f7:1017:74b4:3a96:105e:4c6e/actions"
# Unassign a Reserved IPv6 from a Droplet
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d '{"type":"unassign"}' \
"https://api.digitalocean.com/v2/reserved_ipv6/2409:40d0:f7:1017:74b4:3a96:105e:4c6e/actions"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
lang: Go
source: |-
import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
createRequest := &godo.ReservedIPV6CreateRequest{
RegionSlug: "nyc3",
}
reservedIPV6, _, err := client.ReservedIPV6s.Create(ctx, createRequest)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
lang: Go
source: |-
import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
_, err := client.ReservedIPV6s.Delete(ctx, "2409:40d0:f7:1017:74b4:3a96:105e:4c6e")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
lang: Go
source: |-
import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
reservedIP, _, err := client.ReservedIPV6s.Get(ctx, "2409:40d0:f7:1017:74b4:3a96:105e:4c6e")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
lang: Go
source: |-
import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
opt := &godo.ListOptions{
Page: 1,
PerPage: 200,
}
reservedIPs, _, err := client.ReservedIPV6s.List(ctx, opt)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
lang: Go
source: |-
import (
"context"
"os"
"github.com/digitalocean/godo"
)
func main() {
token := os.Getenv("DIGITALOCEAN_TOKEN")
client := godo.NewFromToken(token)
ctx := context.TODO()
// Assign a Reserved IPv6 to a Droplet
action, _, err := client.ReservedIPV6Actions.Assign(ctx, "2409:40d0:f7:1017:74b4:3a96:105e:4c6e", 8219222)
// Unassign a Reserved IPv6
action, _, err := client.ReservedIPV6Actions.Unassign(ctx, "2409:40d0:f7:1017:74b4:3a96:105e:4c6e")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
lang: Python
source: |-
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"region_slug": nyc3
}
resp = client.reserved_ipv6s.create(body=req)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lang: Python
source: |-
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
resp = client.reserved_ipv6s.delete(reserved_ipv6="2409:40d0:f7:1017:74b4:3a96:105e:4c6e")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lang: Python
source: |-
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
resp = client.reserved_ipv6s.get(reserved_ipv6="2409:40d0:f7:1017:74b4:3a96:105e:4c6e")
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
lang: Python
source: |-
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
resp = client.reserved_ipv6s.list()
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
lang: Python
source: |-
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req={
"type": "unassign"
}
resp = client.reserved_ipv6s_actions.post(reserved_ipv6="2409:40d0:f7:1017:74b4:3a96:105e:4c6e", body=req)
33 changes: 33 additions & 0 deletions specification/resources/reserved_ipv6/models/reserved_ipv6.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
type: object

properties:
ip:
type: string
format: ipv6
example: 2409:40d0:f7:1017:74b4:3a96:105e:4c6e
description: The public IP address of the reserved IPv6. It also serves as its
identifier.

reserved_at:
type: string
format: date-time
example: "2024-11-20T11:08:30Z"
description: The date and time when the reserved IPv6 was reserved.

region_slug:
type: string
description: The region that the reserved IPv6 is reserved to. When you
query a reserved IPv6,the region_slug will be returned.
example: nyc3

droplet:
anyOf:
- title: 'null'
type: object
nullable: true
description: If the reserved IP is not assigned to a Droplet, the
value will be null.
- $ref: '../../droplets/models/droplet.yml'
example: null


Loading

0 comments on commit 6054cfe

Please sign in to comment.