Documentation
¶
Index ¶
- func AgentProfilePlatforms() []string
- func AllConfigletSectionNames() []string
- func AllDcRoutingPolicyImportPolicy() []string
- func AllFFResourceTypes() []string
- func AllInterfaceNumberingIpv4Types() []string
- func AllInterfaceNumberingIpv6Types() []string
- func AllNodeDeployModes() []string
- func AllOverlayControlProtocols() []string
- func AllPlatformOSNames() []string
- func AllResourceGroupNameStrings() []string
- func AllResourcePoolTypes() []string
- func AllStorageSchemaPaths() []string
- func AllTemplateTypes() []string
- func AllValidPrefixFilterActions() []string
- func ApiStringerFromFriendlyString(target StringerWithFromString, in ...string) error
- func BigIntToBigFloat(in *big.Int) *big.Float
- func BlueprintExists(ctx context.Context, client *apstra.Client, id apstra.ObjectId, ...) bool
- func ConfigletSectionNamesByOS(os apstra.PlatformOS) []string
- func ConfigletSupportsPlatforms(configletdata *apstra.ConfigletData, platforms []apstra.PlatformOS) bool
- func ConfigletValidSectionsMap() map[string][]string
- func DiffSliceSets[A comparable](a, b []A) ([]A, []A)
- func FabricAddressing(_ context.Context, s types.String, path *path.Path, diags *diag.Diagnostics) *apstra.AddressingScheme
- func FcdModes() []string
- func GetAllSystemsInfo(ctx context.Context, client *apstra.Client, diags *diag.Diagnostics) map[string]apstra.ManagedSystemInfo
- func GetKeysFromJSON(str types.String) ([]attr.Value, error)
- func GetNodeDeployMode(ctx context.Context, client *apstra.TwoStageL3ClosClient, nodeId string) (string, error)
- func HasValue(v attr.Value) bool
- func Int64ValueOrNull(_ context.Context, in any, diags *diag.Diagnostics) types.Int64
- func IsApstra404(err error) bool
- func IsJSON(str types.String) bool
- func ItemInSlice[A comparable](item A, slice []A) bool
- func JSONEqual(m1, m2 types.String, d *diag.Diagnostics) bool
- func ListValueOrNull[T any](ctx context.Context, elementType attr.Type, elements []T, ...) types.List
- func MapValueOrNull[T any](ctx context.Context, elementType attr.Type, elements map[string]T, ...) types.Map
- func MapsMatch[A, B comparable](a, b map[A]B) bool
- func Min[T constraints.Ordered](a, b T) T
- func NewClientConfig(apstraUrl, envVarPrefix string) (*apstra.ClientCfg, error)
- func ObjectValueOrNull(ctx context.Context, attrTypes map[string]attr.Type, attributes any, ...) types.Object
- func Reverse[A any](in []A)
- func SetNodeDeployMode(ctx context.Context, client *apstra.TwoStageL3ClosClient, nodeId string, ...) error
- func SetValueOrNull[T any](ctx context.Context, elementType attr.Type, elements []T, ...) types.Set
- func SliceComplementOfA[T comparable](a, b []T) []T
- func SliceContains[A comparable](a A, s []A) bool
- func SliceDeleteUnOrdered[A any](i int, a *[]A)
- func SliceIntersectionOfAB[T comparable](a, b []T) []T
- func SliceStringersMatch[A fmt.Stringer](a, b []A) bool
- func SlicesMatch[A comparable](a, b []A) bool
- func Sort[A constraints.Ordered](in []A)
- func StringValueOrNull(_ context.Context, in string, _ *diag.Diagnostics) types.String
- func StringValueWithNull(ctx context.Context, inStr string, nullStr string, diags *diag.Diagnostics) types.String
- func StringersToFriendlyString(in ...fmt.Stringer) string
- func StringersToStrings[A fmt.Stringer](in []A) []string
- func Swap[A any](a, b int, in []A)
- func ToPtr[A any](a A) *A
- func Uniq[A comparable](in []A) []A
- func UniqStringers[A fmt.Stringer](in []A) []A
- func UniqueElementsFromA[E comparable](a, b []E) []E
- func UrlEscapeTable() string
- func ValidSectionsAsTable() string
- func WrapDiagnostic(in diag.Diagnostic, detail string) diag.Diagnostic
- func WrapEachDiagnostic(prefix string, in ...diag.Diagnostic) diag.Diagnostics
- type Stringer
- type StringerWithFromString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgentProfilePlatforms ¶
func AgentProfilePlatforms() []string
func AllConfigletSectionNames ¶
func AllConfigletSectionNames() []string
func AllDcRoutingPolicyImportPolicy ¶
func AllDcRoutingPolicyImportPolicy() []string
func AllFFResourceTypes ¶ added in v0.66.0
func AllFFResourceTypes() []string
func AllInterfaceNumberingIpv4Types ¶ added in v0.60.0
func AllInterfaceNumberingIpv4Types() []string
func AllInterfaceNumberingIpv6Types ¶ added in v0.60.0
func AllInterfaceNumberingIpv6Types() []string
func AllNodeDeployModes ¶
func AllNodeDeployModes() []string
func AllOverlayControlProtocols ¶
func AllOverlayControlProtocols() []string
func AllPlatformOSNames ¶
func AllPlatformOSNames() []string
func AllResourceGroupNameStrings ¶
func AllResourceGroupNameStrings() []string
func AllResourcePoolTypes ¶ added in v0.66.0
func AllResourcePoolTypes() []string
func AllStorageSchemaPaths ¶ added in v0.61.0
func AllStorageSchemaPaths() []string
func AllTemplateTypes ¶
func AllTemplateTypes() []string
func AllValidPrefixFilterActions ¶
func AllValidPrefixFilterActions() []string
func ApiStringerFromFriendlyString ¶
func ApiStringerFromFriendlyString(target StringerWithFromString, in ...string) error
ApiStringerFromFriendlyString attempts to populate a StringerWithFromString using one or more friendly 'in' strings. It is used to turn friendly strings used in the web UI into types used by the SDK and ultimately the API. For example, we can get apstra.AsnAllocationSchemeDistinct directly from a string by invoking apstra.AsnAllocationScheme.FromString("distinct"). But the web UI uses "unique", rather than "distinct". This method will be able to translate "unique" into an apstra.AsnAllocationScheme value.
func BlueprintExists ¶
func ConfigletSectionNamesByOS ¶
func ConfigletSectionNamesByOS(os apstra.PlatformOS) []string
func ConfigletSupportsPlatforms ¶
func ConfigletSupportsPlatforms(configletdata *apstra.ConfigletData, platforms []apstra.PlatformOS) bool
func DiffSliceSets ¶
func DiffSliceSets[A comparable](a, b []A) ([]A, []A)
DiffSliceSets compares two slices of un-ordered data. The returned values are un-ordered slices of values found in only one of the supplied slices. It might be reasonable to think of the returned slices as "missing from a" and "missing from b"
Example: a: []int{1,2,3,4} b: []int{2,1,5} return: []int{5}, []int{4, 3}
func FabricAddressing ¶ added in v0.53.0
func FabricAddressing(_ context.Context, s types.String, path *path.Path, diags *diag.Diagnostics) *apstra.AddressingScheme
func GetAllSystemsInfo ¶
func GetAllSystemsInfo(ctx context.Context, client *apstra.Client, diags *diag.Diagnostics) map[string]apstra.ManagedSystemInfo
GetAllSystemsInfo returns map[string]apstra.ManagedSystemInfo keyed by device_key (switch serial number)
func GetKeysFromJSON ¶
GetKeysFromJSON returns a list of keys from a Json string
func GetNodeDeployMode ¶ added in v0.43.0
func Int64ValueOrNull ¶
func IsApstra404 ¶
func ItemInSlice ¶
func ItemInSlice[A comparable](item A, slice []A) bool
func JSONEqual ¶
func JSONEqual(m1, m2 types.String, d *diag.Diagnostics) bool
JSONEqual takes 2 json strings in types.String variables and matches them
func ListValueOrNull ¶
func ListValueOrNull[T any](ctx context.Context, elementType attr.Type, elements []T, diags *diag.Diagnostics) types.List
ListValueOrNull returns a types.List based on the supplied elements. If the supplied elements is empty, the returned types.List will be flagged as null.
func MapValueOrNull ¶
func MapValueOrNull[T any](ctx context.Context, elementType attr.Type, elements map[string]T, diags *diag.Diagnostics) types.Map
MapValueOrNull returns a types.Map based on the supplied elements. If the supplied elements is empty, the returned types.Map will be flagged as null.
func MapsMatch ¶
func MapsMatch[A, B comparable](a, b map[A]B) bool
func Min ¶
func Min[T constraints.Ordered](a, b T) T
func NewClientConfig ¶
func ObjectValueOrNull ¶
func ObjectValueOrNull(ctx context.Context, attrTypes map[string]attr.Type, attributes any, diags *diag.Diagnostics) types.Object
ObjectValueOrNull returns a types.Object based on the supplied attributes. If the supplied attributes is nil, the returned types.Object will be flagged as null.
func SetNodeDeployMode ¶ added in v0.43.0
func SetValueOrNull ¶
func SetValueOrNull[T any](ctx context.Context, elementType attr.Type, elements []T, diags *diag.Diagnostics) types.Set
SetValueOrNull returns a types.Set based on the supplied elements. If the supplied elements is empty, the returned types.Set will be flagged as null.
func SliceComplementOfA ¶
func SliceComplementOfA[T comparable](a, b []T) []T
SliceComplementOfA returns items from b which do not appear in a
func SliceContains ¶
func SliceContains[A comparable](a A, s []A) bool
func SliceDeleteUnOrdered ¶
func SliceIntersectionOfAB ¶
func SliceIntersectionOfAB[T comparable](a, b []T) []T
SliceIntersectionOfAB returns items which appear in both a and b
func SliceStringersMatch ¶
func SlicesMatch ¶
func SlicesMatch[A comparable](a, b []A) bool
func Sort ¶ added in v0.42.0
func Sort[A constraints.Ordered](in []A)
func StringValueOrNull ¶
StringValueOrNull returns a types.String based on the supplied string. If the supplied string is empty, the returned types.String will be flagged as null.
func StringValueWithNull ¶
func StringValueWithNull(ctx context.Context, inStr string, nullStr string, diags *diag.Diagnostics) types.String
StringValueWithNull returns a types.String based on the supplied inStr. If inStr matches nullStr or is empty, the returned types.String will be flagged as null.
func StringersToFriendlyString ¶
StringersToFriendlyString accepts stringers (probably apstra-go-sdk string-able iota or enum types) and returns a string that better reflects terminology used by the Apstra web UI.
For example, the API uses "distinct" where the web UI uses "unique". This function turns apstra.AsnAllocationSchemeDistinct into "unique".
func StringersToStrings ¶
func Uniq ¶
func Uniq[A comparable](in []A) []A
Uniq returns the supplied slice with consecutive duplicates removed. Order is not preserved. Name is taken from '/usr/bin/uniq' because of similar function.
func UniqStringers ¶
UniqStringers returns the supplied slice with consecutive duplicates removed. Order is not preserved. Name is taken from '/usr/bin/uniq' because of similar function.
func UniqueElementsFromA ¶
func UniqueElementsFromA[E comparable](a, b []E) []E
UniqueElementsFromA returns elements of slice 'a' which do not appear in slice 'b'. Order is not preserved.
func UrlEscapeTable ¶
func UrlEscapeTable() string
func ValidSectionsAsTable ¶
func ValidSectionsAsTable() string
func WrapDiagnostic ¶
func WrapDiagnostic(in diag.Diagnostic, detail string) diag.Diagnostic
func WrapEachDiagnostic ¶
func WrapEachDiagnostic(prefix string, in ...diag.Diagnostic) diag.Diagnostics
Types ¶
type Stringer ¶ added in v0.48.0
type Stringer struct {
// contains filtered or unexported fields
}
func NewStringer ¶ added in v0.48.0
type StringerWithFromString ¶
Source Files
¶
- agent_profiles.go
- attr_has_value.go
- blueprint.go
- client.go
- compare_jsons.go
- compare_maps.go
- compare_slices.go
- configlets.go
- diagnostics.go
- freeform_resource.go
- helpers.go
- interface_numbering.go
- is_apstra_404.go
- node.go
- numbers.go
- provider.go
- rack_type.go
- resource_group.go
- resource_pool.go
- rosetta.go
- routing_policy.go
- slice_utils.go
- sslKeyLogWriter.go
- strings.go
- telemetry_service_registry_entry.go
- templates.go
- terraform_plugin_framework_value_creation.go