Documentation ¶
Index ¶
- Variables
- func CreateResource(d *schema.ResourceData, sync ResourceCreator) (e error)
- func DeleteResource(d *schema.ResourceData, sync ResourceDeleter) (e error)
- func FilterMissingResourceError(sync ResourceVoider, err *error)
- func ReadResource(sync ResourceReader) (e error)
- func UpdateResource(d *schema.ResourceData, sync ResourceUpdater) (e error)
- type BaseCrud
- type ExtraWaitPostDelete
- type IdentitySync
- type ResourceCreator
- type ResourceDataWriter
- type ResourceDeleter
- type ResourceFetcher
- type ResourceReader
- type ResourceUpdater
- type ResourceVoider
- type StatefulResource
- type StatefullyCreatedResource
- type StatefullyDeletedResource
Constants ¶
This section is empty.
Variables ¶
var ( FiveMinutes time.Duration = 5 * time.Minute TwoHours time.Duration = 120 * time.Minute DefaultTimeout = &schema.ResourceTimeout{ Create: &FiveMinutes, Update: &FiveMinutes, Delete: &FiveMinutes, } )
Functions ¶
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 FilterMissingResourceError ¶ added in v1.0.8
func FilterMissingResourceError(sync ResourceVoider, err *error)
func ReadResource ¶
func ReadResource(sync ResourceReader) (e error)
func UpdateResource ¶
func UpdateResource(d *schema.ResourceData, sync ResourceUpdater) (e error)
Types ¶
type BaseCrud ¶
type BaseCrud struct { D *schema.ResourceData Client client.BareMetalClient }
type ExtraWaitPostDelete ¶ added in v1.0.2
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 IdentitySync ¶
type IdentitySync struct{}
func (*IdentitySync) CreatedPending ¶
func (s *IdentitySync) CreatedPending() []string
func (*IdentitySync) CreatedTarget ¶
func (s *IdentitySync) CreatedTarget() []string
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 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 }