vpc

package
v0.9.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package vpc implements VPC code.

Index

Constants

This section is empty.

Variables

View Source
var SecurityGroupByNameNotFound = func(name string) error { return fmt.Errorf("failed to find security group by name '%s'", name) }

SecurityGroupByNameNotFound returns an appropriate error when security group by name not found.

Functions

This section is empty.

Types

type Service

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

Service holds the VPC Service specific information.

func (*Service) CreateImage added in v0.9.0

func (s *Service) CreateImage(options *vpcv1.CreateImageOptions) (*vpcv1.Image, *core.DetailedResponse, error)

CreateImage creates a new VPC Custom Image.

func (*Service) CreateInstance

func (s *Service) CreateInstance(options *vpcv1.CreateInstanceOptions) (*vpcv1.Instance, *core.DetailedResponse, error)

CreateInstance created an virtal server instance.

func (*Service) CreateLoadBalancer

func (s *Service) CreateLoadBalancer(options *vpcv1.CreateLoadBalancerOptions) (*vpcv1.LoadBalancer, *core.DetailedResponse, error)

CreateLoadBalancer creates a new load balancer.

func (*Service) CreateLoadBalancerPoolMember

CreateLoadBalancerPoolMember creates a new member and adds the member to the pool.

func (*Service) CreatePublicGateway

func (s *Service) CreatePublicGateway(options *vpcv1.CreatePublicGatewayOptions) (*vpcv1.PublicGateway, *core.DetailedResponse, error)

CreatePublicGateway creates a public gateway for the VPC.

func (*Service) CreateSecurityGroup added in v0.8.0

func (s *Service) CreateSecurityGroup(options *vpcv1.CreateSecurityGroupOptions) (*vpcv1.SecurityGroup, *core.DetailedResponse, error)

CreateSecurityGroup creates a new security group.

func (*Service) CreateSecurityGroupRule

CreateSecurityGroupRule creates a rule for a security group.

func (*Service) CreateSubnet

func (s *Service) CreateSubnet(options *vpcv1.CreateSubnetOptions) (*vpcv1.Subnet, *core.DetailedResponse, error)

CreateSubnet creates a subnet.

func (*Service) CreateVPC

func (s *Service) CreateVPC(options *vpcv1.CreateVPCOptions) (*vpcv1.VPC, *core.DetailedResponse, error)

CreateVPC creates a new VPC.

func (*Service) DeleteInstance

func (s *Service) DeleteInstance(options *vpcv1.DeleteInstanceOptions) (*core.DetailedResponse, error)

DeleteInstance deleted a virtal server instance.

func (*Service) DeleteLoadBalancer

func (s *Service) DeleteLoadBalancer(options *vpcv1.DeleteLoadBalancerOptions) (*core.DetailedResponse, error)

DeleteLoadBalancer deletes a load balancer.

func (*Service) DeleteLoadBalancerPoolMember

func (s *Service) DeleteLoadBalancerPoolMember(options *vpcv1.DeleteLoadBalancerPoolMemberOptions) (*core.DetailedResponse, error)

DeleteLoadBalancerPoolMember deletes a member from the load balancer pool.

func (*Service) DeletePublicGateway

func (s *Service) DeletePublicGateway(options *vpcv1.DeletePublicGatewayOptions) (*core.DetailedResponse, error)

DeletePublicGateway deletes a public gateway.

func (*Service) DeleteSecurityGroup added in v0.8.0

func (s *Service) DeleteSecurityGroup(options *vpcv1.DeleteSecurityGroupOptions) (*core.DetailedResponse, error)

DeleteSecurityGroup deletes the security group passed.

func (*Service) DeleteSubnet

func (s *Service) DeleteSubnet(options *vpcv1.DeleteSubnetOptions) (*core.DetailedResponse, error)

DeleteSubnet deletes a subnet.

func (*Service) DeleteVPC

