ibm

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MPL-2.0 Imports: 155 Imported by: 0

Documentation

Overview

Copyright IBM Corp. 2017, 2021 All Rights Reserved. Licensed under the Mozilla Public License v2.0

Copyright IBM Corp. 2017, 2021 All Rights Reserved. Licensed under the Mozilla Public License v2.0

Index

Constants

View Source
const (
	CRN       = "crn"
	CreatedAt = "created_at"

	ProvisioningStatus = "provisioning_status"
)
View Source
const (
	IBMComputeTimeFormat                                 = string("2006-01-02T15:04:05-07:00")
	IBMCOMPUTE_SCALE_POLICY_TRIGGER_TYPE_ID_RESOURCE_USE = 1
	IBMCOMPUTE_SCALE_POLICY_TRIGGER_TYPE_ID_REPEATING    = 2
	IBMCOMPUTE_SCALE_POLICY_TRIGGER_TYPE_ID_ONE_TIME     = 3
)
View Source
const (
	// MEMBER ...
	MEMBER = "MEMEBER"
	// ACCESS ...
	ACCESS          = "access"
	NOACCESS        = "noacess"
	VIEWONLY        = "viewonly"
	BASICUSER       = "basicuser"
	SUPERUSER       = "superuser"
	MANAGER         = "manager"
	AUDITOR         = "auditor"
	BILLINGMANANGER = "billingmanager"
	DEVELOPER       = "developer"
)
View Source
const (
	// SCALING ...
	SCALING = "scaling"
	// HEALTHY ...
	HEALTHY = "healthy"
	// DELETING ...
	DELETING = "deleting"
)
View Source
const (
	LB_LARGE_150000_CONNECTIONS = 150000
	LB_SMALL_15000_CONNECTIONS  = 15000

	LbLocalPackageType = "ADDITIONAL_SERVICES_LOAD_BALANCER"
)
View Source
const (
	PACKAGE_ID_APPLICATION_DELIVERY_CONTROLLER = 192
	DELIMITER                                  = "_"
)
View Source
const (
	AdditionalServicesGlobalIpAddressesPackageType = "ADDITIONAL_SERVICES_GLOBAL_IP_ADDRESSES"

	GlobalIpMask = "id,ipAddress[ipAddress,id,note],destinationIpAddress[ipAddress]"
)
View Source
const (
	AdditionalServicesPackageType            = "ADDITIONAL_SERVICES"
	AdditionalServicesNetworkVlanPackageType = "ADDITIONAL_SERVICES_NETWORK_VLAN"

	VlanMask = "id,name,primaryRouter[datacenter[name]],primaryRouter[hostname],vlanNumber," +
		"billingItem[recurringFee],guestNetworkComponentCount,subnets[networkIdentifier,cidr,subnetType],tagReferences[id,tag[name]]"
)
View Source
const (
	AdditionalSSLServicesPackageType            = "ADDITIONAL_SERVICES"
	AdditionalServicesSSLCertificatePackageType = "ADDITIONAL_SERVICES_SSL_CERTIFICATE"

	SSLMask = "id"
)
View Source
const (

	//ResourceControllerURL ...
	ResourceControllerURL = "resource_controller_url"
	//ResourceName ...
	ResourceName = "resource_name"
	//ResourceCRN ...
	ResourceCRN = "resource_crn"
	//ResourceStatus ...
	ResourceStatus = "resource_status"
	//ResourceGroupName ...
	ResourceGroupName = "resource_group_name"
	//RelatedCRN ...
	RelatedCRN            = "related_crn"
	SystemIBMLabelPrefix  = "ibm-cloud.kubernetes.io/"
	KubernetesLabelPrefix = "kubernetes.io/"
	K8sLabelPrefix        = "k8s.io/"
)
View Source
const (
	BareMetalMask = "globalIdentifier,hostname,domain,bandwidthAllocation,provisionDate,id," +
		"primaryIpAddress,primaryBackendIpAddress,privateNetworkOnlyFlag," +
		"notes,userData[value],tagReferences[id,tag[name]]," +
		"allowedNetworkStorage[id,nasType]," +
		"hourlyBillingFlag," +
		"datacenter[id,name,longName]," +
		"primaryNetworkComponent[primarySubnet[networkVlan[id,primaryRouter,vlanNumber],id],maxSpeed," +
		"primaryIpAddressRecord[id]," +
		"primaryVersion6IpAddressRecord[subnet,id]]," +
		"primaryBackendNetworkComponent[primarySubnet[networkVlan[id,primaryRouter,vlanNumber],id]," +
		"primaryIpAddressRecord[id]," +
		"maxSpeed,redundancyEnabledFlag]," +
		"memoryCapacity,powerSupplyCount," +
		"operatingSystem[softwareLicense[softwareDescription[referenceCode]]]"
)
View Source
const (

	// power service instance capabilities
	CUSTOM_VIRTUAL_CORES = "custom-virtualcores"
)
View Source
const DefaultServiceURL = "https://us-south.functions.cloud.ibm.com"

