Documentation ¶
Index ¶
- Variables
- func DiffSuppressForHumanReadableTimePeriod(k, old, new string, d *schema.ResourceData) bool
- func DummyInvokeWriteAPI(ctx context.Context, client *hmrest.APIClient, body RequestSpec) (operation *hmrest.Operation, err error)
- func GetHomeConfigPath() (string, error)
- func IsValidAddress(v interface{}, path cty.Path) diag.Diagnostics
- func IsValidCidr(v interface{}, path cty.Path) diag.Diagnostics
- func IsValidIQN(v interface{}, path cty.Path) diag.Diagnostics
- func IsValidLocalRetention(v interface{}, path cty.Path) diag.Diagnostics
- func IsValidOptionalCidr(v interface{}, path cty.Path) diag.Diagnostics
- func MakeDummyCreateOperation(resourceId string) *hmrest.Operation
- func NewHMClient(ctx context.Context, ...) (*hmrest.APIClient, error)
- func NewHMClientWithAccessToken(ctx context.Context, host, accessToken string) (*hmrest.APIClient, error)
- func Provider() *schema.Provider
- type Auth
- type BaseDataSourceFunctions
- type BaseResourceFunctions
- type BaseResourceProvider
- func (p *BaseResourceProvider) ImportResource(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (ds []*schema.ResourceData, err error)
- func (p *BaseResourceProvider) PrepareCreate(ctx context.Context, d *schema.ResourceData) (fn InvokeWriteAPI, post ResourcePost, err error)
- func (p *BaseResourceProvider) PrepareDelete(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (fn InvokeWriteAPI, err error)
- func (p *BaseResourceProvider) PrepareUpdate(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (fn InvokeWriteAPI, patches []ResourcePatch, err error)
- func (p *BaseResourceProvider) ReadResource(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (err error)
- type DataSource
- type InvokeWriteAPI
- type ProfileConfig
- type RequestSpec
- type ResourcePatch
- type ResourcePost
- type ResourceProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoRequiredAuthFields = errors.New("profile does not have required auth fields") ErrNoDefaultProfileField = errors.New("config does not have required field `default_profile`") ErrNoProfilesField = errors.New("config does not have required field `profiles`") ErrNoProfileExists = errors.New("profile does not exist") ErrNoProfileEndpointField = errors.New("profile does not have required field `endpoint`") )
View Source
var DummyOperation hmrest.Operation = hmrest.Operation{
Status: "Succeeded",
}
Functions ¶
func DiffSuppressForHumanReadableTimePeriod ¶ added in v1.0.12
func DiffSuppressForHumanReadableTimePeriod(k, old, new string, d *schema.ResourceData) bool
func DummyInvokeWriteAPI ¶ added in v1.0.16
func GetHomeConfigPath ¶ added in v1.0.16
func IsValidAddress ¶ added in v1.0.12
func IsValidAddress(v interface{}, path cty.Path) diag.Diagnostics
func IsValidCidr ¶ added in v1.0.16
func IsValidCidr(v interface{}, path cty.Path) diag.Diagnostics
func IsValidIQN ¶ added in v1.0.12
func IsValidIQN(v interface{}, path cty.Path) diag.Diagnostics
func IsValidLocalRetention ¶ added in v1.0.12
func IsValidLocalRetention(v interface{}, path cty.Path) diag.Diagnostics
func IsValidOptionalCidr ¶ added in v1.0.16
func IsValidOptionalCidr(v interface{}, path cty.Path) diag.Diagnostics
func MakeDummyCreateOperation ¶ added in v1.0.16
func NewHMClient ¶
func NewHMClientWithAccessToken ¶ added in v1.0.16
Types ¶
type Auth ¶ added in v1.0.16
type Auth struct { IssuerId string `json:"issuer_id,omitempty"` PrivateKeyFile string `json:"private_pem_file,omitempty"` TokenEndpoint string `json:"token_endpoint,omitempty"` AccessToken string `json:"access_token,omitempty"` PrivateKey string `json:"private_key,omitempty"` PrivateKeyPassword string `json:"private_key_password,omitempty"` }
type BaseDataSourceFunctions ¶ added in v1.0.12
type BaseDataSourceFunctions struct { *schema.Resource DataSourceKind string DataSource DataSource }
func NewBaseDataSourceFunctions ¶ added in v1.0.12
func NewBaseDataSourceFunctions(resourceKind string, dataSource DataSource, dsSchema map[string]*schema.Schema) *BaseDataSourceFunctions
type BaseResourceFunctions ¶
type BaseResourceFunctions struct { *schema.Resource ResourceKind string // We're for volume, tenant space, storage class, etc. More likely to come. Provider ResourceProvider }
Implements interface to Terraform: resource-CRUD
func NewBaseResourceFunctions ¶
func NewBaseResourceFunctions(resourceKind string, provider ResourceProvider) *BaseResourceFunctions
type BaseResourceProvider ¶
type BaseResourceProvider struct {
ResourceKind string
}
Actually, an empty implementation which returns "not implemented" errors. :-)
func (*BaseResourceProvider) ImportResource ¶ added in v1.0.16
func (p *BaseResourceProvider) ImportResource(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (ds []*schema.ResourceData, err error)
func (*BaseResourceProvider) PrepareCreate ¶
func (p *BaseResourceProvider) PrepareCreate(ctx context.Context, d *schema.ResourceData) (fn InvokeWriteAPI, post ResourcePost, err error)
func (*BaseResourceProvider) PrepareDelete ¶
func (p *BaseResourceProvider) PrepareDelete(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (fn InvokeWriteAPI, err error)
func (*BaseResourceProvider) PrepareUpdate ¶
func (p *BaseResourceProvider) PrepareUpdate(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (fn InvokeWriteAPI, patches []ResourcePatch, err error)
func (*BaseResourceProvider) ReadResource ¶
func (p *BaseResourceProvider) ReadResource(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (err error)
type DataSource ¶ added in v1.0.12
type InvokeWriteAPI ¶
type InvokeWriteAPI func(ctx context.Context, client *hmrest.APIClient, body RequestSpec) (operation *hmrest.Operation, err error)
type InvokeReadMultiAPI func(ctx context.Context, client *hmrest.APIClient) (resource []interface{}, err error) type InvokeReadSingleAPI func(ctx context.Context, client *hmrest.APIClient) (resource interface{}, err error)
func MakeDummyCreateInvokeWriteAPI ¶ added in v1.0.16
func MakeDummyCreateInvokeWriteAPI(resourceId string) InvokeWriteAPI
type ProfileConfig ¶ added in v1.0.16
func GetProfileConfig ¶ added in v1.0.16
func GetProfileConfig(path string, profileName string) (ProfileConfig, error)
type RequestSpec ¶
type RequestSpec interface{}
type ResourcePatch ¶
type ResourcePatch interface { }
type ResourcePost ¶
type ResourcePost interface { }
type ResourceProvider ¶
type ResourceProvider interface { // PrepareCreate returns a function which will call the Create REST API on this object and return an operation; // also returns the post body to pass to that function. Invoke the function using the post body. PrepareCreate(ctx context.Context, d *schema.ResourceData) (fn InvokeWriteAPI, post ResourcePost, err error) // ReadResource synchronously reads the resource via its REST API. ReadResource(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (err error) // PrepareUpdate returns a function which will call the Update REST API on this object and return an operation. // Invoke it with each of the patches. PrepareUpdate(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (fn InvokeWriteAPI, patches []ResourcePatch, err error) // PrepareDelete returns a function which will call the Delete REST API on this object and return an operation. Invoke it. PrepareDelete(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (fn InvokeWriteAPI, err error) // ResourceImporter is a function which is called when Terraform is importing a resource. ImportResource(ctx context.Context, client *hmrest.APIClient, d *schema.ResourceData) (ds []*schema.ResourceData, err error) }
This is what you need to implement as the owner of a resource. Use the BaseResourceFunctions to build a schema.
Source Files ¶
- api_client.go
- array.go
- array_data_source.go
- availability_zone.go
- availability_zone_data_source.go
- config.go
- constant.go
- data_source_functions.go
- dummies.go
- hardware_type_data_source.go
- host_access_policy.go
- host_access_policy_data_source.go
- network_interface.go
- network_interface_data_source.go
- network_interface_group.go
- network_interface_group_data_source.go
- placement_group.go
- placement_group_data_source.go
- protection_policy.go
- protection_policy_data_source.go
- provider.go
- region.go
- region_data_source.go
- resource_functions.go
- role_assignment.go
- role_data_source.go
- snapshot.go
- snapshot_data_source.go
- storage_class.go
- storage_class_data_source.go
- storage_endpoint.go
- storage_endpoint_data_source.go
- storage_service.go
- storage_service_data_source.go
- tenant.go
- tenant_data_source.go
- tenant_space.go
- tenant_space_data_source.go
- user_data_source.go
- validation.go
- volume.go
- volume_data_source.go
- volume_snapshot_data_source.go
Click to show internal directories.
Click to hide internal directories.