func (s *Service) DeleteVPC(options *vpcv1.DeleteVPCOptions) (*core.DetailedResponse, error)

DeleteVPC deletes a VPC.

func (*Service) GetImage added in v0.9.0

func (s *Service) GetImage(options *vpcv1.GetImageOptions) (*vpcv1.Image, *core.DetailedResponse, error)

GetImage returns a VPC Custom image.

func (*Service) GetImageByName added in v0.9.0

func (s *Service) GetImageByName(imageName string) (*vpcv1.Image, error)

GetImageByName returns the VPC Custom Image with given name. If not found, returns nil.

func (*Service) GetInstance

func (s *Service) GetInstance(options *vpcv1.GetInstanceOptions) (*vpcv1.Instance, *core.DetailedResponse, error)

GetInstance returns the virtal server instance.

func (*Service) GetInstanceProfile added in v0.8.0

GetInstanceProfile returns instance profile.

func (*Service) GetLoadBalancer

func (s *Service) GetLoadBalancer(options *vpcv1.GetLoadBalancerOptions) (*vpcv1.LoadBalancer, *core.DetailedResponse, error)

GetLoadBalancer returns a load balancer.

func (*Service) GetLoadBalancerByName added in v0.8.0

func (s *Service) GetLoadBalancerByName(loadBalancerName string) (*vpcv1.LoadBalancer, error)

GetLoadBalancerByName returns loadBalancer with given name. If not found, returns nil.

func (*Service) GetSecurityGroup added in v0.8.0

func (s *Service) GetSecurityGroup(options *vpcv1.GetSecurityGroupOptions) (*vpcv1.SecurityGroup, *core.DetailedResponse, error)

GetSecurityGroup gets a specific security group by id.

func (*Service) GetSecurityGroupByName added in v0.8.0

func (s *Service) GetSecurityGroupByName(name string) (*vpcv1.SecurityGroup, error)

GetSecurityGroupByName gets a specific security group by name.

func (*Service) GetSecurityGroupRule added in v0.8.0

GetSecurityGroupRule gets a specific security group rule.

func (*Service) GetSubnet added in v0.8.0

func (s *Service) GetSubnet(options *vpcv1.GetSubnetOptions) (*vpcv1.Subnet, *core.DetailedResponse, error)

GetSubnet return subnet.

func (*Service) GetSubnetAddrPrefix added in v0.8.0

func (s *Service) GetSubnetAddrPrefix(vpcID, zone string) (string, error)

GetSubnetAddrPrefix returns subnets address prefix.

func (*Service) GetSubnetPublicGateway

func (s *Service) GetSubnetPublicGateway(options *vpcv1.GetSubnetPublicGatewayOptions) (*vpcv1.PublicGateway, *core.DetailedResponse, error)

GetSubnetPublicGateway returns a public gateway attached to the subnet.

func (*Service) GetVPC added in v0.8.0

func (s *Service) GetVPC(options *vpcv1.GetVPCOptions) (*vpcv1.VPC, *core.DetailedResponse, error)

GetVPC returns VPC details.

func (*Service) GetVPCByName added in v0.8.0

func (s *Service) GetVPCByName(vpcName string) (*vpcv1.VPC, error)

GetVPCByName returns VPC with given name. If not found, returns nil.

func (*Service) GetVPCPublicGatewayByName added in v0.9.0

func (s *Service) GetVPCPublicGatewayByName(publicGatewayName string, resourceGroupID string) (*vpcv1.PublicGateway, error)

GetVPCPublicGatewayByName returns the VPC Public Gateway with given name. If not found, returns nil.

func (*Service) GetVPCSubnetByName added in v0.8.0

func (s *Service) GetVPCSubnetByName(subnetName string) (*vpcv1.Subnet, error)

GetVPCSubnetByName returns subnet with given name. If not found, returns nil.

func (*Service) GetVPCZonesByRegion added in v0.9.0

func (s *Service) GetVPCZonesByRegion(region string) ([]string, error)

