fix: add missing fields to Legacy UniversalClient + bump version to 5.0.56 + concurrency docs
This commit is contained in:
@@ -53,3 +53,4 @@ universal_rebuild/gen_v2
|
|||||||
universal_rebuild/docs_template_gen_v2
|
universal_rebuild/docs_template_gen_v2
|
||||||
secrets/test.token.new
|
secrets/test.token.new
|
||||||
secrets/*.token.new
|
secrets/*.token.new
|
||||||
|
terraform-provider-nubes_*
|
||||||
|
|||||||
@@ -108,6 +108,23 @@ resource "nubes_postgres_restart" "restart1" {
|
|||||||
run_id = "2026-02-20-001"
|
run_id = "2026-02-20-001"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
## Concurrency and State Locking
|
||||||
|
|
||||||
|
**Provider-level guarantees:**
|
||||||
|
- The provider does NOT implement distributed locking for instance operations.
|
||||||
|
- Two concurrent `terraform apply` with the same `resource_name` may create duplicate
|
||||||
|
instances, leading to a «multiple instances found» error on subsequent applies.
|
||||||
|
|
||||||
|
**User responsibility:**
|
||||||
|
- Use Terraform backend with state locking (S3+DynamoDB, etc.).
|
||||||
|
- Do NOT run `terraform apply` from two workspaces against the same state simultaneously.
|
||||||
|
- If duplicates occur: delete extras via Cloud Console and re-apply.
|
||||||
|
|
||||||
|
**API-side limitations:**
|
||||||
|
- Nubes API does not enforce unique `displayName` per serviceId.
|
||||||
|
- The provider cannot atomically guarantee «create-or-adopt» without API support
|
||||||
|
for conditional creation or name uniqueness constraints.
|
||||||
|
|
||||||
## Documentation Model
|
## Documentation Model
|
||||||
|
|
||||||
From the unified YAML, generate:
|
From the unified YAML, generate:
|
||||||
|
|||||||
@@ -25,9 +25,11 @@ func debugLog(format string, args ...interface{}) {
|
|||||||
|
|
||||||
// UniversalClient handles Nubes API logic
|
// UniversalClient handles Nubes API logic
|
||||||
type UniversalClient struct {
|
type UniversalClient struct {
|
||||||
HttpClient *http.Client
|
HttpClient *http.Client
|
||||||
ApiEndpoint string
|
ApiEndpoint string
|
||||||
ApiToken string
|
ApiToken string
|
||||||
|
ProviderVersion string
|
||||||
|
LogLevel string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request models
|
// Request models
|
||||||
|
|||||||
@@ -11,23 +11,23 @@ import (
|
|||||||
type InstanceState int
|
type InstanceState int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
StateUnknown InstanceState = iota
|
StateUnknown InstanceState = iota
|
||||||
StateNotCreated // 1
|
StateNotCreated // 1
|
||||||
StateCreating // 2
|
StateCreating // 2
|
||||||
StateCreationFailed // 3
|
StateCreationFailed // 3
|
||||||
StateRunning // 4
|
StateRunning // 4
|
||||||
StateRunningPending // 5
|
StateRunningPending // 5
|
||||||
StateModifying // 6
|
StateModifying // 6
|
||||||
StateModificationFailed // 7
|
StateModificationFailed // 7
|
||||||
StateSuspending // 8
|
StateSuspending // 8
|
||||||
StateSuspendFailed // 9
|
StateSuspendFailed // 9
|
||||||
StateSuspended // 10
|
StateSuspended // 10
|
||||||
StateResuming // 11
|
StateResuming // 11
|
||||||
StateResumeFailed // 12
|
StateResumeFailed // 12
|
||||||
StateDeleting // 13
|
StateDeleting // 13
|
||||||
StateDeletionFailed // 14
|
StateDeletionFailed // 14
|
||||||
StateDeleted // 15
|
StateDeleted // 15
|
||||||
StateOrphaned // 16
|
StateOrphaned // 16
|
||||||
)
|
)
|
||||||
|
|
||||||
// classifyStatus определяет состояние инстанса по данным API.
|
// classifyStatus определяет состояние инстанса по данным API.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
version string = "5.0.51"
|
version string = "5.0.56"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user