Documentation ¶
Index ¶
- func GetCloudProvider(i Interface) (*v1alpha1.CloudProvider, error)
- func List() []string
- func MergeAndWriteCloudProvider(i Interface) error
- func MergeCloudProvider(oldData, curData *v1alpha1.CloudProvider) (*v1alpha1.CloudProvider, error)
- func WriteCloudProvider(data *v1alpha1.CloudProvider) error
- func WriteObject(obj runtime.Object) error
- type Interface
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCloudProvider ¶
func GetCloudProvider(i Interface) (*v1alpha1.CloudProvider, error)
get data from api
func MergeAndWriteCloudProvider ¶
get data from api , merge it with previous data and write the data previous data written in cloud_old.json
func MergeCloudProvider ¶
func MergeCloudProvider(oldData, curData *v1alpha1.CloudProvider) (*v1alpha1.CloudProvider, error)
region merge rule:
if region doesn't exist in old data, but exists in cur data, then add it if region exists in old data, but doesn't exists in cur data, then delete it if region exist in both, then if field data exists in both cur and old data , then take the cur data otherwise, take data from (old or cur)whichever contains it
instanceType merge rule: same as region rule, except
if instance exists in old data, but doesn't exists in cur data, then add it , set the deprecated true
In MergeCloudProvider, we merge only the region and instanceType data
func WriteCloudProvider ¶
func WriteCloudProvider(data *v1alpha1.CloudProvider) error
func WriteObject ¶
Types ¶
type Interface ¶
type Interface interface { GetName() string ListRegions() ([]v1alpha1.Region, error) ListZones() ([]string, error) ListMachineTypes() ([]v1alpha1.MachineType, error) }
func NewCloudProvider ¶
type Options ¶
type Options struct { Provider string Do credential.DigitalOcean Packet credential.Packet GCE credential.GCE AWS credential.AWS Azure credential.Azure Vultr credential.Vultr Linode credential.Linode Scaleway credential.Scaleway }
func NewOptions ¶
func NewOptions() *Options
func NewOptionsForCredential ¶
func NewOptionsForCredential(c v1alpha1.Credential) Options
Click to show internal directories.
Click to hide internal directories.