Documentation ¶
Index ¶
- Constants
- Variables
- func BceServiceErrorToHTTPCode(err error) int
- func IsErrorBBCENIPrivateIPExceedLimit(err error) bool
- func IsErrorBBCENIPrivateIPNotFound(err error) bool
- func IsErrorENINotFound(err error) bool
- func IsErrorENIPrivateIPNotFound(err error) bool
- func IsErrorPrivateIPInUse(err error) bool
- func IsErrorQuotaLimitExceeded(err error) bool
- func IsErrorRateLimit(err error) bool
- func IsErrorReasonNoSuchObject(err error) bool
- func IsErrorRouteRuleRepeated(err error) bool
- func IsErrorSubnetHasNoMoreIP(err error) bool
- func IsErrorVmMemoryCanNotAttachMoreIpException(err error) bool
- type Auth
- type AuthMode
- type Client
- func (c *Client) AddPrivateIP(ctx context.Context, privateIP string, eniID string) (string, error)
- func (c *Client) AttachENI(ctx context.Context, args *eni.EniInstance) error
- func (c *Client) BBCBatchAddIP(ctx context.Context, args *bbc.BatchAddIpArgs) (*bbc.BatchAddIpResponse, error)
- func (c *Client) BBCBatchAddIPCrossSubnet(ctx context.Context, args *bbc.BatchAddIpCrossSubnetArgs) (*bbc.BatchAddIpResponse, error)
- func (c *Client) BBCBatchDelIP(ctx context.Context, args *bbc.BatchDelIpArgs) error
- func (c *Client) BatchAddHpcEniPrivateIP(ctx context.Context, args *hpc.EniBatchPrivateIPArgs) (*hpc.BatchAddPrivateIPResult, error)
- func (c *Client) BatchAddPrivateIP(ctx context.Context, privateIPs []string, count int, eniID string) ([]string, error)
- func (c *Client) BatchAddPrivateIpCrossSubnet(ctx context.Context, eniID, subnetID string, privateIPs []string, count int) ([]string, error)
- func (c *Client) BatchDeleteHpcEniPrivateIP(ctx context.Context, args *hpc.EniBatchDeleteIPArgs) error
- func (c *Client) BatchDeletePrivateIP(ctx context.Context, privateIPs []string, eniID string) error
- func (c *Client) CreateENI(ctx context.Context, args *eni.CreateEniArgs) (string, error)
- func (c *Client) CreateRouteRule(ctx context.Context, args *vpc.CreateRouteRuleArgs) (string, error)
- func (c *Client) DeleteENI(ctx context.Context, eniID string) error
- func (c *Client) DeletePrivateIP(ctx context.Context, privateIP string, eniID string) error
- func (c *Client) DeleteRouteRule(ctx context.Context, routeID string) error
- func (c *Client) DescribeSubnet(ctx context.Context, subnetID string) (*vpc.Subnet, error)
- func (c *Client) DetachENI(ctx context.Context, args *eni.EniInstance) error
- func (c *Client) GetBBCInstanceDetail(ctx context.Context, instanceID string) (*bbc.InstanceModel, error)
- func (c *Client) GetBBCInstanceENI(ctx context.Context, instanceID string) (*bbc.GetInstanceEniResult, error)
- func (c *Client) GetBCCInstanceDetail(ctx context.Context, instanceID string) (*bccapi.InstanceModel, error)
- func (c *Client) GetHPCEniID(ctx context.Context, instanceID string) (*hpc.EniList, error)
- func (c *Client) ListENIs(_ context.Context, args eni.ListEniArgs) ([]eni.Eni, error)
- func (c *Client) ListERIs(_ context.Context, args eni.ListEniArgs) ([]eni.Eni, error)
- func (c *Client) ListRouteTable(ctx context.Context, vpcID, routeTableID string) ([]vpc.RouteRule, error)
- func (c *Client) ListSecurityGroup(ctx context.Context, vpcID, instanceID string) ([]bccapi.SecurityGroupModel, error)
- func (c *Client) ListSubnets(ctx context.Context, args *vpc.ListSubnetArgs) ([]vpc.Subnet, error)
- func (c *Client) StatENI(ctx context.Context, eniID string) (*eni.Eni, error)
- type ErrorReason
- type Interface
Constants ¶
View Source
const ( BCCEndpointEnv = "BCC_ENDPOINT" BBCEndpointEnv = "BBC_ENDPOINT" )
Variables ¶
View Source
var ( BCCEndpoints = map[string]string{ "bj": "bcc.bj.baidubce.com", "gz": "bcc.gz.baidubce.com", "su": "bcc.su.baidubce.com", "hkg": "bcc.hkg.baidubce.com", "fwh": "bcc.fwh.baidubce.com", "bd": "bcc.bd.baidubce.com", } BBCEndpoints = map[string]string{ "bj": "bbc.bj.baidubce.com", "gz": "bbc.gz.baidubce.com", "su": "bbc.su.baidubce.com", "hkg": "bbc.hkg.baidubce.com", "fwh": "bbc.fwh.baidubce.com", "bd": "bbc.bd.baidubce.com", } )
Functions ¶
func IsErrorENINotFound ¶
func IsErrorENIPrivateIPNotFound ¶
IsErrorENIPrivateIPNotFound 判定删除辅助 IP 的 err 是否是因为 IP 不属于弹性网卡
func IsErrorPrivateIPInUse ¶
func IsErrorRateLimit ¶
Types ¶
type Auth ¶
type Auth interface { GetSigner(ctx context.Context) auth.Signer GetCredentials(ctx context.Context) *auth.BceCredentials GetSignOptions(ctx context.Context) *auth.SignOptions }
func NewAccessKeyPairAuth ¶
func NewCCEGatewayAuth ¶
func NewCCEGatewayAuth(region, clusterID string, kubeClient kubernetes.Interface) (Auth, error)
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddPrivateIP ¶
func (*Client) BBCBatchAddIP ¶
func (c *Client) BBCBatchAddIP(ctx context.Context, args *bbc.BatchAddIpArgs) (*bbc.BatchAddIpResponse, error)
func (*Client) BBCBatchAddIPCrossSubnet ¶
func (c *Client) BBCBatchAddIPCrossSubnet(ctx context.Context, args *bbc.BatchAddIpCrossSubnetArgs) (*bbc.BatchAddIpResponse, error)
func (*Client) BBCBatchDelIP ¶
func (*Client) BatchAddHpcEniPrivateIP ¶ added in v1.5.4
func (c *Client) BatchAddHpcEniPrivateIP(ctx context.Context, args *hpc.EniBatchPrivateIPArgs) (*hpc.BatchAddPrivateIPResult, error)
func (*Client) BatchAddPrivateIP ¶
func (*Client) BatchAddPrivateIpCrossSubnet ¶
func (*Client) BatchDeleteHpcEniPrivateIP ¶ added in v1.5.4
func (*Client) BatchDeletePrivateIP ¶
func (*Client) CreateRouteRule ¶
func (*Client) DeletePrivateIP ¶
func (*Client) DeleteRouteRule ¶
func (*Client) DescribeSubnet ¶
func (*Client) GetBBCInstanceDetail ¶
func (*Client) GetBBCInstanceENI ¶
func (*Client) GetBCCInstanceDetail ¶
func (*Client) GetHPCEniID ¶ added in v1.5.4
func (*Client) ListRouteTable ¶
func (*Client) ListSecurityGroup ¶
func (*Client) ListSubnets ¶
type ErrorReason ¶
type ErrorReason string
const ( ErrorReasonUnknown ErrorReason = "Unknown" ErrorReasonENIPrivateIPNotFound ErrorReason = "ENIPrivateIPNotFound" ErrorReasonENINotFound ErrorReason = "ENINotFound" ErrorReasonSubnetHasNoMoreIP ErrorReason = "SubnetHasNoMoreIP" ErrorReasonRateLimit ErrorReason = "RateLimit" ErrorReasonPrivateIPInUse ErrorReason = "PrivateIPInUse" ErrorReasonVmMemoryCanNotAttachMoreIpException ErrorReason = "VmMemoryCanNotAttachMoreIpException" ErrorReasonBBCENIPrivateIPNotFound ErrorReason = "BBCENIPrivateIPNotFound" ErrorReasonBBCENIPrivateIPExceedLimit ErrorReason = "BBCENIPrivateIPExceedLimit" ErrorReasonRouteRuleRepeated ErrorReason = "RouteRuleRepeated" ErrorReasonQuotaLimitExceeded ErrorReason = "QuotaLimitExceeded" ErrorReasonNoSuchObject ErrorReason = "NoSuchObject" )
func ReasonForError ¶
func ReasonForError(err error) ErrorReason
type Interface ¶
type Interface interface { ListENIs(ctx context.Context, args eni.ListEniArgs) ([]eni.Eni, error) ListERIs(ctx context.Context, args eni.ListEniArgs) ([]eni.Eni, error) AddPrivateIP(ctx context.Context, privateIP string, eniID string) (string, error) DeletePrivateIP(ctx context.Context, privateIP string, eniID string) error // BatchAddPrivateIpCrossSubnet // Assign IP addresses to Eni across subnets. // Note that this feature needs to initiate a work order in advance to // enable the cross subnet IP allocation function BatchAddPrivateIpCrossSubnet(ctx context.Context, eniID, subnetID string, privateIPs []string, count int) ([]string, error) BatchAddPrivateIP(ctx context.Context, privateIPs []string, count int, eniID string) ([]string, error) BatchDeletePrivateIP(ctx context.Context, privateIPs []string, eniID string) error CreateENI(ctx context.Context, args *eni.CreateEniArgs) (string, error) DeleteENI(ctx context.Context, eniID string) error AttachENI(ctx context.Context, args *eni.EniInstance) error DetachENI(ctx context.Context, args *eni.EniInstance) error StatENI(ctx context.Context, eniID string) (*eni.Eni, error) ListRouteTable(ctx context.Context, vpcID, routeTableID string) ([]vpc.RouteRule, error) CreateRouteRule(ctx context.Context, args *vpc.CreateRouteRuleArgs) (string, error) DeleteRouteRule(ctx context.Context, routeID string) error DescribeSubnet(ctx context.Context, subnetID string) (*vpc.Subnet, error) ListSubnets(ctx context.Context, args *vpc.ListSubnetArgs) ([]vpc.Subnet, error) ListSecurityGroup(ctx context.Context, vpcID, instanceID string) ([]bccapi.SecurityGroupModel, error) GetBCCInstanceDetail(ctx context.Context, instanceID string) (*bccapi.InstanceModel, error) GetBBCInstanceDetail(ctx context.Context, instanceID string) (*bbc.InstanceModel, error) GetBBCInstanceENI(ctx context.Context, instanceID string) (*bbc.GetInstanceEniResult, error) BBCBatchAddIP(ctx context.Context, args *bbc.BatchAddIpArgs) (*bbc.BatchAddIpResponse, error) BBCBatchDelIP(ctx context.Context, args *bbc.BatchDelIpArgs) error BBCBatchAddIPCrossSubnet(ctx context.Context, args *bbc.BatchAddIpCrossSubnetArgs) (*bbc.BatchAddIpResponse, error) GetHPCEniID(ctx context.Context, instanceID string) (*hpc.EniList, error) BatchDeleteHpcEniPrivateIP(ctx context.Context, args *hpc.EniBatchDeleteIPArgs) error BatchAddHpcEniPrivateIP(ctx context.Context, args *hpc.EniBatchPrivateIPArgs) (*hpc.BatchAddPrivateIPResult, error) }
Directories ¶
Path | Synopsis |
---|---|
Package testing is a generated GoMock package.
|
Package testing is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.