Documentation
¶
Index ¶
- Constants
- Variables
- func HecStatusCreate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) resource.StateRefreshFunc
- func HecStatusDelete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) resource.StateRefreshFunc
- func HecStatusPoll(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) resource.StateRefreshFunc
- func HecStatusRead(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) resource.StateRefreshFunc
- func HecStatusRetryTask(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack) resource.StateRefreshFunc
- func HecStatusRetryTaskComplete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) resource.StateRefreshFunc
- func HecStatusUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) resource.StateRefreshFunc
- func HecStatusVerifyUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) resource.StateRefreshFunc
- func ResourceHecToken() *schema.Resource
- func VerifyHecUpdate(patchRequest v2.PatchHECJSONRequestBody, hec v2.HecSpec) bool
- func WaitHecCreate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) error
- func WaitHecDelete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) error
- func WaitHecPoll(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) error
- func WaitHecRead(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) (*v2.HecSpec, error)
- func WaitHecRetryTask(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack) error
- func WaitHecRetryTaskComplete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) error
- func WaitHecUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) error
- func WaitVerifyHecUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, ...) error
- type HecBody
Constants ¶
const ( ResourceKey = "scp_hec_tokens" NameKey = "name" AllowedIndexesKey = "allowed_indexes" DefaultIndexKey = "default_index" DefaultSourceKey = "default_source" DefaultSourcetypeKey = "default_sourcetype" DisabledKey = "disabled" TokenKey = "token" UseAckKey = "use_ack" )
const (
DeploymentTaskFailedErr = "Retry of deployment task %s resulted in failed status upon completion"
)
Variables ¶
var GeneralRetryableStatusCodes = map[int]string{ http.StatusTooManyRequests: http.StatusText(429), }
Functions ¶
func HecStatusCreate ¶
func HecStatusCreate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, createHecRequest v2.CreateHECJSONRequestBody) resource.StateRefreshFunc
HecStatusCreate returns StateRefreshFunc that makes POST request and checks if response is accepted
func HecStatusDelete ¶
func HecStatusDelete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, hecName string) resource.StateRefreshFunc
HecStatusDelete returns StateRefreshFunc that makes DELETE request and checks if request was accepted
func HecStatusPoll ¶
func HecStatusPoll(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, hecName string, targetStatus []string, pendingStatus []string) resource.StateRefreshFunc
HecStatusPoll returns StateRefreshFunc that makes GET request and checks if response is desired target (200 for create and 404 for delete)
func HecStatusRead ¶
func HecStatusRead(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, hecName string) resource.StateRefreshFunc
HecStatusRead returns StateRefreshFunc that makes GET request, checks if request was successful, and returns hec response
func HecStatusRetryTask ¶ added in v1.2.0
func HecStatusRetryTask(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack) resource.StateRefreshFunc
HecStatusRetryTask returns StateRefreshFunc that makes POST request and checks if request was accepted
func HecStatusRetryTaskComplete ¶ added in v1.2.0
func HecStatusRetryTaskComplete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, deploymentId string) resource.StateRefreshFunc
HecStatusRetryTaskComplete returns StateRefreshFunc that makes GET request and checks if request was successful. If the request was successful, we return deployment info to access status
func HecStatusUpdate ¶
func HecStatusUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, patchHecRequest v2.PatchHECJSONRequestBody, hecName string) resource.StateRefreshFunc
HecStatusUpdate returns StateRefreshFunc that makes PATCH request and checks if request was accepted
func HecStatusVerifyUpdate ¶
func HecStatusVerifyUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, patchRequest v2.PatchHECJSONRequestBody, hecName string) resource.StateRefreshFunc
HecStatusVerifyUpdate returns a StateRefreshFunc that makes a GET request and checks to see if the hec fields matches those in patch request
func ResourceHecToken ¶
func VerifyHecUpdate ¶
func VerifyHecUpdate(patchRequest v2.PatchHECJSONRequestBody, hec v2.HecSpec) bool
VerifyHecUpdate is a helper to verify that the fields in patch request match fields in the hec response
func WaitHecCreate ¶
func WaitHecCreate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, createHecRequest v2.CreateHECJSONRequestBody) error
WaitHecCreate Handles retry logic for POST requests for create lifecycle function
func WaitHecDelete ¶
func WaitHecDelete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, hecName string) error
WaitHecDelete Handles retry logic for DELETE requests for the delete lifecycle function
func WaitHecPoll ¶
func WaitHecPoll(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, hecName string, targetStatus []string, pendingStatus []string) error
WaitHecPoll Handles retry logic for polling after POST and DELETE requests for create/delete lifecycle functions
func WaitHecRead ¶
func WaitHecRead(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, hecName string) (*v2.HecSpec, error)
WaitHecRead Handles retry logic for GET requests for the read lifecycle function
func WaitHecRetryTask ¶ added in v1.2.0
WaitHecRetryTask Handles retry logic for retrying a previously failed deployment task.
func WaitHecRetryTaskComplete ¶ added in v1.2.0
func WaitHecRetryTaskComplete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, deploymentId string) error
WaitHecRetryTaskComplete Handles retry logic for GET requests to check status of deployment task until completion
func WaitHecUpdate ¶
func WaitHecUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, patchRequest v2.PatchHECJSONRequestBody, hecName string) error
WaitHecUpdate Handles retry logic for PATCH requests for the update lifecycle function
func WaitVerifyHecUpdate ¶
func WaitVerifyHecUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, patchRequest v2.PatchHECJSONRequestBody, hecName string) error
WaitVerifyHecUpdate Handles retry logic for GET request for the update lifecycle function to verify that the fields in the Hec response match those of the patch request