iks

package
v1.3.440 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeNotAuthorized        = "NotAuthorized"
	ErrCodeUnableToAuthenticate = "UnableToAuthenticate"
)
View Source
const (
	//ErrCodeInvalidToken  ...
	ErrCodeInvalidToken = "InvalidToken"
)

Variables

This section is empty.

Functions

func AuthenticateAPIKey

func AuthenticateAPIKey(apikey string, config *ibmcloud.Config) error

func AuthenticatePassword

func AuthenticatePassword(username string, password string, config *ibmcloud.Config) error

func AuthenticateSSO

func AuthenticateSSO(passcode string, config *ibmcloud.Config) error

func ComputeClusterConfigDir

func ComputeClusterConfigDir(name string) (string, error)

func ConfigFromJSON

func ConfigFromJSON(config *ibmcloud.Config) (accountID string, err error)

func GetAccounts

func GetAccounts(accounts []Account) map[string]*Account

func GetAuthRegions

func GetAuthRegions(config *ibmcloud.Config) ([]string, error)

func GetClusterID

func GetClusterID() (string, error)

func GetClusterName

func GetClusterName() (string, error)

func GetClusterRegistry

func GetClusterRegistry(kubeClient kubernetes.Interface) string

Try to use the regional registry used by the cluster We will also set the corresponding secret for jenkins-x right away

func GetKubeClusterID

func GetKubeClusterID(kubeClient kubernetes.Interface) (string, error)

func GetKubeClusterRegion

func GetKubeClusterRegion(kubeClient kubernetes.Interface) (string, error)

func GetKubeVersions

func GetKubeVersions(versions containerv1.KubeVersions) ([]string, string, error)

func GetMachineTypes

func GetMachineTypes(zone Zone, machinetypes MachineTypes) ([]string, error)

func GetPrivateVLANs

func GetPrivateVLANs(zone Zone, vlans VLANs) ([]string, error)

func GetPublicVLANs

func GetPublicVLANs(zone Zone, vlans VLANs) ([]string, error)

func GetRegions

func GetRegions(regions Regions) ([]string, error)

func GetRegistryConfigJSON

func GetRegistryConfigJSON(registry string) (string, error)

func GetZones

func GetZones(region Region, zones Zones) ([]string, error)

func RefreshTokenToLinkAccounts

func RefreshTokenToLinkAccounts(account *Account, config *ibmcloud.Config) error

Types

type Account

type Account struct {
	GUID          string
	Name          string
	Type          string
	State         string
	OwnerGUID     string
	OwnerUserID   string
	OwnerUniqueID string
	CustomerID    string
	CountryCode   string
	CurrencyCode  string
	Organizations []AccountOrganization
	IMSAccountID  string
}

Account Model ...

type AccountEntity

type AccountEntity struct {
	Name                 string                `json:"name"`
	Type                 string                `json:"type"`
	State                string                `json:"state"`
	OwnerGUID            string                `json:"owner"`
	OwnerUserID          string                `json:"owner_userid"`
	OwnerUniqueID        string                `json:"owner_unique_id"`
	CustomerID           string                `json:"customer_id"`
	CountryCode          string                `json:"country_code"`
	CurrencyCode         string                `json:"currency_code"`
	Organizations        []AccountOrganization `json:"organizations_region"`
	Linkages             []Linkage             `json:"linkages"`
	BluemixSubscriptions []BluemixSubscription `json:"bluemix_subscriptions"`
}

AccountEntity ...

type AccountNameQueryResponse

type AccountNameQueryResponse struct {
	Metadata Metadata
	Entity   AccountEntity
}

AccountQueryResponse ...

func (AccountNameQueryResponse) ToModel

func (nameQueryResponse AccountNameQueryResponse) ToModel() Account

type AccountOrganization

type AccountOrganization struct {
	GUID   string `json:"guid"`
	Region string `json:"region"`
}

AccountOrganization ...

type AccountQueryResponse

type AccountQueryResponse struct {
	Metadata Metadata
	Accounts []AccountResource `json:"resources"`
}

AccountQueryResponse ...

type AccountResource

type AccountResource struct {
	Resource
	Entity AccountEntity
}

AccountResource ...

