{"modulePath":"github.com/oxidecomputer/packer-plugin-oxide","version":"v0.9.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package image\n\n## Types\n\n```go\ntype Config struct {\n\t// Oxide API URL (e.g., `https://oxide.sys.example.com`). If not specified,\n\t// this defaults to the value of the `OXIDE_HOST` environment variable. When\n\t// specified, `token` must be specified. Conflicts with `profile`.\n\tHost string `mapstructure:\"host\" required:\"false\"`\n\n\t// Oxide API token. If not specified, this defaults to the value of the\n\t// `OXIDE_TOKEN` environment variable. When specified, `host` must be specified.\n\t// Conflicts with `profile`.\n\tToken string `mapstructure:\"token\" required:\"false\"`\n\n\t// Oxide credentials profile. If not specified, this defaults to the value of\n\t// the `OXIDE_PROFILE` environment variable. Conflicts with `host` and `token`.\n\tProfile string `mapstructure:\"profile\" required:\"false\"`\n\n\t// Skip TLS certificate verification when connecting to the Oxide API.\n\t// Defaults to `false`.\n\tInsecureSkipVerify bool `mapstructure:\"insecure_skip_verify\" required:\"false\"`\n\n\t// Name of the image to fetch.\n\tName string `mapstructure:\"name\" required:\"true\"`\n\n\t// Name or ID of the project containing the image to fetch. Leave blank to fetch\n\t// a silo image instead of a project image.\n\tProject string `mapstructure:\"project\"`\n}\n```\nThe configuration arguments for the data source. Arguments can either be required or optional.\n\n```go\nfunc (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }\n```\nFlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a \\`mapstructure:,squash\\` tag are bubbled up.\n\n```go\ntype Datasource struct {\n\t// contains filtered or unexported fields\n}\n```\nThe \\`oxide-image\\` data source fetches \\[Oxide]([https://oxide.computer](https://oxide.computer)) image information for use in a Packer build. The image can be a project image or silo image.\n\n```go\nfunc (d *Datasource) ConfigSpec() hcldec.ObjectSpec\n```\nConfigSpec returns the HCL specification that Packer uses to validate and configure this plugin component.\n\n```go\nfunc (d *Datasource) Configure(args ...any) error\n```\nConfigure decodes the configuration for this plugin component, checks whether the configuration is valid, and stores any necessary state for future methods to use during execution.\n\n```go\nfunc (d *Datasource) Execute() (cty.Value, error)\n```\nExecute fetches image information from the Oxide API and returns that information in the format specified by \\[OutputSpec].\n\n```go\nfunc (d *Datasource) OutputSpec() hcldec.ObjectSpec\n```\nOutputSpec returns the HCL specification that Packer uses to populate output values for this plugin component.\n\n```go\ntype DatasourceOutput struct {\n\t// ID of the image that was fetched.\n\tImageID string `mapstructure:\"image_id\"`\n}\n```\nThe outputs returned by this data source component.\n\n```go\nfunc (*DatasourceOutput) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }\n```\nFlatMapstructure returns a new FlatDatasourceOutput. FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput. Where the contents a fields with a \\`mapstructure:,squash\\` tag are bubbled up.\n\n```go\ntype FlatConfig struct {\n\tHost               *string `mapstructure:\"host\" required:\"false\" cty:\"host\" hcl:\"host\"`\n\tToken              *string `mapstructure:\"token\" required:\"false\" cty:\"token\" hcl:\"token\"`\n\tProfile            *string `mapstructure:\"profile\" required:\"false\" cty:\"profile\" hcl:\"profile\"`\n\tInsecureSkipVerify *bool   `mapstructure:\"insecure_skip_verify\" required:\"false\" cty:\"insecure_skip_verify\" hcl:\"insecure_skip_verify\"`\n\tName               *string `mapstructure:\"name\" required:\"true\" cty:\"name\" hcl:\"name\"`\n\tProject            *string `mapstructure:\"project\" cty:\"project\" hcl:\"project\"`\n}\n```\nFlatConfig is an auto-generated flat version of Config. Where the contents of a field with a \\`mapstructure:,squash\\` tag are bubbled up.\n\n```go\nfunc (*FlatConfig) HCL2Spec() map[string]hcldec.Spec\n```\nHCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.\n\n```go\ntype FlatDatasourceOutput struct {\n\tImageID *string `mapstructure:\"image_id\" cty:\"image_id\" hcl:\"image_id\"`\n}\n```\nFlatDatasourceOutput is an auto-generated flat version of DatasourceOutput. Where the contents of a field with a \\`mapstructure:,squash\\` tag are bubbled up.\n\n```go\nfunc (*FlatDatasourceOutput) HCL2Spec() map[string]hcldec.Spec\n```\nHCL2Spec returns the hcl spec of a DatasourceOutput. This spec is used by HCL to read the fields of DatasourceOutput. The decoded values from this spec will then be applied to a FlatDatasourceOutput.\n\n","path":"github.com/oxidecomputer/packer-plugin-oxide/component/data-source/image","name":"image","synopsis":"","isRedistributable":true}
