Documentation ¶
Overview ¶
+k8s:deepcopy-gen=package,register +deepequal-gen=package
Index ¶
- func GetNodeIDName(id string) string
- func IDToNamespaceName(id string) (string, string)
- func ISPodID(id string) bool
- func NodePoolID(name, uuid string) string
- func PodID(owner string) string
- type AcquireIPByPurposeRequest
- type AcquireIPBySubnetRequest
- type AllocatedIP
- type AllocatedIPResponse
- type BatchAcquireIPByPurposeRequest
- type BatchAcquireIPBySubnetRequest
- type BatchReleaseIPRequest
- type Client
- type ErrorResponse
- type IPAllocateClient
- type ListAllocatedIPRequest
- type ListAllocatedIPResponse
- type ListSubnetRequest
- type ListSubnetResponse
- type PrivateCloudBaseClient
- func (p *PrivateCloudBaseClient) AcquireIPBySubnet(ctx context.Context, req AcquireIPBySubnetRequest) (*AllocatedIPResponse, error)
- func (p *PrivateCloudBaseClient) AllocatedIPs(ctx context.Context) (*ListAllocatedIPResponse, error)
- func (p *PrivateCloudBaseClient) BatchAcquireIPBySubnet(ctx context.Context, req BatchAcquireIPBySubnetRequest) (*ListAllocatedIPResponse, error)
- func (p *PrivateCloudBaseClient) BatchReleaseIP(ctx context.Context, req BatchReleaseIPRequest) error
- func (p *PrivateCloudBaseClient) CreateSubnet(ctx context.Context, subnet Subnet) (*SubnetResponse, error)
- func (p *PrivateCloudBaseClient) ListSubnets(ctx context.Context) (*ListSubnetResponse, error)
- type ResponseInterface
- type SetRegion
- type Subnet
- type SubnetClient
- type SubnetResponse
- type SubnetUpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNodeIDName ¶
func IDToNamespaceName ¶
IDToNamespaceName Restore ID to namespace and name
func NodePoolID ¶
NodePoolID This ID represents the IP used by the node pool
Types ¶
type AcquireIPByPurposeRequest ¶
type AcquireIPByPurposeRequest struct { ID string `json:"id,omitempty" binding:"required"` Region string `json:"Region,omitempty" binding:"required"` Purpose string `json:"purpose,omitempty" binding:"required"` VPC string `json:"vpc,omitempty"` Gateway string `json:"gateway,omitempty"` ISP string `json:"isp,omitempty"` IPVersion int `json:"ipVersion,omitempty"` SpecificIP string `json:"specificIP,omitempty" ` SpecificIPSuffix string `json:"specificIPSuffix,omitempty" ` }
申请IP +k8s:deepcopy-gen=false +deepequal-gen=false
type AcquireIPBySubnetRequest ¶
type AcquireIPBySubnetRequest struct { ID string `json:"id,omitempty" binding:"required"` Region string `json:"Region,omitempty" binding:"required"` SpecificIP string `json:"specificIP,omitempty" ` SpecificIPSuffix string `json:"specificIPSuffix,omitempty"` Subnet string `json:"subnet,omitempty" binding:"required"` }
+k8s:deepcopy-gen=false +deepequal-gen=false
func (*AcquireIPBySubnetRequest) SetRegion ¶
func (req *AcquireIPBySubnetRequest) SetRegion(region string)
type AllocatedIP ¶
type AllocatedIP struct { ID string `json:"id,omitempty"` IP string `json:"ip,omitempty"` Mask string `json:"mask,omitempty"` CIDR string `json:"cidr,omitempty"` GW string `json:"gw,omitempty"` NatGW string `json:"natGW,omitempty"` Subnet string `json:"subnet,omitempty"` Region string `json:"Region,omitempty"` VPC string `json:"vpc,omitempty"` ISP string `json:"isp,omitempty"` IPVersion int `json:"ipVersion,omitempty"` Purpose string `json:"purpose,omitempty"` VlanID int `json:"vlanID,omitempty"` }
+k8s:deepcopy-gen=false +deepequal-gen=false
type AllocatedIPResponse ¶
type AllocatedIPResponse struct { ErrorResponse `json:",inline"` AllocatedIP AllocatedIP `json:"allocatedIP,omitempty"` }
+k8s:deepcopy-gen=false +deepequal-gen=false
type BatchAcquireIPByPurposeRequest ¶
type BatchAcquireIPByPurposeRequest struct { ID string `json:"id,omitempty" binding:"required"` Region string `json:"Region,omitempty" binding:"required"` Count int `json:"count,omitempty" binding:"required"` Purpose string `json:"purpose,omitempty" binding:"required"` VPC string `json:"vpc,omitempty"` Gateway string `json:"gateway,omitempty"` ISP string `json:"isp,omitempty"` IPVersion int `json:"ipVersion,omitempty"` }
+k8s:deepcopy-gen=false +deepequal-gen=false
type BatchAcquireIPBySubnetRequest ¶
type BatchAcquireIPBySubnetRequest struct { ID string `json:"id,omitempty" binding:"required"` Region string `json:"Region,omitempty" binding:"required"` Count int `json:"count,omitempty" binding:"required"` Subnet string `json:"subnet,omitempty" binding:"required"` }
批量申请IP +k8s:deepcopy-gen=false +deepequal-gen=false
func (*BatchAcquireIPBySubnetRequest) SetRegion ¶
func (req *BatchAcquireIPBySubnetRequest) SetRegion(region string)
type BatchReleaseIPRequest ¶
type BatchReleaseIPRequest struct { VPC string `json:"vpc,omitempty" binding:"required"` Region string `json:"Region,omitempty" binding:"required"` IPs []string `json:"ips,omitempty"` }
批量释放IP +k8s:deepcopy-gen=false +deepequal-gen=false
func (*BatchReleaseIPRequest) SetRegion ¶
func (req *BatchReleaseIPRequest) SetRegion(region string)
type Client ¶
type Client interface { IPAllocateClient SubnetClient }
+k8s:deepcopy-gen=false +deepequal-gen=false
type ErrorResponse ¶
+k8s:deepcopy-gen=false +deepequal-gen=false
func (*ErrorResponse) IsSuccess ¶
func (receiver *ErrorResponse) IsSuccess() bool
func (*ErrorResponse) SetCode ¶
func (receiver *ErrorResponse) SetCode(code int)
type IPAllocateClient ¶
type IPAllocateClient interface { // AcquireIPBySubnet 指定网段申请IP //Request //* Method: POST //* URL: /ipam/v1/acquire_ip_by_subnet //* Headers: Content-Type:application/json //* Body: AcquireIPBySubnetRequest AcquireIPBySubnet(ctx context.Context, req AcquireIPBySubnetRequest) (*AllocatedIPResponse, error) // BatchAcquireIPBySubnet 指定网段批量申请IP //目前未实现将ID视为token做幂等处理,在请求失败时,可能会造成IP已分配但无人使用的问题。 //Request //* Method: POST //* URL: /ipam/v1/batch_acquire_ip_by_subnet //* Headers: Content-Type:application/json //* Body: BatchAcquireIPBySubnetRequest BatchAcquireIPBySubnet(ctx context.Context, req BatchAcquireIPBySubnetRequest) (*ListAllocatedIPResponse, error) // BatchReleaseIP 批量释放IP //Request //* Method: POST //* URL: /ipam/v1/batch_release_ip //* Headers: Content-Type:application/json //* Body: BatchReleaseIPRequest BatchReleaseIP(ctx context.Context, req BatchReleaseIPRequest) error // AllocatedIPs 查询已分配IP //Request //* Method: PUT //* URL: /ipam/v1/allocated_ips/:Region //* Headers: Content-Type:application/json //* Params: // * ListAllocatedIPRequest (详见数据结构) AllocatedIPs(ctx context.Context) (*ListAllocatedIPResponse, error) }
IPAllocateClient Client to private cloud base https://ku.baidu-int.com/knowledge/HFVrC7hq1Q/bPDEaFBbnd/04hxQCVwYK/ntxk1F6-P7lVRi#anchor-4b444560-5383-11ed-9d27-81f612d08f43 group.POST("/acquire_ip_by_subnet", h.AcquireIPBySubnet) group.POST("/acquire_ip_by_purpose", h.AcquireIPByPurpose) group.POST("/release_ip", h.ReleaseIP) group.POST("/batch_acquire_ip_by_subnet", h.BatchAcquireIPBySubnet) group.POST("/batch_acquire_ip_by_purpose", h.BatchAcquireIPByPurpose) group.POST("/batch_release_ip", h.BatchReleaseIP) group.GET("/allocated_ips/:Region/:id", h.GetAllocatedIP) group.GET("/allocated_ips/:Region", h.ListAllocatedIP) +k8s:deepcopy-gen=false +deepequal-gen=false
type ListAllocatedIPRequest ¶
type ListAllocatedIPRequest struct { Region string `json:"Region,omitempty"` Subnet string `json:"subnet,omitempty"` VPC string `json:"vpc,omitempty"` ISP string `json:"isp,omitempty"` IPVersion int `json:"ipVersion,omitempty"` CIDR string `json:"cidr,omitempty"` Purpose string `json:"purpose,omitempty"` }
查询已申请IP +k8s:deepcopy-gen=false +deepequal-gen=false
func (*ListAllocatedIPRequest) SetRegion ¶
func (req *ListAllocatedIPRequest) SetRegion(region string)
type ListAllocatedIPResponse ¶
type ListAllocatedIPResponse struct { ErrorResponse `json:",inline"` AllocatedIPs []AllocatedIP `json:"allocatedIPs,omitempty"` }
+k8s:deepcopy-gen=false +deepequal-gen=false
type ListSubnetRequest ¶
type ListSubnetRequest struct { Region string `json:"Region,omitempty"` VPC string `json:"vpc,omitempty"` Purpose string `json:"purpose,omitempty"` Gateway string `json:"gateway,omitempty"` ISP string `json:"isp,omitempty"` IPVersion int `json:"ipVersion,omitempty"` MustEnable bool `json:"mustEnable,omitempty"` }
+k8s:deepcopy-gen=false +deepequal-gen=false
func (*ListSubnetRequest) SetRegion ¶
func (req *ListSubnetRequest) SetRegion(region string)
type ListSubnetResponse ¶
type ListSubnetResponse struct { ErrorResponse `json:",inline"` Subnets []*Subnet `json:"subnets,omitempty"` }
+k8s:deepcopy-gen=false +deepequal-gen=false
type PrivateCloudBaseClient ¶
type PrivateCloudBaseClient struct { Region string // contains filtered or unexported fields }
+k8s:deepcopy-gen=false +deepequal-gen=false
func (*PrivateCloudBaseClient) AcquireIPBySubnet ¶
func (p *PrivateCloudBaseClient) AcquireIPBySubnet(ctx context.Context, req AcquireIPBySubnetRequest) (*AllocatedIPResponse, error)
func (*PrivateCloudBaseClient) AllocatedIPs ¶
func (p *PrivateCloudBaseClient) AllocatedIPs(ctx context.Context) (*ListAllocatedIPResponse, error)
func (*PrivateCloudBaseClient) BatchAcquireIPBySubnet ¶
func (p *PrivateCloudBaseClient) BatchAcquireIPBySubnet(ctx context.Context, req BatchAcquireIPBySubnetRequest) (*ListAllocatedIPResponse, error)
func (*PrivateCloudBaseClient) BatchReleaseIP ¶
func (p *PrivateCloudBaseClient) BatchReleaseIP(ctx context.Context, req BatchReleaseIPRequest) error
func (*PrivateCloudBaseClient) CreateSubnet ¶
func (p *PrivateCloudBaseClient) CreateSubnet(ctx context.Context, subnet Subnet) (*SubnetResponse, error)
func (*PrivateCloudBaseClient) ListSubnets ¶
func (p *PrivateCloudBaseClient) ListSubnets(ctx context.Context) (*ListSubnetResponse, error)
type ResponseInterface ¶
+k8s:deepcopy-gen=false +deepequal-gen=false
type SetRegion ¶
type SetRegion interface {
SetRegion(region string)
}
+k8s:deepcopy-gen=false +deepequal-gen=false
type Subnet ¶
type Subnet struct { Name string `json:"name,omitempty" binding:"required"` Region string `json:"Region,omitempty" binding:"required"` VPC string `json:"vpc,omitempty" binding:"required"` Purpose string `json:"purpose,omitempty" binding:"required"` ISP string `json:"isp,omitempty"` IPVersion int `json:"ipVersion,omitemptyn" binding:"required"` RangeStart string `json:"rangeStart,omitempty"` RangeEnd string `json:"rangeEnd,omitempty"` Excludes string `json:"excludes,omitempty"` CIDR string `json:"cidr,omitempty" binding:"required"` Gateway string `json:"gateway,omitempty"` NatGW string `json:"natGW,omitempty"` VlanID int `json:"vlanID,omitempty"` Priority int `json:"priority,omitempty"` Enable bool `json:"enable,omitempty"` }
网段管理 +k8s:deepcopy-gen=true +deepequal-gen=true
func (*Subnet) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet.
func (*Subnet) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SubnetClient ¶
type SubnetClient interface { // CreateSubnet 创建网段 //Request //* Method: POST //* URL: /ipam/v1/subnets //* Headers: Content-Type:application/json // GetIPPool GET /v1/ippool/{{poolname}} CreateSubnet(ctx context.Context, subnet Subnet) (*SubnetResponse, error) // group.GET("/subnets/:Region", h.ListSubnet) ListSubnets(ctx context.Context) (*ListSubnetResponse, error) }
SubnetClient to private cloud base https://ku.baidu-int.com/knowledge/HFVrC7hq1Q/bPDEaFBbnd/04hxQCVwYK/ntxk1F6-P7lVRi#anchor-4b444560-5383-11ed-9d27-81f612d08f43 +k8s:deepcopy-gen=false +deepequal-gen=false
type SubnetResponse ¶
type SubnetResponse struct { ErrorResponse `json:",inline"` Subnet Subnet `json:"subnet,omitempty"` }
+k8s:deepcopy-gen=false +deepequal-gen=false