DefaultServiceURL is the default URL to make service requests to.

View Source
const (
	FwHardwareDedicatedPackageType = "ADDITIONAL_SERVICES_FIREWALL"
)
View Source
const (
	FwHardwarePackageType = "ADDITIONAL_SERVICES_FIREWALL"
)
View Source
const GATEWAY_APPLIANCE_CLUSTER = "NETWORK_GATEWAY_APPLIANCE_CLUSTER"
View Source
const HEALTH_CHECK_TYPE_HTTP_CUSTOM = "HTTP-CUSTOM"
View Source
const (
	ID = "id"
)
View Source
const NOT_FOUND = "SoftLayer_Exception_Network_LBaaS_ObjectNotFound"
View Source
const PUBLIC_SUBNET_TYPE = "public"
View Source
const RetryAPIDelay = 5 * time.Second

RetryAPIDelay - retry api delay

View Source
const (
	SubnetMask = "id,addressSpace,subnetType,version,ipAddressCount," +
		"networkIdentifier,cidr,note,endPointIpAddress[ipAddress],networkVlan[id],totalIpAddresses"
)
View Source
const (
	VPX_VERSION_10_1 = "10.1"
)

Variables

View Source
var BluemixRegion string

BluemixRegion ...

View Source
var IBMComputeAutoScaleGroupObjectMask = []string{
	"id",
	"name",
	"minimumMemberCount",
	"maximumMemberCount",
	"cooldown",
	"status[keyName]",
	"regionalGroup[id,name]",
	"terminationPolicy[keyName]",
	"virtualGuestMemberTemplate[blockDeviceTemplateGroup,primaryNetworkComponent[networkVlan[id]],primaryBackendNetworkComponent[networkVlan[id]]]",
	"loadBalancers[id,port,virtualServerId,healthCheck[id]]",
	"networkVlans[id,networkVlanId,networkVlan[vlanNumber,primaryRouter[hostname]]]",
	"loadBalancers[healthCheck[healthCheckTypeId,type[keyname],attributes[value,type[id,keyname]]]]",
}
View Source
var IBMComputeAutoScalePolicyObjectMask = []string{
	"cooldown",
	"id",
	"name",
	"scaleActions",
	"scaleGroupId",
	"oneTimeTriggers",
	"repeatingTriggers",
	"resourceUseTriggers.watches",
	"triggers",
}

Functions

func CreateVersionDate added in v1.8.0

func CreateVersionDate() *string

CreateVersionDate requires mandatory version attribute. Any date from 2019-12-13 up to the currentdate may be provided. Specify the current date to request the latest version.

func DefaultTransport added in v1.11.2

func DefaultTransport() gohttp.RoundTripper

DefaultTransport ...

func EscapeUrlParm added in v0.15.0

func EscapeUrlParm(urlParm string) string

convert CRN to be url safe

func FlattenHSMInfo added in v1.29.0

func FlattenHSMInfo(hsmInfo []tkesdk.HsmInfo) []map[string]interface{}

func FunctionClient added in v0.7.0

func FunctionClient(c *bluemix.Config) (*whisk.Client, error)

FunctionClient ...

func GetGlobalTagsUsingCRN added in v1.25.0

func GetGlobalTagsUsingCRN(meta interface{}, resourceID, resourceType, tagType string) (*schema.Set, error)

func GetNext added in v1.8.1

func GetNext(next interface{}) string

GetNext ...

func GetNextIAM added in v1.28.0

func GetNextIAM(next interface{}) string

GetNextIAM ...

