@@ -32,63 +32,80 @@ const (
|
||||
AdminUserName = "admin"
|
||||
IngressControllerPrefix = "kubesphere-router-"
|
||||
|
||||
WorkspaceLabelKey = "kubesphere.io/workspace"
|
||||
NamespaceLabelKey = "kubesphere.io/namespace"
|
||||
RuntimeLabelKey = "openpitrix.io/namespace"
|
||||
DisplayNameAnnotationKey = "kubesphere.io/alias-name"
|
||||
DescriptionAnnotationKey = "kubesphere.io/description"
|
||||
CreatorAnnotationKey = "kubesphere.io/creator"
|
||||
UsernameLabelKey = "kubesphere.io/username"
|
||||
System = "system"
|
||||
OpenPitrixRuntimeAnnotationKey = "openpitrix_runtime"
|
||||
WorkspaceAdmin = "workspace-admin"
|
||||
ClusterAdmin = "cluster-admin"
|
||||
WorkspaceRegular = "workspace-regular"
|
||||
WorkspaceViewer = "workspace-viewer"
|
||||
WorkspacesManager = "workspaces-manager"
|
||||
DevopsOwner = "owner"
|
||||
DevopsReporter = "reporter"
|
||||
DevOpsProjectLabelKey = "kubesphere.io/devopsproject"
|
||||
KubefedManagedLabel = "kubefed.io/managed"
|
||||
WorkspaceLabelKey = "kubesphere.io/workspace"
|
||||
NamespaceLabelKey = "kubesphere.io/namespace"
|
||||
DisplayNameAnnotationKey = "kubesphere.io/alias-name"
|
||||
DescriptionAnnotationKey = "kubesphere.io/description"
|
||||
CreatorAnnotationKey = "kubesphere.io/creator"
|
||||
UsernameLabelKey = "kubesphere.io/username"
|
||||
DevOpsProjectLabelKey = "kubesphere.io/devopsproject"
|
||||
KubefedManagedLabel = "kubefed.io/managed"
|
||||
|
||||
UserNameHeader = "X-Token-Username"
|
||||
|
||||
TenantResourcesTag = "Tenant Resources"
|
||||
IdentityManagementTag = "Identity Management"
|
||||
AccessManagementTag = "Access Management"
|
||||
NamespaceResourcesTag = "Namespace Resources"
|
||||
ClusterResourcesTag = "Cluster Resources"
|
||||
ComponentStatusTag = "Component Status"
|
||||
OpenpitrixTag = "Openpitrix Resources"
|
||||
VerificationTag = "Verification"
|
||||
RegistryTag = "Docker Registry"
|
||||
NetworkTopologyTag = "Network Topology"
|
||||
UserResourcesTag = "User Resources"
|
||||
DevOpsProjectTag = "DevOps Project"
|
||||
DevOpsProjectCredentialTag = "DevOps Project Credential"
|
||||
DevOpsProjectMemberTag = "DevOps Project Member"
|
||||
DevOpsPipelineTag = "DevOps Pipeline"
|
||||
DevOpsWebhookTag = "DevOps Webhook"
|
||||
DevOpsJenkinsfileTag = "DevOps Jenkinsfile"
|
||||
DevOpsScmTag = "DevOps Scm"
|
||||
KubeSphereMetricsTag = "KubeSphere Metrics"
|
||||
ClusterMetricsTag = "Cluster Metrics"
|
||||
NodeMetricsTag = "Node Metrics"
|
||||
NamespaceMetricsTag = "Namespace Metrics"
|
||||
PodMetricsTag = "Pod Metrics"
|
||||
PVCMetricsTag = "PVC Metrics"
|
||||
ContainerMetricsTag = "Container Metrics"
|
||||
WorkloadMetricsTag = "Workload Metrics"
|
||||
WorkspaceMetricsTag = "Workspace Metrics"
|
||||
ComponentMetricsTag = "Component Metrics"
|
||||
CustomMetricsTag = "Custom Metrics"
|
||||
LogQueryTag = "Log Query"
|
||||
TerminalTag = "Terminal"
|
||||
EventsQueryTag = "Events Query"
|
||||
AuditingQueryTag = "Auditing Query"
|
||||
AuthenticationTag = "Authentication"
|
||||
UserTag = "User"
|
||||
GroupTag = "Group"
|
||||
|
||||
WorkspaceMemberTag = "Workspace Member"
|
||||
DevOpsProjectMemberTag = "DevOps Project Member"
|
||||
NamespaceMemberTag = "Namespace Member"
|
||||
ClusterMemberTag = "Cluster Member"
|
||||
|
||||
GlobalRoleTag = "Global Role"
|
||||
ClusterRoleTag = "Cluster Role"
|
||||
WorkspaceRoleTag = "Workspace Role"
|
||||
DevOpsProjectRoleTag = "DevOps Project Role"
|
||||
NamespaceRoleTag = "Namespace Role"
|
||||
|
||||
OpenpitrixAppInstanceTag = "App Instance"
|
||||
OpenpitrixAppTemplateTag = "App Template"
|
||||
OpenpitrixCategoryTag = "Category"
|
||||
OpenpitrixAttachmentTag = "Attachment"
|
||||
OpenpitrixRepositoryTag = "Repository"
|
||||
OpenpitrixManagementTag = "App Management"
|
||||
|
||||
DevOpsCredentialTag = "DevOps Credential"
|
||||
DevOpsPipelineTag = "DevOps Pipeline"
|
||||
DevOpsWebhookTag = "DevOps Webhook"
|
||||
DevOpsJenkinsfileTag = "DevOps Jenkinsfile"
|
||||
DevOpsScmTag = "DevOps Scm"
|
||||
DevOpsJenkinsTag = "Jenkins"
|
||||
|
||||
ToolboxTag = "Toolbox"
|
||||
RegistryTag = "Docker Registry"
|
||||
GitTag = "Git"
|
||||
TerminalTag = "Terminal"
|
||||
MultiClusterTag = "Multi-cluster"
|
||||
|
||||
WorkspaceTag = "Workspace"
|
||||
NamespaceTag = "Namespace"
|
||||
DevOpsProjectTag = "DevOps Project"
|
||||
UserResourceTag = "User's Resources"
|
||||
|
||||
NamespaceResourcesTag = "Namespace Resources"
|
||||
ClusterResourcesTag = "Cluster Resources"
|
||||
ComponentStatusTag = "Component Status"
|
||||
|
||||
NetworkTopologyTag = "Network Topology"
|
||||
|
||||
KubeSphereMetricsTag = "KubeSphere Metrics"
|
||||
ClusterMetricsTag = "Cluster Metrics"
|
||||
NodeMetricsTag = "Node Metrics"
|
||||
NamespaceMetricsTag = "Namespace Metrics"
|
||||
PodMetricsTag = "Pod Metrics"
|
||||
PVCMetricsTag = "PVC Metrics"
|
||||
ContainerMetricsTag = "Container Metrics"
|
||||
WorkloadMetricsTag = "Workload Metrics"
|
||||
WorkspaceMetricsTag = "Workspace Metrics"
|
||||
ComponentMetricsTag = "Component Metrics"
|
||||
CustomMetricsTag = "Custom Metrics"
|
||||
|
||||
LogQueryTag = "Log Query"
|
||||
EventsQueryTag = "Events Query"
|
||||
AuditingQueryTag = "Auditing Query"
|
||||
)
|
||||
|
||||
var (
|
||||
WorkSpaceRoles = []string{WorkspaceAdmin, WorkspaceRegular, WorkspaceViewer}
|
||||
SystemNamespaces = []string{KubeSphereNamespace, KubeSphereLoggingNamespace, KubeSphereMonitoringNamespace, OpenPitrixNamespace, KubeSystemNamespace, IstioNamespace, KubesphereDevOpsNamespace, PorterNamespace}
|
||||
)
|
||||
|
||||
@@ -18,11 +18,13 @@ package v1alpha1
|
||||
|
||||
import (
|
||||
"github.com/emicklei/go-restful"
|
||||
restfulspec "github.com/emicklei/go-restful-openapi"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
k8sinformers "k8s.io/client-go/informers"
|
||||
"kubesphere.io/kubesphere/pkg/api"
|
||||
"kubesphere.io/kubesphere/pkg/apiserver/runtime"
|
||||
"kubesphere.io/kubesphere/pkg/client/informers/externalversions"
|
||||
"kubesphere.io/kubesphere/pkg/constants"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -47,13 +49,15 @@ func AddToContainer(container *restful.Container,
|
||||
Doc("Return deployment yaml for cluster agent.").
|
||||
Param(webservice.PathParameter("cluster", "Name of the cluster.").Required(true)).
|
||||
To(h.generateAgentDeployment).
|
||||
Returns(http.StatusOK, api.StatusOK, nil))
|
||||
Returns(http.StatusOK, api.StatusOK, nil).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.MultiClusterTag}))
|
||||
|
||||
webservice.Route(webservice.POST("/clusters/validation").
|
||||
Doc("").
|
||||
Param(webservice.BodyParameter("cluster", "cluster specification")).
|
||||
To(h.validateCluster).
|
||||
Returns(http.StatusOK, api.StatusOK, nil))
|
||||
Returns(http.StatusOK, api.StatusOK, nil).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.MultiClusterTag}))
|
||||
|
||||
container.Add(webservice)
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ func AddPipelineToWebService(webservice *restful.WebService, devopsClient devops
|
||||
webservice.Route(webservice.GET("/devops/{devops}/credentials/{credential}/usage").
|
||||
To(projectPipelineHandler.GetProjectCredentialUsage).
|
||||
Doc("Get the specified credential usage of the DevOps project").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectCredentialTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsCredentialTag}).
|
||||
Param(webservice.PathParameter("devops", "DevOps project's ID, e.g. project-RRRRAzLBlLEm")).
|
||||
Param(webservice.PathParameter("credential", "credential's ID, e.g. dockerhub-id")).
|
||||
Returns(http.StatusOK, RespOK, devops.Credential{}))
|
||||
@@ -697,7 +697,9 @@ func AddJenkinsToContainer(webservice *restful.WebService, devopsClient devops.I
|
||||
u.Path = strings.Replace(request.Request.URL.Path, fmt.Sprintf("/kapis/%s/%s/jenkins", GroupVersion.Group, GroupVersion.Version), "", 1)
|
||||
httpProxy := proxy.NewUpgradeAwareHandler(u, http.DefaultTransport, false, false, &errorResponder{})
|
||||
httpProxy.ServeHTTP(response, request.Request)
|
||||
}).Returns(http.StatusOK, RespOK, nil))
|
||||
}).
|
||||
Returns(http.StatusOK, RespOK, nil).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsJenkinsTag}))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -46,336 +46,335 @@ func AddToContainer(container *restful.Container, im im.IdentityManagementInterf
|
||||
// users
|
||||
ws.Route(ws.POST("/users").
|
||||
To(handler.CreateUser).
|
||||
Doc("Create user in global scope.").
|
||||
Doc("Create a global user account.").
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.User{}).
|
||||
Reads(iamv1alpha2.User{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserTag}))
|
||||
ws.Route(ws.DELETE("/users/{user}").
|
||||
To(handler.DeleteUser).
|
||||
Doc("Delete user.").
|
||||
Doc("Delete the specified user.").
|
||||
Param(ws.PathParameter("user", "username")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserTag}))
|
||||
ws.Route(ws.PUT("/users/{user}").
|
||||
To(handler.UpdateUser).
|
||||
Doc("Update user info.").
|
||||
Doc("Update user profile.").
|
||||
Reads(iamv1alpha2.User{}).
|
||||
Param(ws.PathParameter("user", "username")).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.User{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserTag}))
|
||||
ws.Route(ws.PUT("/users/{user}/password").
|
||||
To(handler.ModifyPassword).
|
||||
Doc("Modify user's password.").
|
||||
Doc("Reset password of the specified user.").
|
||||
Reads(iam.PasswordReset{}).
|
||||
Param(ws.PathParameter("user", "username")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserTag}))
|
||||
ws.Route(ws.GET("/users/{user}").
|
||||
To(handler.DescribeUser).
|
||||
Doc("Retrieve user details.").
|
||||
Param(ws.PathParameter("user", "username")).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.User{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserTag}))
|
||||
ws.Route(ws.GET("/users").
|
||||
To(handler.ListUsers).
|
||||
Doc("List all users in global scope.").
|
||||
Doc("List all users.").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.User{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserTag}))
|
||||
|
||||
ws.Route(ws.GET("/users/{user}/loginrecords").
|
||||
To(handler.ListUserLoginRecords).
|
||||
Param(ws.PathParameter("user", "username of the user")).
|
||||
Doc("List user's login records.").
|
||||
Doc("List login records of the specified user.").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.LoginRecord{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserResourceTag}))
|
||||
|
||||
// clustermembers
|
||||
ws.Route(ws.POST("/clustermembers").
|
||||
To(handler.CreateClusterMembers).
|
||||
Doc("Add user to current cluster.").
|
||||
Doc("Add members to current cluster in bulk.").
|
||||
Reads([]Member{}).
|
||||
Returns(http.StatusOK, api.StatusOK, []Member{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterMemberTag}))
|
||||
ws.Route(ws.DELETE("/clustermembers/{clustermember}").
|
||||
To(handler.RemoveClusterMember).
|
||||
Doc("Delete member in cluster scope.").
|
||||
Doc("Delete a member from current cluster.").
|
||||
Param(ws.PathParameter("clustermember", "cluster member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterMemberTag}))
|
||||
ws.Route(ws.PUT("/clustermembers/{clustermember}").
|
||||
To(handler.UpdateClusterMember).
|
||||
Doc("Update cluster member role bind.").
|
||||
Doc("Update the cluster role bind of the member.").
|
||||
Reads(Member{}).
|
||||
Returns(http.StatusOK, api.StatusOK, Member{}).
|
||||
Param(ws.PathParameter("clustermember", "cluster member's username")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterMemberTag}))
|
||||
ws.Route(ws.GET("/clustermembers/{clustermember}").
|
||||
To(handler.DescribeClusterMember).
|
||||
Doc("Retrieve member details in cluster.").
|
||||
Doc("Retrieve the cluster role of the specified member.").
|
||||
Param(ws.PathParameter("clustermember", "cluster member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.User{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterMemberTag}))
|
||||
ws.Route(ws.GET("/clustermembers").
|
||||
To(handler.ListClusterMembers).
|
||||
Doc("List all members in cluster.").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.User{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterMemberTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/workspacemembers").
|
||||
To(handler.ListWorkspaceMembers).
|
||||
Doc("List all members in the specified workspace.").
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.User{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceMemberTag}))
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/workspacemembers/{workspacemember}").
|
||||
To(handler.DescribeWorkspaceMember).
|
||||
Doc("Retrieve workspace member details.").
|
||||
Doc("Retrieve the workspace role of the specified member.").
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Param(ws.PathParameter("workspacemember", "workspace member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.User{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceMemberTag}))
|
||||
ws.Route(ws.POST("/workspaces/{workspace}/workspacemembers").
|
||||
To(handler.CreateWorkspaceMembers).
|
||||
Doc("Batch add workspace members.").
|
||||
Doc("Add members to current cluster in bulk.").
|
||||
Reads([]Member{}).
|
||||
Returns(http.StatusOK, api.StatusOK, []Member{}).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceMemberTag}))
|
||||
ws.Route(ws.PUT("/workspaces/{workspace}/workspacemembers/{workspacemember}").
|
||||
To(handler.UpdateWorkspaceMember).
|
||||
Doc("Update member in workspace.").
|
||||
Doc("Update the workspace role bind of the member.").
|
||||
Reads(Member{}).
|
||||
Returns(http.StatusOK, api.StatusOK, Member{}).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Param(ws.PathParameter("workspacemember", "workspace member's username")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceMemberTag}))
|
||||
ws.Route(ws.DELETE("/workspaces/{workspace}/workspacemembers/{workspacemember}").
|
||||
To(handler.RemoveWorkspaceMember).
|
||||
Doc("Delete member in workspace scope.").
|
||||
Doc("Delete a member from the workspace.").
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Param(ws.PathParameter("workspacemember", "workspace member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceMemberTag}))
|
||||
|
||||
ws.Route(ws.GET("/namespaces/{namespace}/members").
|
||||
To(handler.ListNamespaceMembers).
|
||||
Doc("List all members in the specified namespace.").
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.User{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceMemberTag}))
|
||||
ws.Route(ws.GET("/namespaces/{namespace}/members/{member}").
|
||||
To(handler.DescribeNamespaceMember).
|
||||
Doc("Retrieve namespace member details.").
|
||||
Doc("Retrieve the role of the specified member.").
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Param(ws.PathParameter("member", "namespace member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.User{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceMemberTag}))
|
||||
ws.Route(ws.POST("/namespaces/{namespace}/members").
|
||||
To(handler.CreateNamespaceMembers).
|
||||
Doc("Batch add namespace members.").
|
||||
Doc("Add members to the namespace in bulk.").
|
||||
Reads([]Member{}).
|
||||
Returns(http.StatusOK, api.StatusOK, []Member{}).
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceMemberTag}))
|
||||
ws.Route(ws.PUT("/namespaces/{namespace}/members/{member}").
|
||||
To(handler.UpdateNamespaceMember).
|
||||
Doc("Update member in namespace.").
|
||||
Doc("Update the role bind of the member.").
|
||||
Reads(Member{}).
|
||||
Returns(http.StatusOK, api.StatusOK, Member{}).
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Param(ws.PathParameter("member", "namespace member's username")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceMemberTag}))
|
||||
ws.Route(ws.DELETE("/namespaces/{namespace}/members/{member}").
|
||||
To(handler.RemoveNamespaceMember).
|
||||
Doc("Delete member in namespace scope.").
|
||||
Doc("Delete a member from the namespace.").
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Param(ws.PathParameter("member", "namespace member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceMemberTag}))
|
||||
|
||||
ws.Route(ws.GET("/devops/{devops}/members").
|
||||
To(handler.ListNamespaceMembers).
|
||||
Doc("List all members in the specified devops project.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.User{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectMemberTag}))
|
||||
ws.Route(ws.GET("/devops/{devops}/members/{member}").
|
||||
To(handler.DescribeNamespaceMember).
|
||||
Doc("Retrieve devops project member details.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Param(ws.PathParameter("member", "devops project member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.User{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectMemberTag}))
|
||||
ws.Route(ws.POST("/devops/{devops}/members").
|
||||
To(handler.CreateNamespaceMembers).
|
||||
Doc("Batch add devops project members.").
|
||||
Doc("Add members to the DevOps project in bulk.").
|
||||
Reads([]Member{}).
|
||||
Returns(http.StatusOK, api.StatusOK, []Member{}).
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectMemberTag}))
|
||||
ws.Route(ws.PUT("/devops/{devops}/members/{member}").
|
||||
To(handler.UpdateNamespaceMember).
|
||||
Doc("Update member in devops project.").
|
||||
Doc("Update the role bind of the member.").
|
||||
Reads(Member{}).
|
||||
Returns(http.StatusOK, api.StatusOK, Member{}).
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Param(ws.PathParameter("member", "devops project member's username")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectMemberTag}))
|
||||
ws.Route(ws.DELETE("/devops/{devops}/members/{member}").
|
||||
To(handler.RemoveNamespaceMember).
|
||||
Doc("Remove member in namespace.").
|
||||
Doc("Delete a member from the DevOps project.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Param(ws.PathParameter("member", "devops project member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectMemberTag}))
|
||||
|
||||
// globalroles
|
||||
ws.Route(ws.POST("/globalroles").
|
||||
To(handler.CreateGlobalRole).
|
||||
Doc("Create global role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Create global role.").
|
||||
Reads(iamv1alpha2.GlobalRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.GlobalRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.GlobalRoleTag}))
|
||||
ws.Route(ws.DELETE("/globalroles/{globalrole}").
|
||||
To(handler.DeleteGlobalRole).
|
||||
Doc("Delete global role.").
|
||||
Param(ws.PathParameter("globalrole", "global role name")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.GlobalRoleTag}))
|
||||
ws.Route(ws.PUT("/globalroles/{globalrole}").
|
||||
To(handler.UpdateGlobalRole).
|
||||
Doc("Update global role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Update global role.").
|
||||
Param(ws.PathParameter("globalrole", "global role name")).
|
||||
Reads(iamv1alpha2.GlobalRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.GlobalRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.GlobalRoleTag}))
|
||||
ws.Route(ws.PATCH("/globalroles/{globalrole}").
|
||||
To(handler.PatchGlobalRole).
|
||||
Doc("Patch global role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Patch global role.").
|
||||
Param(ws.PathParameter("globalrole", "global role name")).
|
||||
Reads(iamv1alpha2.GlobalRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.GlobalRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.GlobalRoleTag}))
|
||||
ws.Route(ws.GET("/globalroles").
|
||||
To(handler.ListGlobalRoles).
|
||||
Doc("List all global roles.").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.GlobalRole{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.GlobalRoleTag}))
|
||||
ws.Route(ws.GET("/globalroles/{globalrole}").
|
||||
To(handler.DescribeGlobalRole).
|
||||
Param(ws.PathParameter("globalrole", "global role name")).
|
||||
Doc("Retrieve global role details.").
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.GlobalRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.GlobalRoleTag}))
|
||||
|
||||
// clusterroles
|
||||
ws.Route(ws.POST("/clusterroles").
|
||||
To(handler.CreateClusterRole).
|
||||
Doc("Create cluster role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Create cluster role.").
|
||||
Reads(rbacv1.ClusterRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.ClusterRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterRoleTag}))
|
||||
ws.Route(ws.DELETE("/clusterroles/{clusterrole}").
|
||||
To(handler.DeleteClusterRole).
|
||||
Doc("Delete cluster role.").
|
||||
Param(ws.PathParameter("clusterrole", "cluster role name")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterRoleTag}))
|
||||
ws.Route(ws.PUT("/clusterroles/{clusterrole}").
|
||||
To(handler.UpdateClusterRole).
|
||||
Doc("Update cluster role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Update cluster role.").
|
||||
Param(ws.PathParameter("clusterrole", "cluster role name")).
|
||||
Reads(rbacv1.ClusterRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.ClusterRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterRoleTag}))
|
||||
ws.Route(ws.PATCH("/clusterroles/{clusterrole}").
|
||||
To(handler.PatchClusterRole).
|
||||
Doc("Patch cluster role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Patch cluster role.").
|
||||
Param(ws.PathParameter("clusterrole", "cluster role name")).
|
||||
Reads(rbacv1.ClusterRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.ClusterRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterRoleTag}))
|
||||
ws.Route(ws.GET("/clusterroles").
|
||||
To(handler.ListClusterRoles).
|
||||
Doc("List all cluster roles.").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{rbacv1.ClusterRole{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterRoleTag}))
|
||||
ws.Route(ws.GET("/clusterroles/{clusterrole}").
|
||||
To(handler.DescribeClusterRole).
|
||||
Param(ws.PathParameter("clusterrole", "cluster role name")).
|
||||
Doc("Retrieve cluster role details.").
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.ClusterRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterRoleTag}))
|
||||
|
||||
// workspaceroles
|
||||
ws.Route(ws.POST("/workspaces/{workspace}/workspaceroles").
|
||||
To(handler.CreateWorkspaceRole).
|
||||
Doc("Create workspace role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Create workspace role.").
|
||||
Reads(iamv1alpha2.WorkspaceRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.WorkspaceRole{}).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceRoleTag}))
|
||||
ws.Route(ws.DELETE("/workspaces/{workspace}/workspaceroles/{workspacerole}").
|
||||
To(handler.DeleteWorkspaceRole).
|
||||
Doc("Delete workspace role.").
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Param(ws.PathParameter("workspacerole", "workspace role name")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceRoleTag}))
|
||||
ws.Route(ws.PATCH("/workspaces/{workspace}/workspaceroles/{workspacerole}").
|
||||
To(handler.PatchWorkspaceRole).
|
||||
Doc("Patch workspace role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Patch workspace role.").
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Param(ws.PathParameter("workspacerole", "workspace role name")).
|
||||
Reads(iamv1alpha2.WorkspaceRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceRoleTag}))
|
||||
ws.Route(ws.PUT("/workspaces/{workspace}/workspaceroles/{workspacerole}").
|
||||
To(handler.UpdateWorkspaceRole).
|
||||
Doc("Update workspace role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Update workspace role.").
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Param(ws.PathParameter("workspacerole", "workspace role name")).
|
||||
Reads(iamv1alpha2.WorkspaceRole{}).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.WorkspaceRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceRoleTag}))
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/workspaceroles").
|
||||
To(handler.ListWorkspaceRoles).
|
||||
Doc("List all workspace roles.").
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.WorkspaceRole{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceRoleTag}))
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/workspaceroles/{workspacerole}").
|
||||
To(handler.DescribeWorkspaceRole).
|
||||
Doc("Retrieve workspace role details.").
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Param(ws.PathParameter("workspacerole", "workspace role name")).
|
||||
Returns(http.StatusOK, api.StatusOK, iamv1alpha2.WorkspaceRole{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceRoleTag}))
|
||||
|
||||
// roles
|
||||
ws.Route(ws.POST("/namespaces/{namespace}/roles").
|
||||
To(handler.CreateNamespaceRole).
|
||||
Doc("Create role in the specified namespace. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Create role in the specified namespace.").
|
||||
Reads(rbacv1.Role{}).
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.Role{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceRoleTag}))
|
||||
ws.Route(ws.DELETE("/namespaces/{namespace}/roles/{role}").
|
||||
To(handler.DeleteNamespaceRole).
|
||||
Doc("Delete role in the specified namespace.").
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Param(ws.PathParameter("role", "role name")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceRoleTag}))
|
||||
ws.Route(ws.PUT("/namespaces/{namespace}/roles/{role}").
|
||||
To(handler.UpdateNamespaceRole).
|
||||
Doc("Update namespace role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Update namespace role.").
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Param(ws.PathParameter("role", "role name")).
|
||||
Reads(rbacv1.Role{}).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.Role{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceRoleTag}))
|
||||
ws.Route(ws.PATCH("/namespaces/{namespace}/roles/{role}").
|
||||
To(handler.PatchNamespaceRole).
|
||||
Doc("Patch namespace role.").
|
||||
@@ -383,99 +382,99 @@ func AddToContainer(container *restful.Container, im im.IdentityManagementInterf
|
||||
Param(ws.PathParameter("role", "role name")).
|
||||
Reads(rbacv1.Role{}).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.Role{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceRoleTag}))
|
||||
ws.Route(ws.GET("/namespaces/{namespace}/roles").
|
||||
To(handler.ListRoles).
|
||||
Doc("List all roles in the specified namespace.").
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{rbacv1.Role{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceRoleTag}))
|
||||
ws.Route(ws.GET("/namespaces/{namespace}/roles/{role}").
|
||||
To(handler.DescribeNamespaceRole).
|
||||
Doc("Retrieve role details.").
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Param(ws.PathParameter("role", "role name")).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.Role{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceRoleTag}))
|
||||
|
||||
// roles
|
||||
ws.Route(ws.POST("/devops/{devops}/roles").
|
||||
To(handler.CreateNamespaceRole).
|
||||
Doc("Create role in the specified devops project. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Create role in the specified devops project.").
|
||||
Reads(rbacv1.Role{}).
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.Role{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectRoleTag}))
|
||||
ws.Route(ws.DELETE("/devops/{devops}/roles/{role}").
|
||||
To(handler.DeleteNamespaceRole).
|
||||
Doc("Delete role in the specified devops project.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Param(ws.PathParameter("role", "role name")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectRoleTag}))
|
||||
ws.Route(ws.PUT("/devops/{devops}/roles/{role}").
|
||||
To(handler.UpdateNamespaceRole).
|
||||
Doc("Update devops project role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Update devops project role.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Param(ws.PathParameter("role", "role name")).
|
||||
Reads(rbacv1.Role{}).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.Role{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectRoleTag}))
|
||||
ws.Route(ws.PATCH("/devops/{devops}/roles/{role}").
|
||||
To(handler.PatchNamespaceRole).
|
||||
Doc("Patch devops project role. Automatically aggregate policy rules according to annotation.").
|
||||
Doc("Patch devops project role.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Param(ws.PathParameter("role", "role name")).
|
||||
Reads(rbacv1.Role{}).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.Role{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectRoleTag}))
|
||||
ws.Route(ws.GET("/devops/{devops}/roles").
|
||||
To(handler.ListRoles).
|
||||
Doc("List all roles in the specified devops project.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{rbacv1.Role{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectRoleTag}))
|
||||
ws.Route(ws.GET("/devops/{devops}/roles/{role}").
|
||||
To(handler.DescribeNamespaceRole).
|
||||
Doc("Retrieve devops project role details.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Param(ws.PathParameter("role", "role name")).
|
||||
Returns(http.StatusOK, api.StatusOK, rbacv1.Role{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectRoleTag}))
|
||||
|
||||
ws.Route(ws.GET("/users/{user}/globalroles").
|
||||
To(handler.RetrieveMemberRoleTemplates).
|
||||
Doc("Retrieve user's global role templates.").
|
||||
Param(ws.PathParameter("user", "username")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.GlobalRole{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.GlobalRoleTag}))
|
||||
ws.Route(ws.GET("/clustermembers/{clustermember}/clusterroles").
|
||||
To(handler.RetrieveMemberRoleTemplates).
|
||||
Doc("Retrieve user's role templates in cluster.").
|
||||
Param(ws.PathParameter("clustermember", "cluster member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{rbacv1.ClusterRole{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterRoleTag}))
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/workspacemembers/{workspacemember}/workspaceroles").
|
||||
To(handler.RetrieveMemberRoleTemplates).
|
||||
Doc("Retrieve member's role templates in workspace.").
|
||||
Param(ws.PathParameter("workspace", "workspace")).
|
||||
Param(ws.PathParameter("workspacemember", "workspace member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{iamv1alpha2.WorkspaceRole{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceRoleTag}))
|
||||
ws.Route(ws.GET("/namespaces/{namespace}/members/{member}/roles").
|
||||
To(handler.RetrieveMemberRoleTemplates).
|
||||
Doc("Retrieve member's role templates in namespace.").
|
||||
Param(ws.PathParameter("namespace", "namespace")).
|
||||
Param(ws.PathParameter("member", "namespace member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{rbacv1.Role{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceRoleTag}))
|
||||
ws.Route(ws.GET("/devops/{devops}/members/{member}/roles").
|
||||
To(handler.RetrieveMemberRoleTemplates).
|
||||
Doc("Retrieve member's role templates in devops project.").
|
||||
Param(ws.PathParameter("devops", "devops project name")).
|
||||
Param(ws.PathParameter("member", "devops project member's username")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{Items: []interface{}{rbacv1.Role{}}}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AccessManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectRoleTag}))
|
||||
|
||||
container.Add(ws)
|
||||
return nil
|
||||
|
||||
@@ -50,7 +50,7 @@ func AddToContainer(c *restful.Container, im im.IdentityManagementInterface, tok
|
||||
Reads(auth.TokenReview{}).
|
||||
To(handler.TokenReview).
|
||||
Returns(http.StatusOK, api.StatusOK, auth.TokenReview{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.IdentityManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AuthenticationTag}))
|
||||
|
||||
// Only support implicit grant flow
|
||||
// https://tools.ietf.org/html/rfc6749#section-4.2
|
||||
@@ -64,15 +64,22 @@ func AddToContainer(c *restful.Container, im im.IdentityManagementInterface, tok
|
||||
Param(ws.QueryParameter("redirect_uri", "After completing its interaction with the resource owner, "+
|
||||
"the authorization server directs the resource owner's user-agent back to the client.The redirection endpoint "+
|
||||
"URI MUST be an absolute URI as defined by [RFC3986] Section 4.3.").Required(false)).
|
||||
To(handler.Authorize))
|
||||
To(handler.Authorize).
|
||||
Returns(http.StatusFound, http.StatusText(http.StatusFound), "").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AuthenticationTag}))
|
||||
// Resource Owner Password Credentials Grant
|
||||
// https://tools.ietf.org/html/rfc6749#section-4.3
|
||||
ws.Route(ws.POST("/token").
|
||||
Consumes("application/x-www-form-urlencoded").
|
||||
Doc("The resource owner password credentials grant type is suitable in\n" +
|
||||
"cases where the resource owner has a trust relationship with the\n" +
|
||||
Doc("The resource owner password credentials grant type is suitable in\n"+
|
||||
"cases where the resource owner has a trust relationship with the\n"+
|
||||
"client, such as the device operating system or a highly privileged application.").
|
||||
To(handler.Token))
|
||||
Param(ws.FormParameter("grant_type", "Value MUST be set to \"password\".").Required(true)).
|
||||
Param(ws.FormParameter("username", "The resource owner username.").Required(true)).
|
||||
Param(ws.FormParameter("password", "The resource owner password.").Required(true)).
|
||||
To(handler.Token).
|
||||
Returns(http.StatusOK, http.StatusText(http.StatusOK), &oauth.Token{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AuthenticationTag}))
|
||||
|
||||
// Authorization callback URL, where the end of the URL contains the identity provider name.
|
||||
// The provider name is also used to build the callback URL.
|
||||
@@ -92,7 +99,8 @@ func AddToContainer(c *restful.Container, im im.IdentityManagementInterface, tok
|
||||
Param(ws.QueryParameter("state", "if the \"state\" parameter was present in the client authorization request."+
|
||||
"The exact value received from the client.").Required(true)).
|
||||
To(handler.oAuthCallBack).
|
||||
Returns(http.StatusOK, api.StatusOK, oauth.Token{}))
|
||||
Returns(http.StatusOK, api.StatusOK, oauth.Token{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AuthenticationTag}))
|
||||
|
||||
c.Add(ws)
|
||||
|
||||
@@ -107,7 +115,7 @@ func AddToContainer(c *restful.Container, im im.IdentityManagementInterface, tok
|
||||
Doc("KubeSphere APIs support token-based authentication via the Authtoken request header. The POST Login API is used to retrieve the authentication token. After the authentication token is obtained, it must be inserted into the Authtoken header for all requests.").
|
||||
Reads(auth.LoginRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, oauth.Token{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.IdentityManagementTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.AuthenticationTag}))
|
||||
|
||||
c.Add(legacy)
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.GET("/applications").
|
||||
To(handler.ListApplications).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Doc("List all applications").
|
||||
Param(webservice.QueryParameter(params.ConditionsParam, "query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a").
|
||||
Required(false).
|
||||
@@ -57,7 +57,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/namespaces/{namespace}/applications").
|
||||
To(handler.ListApplications).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Doc("List all applications within the specified namespace").
|
||||
Param(webservice.QueryParameter(params.ConditionsParam, "query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a").
|
||||
Required(false).
|
||||
@@ -72,7 +72,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/namespaces/{namespace}/applications/{application}").
|
||||
To(handler.DescribeApplication).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.Application{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Doc("Describe the specified application of the namespace").
|
||||
Param(webservice.PathParameter("namespace", "the name of the project").Required(true)).
|
||||
Param(webservice.PathParameter("application", "the id of the application").Required(true)))
|
||||
@@ -80,7 +80,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/clusters/{cluster}/applications").
|
||||
To(handler.ListApplications).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Doc("List all applications in special cluster").
|
||||
Param(webservice.QueryParameter(params.ConditionsParam, "query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a").
|
||||
Required(false).
|
||||
@@ -95,7 +95,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/clusters/{cluster}/namespaces/{namespace}/applications").
|
||||
To(handler.ListApplications).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Doc("List all applications within the specified namespace").
|
||||
Param(webservice.QueryParameter(params.ConditionsParam, "query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a").
|
||||
Required(false).
|
||||
@@ -111,7 +111,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/clusters/{cluster}/namespaces/{namespace}/applications/{application}").
|
||||
To(handler.DescribeApplication).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.Application{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Doc("Describe the specified application of the namespace").
|
||||
Param(webservice.PathParameter("cluster", "the name of the cluster.").Required(true)).
|
||||
Param(webservice.PathParameter("namespace", "the name of the project").Required(true)).
|
||||
@@ -120,7 +120,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.POST("/workspaces/{workspace}/clusters/{cluster}/namespaces/{namespace}/applications").
|
||||
To(handler.CreateApplication).
|
||||
Doc("Deploy a new application").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Reads(openpitrix2.CreateClusterRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("cluster", "the name of the cluster.").Required(true)).
|
||||
@@ -130,7 +130,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Consumes(mimePatch...).
|
||||
To(handler.ModifyApplication).
|
||||
Doc("Modify application").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Reads(openpitrix2.ModifyClusterAttributesRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("cluster", "the name of the cluster.").Required(true)).
|
||||
@@ -140,7 +140,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.DELETE("/workspaces/{workspace}/clusters/{cluster}/namespaces/{namespace}/applications/{application}").
|
||||
To(handler.DeleteApplication).
|
||||
Doc("Delete the specified application").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("cluster", "the name of the cluster.").Required(true)).
|
||||
Param(webservice.PathParameter("namespace", "the name of the project").Required(true)).
|
||||
@@ -150,7 +150,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Consumes(mimePatch...).
|
||||
To(handler.UpgradeApplication).
|
||||
Doc("Upgrade application").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppInstanceTag}).
|
||||
Reads(openpitrix2.UpgradeClusterRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("cluster", "the name of the cluster.").Required(true)).
|
||||
@@ -160,7 +160,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.POST("/apps/{app}/versions").
|
||||
To(handler.CreateAppVersion).
|
||||
Doc("Create a new app template version").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Reads(openpitrix2.CreateAppVersionRequest{}).
|
||||
Param(webservice.QueryParameter("validate", "Validate format of package(pack by op tool)")).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.CreateAppVersionResponse{}).
|
||||
@@ -168,7 +168,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.POST("/workspaces/{workspace}/apps/{app}/versions").
|
||||
To(handler.CreateAppVersion).
|
||||
Doc("Create a new app template version").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Reads(openpitrix2.CreateAppVersionRequest{}).
|
||||
Param(webservice.QueryParameter("validate", "Validate format of package(pack by op tool)")).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.CreateAppVersionResponse{}).
|
||||
@@ -176,14 +176,14 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.DELETE("/apps/{app}/versions/{version}").
|
||||
To(handler.DeleteAppVersion).
|
||||
Doc("Delete the specified app template version").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.DELETE("/workspaces/{workspace}/apps/{app}/versions/{version}").
|
||||
To(handler.DeleteAppVersion).
|
||||
Doc("Delete the specified app template version").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
@@ -191,7 +191,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Consumes(mimePatch...).
|
||||
To(handler.ModifyAppVersion).
|
||||
Doc("Patch the specified app template version").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Reads(openpitrix2.ModifyAppVersionRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
@@ -200,7 +200,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Consumes(mimePatch...).
|
||||
To(handler.ModifyAppVersion).
|
||||
Doc("Patch the specified app template version").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Reads(openpitrix2.ModifyAppVersionRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
@@ -208,7 +208,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
webservice.Route(webservice.GET("/apps/{app}/versions/{version}").
|
||||
To(handler.DescribeAppVersion).
|
||||
Doc("Describe the specified app template version").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.AppVersion{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
@@ -225,12 +225,12 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Param(webservice.PathParameter("app", "app template id")).
|
||||
Param(webservice.QueryParameter(params.ReverseParam, "sort parameters, e.g. reverse=true")).
|
||||
Param(webservice.QueryParameter(params.OrderByParam, "sort parameters, e.g. orderBy=createTime")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}))
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/apps/{app}/versions/{version}").
|
||||
To(handler.DescribeAppVersion).
|
||||
Doc("Describe the specified app template version").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.AppVersion{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
@@ -247,19 +247,19 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Param(webservice.PathParameter("app", "app template id")).
|
||||
Param(webservice.QueryParameter(params.ReverseParam, "sort parameters, e.g. reverse=true")).
|
||||
Param(webservice.QueryParameter(params.OrderByParam, "sort parameters, e.g. orderBy=createTime")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}))
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/apps/{app}/versions/{version}/audits").
|
||||
To(handler.ListAppVersionAudits).
|
||||
Doc("List audits information of version-specific app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.AppVersionAudit{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.GET("/apps/{app}/versions/{version}/audits").
|
||||
To(handler.ListAppVersionAudits).
|
||||
Doc("List audits information of version-specific app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.AppVersionAudit{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
@@ -267,27 +267,27 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
To(handler.GetAppVersionPackage).
|
||||
Doc("Get packages of version-specific app").
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.GetAppVersionPackageResponse{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.POST("/apps/{app}/versions/{version}/action").
|
||||
To(handler.DoAppVersionAction).
|
||||
Doc("Perform submit or other operations on app").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.POST("/workspaces/{workspace}/apps/{app}/versions/{version}/action").
|
||||
To(handler.DoAppVersionAction).
|
||||
Doc("Perform submit or other operations on app").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.GET("/apps/{app}/versions/{version}/files").
|
||||
To(handler.GetAppVersionFiles).
|
||||
Doc("Get app template package files").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.GetAppVersionPackageFilesResponse{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
@@ -301,45 +301,45 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Required(false).
|
||||
DataFormat("limit=%d,page=%d").
|
||||
DefaultValue("limit=10,page=1")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.AppVersionReview{}))
|
||||
webservice.Route(webservice.GET("/apps/{app}/audits").
|
||||
To(handler.ListAppVersionAudits).
|
||||
Doc("List audits information of the specific app template").
|
||||
Param(webservice.PathParameter("app", "app template id")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.AppVersionAudit{}))
|
||||
webservice.Route(webservice.POST("/apps").
|
||||
To(handler.CreateApp).
|
||||
Doc("Create a new app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.CreateAppResponse{}).
|
||||
Reads(openpitrix2.CreateAppRequest{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.POST("/workspaces/{workspace}/apps").
|
||||
To(handler.CreateApp).
|
||||
Doc("Create a new app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.CreateAppResponse{}).
|
||||
Reads(openpitrix2.CreateAppRequest{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.DELETE("/apps/{app}").
|
||||
To(handler.DeleteApp).
|
||||
Doc("Delete the specified app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.DELETE("/workspaces/{workspace}/apps/{app}").
|
||||
To(handler.DeleteApp).
|
||||
Doc("Delete the specified app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.PATCH("/apps/{app}").
|
||||
Consumes(mimePatch...).
|
||||
To(handler.ModifyApp).
|
||||
Doc("Patch the specified app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Reads(openpitrix2.ModifyAppVersionRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
@@ -347,33 +347,33 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Consumes(mimePatch...).
|
||||
To(handler.ModifyApp).
|
||||
Doc("Patch the specified app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Reads(openpitrix2.ModifyAppVersionRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/apps/{app}").
|
||||
To(handler.DescribeApp).
|
||||
Doc("Describe the specified app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.AppVersion{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.GET("/apps/{app}").
|
||||
To(handler.DescribeApp).
|
||||
Doc("Describe the specified app template").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.AppVersion{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.POST("/apps/{app}/action").
|
||||
To(handler.DoAppAction).
|
||||
Doc("Perform recover or suspend operation on app").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.POST("/workspaces/{workspace}/apps/{app}/action").
|
||||
To(handler.DoAppAction).
|
||||
Doc("Perform recover or suspend operation on app").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("version", "app template version id")).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
@@ -389,7 +389,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
DefaultValue("limit=10,page=1")).
|
||||
Param(webservice.QueryParameter(params.ReverseParam, "sort parameters, e.g. reverse=true")).
|
||||
Param(webservice.QueryParameter(params.OrderByParam, "sort parameters, e.g. orderBy=createTime")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}))
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/apps").
|
||||
To(handler.ListApps).
|
||||
@@ -404,33 +404,33 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
DefaultValue("limit=10,page=1")).
|
||||
Param(webservice.QueryParameter(params.ReverseParam, "sort parameters, e.g. reverse=true")).
|
||||
Param(webservice.QueryParameter(params.OrderByParam, "sort parameters, e.g. orderBy=createTime")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAppTemplateTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}))
|
||||
webservice.Route(webservice.POST("/categories").
|
||||
To(handler.CreateCategory).
|
||||
Doc("Create app template category").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixCategoryTag}).
|
||||
Reads(openpitrix2.CreateCategoryRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.CreateCategoryResponse{}).
|
||||
Param(webservice.PathParameter("app", "app template id")))
|
||||
webservice.Route(webservice.DELETE("/categories/{category}").
|
||||
To(handler.DeleteCategory).
|
||||
Doc("Delete the specified category").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixCategoryTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("category", "category id")))
|
||||
webservice.Route(webservice.PATCH("/categories/{category}").
|
||||
Consumes(mimePatch...).
|
||||
To(handler.ModifyCategory).
|
||||
Doc("Patch the specified category").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixCategoryTag}).
|
||||
Reads(openpitrix2.ModifyCategoryRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("category", "category id")))
|
||||
webservice.Route(webservice.GET("/categories/{category}").
|
||||
To(handler.DescribeCategory).
|
||||
Doc("Describe the specified category").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixCategoryTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.Category{}).
|
||||
Param(webservice.PathParameter("category", "category id")))
|
||||
webservice.Route(webservice.GET("/categories").
|
||||
@@ -445,47 +445,47 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
DefaultValue("limit=10,page=1")).
|
||||
Param(webservice.QueryParameter(params.ReverseParam, "sort parameters, e.g. reverse=true")).
|
||||
Param(webservice.QueryParameter(params.OrderByParam, "sort parameters, e.g. orderBy=createTime")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixCategoryTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}))
|
||||
|
||||
webservice.Route(webservice.GET("/attachments/{attachment}").
|
||||
To(handler.DescribeAttachment).
|
||||
Doc("Get attachment by attachment id").
|
||||
Param(webservice.PathParameter("attachment", "attachment id")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixAttachmentTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.Attachment{}))
|
||||
|
||||
webservice.Route(webservice.POST("/repos").
|
||||
To(handler.CreateRepo).
|
||||
Doc("Create repository in the specified workspace, repository used to store package of app").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Param(webservice.QueryParameter("validate", "Validate repository")).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.CreateRepoResponse{}).
|
||||
Reads(openpitrix2.CreateRepoRequest{}))
|
||||
webservice.Route(webservice.POST("/workspaces/{workspace}/repos").
|
||||
To(handler.CreateRepo).
|
||||
Doc("Create repository in the specified workspace, repository used to store package of app").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Param(webservice.QueryParameter("validate", "Validate repository")).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.CreateRepoResponse{}).
|
||||
Reads(openpitrix2.CreateRepoRequest{}))
|
||||
webservice.Route(webservice.DELETE("/repos/{repo}").
|
||||
To(handler.DeleteRepo).
|
||||
Doc("Delete the specified repository in the specified workspace").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
webservice.Route(webservice.DELETE("/workspaces/{workspace}/repos/{repo}").
|
||||
To(handler.DeleteRepo).
|
||||
Doc("Delete the specified repository in the specified workspace").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
webservice.Route(webservice.PATCH("/repos/{repo}").
|
||||
Consumes(mimePatch...).
|
||||
To(handler.ModifyRepo).
|
||||
Doc("Patch the specified repository in the specified workspace").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Reads(openpitrix2.ModifyRepoRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
@@ -493,20 +493,20 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Consumes(mimePatch...).
|
||||
To(handler.ModifyRepo).
|
||||
Doc("Patch the specified repository in the specified workspace").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Reads(openpitrix2.ModifyRepoRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
webservice.Route(webservice.GET("/repos/{repo}").
|
||||
To(handler.DescribeRepo).
|
||||
Doc("Describe the specified repository in the specified workspace").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.Repo{}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/repos/{repo}").
|
||||
To(handler.DescribeRepo).
|
||||
Doc("Describe the specified repository in the specified workspace").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, openpitrix2.Repo{}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
webservice.Route(webservice.GET("/repos").
|
||||
@@ -520,7 +520,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
DataFormat("limit=%d,page=%d").
|
||||
DefaultValue("limit=10,page=1")).
|
||||
Param(webservice.QueryParameter(params.ReverseParam, "sort parameters, e.g. reverse=true")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Param(webservice.QueryParameter(params.OrderByParam, "sort parameters, e.g. orderBy=createTime")).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}))
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/repos").
|
||||
@@ -535,7 +535,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
DefaultValue("limit=10,page=1")).
|
||||
Param(webservice.QueryParameter(params.ReverseParam, "sort parameters, e.g. reverse=true")).
|
||||
Param(webservice.QueryParameter(params.OrderByParam, "sort parameters, e.g. orderBy=createTime")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}))
|
||||
|
||||
webservice.Route(webservice.POST("/repos/{repo}/action").
|
||||
@@ -543,26 +543,26 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, op
|
||||
Doc("Start index repository event").
|
||||
Reads(openpitrix2.RepoActionRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
webservice.Route(webservice.POST("/workspaces/{workspace}/repos/{repo}/action").
|
||||
To(handler.DoRepoAction).
|
||||
Doc("Start index repository event").
|
||||
Reads(openpitrix2.RepoActionRequest{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixManagementTag}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
webservice.Route(webservice.GET("/repos/{repo}/events").
|
||||
To(handler.ListRepoEvents).
|
||||
Doc("Get repository events").
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
webservice.Route(webservice.GET("/workspaces/{workspace}/repos/{repo}/events").
|
||||
To(handler.ListRepoEvents).
|
||||
Doc("Get repository events").
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.OpenpitrixRepositoryTag}).
|
||||
Param(webservice.PathParameter("repo", "repo id")))
|
||||
|
||||
c.Add(webservice)
|
||||
|
||||
@@ -86,7 +86,7 @@ func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, factor
|
||||
To(handler.GetKubectlPod).
|
||||
Doc("get user's kubectl pod").
|
||||
Param(webservice.PathParameter("user", "username")).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserResourcesTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ToolboxTag}).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PodInfo{}))
|
||||
|
||||
webservice.Route(webservice.GET("/users/{user}/kubeconfig").
|
||||
@@ -95,7 +95,7 @@ func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, factor
|
||||
Doc("get users' kubeconfig").
|
||||
Param(webservice.PathParameter("user", "username")).
|
||||
Returns(http.StatusOK, api.StatusOK, "").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ToolboxTag}))
|
||||
|
||||
webservice.Route(webservice.GET("/components").
|
||||
To(handler.handleGetComponents).
|
||||
@@ -130,7 +130,7 @@ func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, factor
|
||||
|
||||
webservice.Route(webservice.POST("registry/verify").
|
||||
To(handler.handleVerifyRegistryCredential).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.VerificationTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.RegistryTag}).
|
||||
Doc("verify if a user has access to the docker registry").
|
||||
Reads(api.RegistryCredential{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}))
|
||||
@@ -152,7 +152,7 @@ func AddToContainer(c *restful.Container, k8sClient kubernetes.Interface, factor
|
||||
)
|
||||
webservice.Route(webservice.POST("git/verify").
|
||||
To(handler.handleVerifyGitCredential).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.VerificationTag}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.GitTag}).
|
||||
Doc("Verify if the kubernetes secret has read access to the git repository").
|
||||
Reads(gitmodel.AuthInfo{}).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.Error{}),
|
||||
|
||||
@@ -59,21 +59,21 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
To(handler.ListClusters).
|
||||
Doc("List clusters available to users").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.UserResourceTag}))
|
||||
|
||||
ws.Route(ws.POST("/workspaces").
|
||||
To(handler.CreateWorkspace).
|
||||
Reads(tenantv1alpha2.WorkspaceTemplate{}).
|
||||
Returns(http.StatusOK, api.StatusOK, tenantv1alpha2.WorkspaceTemplate{}).
|
||||
Doc("Create workspace.").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceTag}))
|
||||
|
||||
ws.Route(ws.DELETE("/workspaces/{workspace}").
|
||||
To(handler.DeleteWorkspace).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Doc("Delete workspace.").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceTag}))
|
||||
|
||||
ws.Route(ws.PUT("/workspaces/{workspace}").
|
||||
To(handler.UpdateWorkspace).
|
||||
@@ -81,7 +81,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Reads(tenantv1alpha2.WorkspaceTemplate{}).
|
||||
Returns(http.StatusOK, api.StatusOK, tenantv1alpha2.WorkspaceTemplate{}).
|
||||
Doc("Update workspace.").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceTag}))
|
||||
|
||||
ws.Route(ws.PATCH("/workspaces/{workspace}").
|
||||
To(handler.PatchWorkspace).
|
||||
@@ -90,60 +90,60 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Reads(tenantv1alpha2.WorkspaceTemplate{}).
|
||||
Returns(http.StatusOK, api.StatusOK, tenantv1alpha2.WorkspaceTemplate{}).
|
||||
Doc("Update workspace.").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces").
|
||||
To(handler.ListWorkspaces).
|
||||
Returns(http.StatusOK, api.StatusOK, models.PageableResponse{}).
|
||||
Doc("List all workspaces that belongs to the current user").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}").
|
||||
To(handler.DescribeWorkspace).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Returns(http.StatusOK, api.StatusOK, tenantv1alpha2.WorkspaceTemplate{}).
|
||||
Doc("Describe workspace.").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/clusters").
|
||||
To(handler.ListWorkspaceClusters).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{}).
|
||||
Doc("List clusters authorized to the specified workspace.").
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.WorkspaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/namespaces").
|
||||
To(handler.ListNamespaces).
|
||||
Doc("List the namespaces for the current user").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/federatednamespaces").
|
||||
To(handler.ListFederatedNamespaces).
|
||||
Doc("List the federated namespaces for the current user").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/federatednamespaces").
|
||||
To(handler.ListFederatedNamespaces).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Doc("List the federated namespaces of the specified workspace for the current user").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/namespaces").
|
||||
To(handler.ListNamespaces).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Doc("List the namespaces of the specified workspace for the current user").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/devops").
|
||||
To(handler.ListDevOpsProjects).
|
||||
Param(ws.PathParameter("workspace", "workspace name")).
|
||||
Doc("List the devops projects of the specified workspace for the current user").
|
||||
Returns(http.StatusOK, api.StatusOK, api.ListResult{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/workspacemembers/{workspacemember}/devops").
|
||||
To(handler.ListDevOpsProjects).
|
||||
@@ -152,7 +152,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Doc("List the devops projects of specified workspace for the workspace member").
|
||||
Reads(corev1.Namespace{}).
|
||||
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.DevOpsProjectTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/namespaces/{namespace}").
|
||||
To(handler.DescribeNamespace).
|
||||
@@ -160,7 +160,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Param(ws.PathParameter("namespace", "project name")).
|
||||
Doc("Retrieve namespace details.").
|
||||
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.DELETE("/workspaces/{workspace}/namespaces/{namespace}").
|
||||
To(handler.DeleteNamespace).
|
||||
@@ -168,7 +168,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Param(ws.PathParameter("namespace", "project name")).
|
||||
Doc("Delete namespace.").
|
||||
Returns(http.StatusOK, api.StatusOK, errors.None).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.POST("/workspaces/{workspace}/namespaces").
|
||||
To(handler.CreateNamespace).
|
||||
@@ -176,7 +176,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Doc("List the namespaces of the specified workspace for the current user").
|
||||
Reads(corev1.Namespace{}).
|
||||
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/workspaces/{workspace}/workspacemembers/{workspacemember}/namespaces").
|
||||
To(handler.ListNamespaces).
|
||||
@@ -185,7 +185,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Doc("List the namespaces of the specified workspace for the workspace member").
|
||||
Reads(corev1.Namespace{}).
|
||||
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.PUT("/workspaces/{workspace}/namespaces/{namespace}").
|
||||
To(handler.UpdateNamespace).
|
||||
@@ -193,7 +193,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Param(ws.PathParameter("namespace", "project name")).
|
||||
Reads(corev1.Namespace{}).
|
||||
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.PATCH("/workspaces/{workspace}/namespaces/{namespace}").
|
||||
To(handler.PatchNamespace).
|
||||
@@ -202,7 +202,7 @@ func AddToContainer(c *restful.Container, factory informers.InformerFactory, k8s
|
||||
Param(ws.PathParameter("namespace", "project name")).
|
||||
Reads(corev1.Namespace{}).
|
||||
Returns(http.StatusOK, api.StatusOK, corev1.Namespace{}).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.TenantResourcesTag}))
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceTag}))
|
||||
|
||||
ws.Route(ws.GET("/events").
|
||||
To(handler.Events).
|
||||
|
||||
Reference in New Issue
Block a user