func (AccountResource) ToModel

func (resource AccountResource) ToModel() Account

ToModel ...

type AccountServiceAPI

type AccountServiceAPI interface {
	Accounts() Accounts
}

AccountServiceAPI is the accountv2 client ...

func NewAccountServiceAPI

func NewAccountServiceAPI(sess *session.Session) (AccountServiceAPI, error)

New ...

type Accounts

type Accounts interface {
	List() ([]Account, error)
	FindByOrg(orgGUID string, region string) (*Account, error)
	FindByOwner(userID string) (*Account, error)
	Get(accountId string) (*Account, error)
}

Accounts ...

type AddTokenResponse

type AddTokenResponse struct {
	Token string `json:"token"`
}

type Auth

type Auth struct {
	Auth string `json:"auth,omitempty"`
}

type BluemixSubscription

type BluemixSubscription struct {
	SoftlayerAccountID string `json:"softlayer_account_id"`
}

type ClusterConfig

type ClusterConfig struct {
	ClusterID      string `json:"cluster_id"`
	ClusterName    string `json:"cluster_name"`
	ClusterType    string `json:"cluster_type"`
	ClusterPayTier string `json:"cluster_pay_tier"`
	Datacenter     string `json:"datacenter"`
	AccountID      string `json:"account_id"`
	Created        string `json:"created"`
}

This name is the name known to cruiser

type Clusters

type Clusters interface {
	GetClusterConfig(name string, target containerv1.ClusterTargetHeader) (string, error)
}

type Config

type Config struct {
	Auths map[string]*Auth `json:"auths,omitempty"`
}

type ConfigJSON

type ConfigJSON struct {
	APIEndpoint     string `json:"APIEndpoint"`
	ConsoleEndpoint string `json:"ConsoleEndpoint"`
	Region          string `json:"Region"`
	RegionID        string `json:"RegionID"`
	RegionType      string `json:"RegionType"`
	IAMEndpoint     string `json:"IAMEndpoint"`
	IAMToken        string `json:"IAMToken"`
	IAMRefreshToken string `json:"IAMRefreshToken"`
	Account         struct {
		GUID  string `json:"GUID"`
		Name  string `json:"Name"`
		Owner string `json:"Owner"`
	} `json:"Account"`
	ResourceGroup struct {
		GUID    string `json:"GUID"`
		Name    string `json:"Name"`
		State   string `json:"State"`
		Default bool   `json:"Default"`
		QuotaID string `json:"QuotaID"`
	} `json:"ResourceGroup"`
	CFEETargeted bool   `json:"CFEETargeted"`
	CFEEEnvID    string `json:"CFEEEnvID"`
	PluginRepos  []struct {
		Name string `json:"Name"`
		URL  string `json:"URL"`
	} `json:"PluginRepos"`
	SSLDisabled                bool   `json:"SSLDisabled"`
	Locale                     string `json:"Locale"`
	Trace                      string `json:"Trace"`
	ColorEnabled               string `json:"ColorEnabled"`
	HTTPTimeout                int    `json:"HTTPTimeout"`
	CLIInfoEndpoint            string `json:"CLIInfoEndpoint"`
	CheckCLIVersionDisabled    bool   `json:"CheckCLIVersionDisabled"`
	UsageStatsDisabled         bool   `json:"UsageStatsDisabled"`
	SDKVersion                 string `json:"SDKVersion"`
	UpdateCheckInterval        int    `json:"UpdateCheckInterval"`
	UpdateRetryCheckInterval   int    `json:"UpdateRetryCheckInterval"`
	UpdateNotificationInterval int    `json:"UpdateNotificationInterval"`
}

type IAMAuthRepository

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

IAMAuthRepository ...

func NewIAMAuthRepository

func NewIAMAuthRepository(config *bluemix.Config, client *rest.Client) (*IAMAuthRepository, error)

NewIAMAuthRepository ...

func (*IAMAuthRepository) AuthenticateAPIKey

func (auth *IAMAuthRepository) AuthenticateAPIKey(apiKey string) error

AuthenticateAPIKey ...

func (*IAMAuthRepository) AuthenticatePassword

func (auth *IAMAuthRepository) AuthenticatePassword(username string, password string) error