func GetPrivateServiceURLForRegion added in v1.25.0

func GetPrivateServiceURLForRegion(region string) (string, error)

func GetTags added in v0.15.1

func GetTags(d *schema.ResourceData, meta interface{}) error

func GetTagsUsingCRN added in v0.17.0

func GetTagsUsingCRN(meta interface{}, resourceCRN string) (*schema.Set, error)

func HashInt

func HashInt(v interface{}) int

HashInt ...

func IgnoreSystemLabels added in v1.18.0

func IgnoreSystemLabels(labels map[string]string) map[string]string

IgnoreSystemLabels returns non-IBM tag keys.

func InvokeDataSourceValidator added in v1.13.0

func InvokeDataSourceValidator(resourceName, identifier string) schema.SchemaValidateFunc

func InvokeValidator added in v1.5.2

func InvokeValidator(resourceName, identifier string) schema.SchemaValidateFunc

This is the main validation function. This function will be used in all the provider code.

func NewQualifiedNameError added in v0.7.0

func NewQualifiedNameError(entityName string, err error) error

NewQualifiedNameError(entityName, err) returns specific whisk error

for invalid qualified names.

func Provider

func Provider() *schema.Provider

Provider returns a *schema.Provider.

func UpdateGlobalTagsUsingCRN added in v1.25.0

func UpdateGlobalTagsUsingCRN(oldList, newList interface{}, meta interface{}, resourceID, resourceType, tagType string) error

func UpdateTags added in v0.15.1

func UpdateTags(d *schema.ResourceData, meta interface{}) error

func UpdateTagsUsingCRN added in v0.17.0

func UpdateTagsUsingCRN(oldList, newList interface{}, meta interface{}, resourceCRN string) error

func WaitForClusterAvailable

func WaitForClusterAvailable(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error)

WaitForClusterAvailable Waits for cluster creation

func WaitForClusterAvailableForFeatureUpdate added in v0.16.0

func WaitForClusterAvailableForFeatureUpdate(cluster string, timeout time.Duration, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error)

WaitForClusterAvailable Waits for cluster creation

func WaitForClusterCreation added in v0.19.1

func WaitForClusterCreation(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error)

func WaitForClusterVersionUpdate added in v0.8.0

func WaitForClusterVersionUpdate(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error)

WaitForClusterVersionUpdate Waits for cluster creation

func WaitForEvaultAvailable added in v0.15.0

func WaitForEvaultAvailable(d *schema.ResourceData, meta interface{}, timeout string) (interface{}, error)

Waits for storage provisioning

func WaitForNoActiveTransactions

func WaitForNoActiveTransactions(id int, d *schema.ResourceData, timeout time.Duration, meta interface{}) (interface{}, error)

WaitForNoActiveTransactions Wait for no active transactions

func WaitForOrderCompletion

func WaitForOrderCompletion(
	receipt *datatypes.Container_Product_Order_Receipt, meta interface{}) (datatypes.Billing_Order_Item, error)

func WaitForSatelliteClusterVersionUpdate added in v1.26.0

func WaitForSatelliteClusterVersionUpdate(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error)

WaitForSatelliteClusterVersionUpdate Waits for cluster creation

func WaitForSatelliteWorkerDelete added in v1.26.0

func WaitForSatelliteWorkerDelete(clusterNameOrID, workerPoolNameOrID string, meta interface{}, timeout time.Duration, target v2.ClusterTargetHeader) (interface{}, error)

func WaitForSatelliteWorkerPoolAvailable added in v1.26.0

func WaitForSatelliteWorkerPoolAvailable(d *schema.ResourceData, meta interface{}, clusterNameOrID, workerPoolNameOrID string, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error)

WaitForSatelliteWorkerPoolAvailable Waits for workerpool deployed

func WaitForSatelliteWorkerVersionUpdate added in v1.26.0

func WaitForSatelliteWorkerVersionUpdate(d *schema.ResourceData, meta interface{}, masterVersion string, target v1.ClusterTargetHeader) (interface{}, error)

WaitForSatelliteWorkerVersionUpdate Waits for worker creation

func WaitForStorageAvailable

func WaitForStorageAvailable(d *schema.ResourceData, meta interface{}) (interface{}, error)

Waits for storage provisioning

func WaitForStorageUpdate added in v0.21.0

