Documentation ¶
Index ¶
- Variables
- func CacheExpires(r *http.Response) time.Time
- type APIClient
- type APIKey
- type APIResponse
- type BasicAuth
- type ClustersApiService
- func (a *ClustersApiService) CreateCluster(ctx context.Context, request model.InternalV1Cluster) (model.InternalV1Cluster, *http.Response, error)
- func (a *ClustersApiService) CreateClusterMember(ctx context.Context, cluster string, request model.ClusterMember) (model.ClusterMember, *http.Response, error)
- func (a *ClustersApiService) CreateClusterRepos(ctx context.Context, cluster string, request model.CreateClusterRepoReq) (model.CreateClusterRepoReq, *http.Response, error)
- func (a *ClustersApiService) CreateClusterRole(ctx context.Context, cluster string, request model.V1ClusterRole) (model.V1ClusterRole, *http.Response, error)
- func (a *ClustersApiService) DeleteCluster(ctx context.Context, name string) (model.V1Cluster, *http.Response, error)
- func (a *ClustersApiService) DeleteClusterMember(ctx context.Context, cluster string, member string) (float32, *http.Response, error)
- func (a *ClustersApiService) DeleteClusterRepo(ctx context.Context, cluster string, repo string) (float32, *http.Response, error)
- func (a *ClustersApiService) DeleteClusterRole(ctx context.Context, cluster string, clusterrole string) (float32, *http.Response, error)
- func (a *ClustersApiService) GetCluster(ctx context.Context, name string) (model.V1Cluster, *http.Response, error)
- func (a *ClustersApiService) GetClusterMember(ctx context.Context, cluster string, member string) (model.ClusterMember, *http.Response, error)
- func (a *ClustersApiService) GetClusterMembers(ctx context.Context, cluster string) ([]model.ClusterMember, *http.Response, error)
- func (a *ClustersApiService) GetClusterRepos(ctx context.Context, cluster string) ([]model.KubepiRepo, *http.Response, error)
- func (a *ClustersApiService) GetClusterRoles(ctx context.Context, cluster string) ([]model.V1ClusterRole, *http.Response, error)
- func (a *ClustersApiService) GetClusters(ctx context.Context) ([]model.V1Cluster, *http.Response, error)
- func (a *ClustersApiService) UpdateCluster(ctx context.Context, request model.ClusterUpdateReq, name string) (model.ClusterUpdateReq, *http.Response, error)
- func (a *ClustersApiService) UpdateClusterMember(ctx context.Context, cluster string, member string, ...) (model.ClusterMember, *http.Response, error)
- func (a *ClustersApiService) UpdateClusterRole(ctx context.Context, cluster string, clusterrole string, ...) (model.V1ClusterRole, *http.Response, error)
- type Configuration
- type GenericSwaggerError
- type ReposApiService
- func (a *ReposApiService) ImagereposClusterClusterGet(ctx context.Context, cluster string) ([]ImagerepoImageRepo, *http.Response, error)
- func (a *ReposApiService) ImagereposClusterRepoPut(ctx context.Context, cluster string, repo string) ([]string, *http.Response, error)
- func (a *ReposApiService) ImagereposNameDelete(ctx context.Context, name string) (ImagerepoImageRepo, *http.Response, error)
- func (a *ReposApiService) ImagereposNameGet(ctx context.Context, name string) (ImagerepoImageRepo, *http.Response, error)
- func (a *ReposApiService) ImagereposNamePut(ctx context.Context, request ImagerepoRepoConfig, name string) (ImagerepoImageRepo, *http.Response, error)
- func (a *ReposApiService) ImagereposPost(ctx context.Context, request ImagerepoRepoConfig) (ImagerepoRepoConfig, *http.Response, error)
- func (a *ReposApiService) ImagereposRepoSearchGet(ctx context.Context, repo string) (ImagerepoRepoResponse, *http.Response, error)
- func (a *ReposApiService) ImagereposRepositoriesSearchPost(ctx context.Context, request ImagerepoRepoConfig) ([]string, *http.Response, error)
- type RolesApiService
- func (a *RolesApiService) CreateRole(ctx context.Context, request model.KubepiRole) (model.KubepiRole, *http.Response, error)
- func (a *RolesApiService) DeleteRole(ctx context.Context, name string) (model.KubepiRole, *http.Response, error)
- func (a *RolesApiService) GetRole(ctx context.Context, name string) (model.KubepiRole, *http.Response, error)
- func (a *RolesApiService) GetRoles(ctx context.Context) ([]model.KubepiRole, *http.Response, error)
- func (a *RolesApiService) UpdateRole(ctx context.Context, name string) (model.KubepiRole, *http.Response, error)
- type SessionsApiService
- type UsersApiService
- func (a *UsersApiService) CreateUser(ctx context.Context, request model.KubepiUserCreateReq) (model.KubepiUser, *http.Response, error)
- func (a *UsersApiService) DeleteUser(ctx context.Context, name string) (model.KubepiUser, *http.Response, error)
- func (a *UsersApiService) GetUser(ctx context.Context, name string) (model.KubepiUser, *http.Response, error)
- func (a *UsersApiService) GetUsers(ctx context.Context) ([]model.KubepiUser, *http.Response, error)
- func (a *UsersApiService) SearchUsers(ctx context.Context) (model.ApiPage, *http.Response, error)
- func (a *UsersApiService) UpdateUser(ctx context.Context, name string) (model.KubepiUser, *http.Response, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
Types ¶
type APIClient ¶
type APIClient struct { ClustersApi *ClustersApiService ReposApi *ReposApiService RolesApi *RolesApiService SessionsApi *SessionsApiService UsersApi *UsersApiService // contains filtered or unexported fields }
APIClient manages communication with the KubePi Restful API API vv1 In most cases there should be only one, shared, APIClient.
func NewAPIClient ¶
func NewAPIClient(cfg *Configuration) *APIClient
NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.
func (*APIClient) ChangeBasePath ¶
Change base path to allow switching to mocks
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type ClustersApiService ¶
type ClustersApiService service
func (*ClustersApiService) CreateCluster ¶
func (a *ClustersApiService) CreateCluster(ctx context.Context, request model.InternalV1Cluster) (model.InternalV1Cluster, *http.Response, error)
ClustersApiService Create Cluster Create Cluster
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param request request
@return InternalV1Cluster
func (*ClustersApiService) CreateClusterMember ¶
func (a *ClustersApiService) CreateClusterMember(ctx context.Context, cluster string, request model.ClusterMember) (model.ClusterMember, *http.Response, error)
ClustersApiService Create Cluster Member Create Cluster Member
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param request request
@return ClusterMember
func (*ClustersApiService) CreateClusterRepos ¶
func (a *ClustersApiService) CreateClusterRepos(ctx context.Context, cluster string, request model.CreateClusterRepoReq) (model.CreateClusterRepoReq, *http.Response, error)
ClustersApiService Create Cluster KubepiRepo Create Cluster KubepiRepo
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param request request
@return CreateClusterRepoReq
func (*ClustersApiService) CreateClusterRole ¶
func (a *ClustersApiService) CreateClusterRole(ctx context.Context, cluster string, request model.V1ClusterRole) (model.V1ClusterRole, *http.Response, error)
ClustersApiService Create Cluster KubepiRole Create Cluster KubepiRole
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param request request
@return V1ClusterRole
func (*ClustersApiService) DeleteCluster ¶
func (a *ClustersApiService) DeleteCluster(ctx context.Context, name string) (model.V1Cluster, *http.Response, error)
ClustersApiService Delete cluster by name Delete cluster by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 集群名称
@return V1Cluster
func (*ClustersApiService) DeleteClusterMember ¶
func (a *ClustersApiService) DeleteClusterMember(ctx context.Context, cluster string, member string) (float32, *http.Response, error)
ClustersApiService Delete clusterMember by name Delete clusterMember by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param member 成员名称
@return float32
func (*ClustersApiService) DeleteClusterRepo ¶
func (a *ClustersApiService) DeleteClusterRepo(ctx context.Context, cluster string, repo string) (float32, *http.Response, error)
ClustersApiService Delete clusterRepo by name Delete clusterRepo by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param repo 镜像仓库名称
@return float32
func (*ClustersApiService) DeleteClusterRole ¶
func (a *ClustersApiService) DeleteClusterRole(ctx context.Context, cluster string, clusterrole string) (float32, *http.Response, error)
ClustersApiService Delete clusterRole by name Delete clusterRole by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param clusterrole 权限名称
@return float32
func (*ClustersApiService) GetCluster ¶
func (a *ClustersApiService) GetCluster(ctx context.Context, name string) (model.V1Cluster, *http.Response, error)
ClustersApiService Get cluster by name Get cluster by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 集群名称
@return V1Cluster
func (*ClustersApiService) GetClusterMember ¶
func (a *ClustersApiService) GetClusterMember(ctx context.Context, cluster string, member string) (model.ClusterMember, *http.Response, error)
ClustersApiService Get Cluster Member By name Get Cluster Member By name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param member 成员名称
@return ClusterMember
func (*ClustersApiService) GetClusterMembers ¶
func (a *ClustersApiService) GetClusterMembers(ctx context.Context, cluster string) ([]model.ClusterMember, *http.Response, error)
ClustersApiService List all ClusterMembers List all ClusterMembers
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
@return []ClusterMember
func (*ClustersApiService) GetClusterRepos ¶
func (a *ClustersApiService) GetClusterRepos(ctx context.Context, cluster string) ([]model.KubepiRepo, *http.Response, error)
ClustersApiService Get ClusterRepo Detail Get ClusterRepo Detail
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
@return []KubepiRepo
func (*ClustersApiService) GetClusterRoles ¶
func (a *ClustersApiService) GetClusterRoles(ctx context.Context, cluster string) ([]model.V1ClusterRole, *http.Response, error)
ClustersApiService List all clusterRoles List all clusterRoles
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
@return []V1ClusterRole
func (*ClustersApiService) GetClusters ¶
func (a *ClustersApiService) GetClusters(ctx context.Context) ([]model.V1Cluster, *http.Response, error)
ClustersApiService List all clusters List all clusters
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []V1Cluster
func (*ClustersApiService) UpdateCluster ¶
func (a *ClustersApiService) UpdateCluster(ctx context.Context, request model.ClusterUpdateReq, name string) (model.ClusterUpdateReq, *http.Response, error)
ClustersApiService Update cluster by name Update cluster by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param request request
- @param name 集群名称
@return ClusterUpdateReq
func (*ClustersApiService) UpdateClusterMember ¶
func (a *ClustersApiService) UpdateClusterMember(ctx context.Context, cluster string, member string, request model.ClusterMember) (model.ClusterMember, *http.Response, error)
ClustersApiService Update Cluster Member Update Cluster Member
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param member 成员名称
- @param request request
@return ClusterMember
func (*ClustersApiService) UpdateClusterRole ¶
func (a *ClustersApiService) UpdateClusterRole(ctx context.Context, cluster string, clusterrole string, request model.V1ClusterRole) (model.V1ClusterRole, *http.Response, error)
ClustersApiService Update Cluster KubepiRole Update Cluster KubepiRole
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param clusterrole 权限名称
- @param request request
@return V1ClusterRole
type Configuration ¶
type Configuration struct { BasePath string `json:"basePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
func NewConfiguration ¶
func NewConfiguration() *Configuration
func (*Configuration) AddDefaultHeader ¶
func (c *Configuration) AddDefaultHeader(key string, value string)
type GenericSwaggerError ¶
type GenericSwaggerError struct {
// contains filtered or unexported fields
}
GenericSwaggerError Provides access to the body, error and model on returned errors.
func (GenericSwaggerError) Body ¶
func (e GenericSwaggerError) Body() []byte
Body returns the raw bytes of the response
func (GenericSwaggerError) Error ¶
func (e GenericSwaggerError) Error() string
Error returns non-empty string if there was an error.
func (GenericSwaggerError) Model ¶
func (e GenericSwaggerError) Model() interface{}
Model returns the unpacked model of the error
type ReposApiService ¶
type ReposApiService service
func (*ReposApiService) ImagereposClusterClusterGet ¶
func (a *ReposApiService) ImagereposClusterClusterGet(ctx context.Context, cluster string) ([]ImagerepoImageRepo, *http.Response, error)
ReposApiService List repo for cluster Get repo for cluster
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
@return []ImagerepoImageRepo
func (*ReposApiService) ImagereposClusterRepoPut ¶
func (a *ReposApiService) ImagereposClusterRepoPut(ctx context.Context, cluster string, repo string) ([]string, *http.Response, error)
ReposApiService List images for cluster Get images for cluster
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param cluster 集群名称
- @param repo 镜像仓库名称
@return []string
func (*ReposApiService) ImagereposNameDelete ¶
func (a *ReposApiService) ImagereposNameDelete(ctx context.Context, name string) (ImagerepoImageRepo, *http.Response, error)
ReposApiService Delete repo by name Delete repo by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 镜像仓库名称
@return ImagerepoImageRepo
func (*ReposApiService) ImagereposNameGet ¶
func (a *ReposApiService) ImagereposNameGet(ctx context.Context, name string) (ImagerepoImageRepo, *http.Response, error)
ReposApiService Get repo by name Get repo by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 镜像仓库名称
@return ImagerepoImageRepo
func (*ReposApiService) ImagereposNamePut ¶
func (a *ReposApiService) ImagereposNamePut(ctx context.Context, request ImagerepoRepoConfig, name string) (ImagerepoImageRepo, *http.Response, error)
ReposApiService Update repo by name Update repo by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param request request
- @param name 镜像仓库名称
@return ImagerepoImageRepo
func (*ReposApiService) ImagereposPost ¶
func (a *ReposApiService) ImagereposPost(ctx context.Context, request ImagerepoRepoConfig) (ImagerepoRepoConfig, *http.Response, error)
ReposApiService Create repo Create repo
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param request request
@return ImagerepoRepoConfig
func (*ReposApiService) ImagereposRepoSearchGet ¶
func (a *ReposApiService) ImagereposRepoSearchGet(ctx context.Context, repo string) (ImagerepoRepoResponse, *http.Response, error)
ReposApiService List images by repo Get images by repo
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param repo 镜像仓库名称
@return ImagerepoRepoResponse
func (*ReposApiService) ImagereposRepositoriesSearchPost ¶
func (a *ReposApiService) ImagereposRepositoriesSearchPost(ctx context.Context, request ImagerepoRepoConfig) ([]string, *http.Response, error)
ReposApiService List Internal repos List Internal repos
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param request request
@return []string
type RolesApiService ¶
type RolesApiService service
func (*RolesApiService) CreateRole ¶
func (a *RolesApiService) CreateRole(ctx context.Context, request model.KubepiRole) (model.KubepiRole, *http.Response, error)
RolesApiService Create role Create role
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param request request
@return KubepiRole
func (*RolesApiService) DeleteRole ¶
func (a *RolesApiService) DeleteRole(ctx context.Context, name string) (model.KubepiRole, *http.Response, error)
RolesApiService Delete role by name Delete role by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 角色名称
@return KubepiRole
func (*RolesApiService) GetRole ¶
func (a *RolesApiService) GetRole(ctx context.Context, name string) (model.KubepiRole, *http.Response, error)
RolesApiService Get role by name Get role by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 权限名称
@return KubepiRole
func (*RolesApiService) GetRoles ¶
func (a *RolesApiService) GetRoles(ctx context.Context) ([]model.KubepiRole, *http.Response, error)
RolesApiService List all roles List all roles
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []KubepiRole
func (*RolesApiService) UpdateRole ¶
func (a *RolesApiService) UpdateRole(ctx context.Context, name string) (model.KubepiRole, *http.Response, error)
RolesApiService Update role by name Update role by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 角色名称
@return KubepiRole
type SessionsApiService ¶
type SessionsApiService service
func (*SessionsApiService) Login ¶
func (a *SessionsApiService) Login(ctx context.Context, request model.LoginCredential) (*http.Response, error)
SessionsApiService KubepiUser Login KubepiUser Login
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param request request
type UsersApiService ¶
type UsersApiService service
func (*UsersApiService) CreateUser ¶
func (a *UsersApiService) CreateUser(ctx context.Context, request model.KubepiUserCreateReq) (model.KubepiUser, *http.Response, error)
UsersApiService Create user Create user
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param request request
@return KubepiUser
func (*UsersApiService) DeleteUser ¶
func (a *UsersApiService) DeleteUser(ctx context.Context, name string) (model.KubepiUser, *http.Response, error)
UsersApiService Delete user by name Delete user by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 用户名称
@return KubepiUser
func (*UsersApiService) GetUser ¶
func (a *UsersApiService) GetUser(ctx context.Context, name string) (model.KubepiUser, *http.Response, error)
UsersApiService Get user by name Get user by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 用户名称
@return KubepiUser
func (*UsersApiService) GetUsers ¶
func (a *UsersApiService) GetUsers(ctx context.Context) ([]model.KubepiUser, *http.Response, error)
UsersApiService List all users List all users
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return []User
func (*UsersApiService) SearchUsers ¶
UsersApiService Search users Search users by Condition
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiPage
func (*UsersApiService) UpdateUser ¶
func (a *UsersApiService) UpdateUser(ctx context.Context, name string) (model.KubepiUser, *http.Response, error)
UsersApiService Update user by name Update user by name
- @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
- @param name 用户名称
@return KubepiUser