Documentation
¶
Index ¶
- Constants
- Variables
- func DataResourceIdHash(ids []string) string
- func Error(msg string, args ...interface{}) error
- func GetTags(d *schema.ResourceData, k string) map[string]string
- func IsContains(array interface{}, value interface{}) bool
- func IsExpectError(err error, expectError []string) bool
- func LogApiRequest(ctx context.Context, action string, request interface{}, response interface{}, ...)
- func LogElapsed(ctx context.Context, mark ...string) func()
- func NonEmptySetFieldValidFunc(keys ...string) schema.CustomizeDiffFunc
- func ParseResourceId(id string, length int) (parts []string, err error)
- func ParseTagChanges(d *schema.ResourceData) (map[string]interface{}, []string)
- func QueryAllPaginatedResource[T any](ctx context.Context, queryFunc QueryPaginatedFunc[T]) ([]T, error)
- func RetryError(ctx context.Context, err error, additionRetryableError ...string) *resource.RetryError
- func String(s string) int
- func TagsToMap(tags interface{}) (map[string]interface{}, error)
- func ToIntList(value []interface{}) []int
- func ToJsonString(data interface{}) string
- func ToStringList(value []interface{}) []string
- func ValidateCIDRNetworkAddress(v interface{}, k string) (ws []string, errors []error)
- func WriteToFile(filePath string, data interface{}) error
- type GoRoutineLimit
- type QueryPaginatedFunc
Constants ¶
View Source
const ( PROVIDER_WRITE_RETRY_TIMEOUT = "ZENLAYERCLOUD_WRITE_RETRY_TIMEOUT" PROVIDER_READ_RETRY_TIMEOUT = "ZENLAYERCLOUD_READ_RETRY_TIMEOUT" PROVIDER_BMC_CREATE_TIMEOUT = "ZENLAYERCLOUD_BMC_CREATE_TIMEOUT" PROVIDER_BMC_UPDATE_TIMEOUT = "ZENLAYERCLOUD_BMC_UPDATE_TIMEOUT" PROVIDER_VM_CREATE_TIMEOUT = "ZENLAYERCLOUD_VM_CREATE_TIMEOUT" PROVIDER_VM_UPDATE_TIMEOUT = "ZENLAYERCLOUD_VM_UPDATE_TIMEOUT" PROVIDER_ZGA_CREATE_TIMEOUT = "ZENLAYERCLOUD_ZGA_CREATE_TIMEOUT" PROVIDER_ZGA_UPDATE_TIMEOUT = "ZENLAYERCLOUD_ZGA_UPDATE_TIMEOUT" )
View Source
const ( ServiceNotAvailable = "SERVICE_TEMPORARY_UNAVAILABLE" InternalServerError = "INTERNAL_SERVER_ERROR" ReadTimedOut = "REQUEST_TIMED_OUT" ResourceNotFound = "OPERATION_FAILED_RESOURCE_NOT_FOUND" OperationTimeout = "INVALID_OPERATION_TIMEOUT" )
Variables ¶
View Source
var BmcCreateTimeout = time.Duration(getEnvDefault(PROVIDER_BMC_CREATE_TIMEOUT, 90)) * time.Minute
View Source
var BmcUpdateTimeout = time.Duration(getEnvDefault(PROVIDER_BMC_UPDATE_TIMEOUT, 90)) * time.Minute
View Source
var ReadRetryTimeout = time.Duration(readRetry) * time.Minute
View Source
var VmCreateTimeout = time.Duration(getEnvDefault(PROVIDER_VM_CREATE_TIMEOUT, 90)) * time.Minute
View Source
var VmUpdateTimeout = time.Duration(getEnvDefault(PROVIDER_VM_UPDATE_TIMEOUT, 90)) * time.Minute
View Source
var ZgaCreateTimeout = time.Duration(getEnvDefault(PROVIDER_ZGA_CREATE_TIMEOUT, 90)) * time.Minute
View Source
var ZgaUpdateTimeout = time.Duration(getEnvDefault(PROVIDER_ZGA_UPDATE_TIMEOUT, 90)) * time.Minute
Functions ¶
func DataResourceIdHash ¶
func IsContains ¶
func IsContains(array interface{}, value interface{}) bool
func IsExpectError ¶
func LogApiRequest ¶
func LogElapsed ¶
func NonEmptySetFieldValidFunc ¶
func NonEmptySetFieldValidFunc(keys ...string) schema.CustomizeDiffFunc
func ParseTagChanges ¶ added in v0.2.18
func ParseTagChanges(d *schema.ResourceData) (map[string]interface{}, []string)
func QueryAllPaginatedResource ¶
func QueryAllPaginatedResource[T any](ctx context.Context, queryFunc QueryPaginatedFunc[T]) ([]T, error)
func RetryError ¶
func ToJsonString ¶
func ToJsonString(data interface{}) string
func ToStringList ¶
func ToStringList(value []interface{}) []string
func ValidateCIDRNetworkAddress ¶
ValidateCIDRNetworkAddress ensures that the string value is a valid CIDR that represents a network address - it adds an error otherwise
func WriteToFile ¶
Types ¶
type GoRoutineLimit ¶
type GoRoutineLimit struct {
Count int
Chan chan struct{}
}
func NewGoRoutine ¶
func NewGoRoutine(num int) *GoRoutineLimit
func (*GoRoutineLimit) Run ¶
func (g *GoRoutineLimit) Run(f func())
Click to show internal directories.
Click to hide internal directories.