func WaitForStorageUpdate(d *schema.ResourceData, meta interface{}) (interface{}, error)

Waits for storage update

func WaitForSubnetAvailable

func WaitForSubnetAvailable(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error)

func WaitForUpgradeTransactionsToAppear

func WaitForUpgradeTransactionsToAppear(d *schema.ResourceData, meta interface{}) (interface{}, error)

WaitForUpgradeTransactionsToAppear Wait for upgrade transactions

func WaitForV2WorkerZoneDeleted added in v1.9.0

func WaitForV2WorkerZoneDeleted(clusterNameOrID, workerPoolNameOrID, zone string, meta interface{}, timeout time.Duration, target v2.ClusterTargetHeader) (interface{}, error)

func WaitForVSAvailable added in v0.10.0

func WaitForVSAvailable(d *schema.ResourceData, meta interface{}, timeout time.Duration) (interface{}, error)

WaitForVirtualGuestAvailable Waits for virtual guest creation

func WaitForVirtualGuestAvailable

func WaitForVirtualGuestAvailable(id int, d *schema.ResourceData, meta interface{}) (interface{}, error)

WaitForVirtualGuestAvailable Waits for virtual guest creation

func WaitForVpcClusterVersionUpdate added in v0.24.0

func WaitForVpcClusterVersionUpdate(d *schema.ResourceData, meta interface{}, target v2.ClusterTargetHeader) (interface{}, error)

WaitForVpcClusterVersionUpdate Waits for cluster creation

func WaitForVpcClusterWokersVersionUpdate added in v1.14.0

func WaitForVpcClusterWokersVersionUpdate(d *schema.ResourceData, meta interface{}, target v2.ClusterTargetHeader, masterVersion, workerID string) (interface{}, error)

WaitForVpcClusterWokersVersionUpdate Waits for Cluster version Update

func WaitForVpcWorkerDelete added in v0.19.0

func WaitForVpcWorkerDelete(clusterNameOrID, workerPoolNameOrID string, meta interface{}, timeout time.Duration, target v2.ClusterTargetHeader) (interface{}, error)

func WaitForWorkerAvailable

func WaitForWorkerAvailable(d *schema.ResourceData, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error)

WaitForWorkerAvailable Waits for worker creation

func WaitForWorkerAvailableForFeatureUpdate added in v0.16.0

func WaitForWorkerAvailableForFeatureUpdate(cluster string, timeout time.Duration, meta interface{}, target v1.ClusterTargetHeader) (interface{}, error)

func WaitForWorkerDelete added in v0.11.0

func WaitForWorkerDelete(clusterNameOrID, workerPoolNameOrID string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error)

func WaitForWorkerNormal added in v0.11.0

func WaitForWorkerNormal(clusterNameOrID, workerPoolNameOrID string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error)

func WaitForWorkerPoolAvailable added in v0.19.0

func WaitForWorkerPoolAvailable(d *schema.ResourceData, meta interface{}, clusterNameOrID, workerPoolNameOrID string, timeout time.Duration, target v2.ClusterTargetHeader) (interface{}, error)

WaitForWorkerPoolAvailable Waits for worker creation

func WaitForWorkerZoneDeleted added in v0.11.0

func WaitForWorkerZoneDeleted(clusterNameOrID, workerPoolNameOrID, zone string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error)

func WaitForWorkerZoneNormal added in v0.11.0

func WaitForWorkerZoneNormal(clusterNameOrID, workerPoolNameOrID, zone string, meta interface{}, timeout time.Duration, target v1.ClusterTargetHeader) (interface{}, error)

Types

type APIKey added in v1.19.0

type APIKey struct {
	Name        string
	Description string
	Apikey      string
	CreatedAt   string
	Locked      bool
}

type ClientSession

type ClientSession interface {
	AppIDAPI() (*appid.AppIDManagementV4, error)
	BluemixSession() (*bxsession.Session, error)
	BluemixAcccountAPI() (accountv2.AccountServiceAPI, error)
	BluemixAcccountv1API() (accountv1.AccountServiceAPI, error)
	BluemixUserDetails() (*UserConfig, error)
	ContainerAPI() (containerv1.ContainerServiceAPI, error)
	VpcContainerAPI() (containerv2.ContainerServiceAPI, error)
	ContainerRegistryV1() (*containerregistryv1.ContainerRegistryV1, error)
	CisAPI() (cisv1.CisServiceAPI, error)
	FunctionClient() (*whisk.Client, error)
	GlobalSearchAPI() (globalsearchv2.GlobalSearchServiceAPI, error)
	GlobalTaggingAPI() (globaltaggingv3.GlobalTaggingServiceAPI, error)
	GlobalTaggingAPIv1() (globaltaggingv1.GlobalTaggingV1, error)
	ICDAPI() (icdv4.ICDServiceAPI, error)
	IAMPolicyManagementV1API() (*iampolicymanagement.IamPolicyManagementV1, error)
	IAMUUMAPIV2() (iamuumv2.IAMUUMServiceAPIv2, error)
	MccpAPI() (mccpv2.MccpServiceAPI, error)
	ResourceCatalogAPI() (catalog.ResourceCatalogAPI, error)
	ResourceManagementAPIv2() (managementv2.ResourceManagementAPIv2, error)
	ResourceControllerAPI() (controller.ResourceControllerAPI, error)
	ResourceControllerAPIV2() (controllerv2.ResourceControllerAPIV2, error)
	SoftLayerSession() *slsession.Session
	IBMPISession() (*ibmpisession.IBMPISession, error)
	UserManagementAPI() (usermanagementv2.UserManagementAPI, error)
	PushServiceV1() (*pushservicev1.PushServiceV1, error)
	AppConfigurationV1() (*appconfigurationv1.AppConfigurationV1, error)
	CertificateManagerAPI() (certificatemanager.CertificateManagerServiceAPI, error)

	VpcV1API() (*vpc.VpcV1, error)
	APIGateway() (*apigateway.ApiGatewayControllerApiV1, error)
	PrivateDNSClientSession() (*dns.DnsSvcsV1, error)
	CosConfigV1API() (*cosconfig.ResourceConfigurationV1, error)
	DirectlinkV1API() (*dl.DirectLinkV1, error)
	DirectlinkProviderV2API() (*dlProviderV2.DirectLinkProviderV2, error)
	TransitGatewayV1API() (*tg.TransitGatewayApisV1, error)
	HpcsEndpointAPI() (hpcs.HPCSV2, error)
	FunctionIAMNamespaceAPI() (functions.FunctionServiceAPI, error)
	CisZonesV1ClientSession() (*ciszonesv1.ZonesV1, error)
	CisDNSRecordClientSession() (*cisdnsrecordsv1.DnsRecordsV1, error)
	CisDNSRecordBulkClientSession() (*cisdnsbulkv1.DnsRecordBulkV1, error)
	CisGLBClientSession() (*cisglbv1.GlobalLoadBalancerV1, error)
	CisGLBPoolClientSession() (*cisglbpoolv0.GlobalLoadBalancerPoolsV0, error)
	CisGLBHealthCheckClientSession() (*cisglbhealthcheckv1.GlobalLoadBalancerMonitorV1, error)
	CisIPClientSession() (*cisipv1.CisIpApiV1, error)
	CisPageRuleClientSession() (*cispagerulev1.PageRuleApiV1, error)
	CisRLClientSession() (*cisratelimitv1.ZoneRateLimitsV1, error)
	CisEdgeFunctionClientSession() (*cisedgefunctionv1.EdgeFunctionsApiV1, error)
	CisSSLClientSession() (*cissslv1.SslCertificateApiV1, error)
	CisWAFPackageClientSession() (*ciswafpackagev1.WafRulePackagesApiV1, error)
	CisDomainSettingsClientSession() (*cisdomainsettingsv1.ZonesSettingsV1, error)
	CisRoutingClientSession() (*cisroutingv1.RoutingV1, error)
	CisWAFGroupClientSession() (*ciswafgroupv1.WafRuleGroupsApiV1, error)
	CisCacheClientSession() (*ciscachev1.CachingApiV1, error)
	CisCustomPageClientSession() (*ciscustompagev1.CustomPagesV1, error)
	CisAccessRuleClientSession() (*cisaccessrulev1.ZoneFirewallAccessRulesV1, error)
	CisUARuleClientSession() (*cisuarulev1.UserAgentBlockingRulesV1, error)
	CisLockdownClientSession() (*cislockdownv1.ZoneLockdownV1, error)
	CisRangeAppClientSession() (*cisrangeappv1.RangeApplicationsV1, error)
	CisWAFRuleClientSession() (*ciswafrulev1.WafRulesApiV1, error)
	IAMIdentityV1API() (*iamidentity.IamIdentityV1, error)
	ResourceManagerV2API() (*resourcemanager.ResourceManagerV2, error)
	CatalogManagementV1() (*catalogmanagementv1.CatalogManagementV1, error)
	EnterpriseManagementV1() (*enterprisemanagementv1.EnterpriseManagementV1, error)
	ResourceControllerV2API() (*resourcecontroller.ResourceControllerV2, error)
	SecretsManagerV1() (*secretsmanagerv1.SecretsManagerV1, error)
	SchematicsV1() (*schematicsv1.SchematicsV1, error)
	SatelliteClientSession() (*kubernetesserviceapiv1.KubernetesServiceApiV1, error)
	CisFiltersSession() (*cisfiltersv1.FiltersV1, error)
	AtrackerV1() (*atrackerv1.AtrackerV1, error)
	// contains filtered or unexported methods
}

