roles

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceKey = "scp_roles"
)

Variables

View Source
var (
	TargetStatusResourceExists  = []string{http.StatusText(200)}
	TargetStatusResourceChange  = []string{http.StatusText(200)}
	TargetStatusResourceDeleted = []string{http.StatusText(200)}
)

For all CRUD operations on synchronous resources we expect a target status of 200.

View Source
var GeneralRetryableStatusCodes = map[int]string{
	http.StatusTooManyRequests: http.StatusText(429),
}

Functions

func ResourceRole

func ResourceRole() *schema.Resource

func RoleStatusCreate

func RoleStatusCreate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, createParams v2.CreateRoleParams, createRoleRequest v2.CreateRoleJSONRequestBody) resource.StateRefreshFunc

RoleStatusCreate returns StateRefreshFunc that makes POST request and checks if response is accepted

func RoleStatusDelete

func RoleStatusDelete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, roleName string) resource.StateRefreshFunc

RoleStatusDelete returns StateRefreshFunc that makes DELETE request and checks if request was accepted

func RoleStatusRead

func RoleStatusRead(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, roleName string) resource.StateRefreshFunc

RoleStatusRead returns StateRefreshFunc that makes GET request, checks if request was successful, and returns role response

func RoleStatusUpdate

func RoleStatusUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, patchParams v2.PatchRoleInfoParams, patchRoleRequest v2.PatchRoleInfoJSONRequestBody, roleName string) resource.StateRefreshFunc

RoleStatusUpdate returns StateRefreshFunc that makes PATCH request and checks if request was successful

func RoleStatusVerifyUpdate

func RoleStatusVerifyUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, patchRequest v2.PatchRoleInfoJSONRequestBody, roleName string) resource.StateRefreshFunc

RoleStatusVerifyUpdate returns a StateRefreshFunc that makes a GET request and checks to see if the role fields matches those in patch request

func VerifyRoleUpdate

func VerifyRoleUpdate(patchRequest v2.PatchRoleInfoJSONRequestBody, roleResponse v2.RolesResponse) bool

VerifyRoleUpdate is a helper to verify that the fields in patch request match fields in the role response

func WaitRoleCreate

func WaitRoleCreate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, createParams v2.CreateRoleParams, createRoleRequest v2.CreateRoleJSONRequestBody) error

WaitRoleCreate Handles retry logic for POST requests for create lifecycle function

func WaitRoleDelete

func WaitRoleDelete(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, roleName string) error

WaitRoleDelete Handles retry logic for DELETE requests for the delete lifecycle function

func WaitRoleRead

func WaitRoleRead(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, roleName string) (*v2.RolesResponse, error)

WaitRoleRead Handles retry logic for GET requests for the read lifecycle function

func WaitRoleUpdate

func WaitRoleUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, patchParams v2.PatchRoleInfoParams, patchRequest v2.PatchRoleInfoJSONRequestBody, roleName string) error

WaitRoleUpdate Handles retry logic for PATCH requests for the update lifecycle function

func WaitVerifyRoleUpdate

func WaitVerifyRoleUpdate(ctx context.Context, acsClient v2.ClientInterface, stack v2.Stack, patchRequest v2.PatchRoleInfoJSONRequestBody, roleName string) error

WaitVerifyRoleUpdate Handles retry logic for GET request for the update lifecycle function to verify that the fields in the role response match those of the patch request

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL