add GetSchema to provisioner interface

This commit is contained in:
James Bardin 2018-06-21 15:12:55 -04:00 committed by Martin Atkins
parent 12521366e1
commit 8c3c0418d4
1 changed files with 12 additions and 0 deletions

View File

@ -1,12 +1,16 @@
package provisioner package provisioner
import ( import (
"github.com/hashicorp/terraform/config/configschema"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
) )
// Interface is the set of methods required for a resource provisioner plugin. // Interface is the set of methods required for a resource provisioner plugin.
type Interface interface { type Interface interface {
// GetSchema returns the schema for the provisioner configuration.
GetSchema() GetSchemaResponse
// ValidateProvisionerConfig allows the provisioner to validate the // ValidateProvisionerConfig allows the provisioner to validate the
// configuration values. // configuration values.
ValidateProvisionerConfig(ValidateProvisionerConfigRequest) ValidateProvisionerConfigResponse ValidateProvisionerConfig(ValidateProvisionerConfigRequest) ValidateProvisionerConfigResponse
@ -30,6 +34,14 @@ type Interface interface {
Stop() error Stop() error
} }
type GetSchemaResponse struct {
// Provisioner contains the schema for this provisioner.
Provisioner *configschema.Block
// Diagnostics contains any warnings or errors from the method call.
Diagnostics tfdiags.Diagnostics
}
// UIOutput provides the Output method for resource provisioner // UIOutput provides the Output method for resource provisioner
// plugins to write any output to the UI. // plugins to write any output to the UI.
// //