Documentation ¶
Index ¶
- Variables
- func AllValid(functions ...schema.SchemaValidateDiagFunc) schema.SchemaValidateDiagFunc
- func AllowedDataUnitSuffix(suffixes ...byte) schema.SchemaValidateDiagFunc
- func CheckBoolAttribute(t *testing.T, attributeName string, found bool, stored string) bool
- func CheckImmutableFields(ctx context.Context, d *schema.ResourceData, fieldNames ...string) error
- func CheckImmutableFieldsExcept(ctx context.Context, d *schema.ResourceData, fieldNames ...string) error
- func CheckStrAttribute(t *testing.T, attributeName, found, stored string) bool
- func CheckTestSkip(t *testing.T)
- func ConvertDataUnitsToInt64(number string, factor int) (int64, error)
- func DataUnitsBeetween(min, max int64, factor int) schema.SchemaValidateDiagFunc
- func GetDiffSuppressForDataUnits(factor int) schema.SchemaDiffSuppressFunc
- func GetIdForDataSource() string
- func IsAddressInPrefix(addr, prefix string) bool
- func IsValidAddress(addr string) bool
- func IsValidCidr(prefix string) bool
- func MinutesToStringISO8601(minutes int) string
- func ParseHumanReadableTimePeriodIntoMinutes(s string) (int, error)
- func ParseSelfLink(selfLink string, orderedRequiredGroupNamesInPath []string) (map[string]string, error)
- func ProcessClientError(ctx context.Context, op string, err error) diag.Diagnostics
- func Retry(ctx context.Context, retryTime time.Duration, backoffFactor float32, ...) error
- func StringISO8601MinutesToInt(s string) (int, error)
- func StringIsInt64(value any, p cty.Path) diag.Diagnostics
- func TestCheckDataSource(dataSourceType, dataSourceName, listFieldName string, ...) resource.TestCheckFunc
- func TestCheckDataSourceExact(dataSourceType, dataSourceName, listFieldName string, ...) resource.TestCheckFunc
- func TestCheckDataSourceNotHave(dataSourceType, dataSourceName, listFieldName string, ...) resource.TestCheckFunc
- func TraceError(ctx context.Context, err error)
- func TraceOperation(ctx context.Context, op *hmrest.Operation, userMessage string)
- func TracePatch(ctx context.Context, resourceType string, resourceName string, ...)
- func WaitOnOperation(ctx context.Context, op *hmrest.Operation, client *hmrest.APIClient) (succeeded bool, err error)
- type RestError
Constants ¶
This section is empty.
Variables ¶
var ( ErrWrongHumanReadableFormat = errors.New("wrong format, expected human-readable time period (e.g. 2d, 3w5h, 1Y32D)") ErrWrongISO8601MinutesFormat = errors.New("wrong format, expected ISO8601 minutes (e.g. PT10M)") )
var ErrImmutableFieldChanged error = errors.New("attempt to update an immutable field")
Functions ¶
func AllValid ¶ added in v1.0.12
func AllValid(functions ...schema.SchemaValidateDiagFunc) schema.SchemaValidateDiagFunc
func AllowedDataUnitSuffix ¶ added in v1.0.12
func AllowedDataUnitSuffix(suffixes ...byte) schema.SchemaValidateDiagFunc
func CheckBoolAttribute ¶ added in v1.0.12
func CheckImmutableFields ¶ added in v1.0.16
func CheckImmutableFieldsExcept ¶ added in v1.0.12
func CheckStrAttribute ¶ added in v1.0.12
func CheckTestSkip ¶ added in v1.0.16
func ConvertDataUnitsToInt64 ¶ added in v1.0.12
func DataUnitsBeetween ¶ added in v1.0.12
func DataUnitsBeetween(min, max int64, factor int) schema.SchemaValidateDiagFunc
func GetDiffSuppressForDataUnits ¶ added in v1.0.12
func GetDiffSuppressForDataUnits(factor int) schema.SchemaDiffSuppressFunc
func GetIdForDataSource ¶ added in v1.0.12
func GetIdForDataSource() string
func IsAddressInPrefix ¶ added in v1.0.12
func IsValidAddress ¶ added in v1.0.12
func IsValidCidr ¶ added in v1.0.16
func MinutesToStringISO8601 ¶ added in v1.0.12
func ParseHumanReadableTimePeriodIntoMinutes ¶ added in v1.0.12
func ParseSelfLink ¶ added in v1.0.16
func ParseSelfLink(selfLink string, orderedRequiredGroupNamesInPath []string) (map[string]string, error)
Generic function for parsing self links. We assume that this helper function is called with ordered list of resource group names
func ProcessClientError ¶ added in v1.0.1
func Retry ¶
func Retry(ctx context.Context, retryTime time.Duration, backoffFactor float32, attemptLimit int, retryContext string, f func() (stop bool, err error)) error
Runs f in a loop if it has failed, until attempts reaches attemptLimit retryTime is a duration to cooldown between attempts retryContext is a string that is included in log output backoffFactor is a float that determines how much to increase retryTime if backoffFactor is 0.0, then there is no backoff increase if backoffFactor is 1.0, then there is a 100% increase, so it doubles each time if backoffFactor is 0.5, then there is a 50% increase, ie maybe 100, then 150, then 225... f returns a bool (stop) if that is true, we won't retry anymore
func StringISO8601MinutesToInt ¶ added in v1.0.12
func StringIsInt64 ¶ added in v1.0.16
func StringIsInt64(value any, p cty.Path) diag.Diagnostics
func TestCheckDataSource ¶ added in v1.0.12
func TestCheckDataSource( dataSourceType, dataSourceName, listFieldName string, items []map[string]interface{}, ) resource.TestCheckFunc
func TestCheckDataSourceExact ¶ added in v1.0.12
func TestCheckDataSourceExact( dataSourceType, dataSourceName, listFieldName string, items []map[string]interface{}, ) resource.TestCheckFunc
func TestCheckDataSourceNotHave ¶ added in v1.0.16
func TestCheckDataSourceNotHave( dataSourceType, dataSourceName, listFieldName string, items []map[string]interface{}, ) resource.TestCheckFunc
func TraceOperation ¶ added in v1.0.1
func TracePatch ¶ added in v1.0.12
func WaitOnOperation ¶ added in v1.0.1
func WaitOnOperation(ctx context.Context, op *hmrest.Operation, client *hmrest.APIClient) (succeeded bool, err error)
Wait on an operation until its status reaches Succeeded (or Completed) or Failed. Return succeeded = true if status reaches Succeeded (or Completed), Failed if status reached Failed, and err otherwise. On return,
op will be up to date with the most recent GET of the operation, EVEN when we're returning an error. if err != nil, then we have an error. Ignore succeeded (it will be false, but it doesn't mean the operation failed.) If err == nil, then check succeeded. It is true iff (op.Status == "Succeeded" || op.Status == "Completed") && op.Status != "Failed"