api

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 20 Imported by: 0

Documentation

Overview

* Tencent is pleased to support the open source community by making TKEStack available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at * * https://opensource.org/licenses/Apache-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.

* Tencent is pleased to support the open source community by making TKEStack available. * * Copyright (C) 2012-2019 Tencent. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at * * https://opensource.org/licenses/Apache-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller is the API controller

func NewController

func NewController(
	ipam floatingip.IPAM, lister v1.PodLister, releaseFunc func(r *schedulerplugin.ReleaseRequest) error) *Controller

NewController construct a controller object

func (*Controller) ListIPs

func (c *Controller) ListIPs(req *restful.Request, resp *restful.Response)

ListIPs lists floating ips

func (*Controller) ReleaseIPs

func (c *Controller) ReleaseIPs(req *restful.Request, resp *restful.Response)

ReleaseIPs releases floating ips #lizard forgives

type FloatingIP

type FloatingIP struct {
	IP         string    `json:"ip"`
	Namespace  string    `json:"namespace,omitempty"`
	AppName    string    `json:"appName,omitempty"`
	PodName    string    `json:"podName,omitempty"`
	PoolName   string    `json:"poolName,omitempty"`
	Policy     uint16    `json:"policy"`
	AppType    string    `json:"appType,omitempty"`
	UpdateTime time.Time `json:"updateTime,omitempty"`
	Status     string    `json:"status,omitempty"`
	Releasable bool      `json:"releasable,omitempty"`
	// contains filtered or unexported fields
}

FloatingIP is the floating ip info

func (FloatingIP) SwaggerDoc

func (FloatingIP) SwaggerDoc() map[string]string

SwaggerDoc is to generate Swagger docs

type GetPoolResp

type GetPoolResp struct {
	httputil.Resp
	Pool Pool `json:"pool"`
}

type ListIPResp

type ListIPResp struct {
	pageutil.Page
	Content []FloatingIP `json:"content,omitempty"`
}

ListIPResp is the ListIPs response

type Pool

type Pool struct {
	Name          string `json:"name"`
	Size          int    `json:"size"`
	PreAllocateIP bool   `json:"preAllocateIP"`
}

func (Pool) SwaggerDoc

func (Pool) SwaggerDoc() map[string]string

type PoolController

type PoolController struct {
	Client       versioned.Interface
	PoolLister   list.PoolLister
	LockPoolFunc func(poolName string) func() // returns unlock func
	IPAM         floatingip.IPAM
}

func (*PoolController) CreateOrUpdate

func (c *PoolController) CreateOrUpdate(req *restful.Request, resp *restful.Response)

func (*PoolController) Delete

func (c *PoolController) Delete(req *restful.Request, resp *restful.Response)

func (*PoolController) Get

func (c *PoolController) Get(req *restful.Request, resp *restful.Response)

type ReleaseIPReq

type ReleaseIPReq struct {
	IPs []FloatingIP `json:"ips"`
}

ReleaseIPReq is the request to release ips

type ReleaseIPResp

type ReleaseIPResp struct {
	httputil.Resp
	Unreleased []string `json:"unreleased,omitempty"`
	// Reason is the reason why this ip is not released
	Reason []string `json:"reasons,omitempty"`
}

ReleaseIPResp is the response of release ip

func (ReleaseIPResp) SwaggerDoc

func (ReleaseIPResp) SwaggerDoc() map[string]string

SwaggerDoc generates swagger doc for release ip response

type UpdatePoolResp

type UpdatePoolResp struct {
	httputil.Resp
	RealPoolSize int `json:"realPoolSize"`
}

func (UpdatePoolResp) SwaggerDoc

func (UpdatePoolResp) SwaggerDoc() map[string]string

Jump to

Keyboard shortcuts

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