Documentation ¶
Overview ¶
Copyright 2024. Clumio, Inc.
Index ¶
- Constants
- func CompareUnversionAttrDiff(req *models.UpdateProtectionGroupV1Request, ...) bool
- func DeletePolicy(idOrResourceName string, isResourceName bool) resource.TestCheckFunc
- func DeleteProtectionGroup(idOrResourceName string, isResourceName bool) resource.TestCheckFunc
- func GetFieldNameFromNestedBlockPath(req validator.SetRequest) string
- func GetSDKConfigForOU(clumioConfig sdkconfig.Config, organizationalUnitId string) sdkconfig.Config
- func GetStringPtr(v basetypes.StringValue) *string
- func GetStringPtrSliceFromStringSlice(input []string) []*string
- func ParseMessageFromApiError(apiError *apiutils.APIError) string
- func PollForProtectionGroup(ctx context.Context, id string, ...) (*models.ReadProtectionGroupResponse, error)
- func PollForProtectionGroupUpdate(ctx context.Context, id string, oldVersion *int64, ...) (*models.ReadProtectionGroupResponse, error)
- func PollTask(ctx context.Context, taskClient tasks.TasksV1Client, taskId string, ...) error
- func SliceDifferenceString(slice1 []string, slice2 []string) []string
- func SnakeCaseToCamelCase(key string) string
- func WrapSetValidator(validator validator.Set) validator.Set
- type ApiClient
- type WrapperSetValidator
Constants ¶
const ( ClumioApiToken = "CLUMIO_API_TOKEN" ClumioApiBaseUrl = "CLUMIO_API_BASE_URL" ClumioOrganizationalUnitContext = "CLUMIO_ORGANIZATIONAL_UNIT_CONTEXT" AwsRegion = "AWS_REGION" ClumioTestAwsAccountId = "CLUMIO_TEST_AWS_ACCOUNT_ID" ClumioTestAwsAccountId2 = "CLUMIO_TEST_AWS_ACCOUNT_ID2" ClumioTestIsSSOConfigured = "CLUMIO_TEST_IS_SSO_CONFIGURED" TaskSuccess = "completed" TaskAborted = "aborted" TaskFailed = "failed" TaskInProgress = "in_progress" // AWS Manual Connection Resources ClumioIAMRoleArn = "clumio_iam_role_arn" ClumioEventPubArn = "clumio_event_pub_arn" ClumioSupportRoleArn = "clumio_support_role_arn" CloudwatchRuleArn = "cloudwatch_rule_arn" CloudtrailRuleArn = "cloudtrail_rule_arn" ContinuousBackupsRoleArn = "continuous_backups_role_arn" SsmNotificationRoleArn = "ssm_notification_role_arn" Ec2SsmInstanceProfileArn = "ec2_ssm_instance_profile_arn" // Default Error Message NilErrorMessageSummary = "Unexpected API response" NilErrorMessageDetail = "An empty response was returned by the API" // Testing error format TestResultsNotMatchingError = "Results don't match.\nExpected: %v\nActual: %v" // Auth Error AuthError = "Unauthorized access. Please ensure that your credentials are valid and/or your account is active." )
Variables ¶
This section is empty.
Functions ¶
func CompareUnversionAttrDiff ¶ added in v0.7.0
func CompareUnversionAttrDiff(req *models.UpdateProtectionGroupV1Request, resp *models.ReadProtectionGroupResponse) bool
CompareUnversionAttrDiff returns a bool whether the given update request differ with response in unversioned attributes: name, description.
func DeletePolicy ¶ added in v0.6.0
func DeletePolicy(idOrResourceName string, isResourceName bool) resource.TestCheckFunc
DeletePolicy deletes the policy using the Clumio API. It takes as argument, either the resource name or the actual id of the policy.
func DeleteProtectionGroup ¶ added in v0.6.0
func DeleteProtectionGroup(idOrResourceName string, isResourceName bool) resource.TestCheckFunc
DeleteProtectionGroup deletes the protection group using the Clumio API. It takes as argument, either the resource name or the actual id of the policy.
func GetFieldNameFromNestedBlockPath ¶ added in v0.6.0
func GetFieldNameFromNestedBlockPath(req validator.SetRequest) string
Parses through the path of a nested block and returns the lowest level field name
func GetSDKConfigForOU ¶ added in v0.6.1
GetSDKConfigForOU returns a copy of the given SDK config with the OrganizationalUnitContext set to the specified organizationalUnitId.
func GetStringPtr ¶ added in v0.5.3
func GetStringPtr(v basetypes.StringValue) *string
GetStringPtr returns the ptr of the string if not null, otherwise return nil.
func GetStringPtrSliceFromStringSlice ¶ added in v0.5.1
GetStringPtrSliceFromStringSlice returns the string pointer slice from string slice.
func ParseMessageFromApiError ¶ added in v0.6.0
Parses the api error and returns the response in stringified format
func PollForProtectionGroup ¶ added in v0.6.1
func PollForProtectionGroup( ctx context.Context, id string, protectionGroup sdkclients.ProtectionGroupClient, timeout time.Duration, interval time.Duration) (*models.ReadProtectionGroupResponse, error)
PollForProtectionGroup polls till the protection group becomes available after create or update protection group as they are asynchronous operations.
func PollForProtectionGroupUpdate ¶ added in v0.7.0
func PollForProtectionGroupUpdate( ctx context.Context, id string, oldVersion *int64, updateReq *models.UpdateProtectionGroupV1Request, protectionGroup sdkclients.ProtectionGroupClient, timeout time.Duration, interval time.Duration) (*models.ReadProtectionGroupResponse, error)
PollForProtectionGroupUpdate polls till the protection group becomes available after create or update protection group as they are asynchronous operations.
func PollTask ¶
func PollTask(ctx context.Context, taskClient tasks.TasksV1Client, taskId string, timeout time.Duration, interval time.Duration) error
PollTask polls created tasks till it completes either with success, aborted, failed or it returns an error.
func SliceDifferenceString ¶ added in v0.5.1
SliceDifferenceString returns the slice difference in string slices.
func SnakeCaseToCamelCase ¶
function to convert string in snake case to camel case
Types ¶
type ApiClient ¶
type ApiClient struct {
ClumioConfig clumioConfig.Config
}
ApiClient defines the APIs/connections required by the resources.
type WrapperSetValidator ¶ added in v0.6.0
WrapperSetValidator acts as a wrapper and validates the input against the provider validator. If there's an error it returns the provided custom error message.
func (WrapperSetValidator) ValidateSet ¶ added in v0.6.0
func (v WrapperSetValidator) ValidateSet(ctx context.Context, req validator.SetRequest, res *validator.SetResponse)
ValidateSet runs validation logic on the provided request and adds diagnostics as required to the response