Skip to content

Add List operation for Dedicated Inference Accelerators#964

Merged
DO-rrao merged 5 commits intodigitalocean:mainfrom
Rachana888:feature/dedicated-inference-list-accelerators
Mar 13, 2026
Merged

Add List operation for Dedicated Inference Accelerators#964
DO-rrao merged 5 commits intodigitalocean:mainfrom
Rachana888:feature/dedicated-inference-list-accelerators

Conversation

@Rachana888
Copy link
Copy Markdown
Contributor

@Rachana888 Rachana888 commented Mar 9, 2026

Summary

  • Adds support for listing accelerators for a specific Dedicated Inference instance
  • Implements GET /v2/dedicated-inferences/{id}/accelerators endpoint with optional filtering and pagination

Changes

  • Added ListAccelerators method to DedicatedInferenceService interface
  • Added DedicatedInferenceListAcceleratorsOptions struct for query parameters:
    • Slug – Filter by accelerator slug
    • Embedded ListOptions for pagination (Page, PerPage)
  • Added DedicatedInferenceAcceleratorInfo struct for accelerator list items:
    • ID, Name, Slug, Status, CreatedAt
  • Added dedicatedInferenceAcceleratorsRoot struct for JSON deserialization including Links and Meta
  • Implemented ListAccelerators method in DedicatedInferenceServiceOp that:
    • Constructs API path /v2/dedicated-inferences/{id}/accelerators
    • Appends query parameters for filtering and pagination
    • Sends HTTP GET request and parses response with pagination metadata
  • Added unit tests for ListAccelerators operation

API Specification

Method Endpoint Query Parameters Response
GET /v2/dedicated-inferences/{id}/accelerators slug, page, per_page 200 OK with paginated list

Testing

Command
go test -v -run "TestDedicatedInference_ListAccelerators

Results

=== RUN   TestDedicatedInference_ListAccelerators
--- PASS: TestDedicatedInference_ListAccelerators (0.00s)
=== RUN   TestDedicatedInference_ListAcceleratorsWithOptions
--- PASS: TestDedicatedInference_ListAcceleratorsWithOptions (0.00s)
PASS
ok      github.com/digitalocean/godo    1.495s

Unit Tests Added

  • TestDedicatedInference_ListAccelerators – Basic list without options
  • TestDedicatedInference_ListAcceleratorsWithOptions – List with slug filter and pagination

@Rachana888 Rachana888 force-pushed the feature/dedicated-inference-list-accelerators branch from c5b03bf to a7a538a Compare March 12, 2026 08:01
DO-rrao
DO-rrao previously approved these changes Mar 13, 2026
@DO-rrao DO-rrao merged commit 4121626 into digitalocean:main Mar 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants