Documentation ¶
Index ¶
- func GetRegion(defaultRegion string) (string, error)
- func GetZone(region string, defaultZone string) (string, error)
- func IsKnownRegion(region string) bool
- func IsKnownZone(region string, zone string) bool
- func Platform() (*powervs.Platform, error)
- func TransitGatewayEnabledZone(zone string) bool
- func Validate(config *types.InstallConfig) error
- func ValidateCapacityWithPools(controlPlanes []machinev1beta1.Machine, computes []machinev1beta1.MachineSet, ...) error
- func ValidateCustomVPCSetup(client API, ic *types.InstallConfig) error
- func ValidatePreExistingDNS(client API, ic *types.InstallConfig, metadata MetadataAPI) error
- func ValidateResourceGroup(client API, ic *types.InstallConfig) error
- func ValidateServiceInstance(client API, ic *types.InstallConfig) error
- type API
- type BxClient
- func (c *BxClient) GetAccountType() (string, error)
- func (c *BxClient) GetBxClientAPIKey() string
- func (c *BxClient) GetSystemPools(ctx context.Context, serviceInstanceID string) (models.SystemPools, error)
- func (c *BxClient) NewPISession() error
- func (c *BxClient) ValidateAccountPermissions() error
- func (c *BxClient) ValidateCapacity(ctx context.Context, controlPlanes []machinev1beta1.Machine, ...) error
- func (c *BxClient) ValidateCloudConnectionInPowerVSRegion(ctx context.Context, svcInsID string) error
- func (c *BxClient) ValidateDhcpService(ctx context.Context, svcInsID string, ...) error
- type Client
- func (c *Client) GetAPIKey() string
- func (c *Client) GetAuthenticatorAPIKeyDetails(ctx context.Context) (*iamidentityv1.APIKey, error)
- func (c *Client) GetDNSInstancePermittedNetworks(ctx context.Context, dnsID string, dnsZone string) ([]string, error)
- func (c *Client) GetDNSRecordsByName(ctx context.Context, crnstr string, zoneID string, recordName string, ...) ([]DNSRecordResponse, error)
- func (c *Client) GetDNSZoneIDByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error)
- func (c *Client) GetDNSZones(ctx context.Context, publish types.PublishingStrategy) ([]DNSZoneResponse, error)
- func (c *Client) GetInstanceCRNByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error)
- func (c *Client) GetPublicGatewayByVPC(ctx context.Context, vpcName string) (*vpcv1.PublicGateway, error)
- func (c *Client) GetSubnetByName(ctx context.Context, subnetName string, region string) (*vpcv1.Subnet, error)
- func (c *Client) GetVPCByName(ctx context.Context, vpcName string) (*vpcv1.VPC, error)
- func (c *Client) GetVPCs(ctx context.Context, region string) ([]vpcv1.VPC, error)
- func (c *Client) ListResourceGroups(ctx context.Context) (*resourcemanagerv2.ResourceGroupList, error)
- func (c *Client) ListServiceInstances(ctx context.Context) ([]string, error)
- func (c *Client) ServiceInstanceIDToCRN(ctx context.Context, id string) (string, error)
- func (c *Client) SetVPCServiceURLForRegion(ctx context.Context, region string) error
- type DNSRecordResponse
- type DNSZoneResponse
- type Metadata
- func (m *Metadata) APIKey(ctx context.Context) (string, error)
- func (m *Metadata) AccountID(ctx context.Context) (string, error)
- func (m *Metadata) CISInstanceCRN(ctx context.Context) (string, error)
- func (m *Metadata) DNSInstanceCRN(ctx context.Context) (string, error)
- func (m *Metadata) GetExistingVPCGateway(ctx context.Context, vpcName string, vpcSubnet string) (string, bool, error)
- func (m *Metadata) IsVPCPermittedNetwork(ctx context.Context, vpcName string, baseDomain string) (bool, error)
- func (m *Metadata) SetCISInstanceCRN(crn string)
- func (m *Metadata) SetDNSInstanceCRN(crn string)
- type MetadataAPI
- type SessionStore
- type SessionVars
- type User
- type Zone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsKnownRegion ¶
IsKnownRegion return true is a specified region is Known to the installer.
func IsKnownZone ¶
IsKnownZone return true is a specified zone is Known to the installer.
func TransitGatewayEnabledZone ¶ added in v1.4.14
TransitGatewayEnabledZone returns if a zone is configured for transit gateways rather than cloud connections.
func Validate ¶
func Validate(config *types.InstallConfig) error
Validate executes platform specific validation/
func ValidateCapacityWithPools ¶
func ValidateCapacityWithPools(controlPlanes []machinev1beta1.Machine, computes []machinev1beta1.MachineSet, systemPools models.SystemPools) error
ValidateCapacityWithPools validates that the VMs created for both the controlPlanes and the computes will fit inside the given systemPools.
func ValidateCustomVPCSetup ¶
func ValidateCustomVPCSetup(client API, ic *types.InstallConfig) error
ValidateCustomVPCSetup ensures optional VPC settings, if specified, are all legit.
func ValidatePreExistingDNS ¶
func ValidatePreExistingDNS(client API, ic *types.InstallConfig, metadata MetadataAPI) error
ValidatePreExistingDNS ensures no pre-existing DNS record exists in the CIS DNS zone or IBM DNS zone for cluster's Kubernetes API.
func ValidateResourceGroup ¶
func ValidateResourceGroup(client API, ic *types.InstallConfig) error
ValidateResourceGroup validates the resource group in our install config.
func ValidateServiceInstance ¶
func ValidateServiceInstance(client API, ic *types.InstallConfig) error
ValidateServiceInstance validates the service instance in our install config.
Types ¶
type API ¶
type API interface { GetDNSRecordsByName(ctx context.Context, crnstr string, zoneID string, recordName string, publish types.PublishingStrategy) ([]DNSRecordResponse, error) GetDNSZoneIDByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error) GetDNSZones(ctx context.Context, publish types.PublishingStrategy) ([]DNSZoneResponse, error) GetDNSInstancePermittedNetworks(ctx context.Context, dnsID string, dnsZone string) ([]string, error) GetVPCByName(ctx context.Context, vpcName string) (*vpcv1.VPC, error) GetPublicGatewayByVPC(ctx context.Context, vpcName string) (*vpcv1.PublicGateway, error) GetSubnetByName(ctx context.Context, subnetName string, region string) (*vpcv1.Subnet, error) GetAuthenticatorAPIKeyDetails(ctx context.Context) (*iamidentityv1.APIKey, error) GetAPIKey() string SetVPCServiceURLForRegion(ctx context.Context, region string) error GetVPCs(ctx context.Context, region string) ([]vpcv1.VPC, error) ListResourceGroups(ctx context.Context) (*resourcemanagerv2.ResourceGroupList, error) ListServiceInstances(ctx context.Context) ([]string, error) ServiceInstanceIDToCRN(ctx context.Context, id string) (string, error) }
API represents the calls made to the API.
type BxClient ¶
type BxClient struct { *bxsession.Session APIKey string Region string Zone string PISession *ibmpisession.IBMPISession User *User AccountAPIV2 accountv2.Accounts ServiceInstanceID string PowerVSResourceGroup string }
BxClient is struct which provides bluemix session details
func NewBxClient ¶
NewBxClient func returns bluemix client
func (*BxClient) GetAccountType ¶
GetAccountType func return the type of account TRAIL/PAID
func (*BxClient) GetBxClientAPIKey ¶
GetBxClientAPIKey returns the API key used by the Blue Mix Client.
func (*BxClient) GetSystemPools ¶
func (c *BxClient) GetSystemPools(ctx context.Context, serviceInstanceID string) (models.SystemPools, error)
GetSystemPools returns the system pools that are in the cloud.
func (*BxClient) NewPISession ¶
NewPISession updates pisession details, return error on fail.
func (*BxClient) ValidateAccountPermissions ¶
ValidateAccountPermissions Checks permission for provisioning Power VS resources
func (*BxClient) ValidateCapacity ¶
func (c *BxClient) ValidateCapacity(ctx context.Context, controlPlanes []machinev1beta1.Machine, computes []machinev1beta1.MachineSet, serviceInstanceID string) error
ValidateCapacity validates space for processors and storage in the cloud.
func (*BxClient) ValidateCloudConnectionInPowerVSRegion ¶
func (c *BxClient) ValidateCloudConnectionInPowerVSRegion(ctx context.Context, svcInsID string) error
ValidateCloudConnectionInPowerVSRegion counts cloud connection in PowerVS Region
func (*BxClient) ValidateDhcpService ¶
func (c *BxClient) ValidateDhcpService(ctx context.Context, svcInsID string, machineNetworks []types.MachineNetworkEntry) error
ValidateDhcpService checks for existing Dhcp service for the provided PowerVS cloud instance
type Client ¶
Client makes calls to the PowerVS API.
func (*Client) GetAuthenticatorAPIKeyDetails ¶
GetAuthenticatorAPIKeyDetails gets detailed information on the API key used for authentication to the IBM Cloud APIs.
func (*Client) GetDNSInstancePermittedNetworks ¶
func (c *Client) GetDNSInstancePermittedNetworks(ctx context.Context, dnsID string, dnsZone string) ([]string, error)
GetDNSInstancePermittedNetworks gets the permitted VPC networks for a DNS Services instance
func (*Client) GetDNSRecordsByName ¶
func (c *Client) GetDNSRecordsByName(ctx context.Context, crnstr string, zoneID string, recordName string, publish types.PublishingStrategy) ([]DNSRecordResponse, error)
GetDNSRecordsByName gets DNS records in specific Cloud Internet Services instance by its CRN, zone ID, and DNS record name.
func (*Client) GetDNSZoneIDByName ¶
func (c *Client) GetDNSZoneIDByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error)
GetDNSZoneIDByName gets the CIS zone ID from its domain name.
func (*Client) GetDNSZones ¶
func (c *Client) GetDNSZones(ctx context.Context, publish types.PublishingStrategy) ([]DNSZoneResponse, error)
GetDNSZones returns all of the active DNS zones managed by CIS.
func (*Client) GetInstanceCRNByName ¶
func (c *Client) GetInstanceCRNByName(ctx context.Context, name string, publish types.PublishingStrategy) (string, error)
GetInstanceCRNByName finds the CRN of the instance with the specified name.
func (*Client) GetPublicGatewayByVPC ¶
func (c *Client) GetPublicGatewayByVPC(ctx context.Context, vpcName string) (*vpcv1.PublicGateway, error)
GetPublicGatewayByVPC gets all PublicGateways in a region
func (*Client) GetSubnetByName ¶
func (c *Client) GetSubnetByName(ctx context.Context, subnetName string, region string) (*vpcv1.Subnet, error)
GetSubnetByName gets a VPC Subnet by its name and region.
func (*Client) GetVPCByName ¶
GetVPCByName gets a VPC by its name.
func (*Client) ListResourceGroups ¶
func (c *Client) ListResourceGroups(ctx context.Context) (*resourcemanagerv2.ResourceGroupList, error)
ListResourceGroups returns a list of resource groups.
func (*Client) ListServiceInstances ¶
ListServiceInstances lists all service instances in the cloud.
func (*Client) ServiceInstanceIDToCRN ¶ added in v1.4.14
ServiceInstanceIDToCRN returns the CRN of the matching service instance GUID which was passed in.
type DNSRecordResponse ¶
DNSRecordResponse represents a DNS record response.
type DNSZoneResponse ¶
type DNSZoneResponse struct { // Name is the domain name of the zone. Name string // ID is the zone's ID. ID string // CISInstanceCRN is the IBM Cloud Resource Name for the CIS instance where // the DNS zone is managed. InstanceCRN string // CISInstanceName is the display name of the CIS instance where the DNS zone // is managed. InstanceName string // ResourceGroupID is the resource group ID of the CIS instance. ResourceGroupID string }
DNSZoneResponse represents a DNS zone response.
type Metadata ¶
type Metadata struct { BaseDomain string // contains filtered or unexported fields }
Metadata holds additional metadata for InstallConfig resources that do not need to be user-supplied (e.g. because it can be retrieved from external APIs).
func NewMetadata ¶
NewMetadata initializes a new Metadata object.
func (*Metadata) APIKey ¶
APIKey returns the IBM Cloud account API Key associated with the authentication credentials.
func (*Metadata) AccountID ¶
AccountID returns the IBM Cloud account ID associated with the authentication credentials.
func (*Metadata) CISInstanceCRN ¶
CISInstanceCRN returns the Cloud Internet Services instance CRN that is managing the DNS zone for the base domain.
func (*Metadata) DNSInstanceCRN ¶
DNSInstanceCRN returns the IBM DNS Service instance CRN that is managing the DNS zone for the base domain.
func (*Metadata) GetExistingVPCGateway ¶
func (m *Metadata) GetExistingVPCGateway(ctx context.Context, vpcName string, vpcSubnet string) (string, bool, error)
GetExistingVPCGateway checks if the VPC is a Permitted Network for the DNS Zone
func (*Metadata) IsVPCPermittedNetwork ¶
func (m *Metadata) IsVPCPermittedNetwork(ctx context.Context, vpcName string, baseDomain string) (bool, error)
IsVPCPermittedNetwork checks if the VPC is a Permitted Network for the DNS Zone
func (*Metadata) SetCISInstanceCRN ¶
SetCISInstanceCRN sets Cloud Internet Services instance CRN to a string value.
func (*Metadata) SetDNSInstanceCRN ¶
SetDNSInstanceCRN sets IBM DNS Service instance CRN to a string value.
type MetadataAPI ¶
type MetadataAPI interface { AccountID(ctx context.Context) (string, error) APIKey(ctx context.Context) (string, error) CISInstanceCRN(ctx context.Context) (string, error) DNSInstanceCRN(ctx context.Context) (string, error) }
MetadataAPI represents functions that eventually call out to the API
type SessionStore ¶
type SessionStore struct { ID string `json:"id,omitempty"` APIKey string `json:"apikey,omitempty"` DefaultRegion string `json:"region,omitempty"` DefaultZone string `json:"zone,omitempty"` ServiceInstanceID string `json:"serviceinstance,omitempty"` PowerVSResourceGroup string `json:"resourcegroup,omitempty"` }
SessionStore is an object and store that holds credentials and variables required to create a SessionVars object.
type SessionVars ¶
type SessionVars struct { ID string APIKey string Region string Zone string ServiceInstanceID string PowerVSResourceGroup string }
SessionVars is an object that holds the variables required to create an ibmpisession object.