GetVPCZonesByRegion gets the VPC availability zones for a specific IBM Cloud region.

func (*Service) ListImages added in v0.4.0

ListImages returns list of images in a region.

func (*Service) ListInstances

ListInstances returns list of virtual server instances.

func (*Service) ListKeys added in v0.4.0

ListKeys returns list of keys in a region.

func (*Service) ListLoadBalancerPoolMembers

ListLoadBalancerPoolMembers returns members of a load balancer pool.

func (*Service) ListLoadBalancers

ListLoadBalancers returns list of load balancers in a region.

func (*Service) ListSecurityGroups added in v0.8.0

ListSecurityGroups lists security group.

func (*Service) ListSubnets

ListSubnets returns list of subnets in a region.

func (*Service) ListVPCAddressPrefixes

ListVPCAddressPrefixes returns list of all address prefixes for a VPC.

func (*Service) ListVpcs

ListVpcs returns list of VPCs in a region.

func (*Service) SetSubnetPublicGateway

func (s *Service) SetSubnetPublicGateway(options *vpcv1.SetSubnetPublicGatewayOptions) (*vpcv1.PublicGateway, *core.DetailedResponse, error)

SetSubnetPublicGateway attaches a public gateway to the subnet.

func (*Service) UnsetSubnetPublicGateway

func (s *Service) UnsetSubnetPublicGateway(options *vpcv1.UnsetSubnetPublicGatewayOptions) (*core.DetailedResponse, error)

UnsetSubnetPublicGateway detaches a public gateway from the subnet.

type Vpc

