Documentation
¶
Index ¶
- Constants
- Variables
- func AppendNameValueStringPair(stringPairs *[]citrixorchestration.NameValueStringPairModel, name string, ...)
- func AttributeMapFromObject(m ModelWithAttributes) (map[string]attr.Type, error)
- func CheckProductVersion(client *citrixdaasclient.CitrixDaasClient, diagnostic *diag.Diagnostics, ...) bool
- func Contains[T comparable](s []T, e T) bool
- func ConvertBaseStringArrayToPrimitiveStringArray(v []types.String) []string
- func ConvertPrimitiveInterfaceArrayToBaseStringArray(v []interface{}) ([]types.String, string)
- func ConvertPrimitiveStringArrayToBaseStringArray(v []string) []types.String
- func ConvertToString(model any) (string, error)
- func GetAllResourcePathList(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) []string
- func GetAllowedFunctionalLevelValues() []string
- func GetFilteredResourcePathList(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) ([]string, error)
- func GetHypervisor(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (*citrixorchestration.HypervisorDetailResponseModel, error)
- func GetHypervisorResourcePool(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (*citrixorchestration.HypervisorResourcePoolDetailResponseModel, error)
- func GetMachineCatalog(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (*citrixorchestration.MachineCatalogDetailResponseModel, error)
- func GetMachineCatalogMachines(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (*citrixorchestration.MachineResponseModelCollection, error)
- func GetSingleHypervisorResource(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (*citrixorchestration.HypervisorResourceResponseModel, error)
- func GetSingleResourceFromHypervisor(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (*citrixorchestration.HypervisorResourceResponseModel, error)
- func GetSingleResourcePathFromHypervisor(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (string, error)
- func GetValidatorFromEnum[V ~string, T []V](enum T) validator.String
- func IsValidUUID(u string) bool
- func IsValidUUIDorNull(u basetypes.StringValue) bool
- func ObjectListToTypedArray[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.List) []objTyp
- func ObjectValueToTypedObject[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.Object) objTyp
- func PanicHandler(diagnostics *diag.Diagnostics)
- func ParseNameValueStringPairToClientModel(stringPairs []NameValueStringPairModel) []citrixorchestration.NameValueStringPairModel
- func ProcessAsyncJobResponse(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (err error)
- func ReadClientError(err error) string
- func ReadResource[ResponseType any](request any, ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (ResponseType, *http.Response, error)
- func RefreshList(state []string, remote []string) []string
- func RefreshListDeprecated(state []types.String, remote []string) []types.String
- func RefreshListProperties[tfType any, clientType any](ctx context.Context, diagnostics *diag.Diagnostics, state []tfType, ...) []tfType
- func RefreshListValueProperties[tfType ModelWithAttributes, clientType any](ctx context.Context, diagnostics *diag.Diagnostics, state types.List, ...) types.List
- func RefreshListValues(ctx context.Context, diagnostics *diag.Diagnostics, state types.List, ...) types.List
- func StringArrayToStringList(ctx context.Context, diagnostics *diag.Diagnostics, v []string) types.List
- func StringListToStringArray(ctx context.Context, diagnostics *diag.Diagnostics, v types.List) []string
- func StringToTypeBool(from string) types.Bool
- func TypeBoolToString(from types.Bool) string
- func TypedArrayToObjectList[objTyp ModelWithAttributes](ctx context.Context, diagnostics *diag.Diagnostics, v []objTyp) types.List
- func TypedObjectToObjectValue(ctx context.Context, diagnostics *diag.Diagnostics, v ModelWithAttributes) types.Object
- func ValidateHypervisorResource(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, ...) (bool, string)
- type HttpErrorBody
- type ModelWithAttributes
- type NameValueStringPairModel
Constants ¶
const AssignmentPriority = 0
GAC
const AwsEc2InstanceTypeRegex string = `^[a-z0-9]{1,15}\.[a-z0-9]{1,15}$`
AWS EC2 Instance Type
const AwsNetworkNameRegex string = `^(\d{1,3}\.){3}\d{1,3}` + "`" + `/\d{1,3}\s\(vpc-.+\)\.network$`
AWS Network Name
const AzureEphemeralOSDisk = "Azure_Ephemeral_OS_Disk"
const DateRegex string = `^\d{4}-\d{2}-\d{2}$`
Date YYYY-MM-DD
const DefaultSitePolicySetId string = "00000000-0000-0000-0000-000000000000"
ID of the Default Site Policy Set
const DomainFqdnRegex string = `^(([a-zA-Z0-9-_]){1,63}\.)+[a-zA-Z]{2,63}$`
Domain FQDN
const GacAppName = "Workspace"
const GuidRegex string = `^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$`
GUID
const IPv4Regex string = `^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$`
IPv4
const IPv4RegexWithProtocol string = `^(http|https)://((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$`
IPv4 with https
const ImageVersionResourceType string = "ImageVersion"
Resource Types
const NOT_EXIST string = "NOT_EXIST"
NOT_EXIST error code
const NUTANIX_PLUGIN_ID string = "AcropolisFactory"
const NetworkResourceType string = "Network"
const Premium_LRS = "Premium_LRS"
const RegionResourceType string = "Region"
const SamRegex string = `^[a-zA-Z][a-zA-Z0-9\- ]{0,61}[a-zA-Z0-9]\\\w[\w\.\- ]+$`
SAM
const SecurityGroupResourceType = "SecurityGroup"
const ServiceOfferingResourceType string = "ServiceOffering"
const SnapshotResourceType string = "Snapshot"
const SslThumbprintRegex string = `^([0-9a-fA-F]{40}|[0-9a-fA-F]{64})$`
SSL Thumbprint
const StandardLRS = "Standard_LRS"
Azure Storage Types
const StandardSSDLRS = "StandardSSD_LRS"
const StorageResourceType string = "Storage"
const TemplateResourceType string = "Template"
const TimeRegex string = `^([0-1][0-9]|2[0-3]):[0-5][0-9]$`
Time HH:MM
const UpnRegex string = `^[^@]+@\b(([a-zA-Z0-9-_]){1,63}\.)+[a-zA-Z]{2,63}$`
UPN
const VhdResourceType string = "Vhd"
const VirtualMachineResourceType string = "Vm"
const VirtualPrivateCloudResourceType string = "VirtualPrivateCloud"
const WindowsClientLicenseType string = "Windows_Client"
Azure License Types
const WindowsServerLicenseType string = "Windows_Server"
Variables ¶
var PlatformSettingsAssignedTo = []string{"AllUsersNoAuthentication"}
Functions ¶
func AppendNameValueStringPair ¶
func AppendNameValueStringPair(stringPairs *[]citrixorchestration.NameValueStringPairModel, name string, appendValue string)
<summary> Helper function to append new name value pairs to an array of NameValueStringPairModel in place </summary> <param name="stringPairs">Original string pair array to append to</param> <param name="name">Name of the new string pair to be added</param> <param name="appendValue">Value of the new string pair to be added</param>
func AttributeMapFromObject ¶ added in v0.6.1
func AttributeMapFromObject(m ModelWithAttributes) (map[string]attr.Type, error)
<summary> Helper function to convert a model to a map of attribute types. Used when converting back to a types.Object </summary> <param name="m">Model to convert, must implement the ModelWithSchema interface</param> <returns>Map of attribute types</returns>
func CheckProductVersion ¶ added in v0.6.0
func CheckProductVersion(client *citrixdaasclient.CitrixDaasClient, diagnostic *diag.Diagnostics, requiredOrchestrationApiVersion int32, requiredProductMajorVersion int, requiredProductMinorVersion int, resourceName string) bool
<summary> Helper function to check the version requirement for DDC. </summary>
func Contains ¶
func Contains[T comparable](s []T, e T) bool
func ConvertBaseStringArrayToPrimitiveStringArray ¶
<summary> Helper function to convert array of terraform strings to array of golang primitive strings Deprecated: Remove after we fully move to types.List </summary> <param name="v">Array of terraform stringsArray of golang primitive strings</param> <returns>Array of golang primitive strings</returns>
func ConvertPrimitiveInterfaceArrayToBaseStringArray ¶ added in v0.6.0
<summary> Helper function to convert array of golang primitive interface to array of terraform strings Deprecated: Remove after we fully move to types.List </summary> <param name="v">Array of golang primitive interface</param> <returns>Array of terraform strings</returns>
func ConvertPrimitiveStringArrayToBaseStringArray ¶
<summary> Helper function to convert array of golang primitive strings to array of terraform strings Deprecated: Remove after we fully move to types.List </summary> <param name="v">Array of golang primitive strings</param> <returns>Array of terraform strings</returns>
func ConvertToString ¶ added in v0.3.4
<summary> Helper function to serialize any struct value into a string </summary> <param name="model">Input struct value</param> <returns>Serialized string value of the struct</returns>
func GetAllResourcePathList ¶
func GetAllResourcePathList(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorId, folderPath, resourceType string) []string
func GetAllowedFunctionalLevelValues ¶ added in v0.6.0
func GetAllowedFunctionalLevelValues() []string
<summary> Helper function to get the allowed functional level values for setting the minimum functional level for machine catalog and deliver group. </summary>
func GetFilteredResourcePathList ¶
func GetFilteredResourcePathList(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorId, folderPath, resourceType string, filter []string, connectionType citrixorchestration.HypervisorConnectionType, pluginId string) ([]string, error)
func GetHypervisor ¶ added in v0.3.6
func GetHypervisor(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, diagnostics *diag.Diagnostics, hypervisorId string) (*citrixorchestration.HypervisorDetailResponseModel, error)
Gets the hypervisor and logs any errors
func GetHypervisorResourcePool ¶ added in v0.3.6
func GetHypervisorResourcePool(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, diagnostics *diag.Diagnostics, hypervisorId, hypervisorResourcePoolId string) (*citrixorchestration.HypervisorResourcePoolDetailResponseModel, error)
func GetMachineCatalog ¶ added in v0.3.6
func GetMachineCatalog(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, diagnostics *diag.Diagnostics, machineCatalogId string, addErrorToDiagnostics bool) (*citrixorchestration.MachineCatalogDetailResponseModel, error)
func GetMachineCatalogMachines ¶ added in v0.3.6
func GetMachineCatalogMachines(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, diagnostics *diag.Diagnostics, machineCatalogId string) (*citrixorchestration.MachineResponseModelCollection, error)
func GetSingleHypervisorResource ¶ added in v0.3.6
func GetSingleHypervisorResource(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorId, folderPath, resourceName, resourceType, resourceGroupName string, hypervisor *citrixorchestration.HypervisorDetailResponseModel) (*citrixorchestration.HypervisorResourceResponseModel, error)
func GetSingleResourceFromHypervisor ¶ added in v0.5.3
func GetSingleResourceFromHypervisor(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorName, hypervisorPoolName, folderPath, resourceName, resourceType, resourceGroupName string) (*citrixorchestration.HypervisorResourceResponseModel, error)
func GetSingleResourcePathFromHypervisor ¶
func GetSingleResourcePathFromHypervisor(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorName, hypervisorPoolName, folderPath, resourceName, resourceType, resourceGroupName string) (string, error)
func GetValidatorFromEnum ¶
<summary> Helper function for generating string validator for an enum value in Terraform schema. Only works when all eligible values for the enum type are supported by provider. When the eligible values are only partially supported, use custom string validator in schema. </summary> <param name="enum">Enum from citrix-daas-rest-go package</param> <returns>String validator for terraform schema</returns>
func IsValidUUID ¶
<summary> Helper function to validate if a string is a valid UUID </summary> <param name="u">String to validate</param> <returns>True if string is a valid UUID. False if otherwise.</returns>
func IsValidUUIDorNull ¶
func IsValidUUIDorNull(u basetypes.StringValue) bool
<summary> Helper function to validate if a string is a valid UUID or null </summary> <param name="u">String to validate</param> <returns>True if string is a valid UUID, or is null. False if otherwise.</returns>
func ObjectListToTypedArray ¶ added in v0.6.1
func ObjectListToTypedArray[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.List) []objTyp
<summary> Helper function to convert a native terraform list of objects to a golang slice of the specified type Use TypedArrayToObjectList to go the other way. </summary> <param name="ctx">context</param> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">List of object in the native terraform types.List wrapper</param> <returns>Array of the specified type</returns>
func ObjectValueToTypedObject ¶ added in v0.6.1
func ObjectValueToTypedObject[objTyp any](ctx context.Context, diagnostics *diag.Diagnostics, v types.Object) objTyp
<summary> Helper function to convert a native terraform object to a golang object of the specified type. Use TypedObjectToObjectValue to go the other way. </summary> <param name="ctx">context</param> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Object in the native terraform types.Object wrapper</param> <returns>Object of the specified type</returns>
func PanicHandler ¶ added in v0.3.6
func PanicHandler(diagnostics *diag.Diagnostics)
<summary> Global panic handler to catch all unexpected errors to prevent provider from crashing. Writes crash stack into local txt file for troubleshooting, and displays error message in Terrafor Diagnostics. </summary> <param name="diagnostics">Terraform Diagnostics from context</param>
func ParseNameValueStringPairToClientModel ¶
func ParseNameValueStringPairToClientModel(stringPairs []NameValueStringPairModel) []citrixorchestration.NameValueStringPairModel
<summary> Helper function to parse an array of name value pairs in terraform model to an array of name value pairs in client model </summary> <param name="stringPairs">Original string pair array in terraform model</param> <returns>String pair array in client model</returns>
func ProcessAsyncJobResponse ¶ added in v0.3.6
func ProcessAsyncJobResponse(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, jobResp *http.Response, errContext string, diagnostics *diag.Diagnostics, maxTimeout int, returnJobError bool) (err error)
<summary> Helper function to process async job response. Takes async job response and polls for result. </summary> <param name="ctx">Context from caller</param> <param name="client">Citrix DaaS client from provider context</param> <param name="jobResp">Job response from async API call</param> <param name="errContext">Context of the job to be use as Terraform diagnostic error message title</param> <param name="diagnostics">Terraform diagnostics from context</param> <param name="maxTimeout">Maximum timeout threashold for job status polling</param> <returns>Error if job polling failed or job itself ended in failed state</returns>
func ReadClientError ¶
<summary> Helper function to read inner error message from a generic error returned from citrix-daas-rest-go </summary> <param name="err">Generic error returned from citrix-daas-rest-go</param> <returns>Inner error message</returns>
func ReadResource ¶ added in v0.3.3
func ReadResource[ResponseType any](request any, ctx context.Context, client *citrixdaasclient.CitrixDaasClient, resp *resource.ReadResponse, resourceType, resourceIdOrName string) (ResponseType, *http.Response, error)
<summary> Wrapper function for reading specific resource from remote with retries </summary> <param name="request">Request object for the GET call</param> <param name="ctx">Context from caller</param> <param name="client">Citrix DaaS client from provider context</param> <param name="resp">Response from the GET call</param> <param name="resourceType">Resource type that would be shown in error message if failed to read resource</param> <param name="resourceIdOrName">Resource ID or name that would be shown in error message if failed to read resource</param> <returns>Response of the Get call. Raw http response. Error if failed to read the resource.</returns>
func RefreshList ¶ added in v0.4.0
<summary> Helper function for calculating the new state of a list of strings, while keeping the order of the elements in the array intact, and adds missing elements from remote to state. Can be used for refreshing list of strings. </summary> <param name="state">List of values in state</param> <param name="remote">List of values in remote</param>
func RefreshListDeprecated ¶
<summary> Helper function for calculating the new state of a list of strings, while keeping the order of the elements in the array intact, and adds missing elements from remote to state. Can be used for refreshing list of strings. Deprecated: Remove after we fully move to types.List </summary> <param name="state">List of values in state</param> <param name="remote">List of values in remote</param>
func RefreshListProperties ¶ added in v0.4.0
func RefreshListProperties[tfType any, clientType any](ctx context.Context, diagnostics *diag.Diagnostics, state []tfType, tfId string, remote []clientType, clientId string, refreshFunc string) []tfType
TODO: make RefreshListProperties private once all resources are updated to use types.List <summary> Helper function for calculating the new state of a list of nested attribute, while keeping the order of the elements in the array intact, and adds missing elements from remote to state. Can be used for refreshing all list nested attributes. </summary> <param name="state">State values in Terraform model</param> <param name="tfId">Name of the identifier field in Terraform model</param> <param name="remote">Remote values in client model</param> <param name="clientId">Name of the identifier field in client model</param> <param name="refreshFunc">Name of the refresh properties function defined in the terraform model</param> <returns>Array in Terraform model for new state</returns>
func RefreshListValueProperties ¶ added in v0.6.1
func RefreshListValueProperties[tfType ModelWithAttributes, clientType any](ctx context.Context, diagnostics *diag.Diagnostics, state types.List, tfId string, remote []clientType, clientId string, refreshFunc string) types.List
<summary> Helper function for calculating the new state of a list of nested attribute, while keeping the order of the elements in the array intact, and adds missing elements from remote to state. Can be used for refreshing all list nested attributes. </summary> <param name="state">State values in Terraform model</param> <param name="tfId">Name of the identifier field in Terraform model</param> <param name="remote">Remote values in client model</param> <param name="clientId">Name of the identifier field in client model</param> <param name="refreshFunc">Name of the refresh properties function defined in the terraform model</param> <returns>Array in Terraform model for new state</returns>
func RefreshListValues ¶ added in v0.6.1
func RefreshListValues(ctx context.Context, diagnostics *diag.Diagnostics, state types.List, remote []string) types.List
<summary> Helper function for calculating the new state of a list of strings, while keeping the order of the elements in the array intact, and adds missing elements from remote to state. Can be used for refreshing all list of strings. </summary> <param name="state">State values in Terraform model</param> <param name="remote">Remote values in client model</param> <returns>Array in Terraform model for new state</returns>
func StringArrayToStringList ¶ added in v0.6.1
func StringArrayToStringList(ctx context.Context, diagnostics *diag.Diagnostics, v []string) types.List
<summary> Helper function to convert a golang slice of string to a native terraform list of strings. Use StringListToStringArray to go the other way. </summary> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Slice of strings</param> <returns>types.List</returns>
func StringListToStringArray ¶ added in v0.6.1
func StringListToStringArray(ctx context.Context, diagnostics *diag.Diagnostics, v types.List) []string
<summary> Helper function to convert a terraform list of terraform strings to array of golang primitive strings. Use StringArrayToStringList to go the other way. </summary> <param name="v">Array of terraform stringsArray of golang primitive strings</param> <returns>Array of golang primitive strings</returns>
func StringToTypeBool ¶
<summary> Helper function to convert string to terraform boolean value </summary> <param name="from">Boolean value in string</param> <returns>Boolean value in terraform types.Bool</returns>
func TypeBoolToString ¶
<summary> Helper function to convert terraform bool value to string </summary> <param name="from">Boolean value in terraform bool</param> <returns>Boolean value in string</returns>
func TypedArrayToObjectList ¶ added in v0.6.1
func TypedArrayToObjectList[objTyp ModelWithAttributes](ctx context.Context, diagnostics *diag.Diagnostics, v []objTyp) types.List
<summary> Helper function to convert a golang slice to a native terraform list of objects. Use ObjectListToTypedArray to go the other way. </summary> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Slice of objects</param> <returns>types.List</returns>
func TypedObjectToObjectValue ¶ added in v0.6.1
func TypedObjectToObjectValue(ctx context.Context, diagnostics *diag.Diagnostics, v ModelWithAttributes) types.Object
<summary> Helper function to convert a golang object to a native terraform object. Use ObjectValueToTypedObject to go the other way. </summary> <param name="ctx">"context</param> <param name="diagnostics">Any issues will be appended to these diagnostics</param> <param name="v">Object of the specified type</param> <param name="s">Schema map of the object</param> <returns>Object in the native terraform types.Object wrapper</returns>
func ValidateHypervisorResource ¶ added in v0.6.0
func ValidateHypervisorResource(ctx context.Context, client *citrixdaasclient.CitrixDaasClient, hypervisorName, hypervisorPoolName, resourcePath string) (bool, string)
Types ¶
type HttpErrorBody ¶ added in v0.5.0
type ModelWithAttributes ¶ added in v0.6.1
type NameValueStringPairModel ¶
type NameValueStringPairModel struct {
Name types.String `tfsdk:"name"`
Value types.String `tfsdk:"value"`
}
Terraform model for name value string pair
func ParseNameValueStringPairToPluginModel ¶
func ParseNameValueStringPairToPluginModel(stringPairs []citrixorchestration.NameValueStringPairModel) []NameValueStringPairModel
<summary> Helper function to parse an array of name value pairs in client model to an array of name value pairs in terraform model </summary> <param name="stringPairs">Original string pair array in client model</param> <returns>String pair array in terraform model</returns>
func (NameValueStringPairModel) GetAttributes ¶ added in v0.6.1
func (NameValueStringPairModel) GetAttributes() map[string]schema.Attribute
func (NameValueStringPairModel) GetSchema ¶ added in v0.6.1
func (r NameValueStringPairModel) GetSchema() schema.NestedAttributeObject