Documentation ¶
Index ¶
- Constants
- Variables
- func OperationPath(base_path string, step string) string
- type Install
- func (i *Install) Delete(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, model any)
- func (i *Install) EnsureConfig(ctx context.Context, diags *diag.Diagnostics, plan *tfsdk.Plan, ...)
- func (i *Install) Read(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, json any, ...)
- func (i *Install) Rollback(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, model any)
- func (i *Install) Stage(ctx context.Context, diags *diag.Diagnostics, plan *tfsdk.Plan, ...)
- func (i *Install) UpsertFromStage(ctx context.Context, diags *diag.Diagnostics, plan *tfsdk.Plan, ...)
- type ReadResponse
- type RootInstall
- func (i *RootInstall) Create(ctx context.Context, diags *diag.Diagnostics, plan *tfsdk.Plan, ...)
- func (i *RootInstall) Delete(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, model any)
- func (i *RootInstall) Read(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, json any, ...)
Constants ¶
const ( Config = "configure" Verify = "verify" IamAssessment = "iam-assessment" IamWrite = "iam-write" SingletonKey = "_" StateMarkdownDescription = `` /* 228-byte string literal not displayed */ )
Variables ¶
var InstallSteps = []string{Verify, Config}
Order matters here; components installed in this order.
Functions ¶
func OperationPath ¶
Types ¶
type Install ¶
type Install struct { // This Integration's key Integration string // This Component's key Component string // The provider internal data object ProviderData *internal.P0ProviderData // Extract the item id from the TF state model, or nil if it can not be extracted GetId func(data any) *string // Convert the API response to the single item's JSON (should just equate to returning &data.Item) GetItemJson func(readJson any) any // Convert a pointer to the item's JSON model to a pointer to the TF state model. // Returns nil if the JSON can not be converted. FromJson func(ctx context.Context, diags *diag.Diagnostics, id string, json any) any // Convert a pointer to the TF state model to a pointer to an item's JSON model ToJson func(data any) any }
func (*Install) Delete ¶
func (i *Install) Delete(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, model any)
Deletes the item from P0.
func (*Install) EnsureConfig ¶
func (i *Install) EnsureConfig(ctx context.Context, diags *diag.Diagnostics, plan *tfsdk.Plan, state *tfsdk.State, model any)
Ensures that the item's configuration has been created in P0. If the item's configuration already exists we'll ignore the error.
func (*Install) Read ¶
func (i *Install) Read(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, json any, model any)
Reads current item value.
'json' must be a pointer to a struct of form:
struct{ Item *ItemConfigurationJson `json:"item"` }
func (*Install) Rollback ¶
func (i *Install) Rollback(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, model any)
"Rollback" does not delete the item from P0; rather, it returns it to the "stage" state.
This prevents double-delete issues when the stage resource is also deleted.
func (*Install) Stage ¶
func (i *Install) Stage(ctx context.Context, diags *diag.Diagnostics, plan *tfsdk.Plan, state *tfsdk.State, json any, model any)
Places the item in the "stage" state in P0. To use, the item's TFSDK model must be passed. For example:
var data ItemConfigurationModel var json ConfigurationApiResponseJson
func (*Install) UpsertFromStage ¶
func (i *Install) UpsertFromStage(ctx context.Context, diags *diag.Diagnostics, plan *tfsdk.Plan, state *tfsdk.State, json any, model any)
Advances the item to "installed" state.
To use, the item's TFSDK model must be passed. For example:
var data ItemConfigurationModel var json ConfigurationApiResponseJson install.Upsert(ctx, &resp.Diagnostics, &req.Plan, &resp.State, &data)
type ReadResponse ¶
type ReadResponse struct {
Item *any
}
type RootInstall ¶ added in v0.5.0
type RootInstall struct { // This Integration's key Integration string // The provider internal data object ProviderData *internal.P0ProviderData // Convert a pointer to the item's JSON model to a pointer to the TF state model FromJson func(ctx context.Context, diags *diag.Diagnostics, json any) any // Convert a pointer to the TF state model to a pointer to an item's JSON model ToJson func(data any) any }
func (*RootInstall) Create ¶ added in v0.5.0
func (i *RootInstall) Create(ctx context.Context, diags *diag.Diagnostics, plan *tfsdk.Plan, state *tfsdk.State, json any, model any)
Creates the integration + root item in P0.
func (*RootInstall) Delete ¶ added in v0.5.0
func (i *RootInstall) Delete(ctx context.Context, diags *diag.Diagnostics, state *tfsdk.State, model any)
Deletes the integration from P0.