ClientSession ...

type Config

type Config struct {
	//BluemixAPIKey is the Bluemix api key
	BluemixAPIKey string
	//Bluemix region
	Region string
	//Resource group id
	ResourceGroup string
	//Bluemix API timeout
	BluemixTimeout time.Duration

	//Softlayer end point url
	SoftLayerEndpointURL string

	//Softlayer API timeout
	SoftLayerTimeout time.Duration

	// Softlayer User Name
	SoftLayerUserName string

	// Softlayer API Key
	SoftLayerAPIKey string

	//Retry Count for API calls
	//Unexposed in the schema at this point as they are used only during session creation for a few calls
	//When sdk implements it we an expose them for expected behaviour
	//https://github.com/softlayer/softlayer-go/issues/41
	RetryCount int
	//Constant Retry Delay for API calls
	RetryDelay time.Duration

	// FunctionNameSpace ...
	FunctionNameSpace string

	//Riaas End point
	RiaasEndPoint string

	//Generation
	Generation int

	//IAM Token
	IAMToken string

	//IAM Refresh Token
	IAMRefreshToken string

	// PowerService Instance
	PowerServiceInstance string

	// Zone
	Zone       string
	Visibility string
}

Config stores user provider input

func (*Config) ClientSession

func (c *Config) ClientSession() (interface{}, error)

ClientSession configures and returns a fully initialized ClientSession

type CountLimit added in v1.24.0

type CountLimit struct {
	Units           string
	AllocationCount int
	MinimumCount    int
	MaximumCount    int
	StepSizeCount   int
	IsAdjustable    bool
	CanScaleDown    bool
}

type CsEntry added in v0.15.0

type CsEntry struct {
	Name       string
	Password   string
	String     string
	Composed   string
	CertName   string
	CertBase64 string
	Hosts      []struct {
		HostName string `json:"hostname"`
		Port     int    `json:"port"`
	}
	Scheme       string
	QueryOptions map[string]interface{}
	Path         string
	Database     string
}

type FunctionIdentifier added in v1.5.2

type FunctionIdentifier int

ValidateFunc is honored only when the schema's Type is set to TypeInt, TypeFloat, TypeString, TypeBool, or TypeMap. It is ignored for all other types. enum to list all the validator functions supported by this tool.

const (
	IntBetween FunctionIdentifier = iota
	IntAtLeast
	IntAtMost
	ValidateAllowedStringValue
	StringLenBetween
	ValidateIPorCIDR
	ValidateCIDRAddress
	ValidateAllowedIntValue
	ValidateRegexpLen
	ValidateRegexp
	ValidateNoZeroValues
	ValidateJSONString
	ValidateJSONParam
	ValidateBindedPackageName
	ValidateOverlappingAddress
)

func (FunctionIdentifier) MarshalText added in v1.30.0

func (f FunctionIdentifier) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

Without this function, when FunctionalIdentifier is marshaled, it prints 0,1,2.. instead
of printing IntBetween, IntAtLeast, IntAtMost.. in JSON Output

func (FunctionIdentifier) String added in v1.5.2

func (i FunctionIdentifier) String() string

Use stringer tool to generate this later.

