mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Add backend API support for resource metadata (#3242)
* Initial support for metadata in provisioner API and Terraform provisioner * add support for nullable metadata fields * handle metadata fields in provisionerd and API
This commit is contained in:
@@ -21,13 +21,20 @@ const (
|
||||
)
|
||||
|
||||
type WorkspaceResource struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
JobID uuid.UUID `json:"job_id"`
|
||||
Transition WorkspaceTransition `json:"workspace_transition"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Agents []WorkspaceAgent `json:"agents,omitempty"`
|
||||
ID uuid.UUID `json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
JobID uuid.UUID `json:"job_id"`
|
||||
Transition WorkspaceTransition `json:"workspace_transition"`
|
||||
Type string `json:"type"`
|
||||
Name string `json:"name"`
|
||||
Agents []WorkspaceAgent `json:"agents,omitempty"`
|
||||
Metadata []WorkspaceResourceMetadata `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type WorkspaceResourceMetadata struct {
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
Sensitive bool `json:"sensitive"`
|
||||
}
|
||||
|
||||
type WorkspaceAgent struct {
|
||||
|
||||
Reference in New Issue
Block a user