Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDBSystemResource(d *schema.ResourceData, sync ResourceCreator) (e error)
- func CreateResource(d *schema.ResourceData, sync ResourceCreator) (e error)
- func DeleteResource(d *schema.ResourceData, sync ResourceDeleter) (e error)
- func EqualIgnoreCaseSuppressDiff(key string, old string, new string, d *schema.ResourceData) bool
- func FieldDeprecated(deprecatedFieldName string) string
- func FieldDeprecatedAndOverridenByAnother(deprecatedFieldName string, newFieldName string) string
- func FieldDeprecatedForAnother(deprecatedFieldName string, newFieldName string) string
- func FilterMissingResourceError(sync ResourceVoider, err *error)
- func GenerateDataSourceID() string
- func LoadBalancerResourceGet(client *oci_load_balancer.LoadBalancerClient, d *schema.ResourceData, ...) (id string, stillWorking bool, err error)
- func LoadBalancerResourceID(res interface{}, workReq *oci_load_balancer.WorkRequest) (id *string, workReqSucceeded bool)
- func LoadBalancerWaitForWorkRequest(client *oci_load_balancer.LoadBalancerClient, d *schema.ResourceData, ...) error
- func NormalizeBoolString(v string) (string, error)
- func ReadResource(sync ResourceReader) (e error)
- func SetToStrings(volumeIdsSet *schema.Set) []string
- func StringsToSet(ss []string) *schema.Set
- func UpdateResource(d *schema.ResourceData, sync ResourceUpdater) (e error)
- func WaitForResourceCondition(s ResourceFetcher, resourceChangedFunc func() bool, timeout time.Duration) error
- type BaseCrud
- type ExtraWaitPostCreateDelete
- type ResourceCreator
- type ResourceDataWriter
- type ResourceDeleter
- type ResourceFetcher
- type ResourceReader
- type ResourceUpdater
- type ResourceVoider
- type StatefulResource
- type StatefullyCreatedResource
- type StatefullyDeletedResource
- type StatefullyUpdatedResource
- type SynchronizedResource
Constants ¶
const (
FAILED = "FAILED"
)
Variables ¶
var ( FifteenMinutes = 15 * time.Minute TwoHours = 120 * time.Minute ZeroTime time.Duration = 0 DefaultTimeout = &schema.ResourceTimeout{ Create: &FifteenMinutes, Update: &FifteenMinutes, Delete: &FifteenMinutes, } )
Functions ¶
func CreateDBSystemResource ¶ added in v1.0.15
func CreateDBSystemResource(d *schema.ResourceData, sync ResourceCreator) (e error)
func CreateResource ¶
func CreateResource(d *schema.ResourceData, sync ResourceCreator) (e error)
func DeleteResource ¶
func DeleteResource(d *schema.ResourceData, sync ResourceDeleter) (e error)
DeleteResource requests a Delete(). If the resource deletes statefully (not immediately), poll State to ensure: () -> Pending -> Deleted. Finally, sets the ResourceData state to empty.
func FieldDeprecated ¶
func FilterMissingResourceError ¶ added in v1.0.8
func FilterMissingResourceError(sync ResourceVoider, err *error)
func GenerateDataSourceID ¶
func GenerateDataSourceID() string
GenerateDataSourceID generates an ID for the data source based on the current time stamp.
func LoadBalancerResourceGet ¶ added in v1.0.11
func LoadBalancerResourceGet(client *oci_load_balancer.LoadBalancerClient, d *schema.ResourceData, wr *oci_load_balancer.WorkRequest, retryPolicy *oci_common.RetryPolicy) (id string, stillWorking bool, err error)
func LoadBalancerResourceID ¶ added in v1.0.11
func LoadBalancerResourceID(res interface{}, workReq *oci_load_balancer.WorkRequest) (id *string, workReqSucceeded bool)
func LoadBalancerWaitForWorkRequest ¶ added in v1.0.13
func LoadBalancerWaitForWorkRequest(client *oci_load_balancer.LoadBalancerClient, d *schema.ResourceData, wr *oci_load_balancer.WorkRequest, retryPolicy *oci_common.RetryPolicy) error
func NormalizeBoolString ¶
NormalizeBoolString parses a string value into a bool value, and if successful, formats it back into a string & throws an error otherwise. This allows for normalizing the different formats of valid bool strings (e.g. "1", "false", "TRUE", "F", etc.) to a uniform string representation of a boolean value ("true" & "false").
func ReadResource ¶
func ReadResource(sync ResourceReader) (e error)
func SetToStrings ¶
SetToString encodes an *schema.Set into an []string honoring the structure for the schema
func StringsToSet ¶
stringsToSet encodes an []string into a *schema.Set in the appropriate structure for the schema
func UpdateResource ¶
func UpdateResource(d *schema.ResourceData, sync ResourceUpdater) (e error)
func WaitForResourceCondition ¶
func WaitForResourceCondition(s ResourceFetcher, resourceChangedFunc func() bool, timeout time.Duration) error
WaitForResourceCondition polls on a resource, waiting for it to reach a specified condition. This is done with exponential backoff. The terminating condition is specified as a boolean function; and this will return a timeout error if the specified condition isn't reached within the specified timeout period.
Types ¶
type BaseCrud ¶
type BaseCrud struct { D *schema.ResourceData Mutex *sync.Mutex }
type ExtraWaitPostCreateDelete ¶ added in v1.0.11
Some resources in the oracle API are removed asynchronously, so even after they claim to be gone, other dependencies haven't been notified of that fact. This facility allows us to add an artificial delay for resources that need a little time to let the oracle API backend catch up with reality.
type ResourceCreator ¶
type ResourceCreator interface { ResourceDataWriter // ID identifies the resource, or a work request to create the resource. ID() string Create() error }
ResourceCreator may create a BareMetal resource and populate into ResourceData state by using CreateResource()
type ResourceDataWriter ¶
type ResourceDataWriter interface { ResourceVoider // SetData populates ResourceData state from current // BareMetal resource SetData() }
ResourceDataWriter populates ResourceData state from the current BareMetal resource
type ResourceDeleter ¶
type ResourceDeleter interface { ResourceVoider // ID identifies the resource, or a work request to create the resource. ID() string Delete() error }
Deletes a BareMetal entity
type ResourceFetcher ¶
type ResourceFetcher interface { // Get should update the s.Resource, and is used by crud.ReadResource() to populate s.D // Get() may expect s.D.Id() to be set, but not s.Resource, or anything else in s.D Get() error }
Gets the current BareMetal Resource
type ResourceReader ¶
type ResourceReader interface { ResourceFetcher ResourceDataWriter }
ResourceReader get BareMetal Resource and updated ResourceData
type ResourceUpdater ¶
type ResourceUpdater interface { ResourceDataWriter Update() error }
Updates a BareMetal entity to match ResourceData
type ResourceVoider ¶
type ResourceVoider interface { // VoidState sets ResourceData ID to "". To be called when // the resource is gone. VoidState() }
ResourceVoider may set its ResourceData state to empty.
type StatefulResource ¶
type StatefulResource interface { ResourceReader State() string // contains filtered or unexported methods }
type StatefullyCreatedResource ¶
type StatefullyCreatedResource interface { StatefulResource CreatedPending() []string CreatedTarget() []string }
type StatefullyDeletedResource ¶
type StatefullyDeletedResource interface { StatefulResource DeletedPending() []string DeletedTarget() []string }
type StatefullyUpdatedResource ¶ added in v1.0.13
type StatefullyUpdatedResource interface { StatefulResource UpdatedPending() []string UpdatedTarget() []string }
type SynchronizedResource ¶
This provides a mechanism for synchronizing CRUD operations from different resources that may concurrently modify the same resource. Implementing these interfaces will cause the Create/Update/Delete operations to wait on the lock before starting those operations.