type GroupLimit added in v1.24.0

type GroupLimit struct {
	Units        string
	Allocation   int
	Minimum      int
	Maximum      int
	StepSize     int
	IsAdjustable bool
	CanScaleDown bool
}

type HPCSParams added in v1.29.0

type HPCSParams struct {
	Units            int    `json:"units,omitempty"`
	FailoverUnits    int    `json:"failover_units,omitempty"`
	ServiceEndpoints string `json:"allowed_network,omitempty"`
}

type Map added in v1.1.0

type Map map[string]string

Map is a wrapper around map[string]string that provides some helpers above it that assume the map is in the format that flatmap expects (the result of Flatten).

All modifying functions such as Delete are done in-place unless otherwise noted.

func Flatten added in v1.1.0

func Flatten(thing map[string]interface{}) Map

Flatten takes a structure and turns into a flat map[string]string.

Within the "thing" parameter, only primitive values are allowed. Structs are not supported. Therefore, it can only be slices, maps, primitives, and any combination of those together.

See the tests for examples of what inputs are turned into.

func (Map) Contains added in v1.1.0

func (m Map) Contains(key string) bool

Contains returns true if the map contains the given key.

func (Map) Delete added in v1.1.0

func (m Map) Delete(prefix string)

Delete deletes a key out of the map with the given prefix.

func (Map) Keys added in v1.1.0

func (m Map) Keys() []string

Keys returns all of the top-level keys in this map

func (Map) Merge added in v1.1.0

func (m Map) Merge(m2 Map)

Merge merges the contents of the other Map into this one.

This merge is smarter than a simple map iteration because it will fully replace arrays and other complex structures that are present in this map with the other map's. For example, if this map has a 3 element "foo" list, and m2 has a 2 element "foo" list, then the result will be that m has a 2 element "foo" list.

type MbLimit added in v1.24.0

type MbLimit struct {
	Units        string
	AllocationMb int
	MinimumMb    int
	MaximumMb    int
	StepSizeMb   int
	IsAdjustable bool
	CanScaleDown bool
}

type Params added in v0.15.0

type Params struct {
	Version             string `json:"version,omitempty"`
	KeyProtectKey       string `json:"disk_encryption_key_crn,omitempty"`
	BackUpEncryptionCRN string `json:"backup_encryption_key_crn,omitempty"`
	Memory              int    `json:"members_memory_allocation_mb,omitempty"`
	Disk                int    `json:"members_disk_allocation_mb,omitempty"`
	CPU                 int    `json:"members_cpu_allocation_count,omitempty"`
	KeyProtectInstance  string `json:"disk_encryption_instance_crn,omitempty"`
	ServiceEndpoints    string `json:"service-endpoints,omitempty"`
	BackupID            string `json:"backup-id,omitempty"`
	RemoteLeaderID      string `json:"remote_leader_id,omitempty"`
	PITRDeploymentID    string `json:"point_in_time_recovery_deployment_id,omitempty"`
	PITRTimeStamp       string `json:"point_in_time_recovery_time,omitempty"`
}

type QualifiedName added in v0.7.0

type QualifiedName struct {
	EntityName string // pkg+entity
	// contains filtered or unexported fields
}

func NewQualifiedName added in v0.7.0

func NewQualifiedName(name string) (*QualifiedName, error)

NewQualifiedName(name) initializes and constructs a (possibly fully qualified)

QualifiedName struct.

NOTE: If the given qualified name is None, then this is a default qualified
    name and it is resolved from properties.
NOTE: If the namespace is missing from the qualified name, the namespace
    is also resolved from the property file.

Examples:

foo => qualifiedName {namespace: "_", entityName: foo}
pkg/foo => qualifiedName {namespace: "_", entityName: pkg/foo}
/ns/foo => qualifiedName {namespace: ns, entityName: foo}
/ns/pkg/foo => qualifiedName {namespace: ns, entityName: pkg/foo}

func (*QualifiedName) GetEntity added in v0.7.0

func (qualifiedName *QualifiedName) GetEntity() string

GetEntity() returns the name of entity in qualifiedName without a leading '/'

func (*QualifiedName) GetEntityName added in v0.7.0

func (qualifiedName *QualifiedName) GetEntityName() string

GetEntityName() returns the entity name ([package/]entity) of qualifiedName