type Vpc interface {
	CreateInstance(options *vpcv1.CreateInstanceOptions) (*vpcv1.Instance, *core.DetailedResponse, error)
	DeleteInstance(options *vpcv1.DeleteInstanceOptions) (*core.DetailedResponse, error)
	GetInstance(options *vpcv1.GetInstanceOptions) (*vpcv1.Instance, *core.DetailedResponse, error)
	ListInstances(options *vpcv1.ListInstancesOptions) (*vpcv1.InstanceCollection, *core.DetailedResponse, error)
	CreateVPC(options *vpcv1.CreateVPCOptions) (*vpcv1.VPC, *core.DetailedResponse, error)
	DeleteVPC(options *vpcv1.DeleteVPCOptions) (response *core.DetailedResponse, err error)
	ListVpcs(options *vpcv1.ListVpcsOptions) (*vpcv1.VPCCollection, *core.DetailedResponse, error)
	CreateSubnet(options *vpcv1.CreateSubnetOptions) (*vpcv1.Subnet, *core.DetailedResponse, error)
	DeleteSubnet(options *vpcv1.DeleteSubnetOptions) (*core.DetailedResponse, error)
	ListSubnets(options *vpcv1.ListSubnetsOptions) (*vpcv1.SubnetCollection, *core.DetailedResponse, error)
	GetSubnetPublicGateway(options *vpcv1.GetSubnetPublicGatewayOptions) (*vpcv1.PublicGateway, *core.DetailedResponse, error)
	SetSubnetPublicGateway(options *vpcv1.SetSubnetPublicGatewayOptions) (*vpcv1.PublicGateway, *core.DetailedResponse, error)
	UnsetSubnetPublicGateway(options *vpcv1.UnsetSubnetPublicGatewayOptions) (*core.DetailedResponse, error)
	CreatePublicGateway(options *vpcv1.CreatePublicGatewayOptions) (*vpcv1.PublicGateway, *core.DetailedResponse, error)
	DeletePublicGateway(options *vpcv1.DeletePublicGatewayOptions) (*core.DetailedResponse, error)
	ListVPCAddressPrefixes(options *vpcv1.ListVPCAddressPrefixesOptions) (*vpcv1.AddressPrefixCollection, *core.DetailedResponse, error)
	CreateSecurityGroupRule(options *vpcv1.CreateSecurityGroupRuleOptions) (vpcv1.SecurityGroupRuleIntf, *core.DetailedResponse, error)
	CreateLoadBalancer(options *vpcv1.CreateLoadBalancerOptions) (*vpcv1.LoadBalancer, *core.DetailedResponse, error)
	DeleteLoadBalancer(options *vpcv1.DeleteLoadBalancerOptions) (*core.DetailedResponse, error)
	ListLoadBalancers(options *vpcv1.ListLoadBalancersOptions) (*vpcv1.LoadBalancerCollection, *core.DetailedResponse, error)
	GetLoadBalancer(options *vpcv1.GetLoadBalancerOptions) (*vpcv1.LoadBalancer, *core.DetailedResponse, error)
	CreateLoadBalancerPoolMember(options *vpcv1.CreateLoadBalancerPoolMemberOptions) (*vpcv1.LoadBalancerPoolMember, *core.DetailedResponse, error)
	DeleteLoadBalancerPoolMember(options *vpcv1.DeleteLoadBalancerPoolMemberOptions) (*core.DetailedResponse, error)
	ListLoadBalancerPoolMembers(options *vpcv1.ListLoadBalancerPoolMembersOptions) (*vpcv1.LoadBalancerPoolMemberCollection, *core.DetailedResponse, error)
	ListKeys(options *vpcv1.ListKeysOptions) (*vpcv1.KeyCollection, *core.DetailedResponse, error)
	CreateImage(options *vpcv1.CreateImageOptions) (*vpcv1.Image, *core.DetailedResponse, error)
	ListImages(options *vpcv1.ListImagesOptions) (*vpcv1.ImageCollection, *core.DetailedResponse, error)
	GetImage(options *vpcv1.GetImageOptions) (*vpcv1.Image, *core.DetailedResponse, error)
	GetInstanceProfile(options *vpcv1.GetInstanceProfileOptions) (*vpcv1.InstanceProfile, *core.DetailedResponse, error)
	GetVPC(*vpcv1.GetVPCOptions) (*vpcv1.VPC, *core.DetailedResponse, error)
	GetVPCByName(vpcName string) (*vpcv1.VPC, error)
	GetImageByName(imageName string) (*vpcv1.Image, error)
	GetVPCPublicGatewayByName(publicGatewayName string, resourceGroupID string) (*vpcv1.PublicGateway, error)
	GetSubnet(*vpcv1.GetSubnetOptions) (*vpcv1.Subnet, *core.DetailedResponse, error)
	GetVPCSubnetByName(subnetName string) (*vpcv1.Subnet, error)
	GetLoadBalancerByName(loadBalancerName string) (*vpcv1.LoadBalancer, error)
	GetSubnetAddrPrefix(vpcID, zone string) (string, error)
	CreateSecurityGroup(options *vpcv1.CreateSecurityGroupOptions) (*vpcv1.SecurityGroup, *core.DetailedResponse, error)
	DeleteSecurityGroup(options *vpcv1.DeleteSecurityGroupOptions) (*core.DetailedResponse, error)
	ListSecurityGroups(options *vpcv1.ListSecurityGroupsOptions) (*vpcv1.SecurityGroupCollection, *core.DetailedResponse, error)
	GetSecurityGroup(options *vpcv1.GetSecurityGroupOptions) (*vpcv1.SecurityGroup, *core.DetailedResponse, error)
	GetSecurityGroupByName(name string) (*vpcv1.SecurityGroup, error)
	GetSecurityGroupRule(options *vpcv1.GetSecurityGroupRuleOptions) (vpcv1.SecurityGroupRuleIntf, *core.DetailedResponse, error)
	GetVPCZonesByRegion(region string) ([]string, error)
}

Vpc interface defines methods that a Cluster API IBMCLOUD object should implement.

func NewService

func NewService(svcEndpoint string) (Vpc, error)

NewService returns a new VPC Service.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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