Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIProvider ¶
APIProvider returns a terraform.ResourceProvider.
Types ¶
type PluginConfigSchema ¶ added in v0.1.1
type PluginConfigSchema interface {
// Validate performs a check to confirm that the schema content is correct
Validate() error
// GetServiceConfig returns the service configuration for a given provider name
GetServiceConfig(providerName string) (ServiceConfiguration, error)
}
PluginConfigSchema defines the interface/expected behaviour for PluginConfigSchema implementations.
type PluginConfigSchemaV1 ¶ added in v0.1.1
type PluginConfigSchemaV1 struct {
Version string `yaml:"version"`
Services map[string]*ServiceConfigV1 `yaml:"services"`
}
PluginConfigSchemaV1 defines PluginConfigSchema version 1 Configuration example: version: '1' services:
monitor: swagger-url: http://monitor-api.com/swagger.json insecure_skip_verify: true cdn: swagger-url: https://cdn-api.com/swagger.json vm: swagger-url: http://vm-api.com/swagger.json
func NewPluginConfigSchemaV1 ¶ added in v0.1.1
func NewPluginConfigSchemaV1(version string, services map[string]*ServiceConfigV1) *PluginConfigSchemaV1
NewPluginConfigSchemaV1 creates a new PluginConfigSchemaV1 that implements PluginConfigSchema interface
func (*PluginConfigSchemaV1) GetServiceConfig ¶ added in v0.1.1
func (p *PluginConfigSchemaV1) GetServiceConfig(providerName string) (ServiceConfiguration, error)
GetServiceConfig returns the configuration for the given provider name
func (*PluginConfigSchemaV1) Validate ¶ added in v0.1.1
func (p *PluginConfigSchemaV1) Validate() error
Validate makes sure that schema data is correct
type PluginConfiguration ¶ added in v0.1.1
type PluginConfiguration struct {
// ProviderName defines the <provider_name> (should match the provider name of the terraform provider binary; terraform-provider-<provider_name>)
ProviderName string
// Configuration defines the reader that contains the plugin's external configuration (located at ~/.terraform.d/plugins)
// If the plugin configuration file is not present the OTF_VAR_<provider_name>_SWAGGER_URL environment variable will
// be required when invoking the openapi provider.
// If at runtime both the OTF_VAR_<provider_name>_SWAGGER_URL as well as the plugin configuration file are present
// the former takes preference. This allows the user to override the url specified in the configuration file with
// the value provided in the OTF_VAR_<provider_name>_SWAGGER_URL
Configuration io.Reader
}
PluginConfiguration defines the OpenAPI plugin's configuration
func NewPluginConfiguration ¶ added in v0.1.1
func NewPluginConfiguration(providerName string) (*PluginConfiguration, error)
NewPluginConfiguration creates a new PluginConfiguration
type ServiceConfigV1 ¶ added in v0.1.1
type ServiceConfigV1 struct {
// SwaggerURL defines where the swagger is located
SwaggerURL string `yaml:"swagger-url"`
// InsecureSkipVerify defines whether the internal http client used to fetch the swagger file should verify the server cert
// or not. This should only be used purposefully if the server is using a self-signed cert and only if the server is trusted
InsecureSkipVerify bool `yaml:"insecure_skip_verify"`
}
ServiceConfigV1 defines configuration for the service provider
func (*ServiceConfigV1) GetSwaggerURL ¶ added in v0.1.1
func (s *ServiceConfigV1) GetSwaggerURL() string
GetSwaggerURL returns the URL where the service swagger doc is exposed
func (*ServiceConfigV1) IsInsecureSkipVerifyEnabled ¶ added in v0.1.1
func (s *ServiceConfigV1) IsInsecureSkipVerifyEnabled() bool
IsInsecureSkipVerifyEnabled returns true if the given provider's service configuration has InsecureSkipVerify enabled; false otherwise
type ServiceConfiguration ¶ added in v0.1.1
type ServiceConfiguration interface {
// GetSwaggerURL returns the URL where the service swagger doc is exposed
GetSwaggerURL() string
// IsInsecureSkipVerifyEnabled returns true if the given provider's service configuration has InsecureSkipVerify enabled; false
// otherwise
IsInsecureSkipVerifyEnabled() bool
}
ServiceConfiguration defines the interface/expected behaviour for ServiceConfiguration implementations.