-
Notifications
You must be signed in to change notification settings - Fork 6
refactor(go,terraform): enhance SDK types for Terraform provider integration #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ba9ecb4
feat(go): enhance SDK types for Terraform provider integration
Leechael b33e11d
chore: update terraform submodule to use Go SDK
Leechael 2dd6d0b
feat: add structured error codes and idempotency support across all SDKs
Leechael 0443f82
feat(go): add visibility and storage fields to ComposeFile struct
Leechael 1ab43fc
chore: update terraform submodule
Leechael ab5eaf1
feat(go): add Region field to ProvisionCVMRequest
Leechael b200247
chore: update terraform submodule (region + listed fixes)
Leechael 22acec1
feat(go): add ReplicateAppCVM for app-scoped replica creation
Leechael 87bb158
chore: update terraform submodule
Leechael 7443a75
refactor(go): use dstack sdk helpers
Leechael d3fd65f
fix(go): preserve endpoint instance and error detail values
Leechael c46565a
refactor(terraform): align env list shapes
Leechael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| package phala | ||
|
|
||
| // Structured error codes returned by the Phala Cloud API. | ||
| // Use with APIError.HasErrorCode() to match specific errors. | ||
| // | ||
| // Error codes follow the format ERR-{MODULE}-{CODE} where MODULE is a | ||
| // two-digit module identifier and CODE is a three-digit sequential number. | ||
|
|
||
| // Module 01: CVM Preflight & Compose Hash | ||
| const ( | ||
| ErrNodeNotFound = "ERR-01-001" | ||
| ErrComposeFileRequired = "ERR-01-002" | ||
| ErrInvalidComposeFile = "ERR-01-003" | ||
| ErrDuplicateCvmName = "ERR-01-004" | ||
| ErrHashRegistration = "ERR-01-005" | ||
| ErrHashInvalidExpired = "ERR-01-006" | ||
| ErrTxVerifyFailed = "ERR-01-007" | ||
| ErrHashNotAllowed = "ERR-01-008" | ||
| ) | ||
|
|
||
| // Module 02: Inventory | ||
| const ( | ||
| ErrInstanceTypeNotFound = "ERR-02-001" | ||
| ErrResourceNotAvailable = "ERR-02-002" | ||
| ErrInsufficientVcpu = "ERR-02-003" | ||
| ErrInsufficientMemory = "ERR-02-004" | ||
| ErrInsufficientSlots = "ERR-02-005" | ||
| ErrGpuAllocation = "ERR-02-006" | ||
| ErrInsufficientGpu = "ERR-02-007" | ||
| ErrInvalidRequest = "ERR-02-008" | ||
| ErrIncompatibleConfig = "ERR-02-009" | ||
| ErrImageNotFound = "ERR-02-010" | ||
| ErrKmsNotFound = "ERR-02-011" | ||
| ErrTeepodNotAccessible = "ERR-02-012" | ||
| ErrOsImageNotCompatible = "ERR-02-013" | ||
| ErrNodeCapacityNotConfig = "ERR-02-014" | ||
| ErrQuotaExceeded = "ERR-02-015" | ||
| ) | ||
|
|
||
| // Module 03: CVM Operations | ||
| const ( | ||
| ErrCvmNotFound = "ERR-03-001" | ||
| ErrMultipleCvmsSameName = "ERR-03-002" | ||
| // ERR-03-003 and ERR-03-004 are CvmNotInWorkspaceError variants (reveal/hide existence). | ||
| ErrCvmNotInWorkspace = "ERR-03-003" | ||
| ErrCvmAccessDenied = "ERR-03-005" | ||
| ErrReplicaImageNotAvail = "ERR-03-006" | ||
| ErrCvmAppIdConflict = "ERR-03-007" | ||
| ) | ||
|
|
||
| // Module 04: Workspace | ||
| const ( | ||
| ErrInsufficientBalance = "ERR-04-001" | ||
| ErrMaxCvmLimit = "ERR-04-002" | ||
| ErrResourceLimitExceed = "ERR-04-003" | ||
| ) | ||
|
|
||
| // Module 05: Credentials | ||
| const ( | ||
| ErrTokenLimitExceeded = "ERR-05-001" | ||
| ErrTokenRateLimit = "ERR-05-002" | ||
| ) | ||
|
|
||
| // Module 06: Auth | ||
| const ( | ||
| ErrOAuthEmailInvalid = "ERR-06-001" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.