AuthenticatePassword ...

func (*IAMAuthRepository) AuthenticateSSO

func (auth *IAMAuthRepository) AuthenticateSSO(passcode string) error

AuthenticateSSO ...

func (*IAMAuthRepository) RefreshToken

func (auth *IAMAuthRepository) RefreshToken() (string, error)

RefreshToken ...

func (*IAMAuthRepository) RefreshTokenToLinkAccounts

func (auth *IAMAuthRepository) RefreshTokenToLinkAccounts(account *Account) error

type IAMError

type IAMError struct {
	ErrorCode    string `json:"errorCode"`
	ErrorMessage string `json:"errorMessage"`
	ErrorDetails string `json:"errorDetails"`
}

IAMError ...

func (IAMError) Description

func (e IAMError) Description() string

Description ...

type IAMTokenResponse

type IAMTokenResponse struct {
	AccessToken     string `json:"access_token"`
	RefreshToken    string `json:"refresh_token"`
	UAAAccessToken  string `json:"uaa_token"`
	UAARefreshToken string `json:"uaa_refresh_token"`
	TokenType       string `json:"token_type"`
}

IAMTokenResponse ...

type KubernetesServiceAPI

type KubernetesServiceAPI interface {
	Zones() Zones
	Regions() Regions
	MachineTypes() MachineTypes
	VLANs() VLANs
	Clusters() Clusters
}

func New

func NewSessionless

func NewSessionless(sess *session.Session) (KubernetesServiceAPI, error)

No auth session is required for region and zone calls

type Linkage

type Linkage struct {
	Origin string `json:"origin"`
	State  string `json:"state"`
}

type MachineType

type MachineType struct {
	Name                      string
	Memory                    string
	NetworkSpeed              string
	Cores                     string
	Os                        string
	ServerType                string
	Storage                   string
	SecondaryStorage          string
	SecondaryStorageEncrypted bool
	Deprecated                bool
	CorrespondingMachineType  string
	IsTrusted                 bool
	Gpus                      string
}

type MachineTypes

type MachineTypes interface {
	GetMachineTypes(zone Zone) ([]MachineType, error)
	GetMachineType(machinetypearg string, zone Zone) (*MachineType, error)
}

type Metadata

type Metadata struct {
	GUID string `json:"guid"`
	URL  string `json:"url"`
}

Metadata ...

type Region

type Region struct {
	Name        string `json:"name"`
	Alias       string `json:"alias"`
	CfURL       string `json:"cfURL"`
	FreeEnabled bool   `json:"freeEnabled"`
}

type RegionResponse

type RegionResponse struct {
	Regions []Region `json:"regions"`
}

type Regions

type Regions interface {
	GetRegions() ([]Region, error)
	GetRegion(region string) (*Region, error)
}

type Registry

type Registry interface {
	AddToken(account string, description string, permanent bool, write bool) (string, error)
}

type RegistryServiceAPI

type RegistryServiceAPI interface {
	Registry() Registry
}

func NewRegistryServiceAPI

func NewRegistryServiceAPI(sess *session.Session) (RegistryServiceAPI, error)

New ...

type Resource

type Resource struct {
	Metadata Metadata
}

Resource ...

type VLAN

type VLAN struct {
	ID         string `json:"id"`
	Type       string `json:"type"`
	Properties struct {
		Name                       string `json:"name"`
		Note                       string `json:"note"`
		PrimaryRouter              string `json:"primary_router"`
		VlanNumber                 string `json:"vlan_number"`
		VlanType                   string `json:"vlan_type"`
		Location                   string `json:"location"`
		LocalDiskStorageCapability string `json:"local_disk_storage_capability"`
		SanStorageCapability       string `json:"san_storage_capability"`
	} `json:"properties"`
}

type VLANs

type VLANs interface {
	GetVLANs(zone Zone) ([]VLAN, error)
	GetVLAN(vlanarg string, zone Zone) (*VLAN, error)
}

type Zone

type Zone struct {
	ID    string
	Metro string
}

type Zones

type Zones interface {
	GetZones(region Region) ([]Zone, error)
	GetZone(zone string, region Region) (*Zone, error)
}

Jump to

Keyboard shortcuts

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