Documentation ¶
Index ¶
- Constants
- type Client
- func (c *Client) AddTags(instanceID string, serverTags []string) error
- func (c *Client) Authenticate() error
- func (c *Client) BindFloatingIP(floatingIP, instanceID string) error
- func (c *Client) BindFloatingIPToPort(floatingIP, portID string) error
- func (c *Client) CreateCluster(opts *CreateClusterOpts) (*clusters.Clusters, error)
- func (c *Client) CreateECSInstance(opts cloudservers.CreateOptsBuilder, timeoutSeconds int) (string, error)
- func (c *Client) CreateEIP(opts *ElasticIPOpts) (*eips.PublicIp, error)
- func (c *Client) CreateInstance(opts *ExtendedServerOpts) (*servers.Server, error)
- func (c *Client) CreateKeyPair(name string, publicKey string) (*keypairs.KeyPair, error)
- func (c *Client) CreateLBListener(opts *listeners.CreateOpts) (*listeners.Listener, error)
- func (c *Client) CreateLBMember(poolID string, opts *pools.CreateMemberOpts) (*pools.Member, error)
- func (c *Client) CreateLBMonitor(opts *monitors.CreateOpts) (*monitors.Monitor, error)
- func (c *Client) CreateLBPool(opts *pools.CreateOpts) (*pools.Pool, error)
- func (c *Client) CreateLoadBalancer(opts *loadbalancers.CreateOpts) (*loadbalancers.LoadBalancer, error)
- func (c *Client) CreateNodes(opts *CreateNodesOpts, count int) ([]string, error)
- func (c *Client) CreateSecurityGroup(securityGroupName string, ports ...PortRange) (*secgroups.SecurityGroup, error)
- func (c *Client) CreateServerGroup(opts *servergroups.CreateOpts) (*servergroups.ServerGroup, error)
- func (c *Client) CreateSubnet(vpcID string, subnetName string) (*subnets.Subnet, error)
- func (c *Client) CreateVPC(vpcName string) (*vpcs.Vpc, error)
- func (c *Client) DeleteCluster(clusterID string) error
- func (c *Client) DeleteECSInstance(instanceID string) error
- func (c *Client) DeleteFloatingIP(floatingIP string) error
- func (c *Client) DeleteInstance(instanceID string) error
- func (c *Client) DeleteKeyPair(name string) error
- func (c *Client) DeleteLBListener(id string) error
- func (c *Client) DeleteLBMember(poolID, memberID string) error
- func (c *Client) DeleteLBMonitor(id string) error
- func (c *Client) DeleteLBPool(id string) error
- func (c *Client) DeleteLoadBalancer(id string) error
- func (c *Client) DeleteNodes(clusterID string, nodeIDs []string) error
- func (c *Client) DeleteSecurityGroup(securityGroupID string) error
- func (c *Client) DeleteServerGroup(id string) error
- func (c *Client) DeleteSubnet(vpcID string, subnetID string) error
- func (c *Client) DeleteVPC(vpcID string) error
- func (c *Client) FindFlavor(flavorName string) (string, error)
- func (c *Client) FindFloatingIP(floatingIP string) (addressID string, err error)
- func (c *Client) FindImage(imageName string) (string, error)
- func (c *Client) FindInstance(name string) (string, error)
- func (c *Client) FindKeyPair(name string) (string, error)
- func (c *Client) FindSecurityGroups(secGroups []string) ([]string, error)
- func (c *Client) FindServerGroup(groupName string) (result string, err error)
- func (c *Client) FindSubnet(vpcID string, subnetName string) (string, error)
- func (c *Client) FindVPC(vpcName string) (string, error)
- func (c *Client) GetCluster(clusterID string) (*clusters.Clusters, error)
- func (c *Client) GetClusterCertificate(clusterID string) (*clusters.Certificate, error)
- func (c *Client) GetECSStatus(instanceID string) (*cloudservers.CloudServer, error)
- func (c *Client) GetEIPStatus(eipID string) (string, error)
- func (c *Client) GetInstanceSG(instanceID string) ([]secgroups.SecurityGroup, error)
- func (c *Client) GetInstanceStatus(instanceID string) (*servers.Server, error)
- func (c *Client) GetLBMemberStatus(poolID, memberID string) (*pools.Member, error)
- func (c *Client) GetLoadBalancerDetails(id string) (*loadbalancers.LoadBalancer, error)
- func (c *Client) GetNodesStatus(clusterID string, nodeIDs []string) ([]*nodes.Status, error)
- func (c *Client) GetPublicKey(keyPairName string) ([]byte, error)
- func (c *Client) GetServerEIP(id string) (string, error)
- func (c *Client) GetSubnetStatus(subnetID string) (*subnets.Subnet, error)
- func (c *Client) GetVPCDetails(vpcID string) (*vpcs.Vpc, error)
- func (c *Client) InitCCE() error
- func (c *Client) InitCompute() error
- func (c *Client) InitECS() error
- func (c *Client) InitIms() error
- func (c *Client) InitNetworkV2() error
- func (c *Client) InitVPC() error
- func (c *Client) InstanceBindToIP(instanceID string, ip string) (bool, error)
- func (c *Client) NewServiceClient(service string) (*golangsdk.ServiceClient, error)
- func (c *Client) ReleaseEIP(opts eips.ListOpts) error
- func (c *Client) RestartInstance(instanceID string) error
- func (c *Client) SecurityGroupExist(id string) bool
- func (c *Client) StartInstance(instanceID string) error
- func (c *Client) StopInstance(instanceID string) error
- func (c *Client) Token() (string, error)
- func (c *Client) UnbindFloatingIP(floatingIP, instanceID string) error
- func (c *Client) UpdateCluster(clusterID string, opts *clusters.UpdateSpec) error
- func (c *Client) WaitForEIPActive(eipID string) error
- func (c *Client) WaitForGroupDeleted(securityGroupID string) error
- func (c *Client) WaitForInstanceStatus(instanceID string, status string) error
- func (c *Client) WaitForSubnetStatus(subnetID string, status string) error
- func (c *Client) WaitForVPCStatus(vpcID, status string) error
- type CreateClusterOpts
- type CreateNodesOpts
- type DiskOpts
- type ElasticIPOpts
- type ExtendedServerOpts
- type Metadata
- type PortRange
Constants ¶
const ( InstanceStatusStopped = "SHUTOFF" InstanceStatusRunning = "ACTIVE" DefaultSecurityGroupDescription = "Automatically created by docker-machine for OTC" )
Instance statuses
const ( // ClusterTypeECS default cluster type for ECS ClusterTypeECS = "VirtualMachine" // ClusterTypeBMS default cluster type for BMS ClusterTypeBMS = "BareMetal" // ContainerNetworkModeOverlay default cluster network overlay ContainerNetworkModeOverlay = "overlay_l2" // ContainerNetworkModeUnderlay default cluster network underlay ContainerNetworkModeUnderlay = "underlay_ipvlan" // ContainerNetworkModeVPC default cluster network mode ContainerNetworkModeVPC = "vpc-router" // ClusterAvailable default cluster state ClusterAvailable = "Available" // NodeActive default node state NodeActive = "Active" // EulerOSVersion default os version EulerOSVersion = "EulerOS 2.5" )
const LBStateActive = "ACTIVE"
LBStateActive default
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Provider *golangsdk.ProviderClient ECS *golangsdk.ServiceClient ComputeV2 *golangsdk.ServiceClient ImsV2 *golangsdk.ServiceClient NetworkV2 *golangsdk.ServiceClient VPC *golangsdk.ServiceClient CCE *golangsdk.ServiceClient // contains filtered or unexported fields }
Client contains service clients
func NewCloudClient ¶ added in v0.3.0
NewCloudClient - creates new cloud client
func (*Client) Authenticate ¶
Authenticate - authenticate client in the cloud with token (either directly or via username/password)
func (*Client) BindFloatingIP ¶
BindFloatingIP binds floating IP to instance
func (*Client) BindFloatingIPToPort ¶ added in v0.3.0
BindFloatingIPToPort binds floating IP to networking port
func (*Client) CreateCluster ¶ added in v0.3.0
func (c *Client) CreateCluster(opts *CreateClusterOpts) (*clusters.Clusters, error)
CreateCluster create CCE cluster and wait until it is available
func (*Client) CreateECSInstance ¶ added in v0.3.0
func (c *Client) CreateECSInstance(opts cloudservers.CreateOptsBuilder, timeoutSeconds int) (string, error)
CreateECSInstance - create new ECS instance
func (*Client) CreateEIP ¶ added in v0.2.2
func (c *Client) CreateEIP(opts *ElasticIPOpts) (*eips.PublicIp, error)
CreateEIP creates new eip
func (*Client) CreateInstance ¶
func (c *Client) CreateInstance(opts *ExtendedServerOpts) (*servers.Server, error)
CreateInstance creates new ECS
func (*Client) CreateKeyPair ¶
CreateKeyPair creates new key pair from given public key string
func (*Client) CreateLBListener ¶ added in v0.3.0
CreateLBListener creates listener
func (*Client) CreateLBMember ¶ added in v0.3.0
CreateLBMember creates load balancer member
func (*Client) CreateLBMonitor ¶ added in v0.3.0
CreateLBMonitor creates load balancer health monitor
func (*Client) CreateLBPool ¶ added in v0.3.0
CreateLBPool creates load balancer pool
func (*Client) CreateLoadBalancer ¶ added in v0.3.0
func (c *Client) CreateLoadBalancer(opts *loadbalancers.CreateOpts) (*loadbalancers.LoadBalancer, error)
CreateLoadBalancer creating new ELBv2
func (*Client) CreateNodes ¶ added in v0.3.0
func (c *Client) CreateNodes(opts *CreateNodesOpts, count int) ([]string, error)
CreateNodes create `count` nodes and wait until they are active
func (*Client) CreateSecurityGroup ¶
func (c *Client) CreateSecurityGroup(securityGroupName string, ports ...PortRange) (*secgroups.SecurityGroup, error)
CreateSecurityGroup creates new sec group and returns group ID
func (*Client) CreateServerGroup ¶ added in v0.3.0
func (c *Client) CreateServerGroup(opts *servergroups.CreateOpts) (*servergroups.ServerGroup, error)
CreateServerGroup - creates server group
func (*Client) CreateSubnet ¶
CreateSubnet creates new Subnet and set Driver.SubnetID
func (*Client) DeleteCluster ¶ added in v0.3.0
DeleteCluster removes cluster
func (*Client) DeleteECSInstance ¶ added in v0.3.0
DeleteECSInstance deletes ecs
func (*Client) DeleteFloatingIP ¶
DeleteFloatingIP releases floating IP
func (*Client) DeleteInstance ¶
DeleteInstance removes existing ECS instance
func (*Client) DeleteKeyPair ¶
DeleteKeyPair removes existing key pair
func (*Client) DeleteLBListener ¶ added in v0.3.0
DeleteLBListener deletes listener
func (*Client) DeleteLBMember ¶ added in v0.3.0
DeleteLBMember deletes load balancer member
func (*Client) DeleteLBMonitor ¶ added in v0.3.0
DeleteLBMonitor deletes load balancer health monitor
func (*Client) DeleteLBPool ¶ added in v0.3.0
DeleteLBPool deletes load balancer pool
func (*Client) DeleteLoadBalancer ¶ added in v0.3.0
DeleteLoadBalancer removes existing load balancer
func (*Client) DeleteNodes ¶ added in v0.3.0
DeleteNodes deletes all given nodes
func (*Client) DeleteSecurityGroup ¶
DeleteSecurityGroup deletes managed security group
func (*Client) DeleteServerGroup ¶ added in v0.3.0
DeleteServerGroup - deletes server group
func (*Client) DeleteSubnet ¶
DeleteSubnet removes subnet from VPC
func (*Client) FindFlavor ¶
FindFlavor resolves `Flavor ID` for given `Flavor Name`
func (*Client) FindFloatingIP ¶
FindFloatingIP finds given floating IP and returns ID
func (*Client) FindInstance ¶
FindInstance returns instance ID by instance Name
func (*Client) FindKeyPair ¶
FindKeyPair searches for key pair and returns public key
func (*Client) FindSecurityGroups ¶ added in v0.1.2
FindSecurityGroups get slice of security group IDs from given security group names
func (*Client) FindServerGroup ¶ added in v0.2.3
FindServerGroup - get server group
func (*Client) FindSubnet ¶
FindSubnet find subnet by name in given VPC and return ID
func (*Client) GetCluster ¶ added in v0.3.0
GetCluster cluster details
func (*Client) GetClusterCertificate ¶ added in v0.3.0
func (c *Client) GetClusterCertificate(clusterID string) (*clusters.Certificate, error)
GetClusterCertificate cluster certificate
func (*Client) GetECSStatus ¶ added in v0.3.0
func (c *Client) GetECSStatus(instanceID string) (*cloudservers.CloudServer, error)
GetECSStatus returns current ecs status
func (*Client) GetEIPStatus ¶ added in v0.2.2
GetEIPStatus get status of ip
func (*Client) GetInstanceSG ¶ added in v0.3.2
func (c *Client) GetInstanceSG(instanceID string) ([]secgroups.SecurityGroup, error)
GetInstanceSG get details of ECS instance security groups
func (*Client) GetInstanceStatus ¶
GetInstanceStatus returns instance details by instance ID
func (*Client) GetLBMemberStatus ¶ added in v0.3.0
GetLBMemberStatus get load balancer member status
func (*Client) GetLoadBalancerDetails ¶ added in v0.3.0
func (c *Client) GetLoadBalancerDetails(id string) (*loadbalancers.LoadBalancer, error)
GetLoadBalancerDetails fetches load balancer data
func (*Client) GetNodesStatus ¶ added in v0.3.0
GetNodesStatus returns statuses of given nodes
func (*Client) GetPublicKey ¶
GetPublicKey returns public key data from keypair
func (*Client) GetServerEIP ¶ added in v0.3.3
GetServerEIP - get floating ip by instance ID
func (*Client) GetSubnetStatus ¶
GetSubnetStatus returns details of subnet by ID
func (*Client) GetVPCDetails ¶
GetVPCDetails returns details of VPC
func (*Client) InitCompute ¶
InitCompute initializes Compute v2 service
func (*Client) InitNetworkV2 ¶ added in v0.3.0
InitNetworkV2 initializes OpenStack Neutron client
func (*Client) InstanceBindToIP ¶
InstanceBindToIP checks if instance has IP bind
func (*Client) NewServiceClient ¶ added in v0.3.0
func (c *Client) NewServiceClient(service string) (*golangsdk.ServiceClient, error)
NewServiceClient is a convenience function to get a new service client.
func (*Client) ReleaseEIP ¶ added in v0.3.0
ReleaseEIP releases new eip
func (*Client) RestartInstance ¶
RestartInstance restarts ECS instance
func (*Client) SecurityGroupExist ¶ added in v0.3.2
SecurityGroupExist check if security group still exist
func (*Client) StartInstance ¶
StartInstance starts existing ECS instance
func (*Client) StopInstance ¶
StopInstance stops existing ECS instance
func (*Client) UnbindFloatingIP ¶
UnbindFloatingIP unbinds floating IP to instance
func (*Client) UpdateCluster ¶ added in v0.3.0
func (c *Client) UpdateCluster(clusterID string, opts *clusters.UpdateSpec) error
UpdateCluster updates cluster description
func (*Client) WaitForEIPActive ¶ added in v0.2.2
WaitForEIPActive wait for ip to be active
func (*Client) WaitForGroupDeleted ¶ added in v0.2.1
WaitForGroupDeleted polls sec group until it returns 404
func (*Client) WaitForInstanceStatus ¶
WaitForInstanceStatus waits for instance to be in given status
func (*Client) WaitForSubnetStatus ¶
WaitForSubnetStatus waits for subnet to be in given status
func (*Client) WaitForVPCStatus ¶
WaitForVPCStatus waits until VPC is in given status
type CreateClusterOpts ¶ added in v0.3.0
type CreateClusterOpts struct { Metadata Name string Description string ClusterType string // required, VirtualMachine or BareMetal ClusterVersion string // optional, uses latest available version by default FlavorID string // required, one of CCE flavour VpcID string // required SubnetID string // required HighwaySubnetID string // optional, used for BMS ContainerNetwork clusters.ContainerNetworkSpec // required, `Mode` should be one of ContainerNetworkMode const AuthenticationMode string // required, recommended: rbac BillingMode int MultiAZ bool FloatingIP string ExtendParam map[string]string }
CreateClusterOpts cluster structure
type CreateNodesOpts ¶ added in v0.3.0
type CreateNodesOpts struct { Metadata Name string ClusterID string // required Region string // required, project name actually FlavorID string // required AvailabilityZone string // required KeyPair string // required RootVolume nodes.VolumeSpec // required, 40G+ DataVolumes []nodes.VolumeSpec // at least one is required required, 100G+ Os string // by default EulerOS 2.5 MaxPods int PreInstall string PostInstall string EipCount int EipOpts ElasticIPOpts BillingMode int PublicKey string ChargingMode int PerformanceType string OrderID string ProductID string }
CreateNodesOpts node structure
type ElasticIPOpts ¶ added in v0.2.2
ElasticIPOpts structure
type ExtendedServerOpts ¶ added in v0.2.3
type ExtendedServerOpts struct { *servers.CreateOpts SubnetID string FixedIP string KeyPairName string DiskOpts *DiskOpts ServerGroupID string }
ExtendedServerOpts server opts struct