without a leading '/'

func (*QualifiedName) GetFullQualifiedName added in v0.7.0

func (qualifiedName *QualifiedName) GetFullQualifiedName() string

GetFullQualifiedName() returns a full qualified name in proper string format

from qualifiedName with proper syntax.

Example: /namespace/[package/]entity

func (*QualifiedName) GetNamespace added in v0.7.0

func (qualifiedName *QualifiedName) GetNamespace() string

GetNamespace() returns the name of the namespace in qualifiedName without

a leading '/'

func (*QualifiedName) GetPackageName added in v0.7.0

func (qualifiedName *QualifiedName) GetPackageName() string

GetPackageName() returns the package name from qualifiedName without a

leading '/'

type ResourceValidator added in v1.5.2

type ResourceValidator struct {
	// This is the resource name - Found in provider.go of IBM Terraform provider.
	// Ex: ibm_compute_monitor, ibm_compute_bare_metal, ibm_compute_dedicated_host, ibm_cis_global_load_balancer etc.,
	ResourceName string

	// Array of validator objects. Each object refers to one parameter in the resource provider.
	Schema []ValidateSchema
}

type ServiceErrorResponse added in v1.26.0

type ServiceErrorResponse struct {
	Message    string
	StatusCode int
	Result     interface{}
}

error object

func (*ServiceErrorResponse) String added in v1.26.0

func (response *ServiceErrorResponse) String() string

type Session

type Session struct {
	// SoftLayerSesssion is the the SoftLayer session used to connect to the SoftLayer API
	SoftLayerSession *slsession.Session

	// BluemixSession is the the Bluemix session used to connect to the Bluemix API
	BluemixSession *bxsession.Session
}

Session stores the information required for communication with the SoftLayer and Bluemix API

type UserConfig added in v0.6.0

type UserConfig struct {
	// contains filtered or unexported fields
}

UserConfig ...

type ValidateSchema added in v1.5.2

type ValidateSchema struct {

	//This is the parameter name.
	//Ex: private_subnet in ibm_compute_bare_metal resource
	Identifier string

	// this is similar to schema.ValueType
	Type ValueType

	// The actual validation function that needs to be invoked.
	// Ex: IntBetween, validateAllowedIntValue, validateAllowedStringValue
	ValidateFunctionIdentifier FunctionIdentifier

	MinValue       string
	MaxValue       string
	AllowedValues  string //Comma separated list of strings.
	Matches        string
	Regexp         string
	MinValueLength int
	MaxValueLength int

	// Is this nullable
	Nullable bool

	Optional bool
	Required bool
	Default  interface{}
	ForceNew bool
}

Schema is used to describe the validation schema.

func (ValidateSchema) GetValue added in v1.5.2

func (vs ValidateSchema) GetValue(valueConstraint ValueConstraintType) interface{}

utility functions - Move to different package

func (ValidateSchema) Zero added in v1.5.2

func (vs ValidateSchema) Zero() interface{}

Zero returns the zero value for a type.

type ValidatorDict added in v1.5.2

type ValidatorDict struct {
	ResourceValidatorDictionary   map[string]*ResourceValidator
	DataSourceValidatorDictionary map[string]*ResourceValidator
}

func Validator added in v1.5.2

func Validator() ValidatorDict

Validator return validator

type ValueConstraintType added in v1.5.2

type ValueConstraintType int

Type of constraints required for validation

const (
	MinValue ValueConstraintType = iota
	MaxValue
	MinValueLength
	MaxValueLength
	AllowedValues
	MatchesValue
)

func (ValueConstraintType) MarshalText added in v1.30.0

func (vct ValueConstraintType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (ValueConstraintType) String added in v1.5.2

func (i ValueConstraintType) String() string

Use Stringer tool to generate this later.

type ValueType added in v1.5.2

type ValueType int

ValueType -- Copied from Terraform for now. You can refer to Terraform ValueType directly. ValueType is an enum of the type that can be represented by a schema.

const (
	TypeInvalid ValueType = iota
	TypeBool
	TypeInt
	TypeFloat
	TypeString
)

func (ValueType) MarshalText added in v1.30.0

func (vt ValueType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (ValueType) String added in v1.5.2

func (i ValueType) String() string

Use Stringer tool to generate this later.

Source Files

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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