Documentation ¶
Overview ¶
Package helpers provides api errors helpers for the CloudAvenue Terraform Provider.
Package helpers provides auth helpers for the CloudAvenue Terraform Provider.
Package helpers provides configuration helpers for Terraform Provider.
Package helpers provides helpers for the CloudAvenue Terraform Provider.
Index ¶
Constants ¶
const (
// ForceNewDescription is the description for ForceNew.
ForceNewDescription = "Changes to this field will force a new resource to be created."
)
Variables ¶
This section is empty.
Functions ¶
func GetAuthContextWithTO ¶
GetAuthContextWithTO is a helper function to create the auth context with the token api and the terraform context with timeout.
func JobStateDone ¶
func JobStateDone() []string
JobStateDone is a helper function to return an array of done states.
func JobStatePending ¶
func JobStatePending() []string
JobStatePending is a helper function to return an array of pending states.
Types ¶
type APIError ¶
type APIError struct { cloudavenue.ApiError // contains filtered or unexported fields }
APIError is an error returned by the CloudAvenue API.
func CheckAPIError ¶
CheckAPIError checks the HTTP response for errors and returns an APIError with statusCode and model is the error is a cloudavenue.GenericSwaggerError type or only the error if not.
func (*APIError) GetStatusCode ¶
GetStatusCode returns the HTTP status code.
func (*APIError) GetSummary ¶
GetSummary returns a summary of the error.
func (*APIError) GetTerraformDiagnostic ¶
func (e *APIError) GetTerraformDiagnostic() diag.Diagnostic
GetTerraformDiagnostic returns a Terraform Diagnostic for the error.
func (*APIError) IsNotFound ¶
IsNotFound returns true if the error is a 404 Not Found error.
type JobStatusMessage ¶
type JobStatusMessage string
JobStatusMessage is a type for job status.
const ( // DONE is the done status message. DONE JobStatusMessage = "DONE" // FAILED is the failed status message. FAILED JobStatusMessage = "FAILED" // CREATED is the created status message. CREATED JobStatusMessage = "CREATED" // PENDING is the pending status message. PENDING JobStatusMessage = "PENDING" // INPROGRESS is the in progress status message. INPROGRESS JobStatusMessage = "IN_PROGRESS" // ERROR is the error status message. ERROR JobStatusMessage = "ERROR" )
func GetJobStatus ¶
func GetJobStatus( ctx context.Context, client *client.CloudAvenue, jobID string, ) (JobStatusMessage, error)
GetJobStatus is a helper function to get the status of a job.
func (JobStatusMessage) IsDone ¶
func (j JobStatusMessage) IsDone() bool
IsDone is a helper function to check if a job is done.
func (JobStatusMessage) String ¶
func (j JobStatusMessage) String() string
String is a stringer interface for jobStatus.