Documentation
¶
Overview ¶
Package resource provides a registry of known HCP Terraform API resource types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColumnsForType ¶
ColumnsForType returns the preferred display columns for the given type, or nil.
func CompletionNames ¶
func CompletionNames() []string
CompletionNames returns all type names and aliases (for shell autocompletion).
func CreatableNames ¶
func CreatableNames() []string
CreatableNames returns names and aliases of resource types that support creation.
func ExcludeColumnsForType ¶
ExcludeColumnsForType returns columns to exclude for the given type, or nil.
func IDPrefixForType ¶
IDPrefixForType returns the ID prefix for the given type name, or "" if unknown.
func IsResolvableType ¶
IsResolvableType returns true if the given type name (e.g. "workspaces") supports name-to-ID resolution via the API.
Types ¶
type Resource ¶
type Resource struct {
Type string // JSON:API type: "workspaces"
Aliases []string // shorthand: ["ws", "workspace"]
IDPrefix string // "ws-" (empty if unknown)
PathGet string // "/workspaces/{id}"
PathList string // "/organizations/{organization_name}/workspaces" (empty if not top-level listable)
PathCreate string // "/organizations/{organization_name}/workspaces" (empty if not supported)
Resolvable bool // true if the API supports name-to-ID resolution for this type
Columns []string // most important attributes for display (nil = auto-detect)
ExcludeColumns []string // attributes to exclude from display
}
Resource describes a known API resource type.
func ByIDPrefix ¶
ByIDPrefix scans the registry for a resource whose IDPrefix matches the beginning of value. Returns nil if no match is found or if value is empty.