KubeSphere (v2.1.0)

Download OpenAPI specification:Download

KubeSphere OpenAPI

Authentication

jwt

Security scheme type: API Key
Header parameter name: Authorization

Identity Management

TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.

Authorizations:
Request Body schema: application/json
apiVersion
required
string

Kubernetes API version

kind
required
string

kind of the API object

spec
object (iam.Spec)
status
object (iam.Status)

Responses

200

ok

default

ok

post /kapis/iam.kubesphere.io/v1alpha2/authenticate
./kapis/iam.kubesphere.io/v1alpha2/authenticate

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "spec":
    {
    },
  • "status":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "spec":
    {
    },
  • "status":
    {
    }
}

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.

Authorizations:
Request Body schema: application/json
password
required
string

password

username
required
string

username

Responses

200

ok

default

ok

post /kapis/iam.kubesphere.io/v1alpha2/login
./kapis/iam.kubesphere.io/v1alpha2/login

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "password": "string",
  • "username": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "access_token": "string",
  • "expires_in": 0,
  • "refresh_token": "string",
  • "token_type": "string"
}

OAuth API,only support resource owner password credentials grant

Authorizations:
Request Body schema: application/json
password
required
string

password

username
required
string

username

Responses

200

ok

default

ok

post /kapis/iam.kubesphere.io/v1alpha2/token
./kapis/iam.kubesphere.io/v1alpha2/token

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "password": "string",
  • "username": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "access_token": "string",
  • "expires_in": 0,
  • "refresh_token": "string",
  • "token_type": "string"
}

List all users.

Authorizations:

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/users
./kapis/iam.kubesphere.io/v1alpha2/users

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

Create a user account.

Authorizations:
Request Body schema: application/json
cluster_role
required
string

user's cluster role

description
required
string

user's description

email
required
string

email address

lang
string

user's language setting, default is zh-CN

password
required
string

password'

username
required
string

username

Responses

200

ok

default

ok

post /kapis/iam.kubesphere.io/v1alpha2/users
./kapis/iam.kubesphere.io/v1alpha2/users

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "cluster_role": "string",
  • "description": "string",
  • "email": "string",
  • "lang": "string",
  • "password": "string",
  • "username": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Describe the specified user.

Authorizations:
path Parameters
user
required
string

username

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/users/{user}
./kapis/iam.kubesphere.io/v1alpha2/users/{user}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "avatar_url": "string",
  • "cluster_role": "string",
  • "create_time": "2022-10-14T03:23:07Z",
  • "current_password": "string",
  • "description": "string",
  • "email": "string",
  • "groups":
    [
    ],
  • "lang": "string",
  • "last_login_time": "string",
  • "password": "string",
  • "role": "string",
  • "role_bind_time": "2022-10-14T03:23:07Z",
  • "role_binding": "string",
  • "roles":
    {
    },
  • "status": 0,
  • "username": "string",
  • "workspace_role": "string"
}

Update information about the specified user.

Authorizations:
path Parameters
user
required
string

username

Request Body schema: application/json
cluster_role
required
string

user's cluster role

current_password
string

this is necessary if you need to change your password

description
required
string

user's description

email
required
string

email address

lang
required
string

user's language setting, default is zh-CN

password
string

this is necessary if you need to change your password

username
required
string

username

Responses

200

ok

default

ok

put /kapis/iam.kubesphere.io/v1alpha2/users/{user}
./kapis/iam.kubesphere.io/v1alpha2/users/{user}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "cluster_role": "string",
  • "current_password": "string",
  • "description": "string",
  • "email": "string",
  • "lang": "string",
  • "password": "string",
  • "username": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Delete the specified user.

Authorizations:
path Parameters
user
required
string

username

Responses

200

ok

default

ok

delete /kapis/iam.kubesphere.io/v1alpha2/users/{user}
./kapis/iam.kubesphere.io/v1alpha2/users/{user}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Retrieve the "login logs" for the specified user.

Authorizations:
path Parameters
user
required
string

username

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/users/{user}/logs
./kapis/iam.kubesphere.io/v1alpha2/users/{user}/logs

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "login_ip": "string",
  • "login_time": "string"
}

Access Management

List all cluster roles.

Authorizations:

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/clusterroles
./kapis/iam.kubesphere.io/v1alpha2/clusterroles

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

List all policy rules of the specified cluster role.

Authorizations:
path Parameters
clusterrole
required
string

cluster role name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/clusterroles/{clusterrole}/rules
./kapis/iam.kubesphere.io/v1alpha2/clusterroles/{clusterrole}/rules

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List all users that are bound to the specified cluster role.

Authorizations:
path Parameters
clusterrole
required
string

cluster role name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/clusterroles/{clusterrole}/users
./kapis/iam.kubesphere.io/v1alpha2/clusterroles/{clusterrole}/users

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

List all policy rules of the specified role in the given devops project.

Authorizations:
path Parameters
devops
required
string

devops project ID

role
required
string

devops role name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/devops/{devops}/roles/{role}/rules
./kapis/iam.kubesphere.io/v1alpha2/devops/{devops}/roles/{role}/rules

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Retrieve the roles that are assigned to the user in the specified namespace.

Authorizations:
path Parameters
namespace
required
string

kubernetes namespace

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/namespaces/{namespace}/roles
./kapis/iam.kubesphere.io/v1alpha2/namespaces/{namespace}/roles

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

List all policy rules of the specified role in the given namespace.

Authorizations:
path Parameters
namespace
required
string

kubernetes namespace

role
required
string

role name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/namespaces/{namespace}/roles/{role}/rules
./kapis/iam.kubesphere.io/v1alpha2/namespaces/{namespace}/roles/{role}/rules

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Retrieve the users that are bound to the role in the specified namespace.

Authorizations:
path Parameters
namespace
required
string

kubernetes namespace

role
required
string

role name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/namespaces/{namespace}/roles/{role}/users
./kapis/iam.kubesphere.io/v1alpha2/namespaces/{namespace}/roles/{role}/users

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List all users in the specified namespace.

Authorizations:
path Parameters
namespace
required
string

kubernetes namespace

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/namespaces/{namespace}/users
./kapis/iam.kubesphere.io/v1alpha2/namespaces/{namespace}/users

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get the mapping relationships between cluster roles and policy rules.

Authorizations:

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/rulesmapping/clusterroles
./kapis/iam.kubesphere.io/v1alpha2/rulesmapping/clusterroles

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get the mapping relationships between namespaced roles and policy rules.

Authorizations:

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/rulesmapping/roles
./kapis/iam.kubesphere.io/v1alpha2/rulesmapping/roles

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Retrieve all the roles that are assigned to the specified user.

Authorizations:
path Parameters
user
required
string

username

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/users/{user}/roles
./kapis/iam.kubesphere.io/v1alpha2/users/{user}/roles

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "clusterRole":
    [
    ],
  • "roles":
    [
    ]
}

List all members in the specified workspace.

Authorizations:
path Parameters
workspace
required
string

workspace name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/members
./kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/members

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

Invite a member to the specified workspace.

Authorizations:
path Parameters
workspace
required
string

workspace name

Request Body schema: application/json
username
required
string

username

workspace_role
required
string

user's workspace role'

Responses

200

ok

default

ok

post /kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/members
./kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/members

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "username": "string",
  • "workspace_role": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Describe the specified user in the given workspace.

Authorizations:
path Parameters
workspace
required
string

workspace name

member
required
string

username

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/members/{member}
./kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/members/{member}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "cluster_role": "string",
  • "create_time": "2022-10-14T03:23:08Z",
  • "description": "string",
  • "email": "string",
  • "lang": "string",
  • "last_login_time": "2022-10-14T03:23:08Z",
  • "username": "string",
  • "workspace_role": "string"
}

Remove the specified member from the workspace.

Authorizations:
path Parameters
workspace
required
string

workspace name

member
required
string

username

Responses

200

ok

default

ok

delete /kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/members/{member}
./kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/members/{member}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List all workspace roles.

Authorizations:
path Parameters
workspace
required
string

workspace name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/roles
./kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/roles

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

Describe the workspace role.

Authorizations:
path Parameters
workspace
required
string

workspace name

role
required
string

workspace role name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/roles/{role}
./kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/roles/{role}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "aggregationRule":
    {
    },
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "rules":
    [
    ]
}

List all policy rules of the specified workspace role.

Authorizations:
path Parameters
workspace
required
string

workspace name

role
required
string

workspace role name

Responses

200

ok

default

ok

get /kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/roles/{role}/rules
./kapis/iam.kubesphere.io/v1alpha2/workspaces/{workspace}/roles/{role}/rules

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Cluster Resources

get abnormal workloads' count of whole cluster

Authorizations:

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/abnormalworkloads
./kapis/resources.kubesphere.io/v1alpha2/abnormalworkloads

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "items": { },
  • "namespace": "string"
}

remove a node from service, safely evict all of your pods from a node and you can power down the node. More info: https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/

Authorizations:
path Parameters
node
required
string

node name

Responses

200

ok

default

ok

post /kapis/resources.kubesphere.io/v1alpha2/nodes/{node}/drainage
./kapis/resources.kubesphere.io/v1alpha2/nodes/{node}/drainage

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

get whole cluster's resource usage

Authorizations:

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/quotas
./kapis/resources.kubesphere.io/v1alpha2/quotas

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "namespace": "string"
}

List all routers of all projects

Authorizations:

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/routers
./kapis/resources.kubesphere.io/v1alpha2/routers

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "items":
    [
    ],
  • "kind": "string",
  • "metadata":
    {
    }
}

Cluster level resource query

Authorizations:
path Parameters
resources
required
string

cluster level resource type, e.g. nodes,workspaces,storageclasses,clusterroles.

query Parameters
conditions
string <key=value,key~value>

query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a

paging
string <limit=%d,page=%d>
Default: "limit=10,page=1"

paging query, e.g. limit=100,page=1

reverse
string

sort parameters, e.g. reverse=true

orderBy
string

sort parameters, e.g. orderBy=createTime

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/{resources}
./kapis/resources.kubesphere.io/v1alpha2/{resources}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

Namespace Resources

List all applications

Authorizations:
path Parameters
namespace
required
string

the name of the project

query Parameters
conditions
string <key=value,key~value>

query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a

paging
string <limit=%d,page=%d>
Default: "limit=10,page=1"

paging query, e.g. limit=100,page=1

Responses

200

ok

default

ok

get /kapis/openpitrix.io/v1/applications
./kapis/openpitrix.io/v1/applications

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

List all applications within the specified namespace

Authorizations:
path Parameters
namespace
required
string

the name of the project

query Parameters
conditions
string <key=value,key~value>

query conditions, connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a

paging
string <limit=%d,page=%d>
Default: "limit=10,page=1"

paging query, e.g. limit=100,page=1

Responses

200

ok

default

ok

get /kapis/openpitrix.io/v1/namespaces/{namespace}/applications
./kapis/openpitrix.io/v1/namespaces/{namespace}/applications

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

Deploy a new application

Authorizations:
path Parameters
namespace
required
string

the name of the project

Request Body schema: application/json
advanced_param
required
Array of strings
app_id
string
conf
string
runtime_id
string
version_id
string

Responses

200

ok

default

ok

post /kapis/openpitrix.io/v1/namespaces/{namespace}/applications
./kapis/openpitrix.io/v1/namespaces/{namespace}/applications

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "advanced_param":
    [
    ],
  • "app_id": "string",
  • "conf": "string",
  • "runtime_id": "string",
  • "version_id": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Describe the specified application of the namespace

Authorizations:
path Parameters
namespace
required
string

the name of the project

application
required
string

application ID

Responses

200

ok

default

ok

get /kapis/openpitrix.io/v1/namespaces/{namespace}/applications/{application}
./kapis/openpitrix.io/v1/namespaces/{namespace}/applications/{application}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "app":
    {
    },
  • "cluster":
    {
    },
  • "ingresses":
    [
    ],
  • "name": "string",
  • "services":
    [
    ],
  • "version":
    {
    },
  • "workloads":
    {
    }
}

Delete the specified application

Authorizations:
path Parameters
namespace
required
string

the name of the project

application
required
string

the id of the application cluster

Responses

200

ok

default

ok

delete /kapis/openpitrix.io/v1/namespaces/{namespace}/applications/{application}
./kapis/openpitrix.io/v1/namespaces/{namespace}/applications/{application}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Modify application

Authorizations:
path Parameters
namespace
required
string

the name of the project

application
required
string

the id of the application cluster

Request Body schema:
cluster_id
string
description
string
name
string

Responses

200

ok

default

ok

patch /kapis/openpitrix.io/v1/namespaces/{namespace}/applications/{application}
./kapis/openpitrix.io/v1/namespaces/{namespace}/applications/{application}

Request samples

Content type
Copy
Expand all Collapse all
{
  • "cluster_id": "string",
  • "description": "string",
  • "name": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

get abnormal workloads' count of specified namespace

Authorizations:
path Parameters
namespace
required
string

the name of the project

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/abnormalworkloads
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/abnormalworkloads

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "items": { },
  • "namespace": "string"
}

Get the specified daemonset revision

Authorizations:
path Parameters
daemonset
required
string

the name of the daemonset

namespace
required
string

the namespace of the daemonset

revision
required
string

the revision of the daemonset

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/daemonsets/{daemonset}/revisions/{revision}
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/daemonsets/{daemonset}/revisions/{revision}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "spec":
    {
    },
  • "status":
    {
    }
}

Get the specified deployment revision

Authorizations:
path Parameters
deployment
required
string

the name of deployment

namespace
required
string

the namespace of the deployment

revision
required
string

the revision of the deployment

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/deployments/{deployment}/revisions/{revision}
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/deployments/{deployment}/revisions/{revision}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "spec":
    {
    },
  • "status":
    {
    }
}

Rerun job whether the job is complete or not

Authorizations:
path Parameters
job
required
string

job name

namespace
required
string

the name of the namespace where the job runs in

query Parameters
action
string

action must be "rerun"

resourceVersion
string

version of job, rerun when the version matches

Responses

200

ok

default

ok

post /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/jobs/{job}
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/jobs/{job}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

get specified namespace's resource quota and usage

Authorizations:
path Parameters
namespace
required
string

the name of the project

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/quotas
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/quotas

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "namespace": "string"
}

List router of a specified project

Authorizations:
path Parameters
namespace
required
string

the name of the project

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/router
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/router

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "spec":
    {
    },
  • "status":
    {
    }
}

Update a router for a specified project

Authorizations:
path Parameters
namespace
required
string

the name of the project

Responses

200

ok

default

ok

put /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/router
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/router

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "spec":
    {
    },
  • "status":
    {
    }
}

Create a router for a specified project

Authorizations:
path Parameters
namespace
required
string

the name of the project

Responses

200

ok

default

ok

post /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/router
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/router

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "spec":
    {
    },
  • "status":
    {
    }
}

List router of a specified project

Authorizations:
path Parameters
namespace
required
string

the name of the project

Responses

200

ok

default

ok

delete /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/router
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/router

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "spec":
    {
    },
  • "status":
    {
    }
}

Get the specified statefulset revision

Authorizations:
path Parameters
statefulset
required
string

the name of the statefulset

namespace
required
string

the namespace of the statefulset

revision
required
string

the revision of the statefulset

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/statefulsets/{statefulset}/revisions/{revision}
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/statefulsets/{statefulset}/revisions/{revision}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "spec":
    {
    },
  • "status":
    {
    }
}

Namespace level resource query

Authorizations:
path Parameters
namespace
required
string

the name of the project

resources
required
string

namespace level resource type, e.g. pods,jobs,configmaps,services.

query Parameters
conditions
string <key=%s,key~%s>

query conditions,connect multiple conditions with commas, equal symbol for exact query, wave symbol for fuzzy query e.g. name~a

paging
string <limit=%d,page=%d>
Default: "limit=10,page=1"

paging query, e.g. limit=100,page=1

reverse
string

sort parameters, e.g. reverse=true

orderBy
string

sort parameters, e.g. orderBy=createTime

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/{resources}
./kapis/resources.kubesphere.io/v1alpha2/namespaces/{namespace}/{resources}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

User Resources

get users' kubeconfig

Authorizations:
path Parameters
user
required
string

username

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/users/{user}/kubeconfig
./kapis/resources.kubesphere.io/v1alpha2/users/{user}/kubeconfig

Response samples

Content type
No sample

get user's kubectl pod

Authorizations:
path Parameters
user
required
string

username

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/users/{user}/kubectl
./kapis/resources.kubesphere.io/v1alpha2/users/{user}/kubectl

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "container": "string",
  • "namespace": "string",
  • "pod": "string"
}

Component Status

Get the health status of system components.

Authorizations:

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/componenthealth
./kapis/resources.kubesphere.io/v1alpha2/componenthealth

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "kubesphereStatus":
    [
    ],
  • "nodeStatus":
    {
    }
}

List the system components.

Authorizations:

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/components
./kapis/resources.kubesphere.io/v1alpha2/components

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Describe the specified system component.

Authorizations:
path Parameters
component
required
string

component name

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/components/{component}
./kapis/resources.kubesphere.io/v1alpha2/components/{component}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "healthyBackends": 0,
  • "label": null,
  • "name": "string",
  • "namespace": "string",
  • "selfLink": "string",
  • "startedAt": "2022-10-14T03:23:08Z",
  • "totalBackends": 0
}

Tenant Resources

List the rules of the specified DevOps project for the current user

Authorizations:
path Parameters
devops
required
string

devops project ID

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/devops/{devops}/rules
./kapis/tenant.kubesphere.io/v1alpha2/devops/{devops}/rules

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "actions":
    [
    ],
  • "name": "string"
}

Get the devops projects count for the member

Authorizations:

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/devopscount
./kapis/tenant.kubesphere.io/v1alpha2/devopscount

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "count": 0
}

Query cluster-level logs in a multi-tenants environment

Authorizations:
query Parameters
operation
string
Default: "query"

Operation type. This can be one of four types: query (for querying logs), statistics (for retrieving statistical data), histogram (for displaying log count by time interval) and export (for exporting logs). Defaults to query.

workspaces
string

A comma-separated list of workspaces. This field restricts the query to specified workspaces. For example, the following filter matches the workspace my-ws and demo-ws: my-ws,demo-ws

workspace_query
string

A comma-separated list of keywords. Differing from workspaces, this field performs fuzzy matching on workspaces. For example, the following value limits the query to workspaces whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

namespaces
string

A comma-separated list of namespaces. This field restricts the query to specified namespaces. For example, the following filter matches the namespace my-ns and demo-ns: my-ns,demo-ns

namespace_query
string

A comma-separated list of keywords. Differing from namespaces, this field performs fuzzy matching on namespaces. For example, the following value limits the query to namespaces whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

workloads
string

A comma-separated list of workloads. This field restricts the query to specified workloads. For example, the following filter matches the workload my-wl and demo-wl: my-wl,demo-wl

workload_query
string

A comma-separated list of keywords. Differing from workloads, this field performs fuzzy matching on workloads. For example, the following value limits the query to workloads whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

pods
string

A comma-separated list of pods. This field restricts the query to specified pods. For example, the following filter matches the pod my-po and demo-po: my-po,demo-po

pod_query
string

A comma-separated list of keywords. Differing from pods, this field performs fuzzy matching on pods. For example, the following value limits the query to pods whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

containers
string

A comma-separated list of containers. This field restricts the query to specified containers. For example, the following filter matches the container my-cont and demo-cont: my-cont,demo-cont

container_query
string

A comma-separated list of keywords. Differing from containers, this field performs fuzzy matching on containers. For example, the following value limits the query to containers whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

log_query
string

A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to err,INFO, the query returns any log containing err(ERR,Err,...) OR INFO(info,InFo,...).

interval
string
Default: "15m"

Time interval. It requires operation is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).

start_time
string

Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

end_time
string

End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

sort
string
Default: "desc"

Sort order. One of acs, desc. This field sorts logs by timestamp.

from
integer
Default: 0

The offset from the result set. This field returns query results from the specified offset. It requires operation is set to query. Defaults to 0 (i.e. from the beginning of the result set).

size
integer
Default: 10

Size of result to return. It requires operation is set to query. Defaults to 10 (i.e. 10 log records).

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/logs
./kapis/tenant.kubesphere.io/v1alpha2/logs

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_scroll_id": "string",
  • "_shards":
    {
    },
  • "aggregations": "string",
  • "hits":
    {
    }
}

List the rules of the specified namespace for the current user

Authorizations:
path Parameters
namespace
required
string

the name of the namespace

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/namespaces/{namespace}/rules
./kapis/tenant.kubesphere.io/v1alpha2/namespaces/{namespace}/rules

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "actions":
    [
    ],
  • "name": "string"
}

List all workspaces that belongs to the current user

Authorizations:

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/workspaces
./kapis/tenant.kubesphere.io/v1alpha2/workspaces

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

Describe the specified workspace

Authorizations:
path Parameters
workspace
required
string

workspace name

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiVersion": "string",
  • "kind": "string",
  • "metadata":
    {
    },
  • "spec":
    {
    },
  • "status": null
}

List devops projects for the current user

Authorizations:
path Parameters
workspace
required
string

workspace name

query Parameters
paging
string <limit=%d,page=%d>
Default: "limit=10,page=1"

page

conditions
string <key=%s,key~%s>

query conditions

Responses

200

OK

get /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/devops
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/devops

Create a devops project in the specified workspace

Authorizations:
path Parameters
workspace
required
string

workspace name

Request Body schema: application/json
create_time
required
string <date-time>

DevOps Project's Creation time

creator
required
string

Creator's username

description
string

DevOps Projects's Description, used to describe the DevOps Project

extra
string

Internal Use

name
required
string

DevOps Projects's Name

project_id
required
string

ProjectId must be unique within a workspace, it is generated by kubesphere.

status
required
string

DevOps project's status. e.g. active

visibility
string

Deprecated Field

workspace
required
string

The workspace to which the devops project belongs

Responses

200

ok

default

ok

post /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/devops
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/devops

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "extra": "string",
  • "name": "string",
  • "project_id": "string",
  • "status": "string",
  • "visibility": "string",
  • "workspace": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "extra": "string",
  • "name": "string",
  • "project_id": "string",
  • "status": "string",
  • "visibility": "string",
  • "workspace": "string"
}

Delete the specified devops project from the workspace

Authorizations:
path Parameters
workspace
required
string

workspace name

devops
required
string

devops project ID

Responses

200

ok

default

ok

delete /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/devops/{devops}
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/devops/{devops}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "extra": "string",
  • "name": "string",
  • "project_id": "string",
  • "status": "string",
  • "visibility": "string",
  • "workspace": "string"
}

List the devops projects for the workspace member

Authorizations:
path Parameters
workspace
required
string

workspace name

member
required
string

workspace member's username

query Parameters
paging
string <limit=%d,page=%d>
Default: "limit=10,page=1"

page

conditions
string <key=%s,key~%s>

query conditions

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/members/{member}/devops
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/members/{member}/devops

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

List the namespaces for the workspace member

Authorizations:
path Parameters
workspace
required
string

workspace name

member
required
string

workspace member's username

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/members/{member}/namespaces
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/members/{member}/namespaces

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List the namespaces of the specified workspace for the current user

Authorizations:
path Parameters
workspace
required
string

workspace name

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/namespaces
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/namespaces

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create a namespace in the specified workspace

Authorizations:
path Parameters
workspace
required
string

workspace name

Responses

200

ok

default

ok

post /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/namespaces
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/namespaces

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Delete the specified namespace from the workspace

Authorizations:
path Parameters
workspace
required
string

workspace name

namespace
required
string

the name of the namespace

Responses

200

ok

default

ok

delete /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/namespaces/{namespace}
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/namespaces/{namespace}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

List the rules of the specified workspace for the current user

Authorizations:
path Parameters
workspace
required
string

workspace name

Responses

200

ok

default

ok

get /kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/rules
./kapis/tenant.kubesphere.io/v1alpha2/workspaces/{workspace}/rules

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "actions":
    [
    ],
  • "name": "string"
}

Verification

Verify if the kubernetes secret has read access to the git repository

Authorizations:
Request Body schema: application/json
remoteUrl
required
string

git server url

secretRef
object (v1.SecretReference)

SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace

Responses

200

ok

default

ok

post /kapis/resources.kubesphere.io/v1alpha2/git/verify
./kapis/resources.kubesphere.io/v1alpha2/git/verify

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "remoteUrl": "string",
  • "secretRef":
    {
    }
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

verify if a user has access to the docker registry

Authorizations:
Request Body schema: application/json
password
required
string

password

serverhost
required
string

registry server host

username
required
string

username

Responses

200

ok

default

ok

post /kapis/resources.kubesphere.io/v1alpha2/registry/verify
./kapis/resources.kubesphere.io/v1alpha2/registry/verify

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "password": "string",
  • "serverhost": "string",
  • "username": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "message": "string"
}

Docker Registry

Retrieve the blob from the registry identified

Authorizations:
query Parameters
image
required
string <image=%s>

query image, condition for filtering.

namespace
string <namespace=%s>

namespace which secret in.

secret
string <secret=%s>

secret name

Responses

200

ok

default

ok

get /kapis/resources.kubesphere.io/v1alpha2/registry/blob
./kapis/resources.kubesphere.io/v1alpha2/registry/blob

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "imageBlob":
    {
    },
  • "imageManifest":
    {
    },
  • "imageTag": "string",
  • "message": "string",
  • "registry": "string",
  • "status": "string"
}

DevOps Project

Get the specified DevOps Project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "extra": "string",
  • "name": "string",
  • "project_id": "string",
  • "status": "string",
  • "visibility": "string",
  • "workspace": "string"
}

Update the specified DevOps Project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

Request Body schema: application/json
create_time
required
string <date-time>

DevOps Project's Creation time

creator
required
string

Creator's username

description
string

DevOps Projects's Description, used to describe the DevOps Project

extra
string

Internal Use

name
required
string

DevOps Projects's Name

project_id
required
string

ProjectId must be unique within a workspace, it is generated by kubesphere.

status
required
string

DevOps project's status. e.g. active

visibility
string

Deprecated Field

workspace
required
string

The workspace to which the devops project belongs

Responses

200

ok

default

ok

patch /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "extra": "string",
  • "name": "string",
  • "project_id": "string",
  • "status": "string",
  • "visibility": "string",
  • "workspace": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "extra": "string",
  • "name": "string",
  • "project_id": "string",
  • "status": "string",
  • "visibility": "string",
  • "workspace": "string"
}

DevOps Project Credential

Get all credentials of the specified DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create a credential in the specified DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

Request Body schema: application/json
create_time
string <date-time>

Credential's create_time'

creator
string

Creator's username

description
string

Credential's description'

display_name
string

Credential's display name

domain
string

Credential's domain,In ks we only use the default domain, default '_''

fingerprint
object (devops.JenkinsCredential.fingerprint)
id
required
string

Id of Credential, e.g. dockerhub-id

kubeconfig
object (devops.KubeconfigCredential)
secret_text
object (devops.SecretTextCredential)
ssh
object (devops.SshCredential)
type
required
string

Type of Credential, e.g. ssh/kubeconfig

username_password
object (devops.UsernamePasswordCredential)

Responses

200

OK

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "display_name": "string",
  • "domain": "string",
  • "fingerprint":
    {
    },
  • "id": "string",
  • "kubeconfig":
    {
    },
  • "secret_text":
    {
    },
  • "ssh":
    {
    },
  • "type": "string",
  • "username_password":
    {
    }
}

Get the specified credential of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

credential
required
string

credential's ID, e.g. dockerhub-id

query Parameters
content
string

Get extra credential content if this query parameter is set. Specifically, there are three types of info in a credential. One is the basic info that must be returned for each query such as name, id, etc. The second one is non-encrypted info such as the username of the username-password type of credential, which returns when the "content" parameter is set to non-empty. The last one is encrypted info, such as the password of the username-password type of credential, which never returns.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials/{credential}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials/{credential}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "display_name": "string",
  • "domain": "string",
  • "fingerprint":
    {
    },
  • "id": "string",
  • "kubeconfig":
    {
    },
  • "secret_text":
    {
    },
  • "ssh":
    {
    },
  • "type": "string",
  • "username_password":
    {
    }
}

Update the specified credential of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

credential
required
string

credential's ID, e.g. dockerhub-id

Request Body schema: application/json
create_time
string <date-time>

Credential's create_time'

creator
string

Creator's username

description
string

Credential's description'

display_name
string

Credential's display name

domain
string

Credential's domain,In ks we only use the default domain, default '_''

fingerprint
object (devops.JenkinsCredential.fingerprint)
id
required
string

Id of Credential, e.g. dockerhub-id

kubeconfig
object (devops.KubeconfigCredential)
secret_text
object (devops.SecretTextCredential)
ssh
object (devops.SshCredential)
type
required
string

Type of Credential, e.g. ssh/kubeconfig

username_password
object (devops.UsernamePasswordCredential)

Responses

200

OK

put /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials/{credential}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials/{credential}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "create_time": "2022-10-14T03:23:08Z",
  • "creator": "string",
  • "description": "string",
  • "display_name": "string",
  • "domain": "string",
  • "fingerprint":
    {
    },
  • "id": "string",
  • "kubeconfig":
    {
    },
  • "secret_text":
    {
    },
  • "ssh":
    {
    },
  • "type": "string",
  • "username_password":
    {
    }
}

Delete the specified credential of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

credential
required
string

credential's ID, e.g. dockerhub-id

Responses

200

OK

delete /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials/{credential}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/credentials/{credential}

DevOps Pipeline

Get crumb issuer. A CrumbIssuer represents an algorithm to generate a nonce value, known as a crumb, to counter cross site request forgery exploits. Crumbs are typically hashes incorporating information that uniquely identifies an agent that sends a request, along with a guarded secret so that the crumb value cannot be forged by a third party.

Authorizations:

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/crumbissuer
./kapis/devops.kubesphere.io/v1alpha2/crumbissuer

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "crumb": "string",
  • "crumbRequestField": "string"
}

Check cron script compile.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

Request Body schema: application/json
cron
required
string

Cron script data.

pipelineName
string

Pipeline name, if pipeline haven't created, not required'

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/checkCron
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/checkCron

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "cron": "string",
  • "pipelineName": "string"
}

Response samples

Content type
Copy
Expand all Collapse all
{
  • "lastTime": "string",
  • "message": "string",
  • "nextTime": "string",
  • "result": "string"
}

Create a DevOps project pipeline

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

Request Body schema: application/json
multi_branch_pipeline
object (devops.MultiBranchPipeline)
pipeline
object (devops.NoScmPipeline)
type
required
string

type of devops pipeline, in scm or no scm

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "multi_branch_pipeline":
    {
    },
  • "pipeline":
    {
    },
  • "type": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "multi_branch_pipeline":
    {
    },
  • "pipeline":
    {
    },
  • "type": "string"
}

Get the specified pipeline of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "branchNames":
    [
    ],
  • "disabled": null,
  • "displayName": "string",
  • "estimatedDurationInMillis": 0,
  • "fullDisplayName": "string",
  • "fullName": "string",
  • "name": "string",
  • "numberOfFailingBranches": 0,
  • "numberOfFailingPullRequests": 0,
  • "numberOfFolders": 0,
  • "numberOfPipelines": 0,
  • "numberOfSuccessfulBranches": 0,
  • "numberOfSuccessfulPullRequests": 0,
  • "organization": "string",
  • "parameters": null,
  • "permissions":
    {
    },
  • "pipelineFolderNames":
    [
    ],
  • "scmSource":
    {
    },
  • "totalNumberOfBranches": 0,
  • "totalNumberOfPullRequests": 0,
  • "weatherScore": 0
}

Update the specified pipeline of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of pipeline, e.g. sample-pipeline

Request Body schema: application/json
multi_branch_pipeline
object (devops.MultiBranchPipeline)
pipeline
object (devops.NoScmPipeline)
type
required
string

type of devops pipeline, in scm or no scm

Responses

200

OK

put /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "multi_branch_pipeline":
    {
    },
  • "pipeline":
    {
    },
  • "type": "string"
}

Delete the specified pipeline of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of pipeline, e.g. sample-pipeline

Responses

200

OK

delete /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}

(MultiBranchesPipeline) Get all branches in the specified pipeline.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

query Parameters
filter
string <filter=%s>

filter remote scm. e.g. origin

start
string <start=%d>
Default: "start=0"

the count of branches start.

limit
string <limit=%d>
Default: "limit=100"

the count of branches limit.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

(MultiBranchesPipeline) Get all activities in the specified pipeline.

Authorizations:
path Parameters
devops
required
string

the name of devops project

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "branch":
    {
    },
  • "disabled": true,
  • "displayName": "string",
  • "estimatedDurationInMillis": 0,
  • "fullDisplayName": "string",
  • "fullName": "string",
  • "latestRun":
    {
    },
  • "name": "string",
  • "organization": "string",
  • "parameters":
    [
    ],
  • "permissions":
    {
    },
  • "weatherScore": 0
}

(MultiBranchesPipeline) Run the specified pipeline of the DevOps project.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

Request Body schema: application/json
parameters
Array of objects (devops.RunPayload.parameters)

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "parameters":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "artifactsZipFile": null,
  • "causeOfBlockage": "string",
  • "causes":
    [
    ],
  • "changeSet":
    [
    ],
  • "description": null,
  • "durationInMillis": null,
  • "enQueueTime": null,
  • "endTime": null,
  • "estimatedDurationInMillis": null,
  • "id": "string",
  • "name": null,
  • "organization": "string",
  • "pipeline": "string",
  • "queueId": "string",
  • "replayable": true,
  • "result": "string",
  • "runSummary": null,
  • "startTime": null,
  • "state": "string",
  • "type": "string"
}

(MultiBranchesPipeline) Get all runs in the specified branch

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run id, the unique id for a pipeline once build.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "artifactsZipFile": null,
  • "branch":
    {
    },
  • "causeOfBlockage": null,
  • "causes":
    [
    ],
  • "changeSet":
    [
    ],
  • "commitId": "string",
  • "commitUrl": null,
  • "description": null,
  • "durationInMillis": 0,
  • "enQueueTime": "string",
  • "endTime": "string",
  • "estimatedDurationInMillis": 0,
  • "id": "string",
  • "name": null,
  • "organization": "string",
  • "pipeline": "string",
  • "pullRequest": null,
  • "replayable": true,
  • "result": "string",
  • "runSummary": "string",
  • "startTime": "string",
  • "state": "string",
  • "type": "string"
}

(MultiBranchesPipeline) Get all artifacts generated from the specified run of the pipeline branch.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

query Parameters
start
string <start=%d>

the item number that the search starts from.

limit
string <limit=%d>

the limit item count of the search.

Responses

200

The filed of "Url" in response can download artifacts

default

The filed of "Url" in response can download artifacts

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/artifacts
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/artifacts

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

(MultiBranchesPipeline) Get run logs of the specified pipeline activity.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

query Parameters
start
string <start=%d>
Default: "start=0"

the item number that the search starts from.

Responses

200

OK

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/log
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/log

(MultiBranchesPipeline) Get run nodes.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run id, the unique id for a pipeline once build.

query Parameters
limit
string <limit=%d>
Default: "limit=10000"

the limit item count of the search.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

(MultiBranchesPipeline) Get all steps in the specified node.

Authorizations:
path Parameters
devops
required
string

the name of devops project

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

node
required
string

pipeline node ID, the stage in pipeline.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes/{node}/steps
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes/{node}/steps

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

(MultiBranchesPipeline) Proceed or Break the paused pipeline which waiting for user input.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

node
required
string

pipeline node ID, the stage in pipeline.

step
required
string

pipeline step ID, the step in pipeline.

Request Body schema: application/json
abort
boolean

abort or not

id
string

id

parameters
Array of objects (devops.CheckPlayloadParameters)

Responses

200

OK

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes/{node}/steps/{step}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes/{node}/steps/{step}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "abort": true,
  • "id": "string",
  • "parameters":
    [
    ]
}

(MultiBranchesPipeline) Get the step logs in the specified pipeline activity.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run id, the unique id for a pipeline once build.

node
required
string

pipeline node id, the stage in pipeline.

step
required
string

pipeline step id, the step in pipeline.

query Parameters
start
string <start=%d>
Default: "start=0"

the item number that the search starts from.

Responses

200

OK

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes/{node}/steps/{step}/log
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodes/{node}/steps/{step}/log

(MultiBranchesPipeline) Get steps details in an activity node. For a node, the steps which is defined inside the node.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodesdetail
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/nodesdetail

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

(MultiBranchesPipeline) Replay the specified pipeline of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/replay
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/replay

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "artifactsZipFile": null,
  • "causeOfBlockage": "string",
  • "causes":
    [
    ],
  • "changeSet":
    [
    ],
  • "description": null,
  • "durationInMillis": null,
  • "enQueueTime": null,
  • "endTime": null,
  • "estimatedDurationInMillis": null,
  • "id": "string",
  • "name": null,
  • "organization": "string",
  • "pipeline": "string",
  • "queueId": "string",
  • "replayable": true,
  • "result": "string",
  • "runSummary": null,
  • "startTime": null,
  • "state": "string",
  • "type": "string"
}

(MultiBranchesPipeline) Stop the specified pipeline of the DevOps project.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

query Parameters
blocking
string <blocking=%t>
Default: "blocking=false"

stop and between each retries will sleep.

timeOutInSecs
string <timeOutInSecs=%d>
Default: "timeOutInSecs=10"

the time of stop and between each retries sleep.

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/stop
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/runs/{run}/stop

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "artifactsZipFile": null,
  • "branch":
    {
    },
  • "causeOfBlockage": null,
  • "causes":
    [
    ],
  • "changeSet":
    [
    ],
  • "commitId": "string",
  • "commitUrl": null,
  • "description": null,
  • "durationInMillis": 0,
  • "enQueueTime": "string",
  • "endTime": "string",
  • "estimatedDurationInMillis": 0,
  • "id": "string",
  • "name": null,
  • "organization": "string",
  • "pipeline": "string",
  • "pullRequest": null,
  • "replayable": true,
  • "result": "string",
  • "runSummary": "string",
  • "startTime": "string",
  • "state": "string",
  • "type": "string"
}

Get the sonar quality check information for the specified pipeline branch of the DevOps project. More info: https://docs.sonarqube.org/7.4/user-guide/metric-definitions/

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of pipeline, e.g. sample-pipeline

branch
required
string

branch name, e.g. master

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/sonarstatus
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/branches/{branch}/sonarstatus

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Check pipeline script compile.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

query Parameters
pipeline
string <pipeline=%s>

the name of the CI/CD pipeline

Request Body schema:
value
string

Pipeline script data

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/checkScriptCompile
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/checkScriptCompile

Response samples

Content type
Copy
Expand all Collapse all
{
  • "column": 0,
  • "line": 0,
  • "message": "string",
  • "status": "string"
}

Get the configuration information of the specified pipeline of the DevOps Project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of pipeline, e.g. sample-pipeline

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/config
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/config

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "multi_branch_pipeline":
    {
    },
  • "pipeline":
    {
    },
  • "type": "string"
}

Get scan reponsitory logs in the specified pipeline.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

Responses

200

OK

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/consolelog
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/consolelog

Get all runs of the specified pipeline

Authorizations:
path Parameters
pipeline
required
string

the name of the CI/CD pipeline

devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

query Parameters
start
string <start=%d>

the item number that the search starts from

limit
string <limit=%d>

the limit item count of the search

branch
string <branch=%s>

the name of branch, same as repository branch, will be filtered by branch.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

Run pipeline.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

Request Body schema: application/json
parameters
Array of objects (devops.RunPayload.parameters)

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "parameters":
    [
    ]
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "artifactsZipFile": null,
  • "causeOfBlockage": "string",
  • "causes":
    [
    ],
  • "changeSet":
    [
    ],
  • "description": null,
  • "durationInMillis": null,
  • "enQueueTime": null,
  • "endTime": null,
  • "estimatedDurationInMillis": null,
  • "id": "string",
  • "name": null,
  • "organization": "string",
  • "pipeline": "string",
  • "queueId": "string",
  • "replayable": true,
  • "result": "string",
  • "runSummary": null,
  • "startTime": null,
  • "state": "string",
  • "type": "string"
}

Get all activities in the specified pipeline.

Authorizations:
path Parameters
devops
required
string

the name of devops project

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "artifactsZipFile": null,
  • "branch": null,
  • "causeOfBlockage": null,
  • "causes":
    [
    ],
  • "changeSet":
    [
    ],
  • "commitId": null,
  • "commitUrl": null,
  • "description": null,
  • "durationInMillis": 0,
  • "enQueueTime": "string",
  • "endTime": "string",
  • "estimatedDurationInMillis": 0,
  • "id": "string",
  • "name": null,
  • "organization": "string",
  • "pipeline": "string",
  • "pullRequest": null,
  • "replayable": true,
  • "result": "string",
  • "runSummary": "string",
  • "startTime": "string",
  • "state": "string",
  • "type": "string"
}

Get all artifacts in the specified pipeline.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

query Parameters
start
string <start=%d>

the item number that the search starts from.

limit
string <limit=%d>

the limit item count of the search.

Responses

200

The filed of "Url" in response can download artifacts

default

The filed of "Url" in response can download artifacts

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/artifacts
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/artifacts

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get run logs of the specified pipeline activity.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

query Parameters
start
string <start=%d>
Default: "start=0"

the item number that the search starts from.

Responses

200

OK

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/log
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/log

Get all nodes in the specified activity. node is the stage in the pipeline task

Authorizations:
path Parameters
devops
required
string

the name of devops project

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get all steps in the specified node.

Authorizations:
path Parameters
devops
required
string

the name of devops project

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build

node
required
string

pipeline node ID, the stage in pipeline.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Proceed or Break the paused pipeline which is waiting for user input.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

node
required
string

pipeline node ID, the stage in pipeline.

step
required
string

pipeline step ID

Request Body schema: application/json
abort
boolean

abort or not

id
string

id

parameters
Array of objects (devops.CheckPlayloadParameters)

Responses

200

OK

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps/{step}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps/{step}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "abort": true,
  • "id": "string",
  • "parameters":
    [
    ]
}

Get pipelines step log.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

node
required
string

pipeline node ID, the stage in pipeline.

step
required
string

pipeline step ID, the step in pipeline.

query Parameters
start
string <start=%d>
Default: "start=0"

the item number that the search starts from.

Responses

200

OK

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps/{step}/log
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodes/{node}/steps/{step}/log

Get steps details inside a activity node. For a node, the steps which defined inside the node.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

branch
required
string

the name of branch, same as repository branch.

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodesdetail
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/nodesdetail

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Replay pipeline

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/replay
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/replay

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "artifactsZipFile": null,
  • "causeOfBlockage": "string",
  • "causes":
    [
    ],
  • "changeSet":
    [
    ],
  • "description": null,
  • "durationInMillis": null,
  • "enQueueTime": null,
  • "endTime": null,
  • "estimatedDurationInMillis": null,
  • "id": "string",
  • "name": null,
  • "organization": "string",
  • "pipeline": "string",
  • "queueId": "string",
  • "replayable": true,
  • "result": "string",
  • "runSummary": null,
  • "startTime": null,
  • "state": "string",
  • "type": "string"
}

Stop pipeline

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

run
required
string

pipeline run ID, the unique ID for a pipeline once build.

query Parameters
blocking
string <blocking=%t>
Default: "blocking=false"

stop and between each retries will sleep.

timeOutInSecs
string <timeOutInSecs=%d>
Default: "timeOutInSecs=10"

the time of stop and between each retries sleep.

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/stop
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/runs/{run}/stop

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "actions":
    [
    ],
  • "artifactsZipFile": null,
  • "branch":
    {
    },
  • "causeOfBlockage": null,
  • "causes":
    [
    ],
  • "changeSet":
    [
    ],
  • "commitId": "string",
  • "commitUrl": null,
  • "description": null,
  • "durationInMillis": 0,
  • "enQueueTime": "string",
  • "endTime": "string",
  • "estimatedDurationInMillis": 0,
  • "id": "string",
  • "name": null,
  • "organization": "string",
  • "pipeline": "string",
  • "pullRequest": null,
  • "replayable": true,
  • "result": "string",
  • "runSummary": "string",
  • "startTime": "string",
  • "state": "string",
  • "type": "string"
}

Scan remote Repository, Start a build if have new branch.

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of the CI/CD pipeline

query Parameters
delay
string <delay=%d>

the delay time to scan

Responses

200

OK

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/scan
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/scan

Get the sonar quality information for the specified pipeline of the DevOps project. More info: https://docs.sonarqube.org/7.4/user-guide/metric-definitions/

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

pipeline
required
string

the name of pipeline, e.g. sample-pipeline

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/sonarstatus
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/pipelines/{pipeline}/sonarstatus

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Search DevOps resource. More info: https://github.com/jenkinsci/blueocean-plugin/tree/master/blueocean-rest#get-pipelines-across-organization

Authorizations:
query Parameters
q
required
string <q=%s>

query pipelines, condition for filtering.

filter
string <filter=%s>

Filter some types of jobs. e.g. no-folder,will not get a job of type folder

start
string <start=%d>

the item number that the search starts from.

limit
string <limit=%d>

the limit item count of the search.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/search
./kapis/devops.kubesphere.io/v1alpha2/search

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    [
    ],
  • "total_count": 0
}

DevOps Project Member

Get the build-in roles info of the specified DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/defaultroles
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/defaultroles

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Get the members of the specified DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

query Parameters
paging
string <limit=%d,page=%d>
Default: "limit=10,page=1"

page

conditions
string <key=%s,key~%s>

query conditions, support using key-value pairs separated by comma to search, like 'conditions:somekey=somevalue,anotherkey=anothervalue'

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Add a member to the specified DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

Request Body schema: application/json
grand_by
string

Username of the user who assigned the role

project_id
required
string

the DevOps Projects which project membership belongs to

role
required
string

DevOps Project membership's role type. e.g. owner '

status
required
string

Deprecated, Status of project membership. e.g. active

username
required
string

Member's username,username can uniquely identify a user

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "grand_by": "string",
  • "project_id": "string",
  • "role": "string",
  • "status": "string",
  • "username": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "grand_by": "string",
  • "project_id": "string",
  • "role": "string",
  • "status": "string",
  • "username": "string"
}

Get the specified member of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

member
required
string

member's username, e.g. admin

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members/{member}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members/{member}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "grand_by": "string",
  • "project_id": "string",
  • "role": "string",
  • "status": "string",
  • "username": "string"
}

Delete the specified member of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

member
required
string

member's username, e.g. admin

Responses

200

OK

delete /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members/{member}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members/{member}

Update the specified member of the DevOps project

Authorizations:
path Parameters
devops
required
string

DevOps project's ID, e.g. project-RRRRAzLBlLEm

member
required
string

member's username, e.g. admin

Request Body schema: application/json
grand_by
string

Username of the user who assigned the role

project_id
required
string

the DevOps Projects which project membership belongs to

role
required
string

DevOps Project membership's role type. e.g. owner '

status
required
string

Deprecated, Status of project membership. e.g. active

username
required
string

Member's username,username can uniquely identify a user

Responses

200

ok

default

ok

patch /kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members/{member}
./kapis/devops.kubesphere.io/v1alpha2/devops/{devops}/members/{member}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "grand_by": "string",
  • "project_id": "string",
  • "role": "string",
  • "status": "string",
  • "username": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "grand_by": "string",
  • "project_id": "string",
  • "role": "string",
  • "status": "string",
  • "username": "string"
}

DevOps Webhook

Get commit notification by HTTP GET method. Git webhook will request here.

Authorizations:
query Parameters
url
required
string <url=%s>

Git url

Responses

200

OK

get /kapis/devops.kubesphere.io/v1alpha2/webhook/git
./kapis/devops.kubesphere.io/v1alpha2/webhook/git

Get commit notification by HTTP POST method. Git webhook will request here.

Authorizations:
query Parameters
url
required
string <url=%s>

Git url

Responses

200

OK

post /kapis/devops.kubesphere.io/v1alpha2/webhook/git
./kapis/devops.kubesphere.io/v1alpha2/webhook/git

Get commit notification. Github webhook will request here.

Authorizations:

Responses

200

OK

post /kapis/devops.kubesphere.io/v1alpha2/webhook/github
./kapis/devops.kubesphere.io/v1alpha2/webhook/github

DevOps Jenkinsfile

Convert json to jenkinsfile format.

Authorizations:
Request Body schema: application/x-www-form-urlencoded
json
string

json data

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/tojenkinsfile
./kapis/devops.kubesphere.io/v1alpha2/tojenkinsfile

Response samples

Content type
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "status": "string"
}

Convert jenkinsfile to json format. Usually the frontend uses json to show or edit pipeline

Authorizations:
Request Body schema: application/x-www-form-urlencoded
jenkinsfile
string

jenkinsfile

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/tojson
./kapis/devops.kubesphere.io/v1alpha2/tojson

Response samples

Content type
Copy
Expand all Collapse all
{
  • "data":
    {
    },
  • "status": "string"
}

DevOps Scm

List all organizations of the specified source configuration management (SCM) such as Github.

Authorizations:
path Parameters
scm
required
string

the ID of the source configuration management (SCM).

query Parameters
credentialId
required
string <credentialId=%s>

credential ID for source configuration management (SCM).

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/organizations
./kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/organizations

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List all repositories in the specified organization.

Authorizations:
path Parameters
scm
required
string

The ID of the source configuration management (SCM).

organization
required
string

organization ID, such as github username.

query Parameters
credentialId
required
string <credentialId=%s>

credential ID for SCM.

pageNumber
required
string <pageNumber=%d>

page number.

pageSize
required
string <pageSize=%d>

the item count of one page.

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/organizations/{organization}/repositories
./kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/organizations/{organization}/repositories

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

List all servers in the jenkins.

Authorizations:
path Parameters
scm
required
string

The ID of the source configuration management (SCM).

Responses

200

ok

default

ok

get /kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/servers
./kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/servers

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create scm server in the jenkins.

Authorizations:
path Parameters
scm
required
string

The ID of the source configuration management (SCM).

Request Body schema: application/json
apiUrl
string

url of scm server

name
string

name of scm server

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/servers
./kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/servers

Request samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "apiUrl": "string",
  • "name": "string"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "_class": "string",
  • "_links":
    {
    },
  • "apiUrl": "string",
  • "id": "string",
  • "name": "string"
}

Validate the access token of the specified source configuration management (SCM) such as Github

Authorizations:
path Parameters
scm
required
string

the ID of the source configuration management (SCM).

Responses

200

ok

default

ok

post /kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/verify
./kapis/devops.kubesphere.io/v1alpha2/scms/{scm}/verify

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "credentialId": "string"
}

Cluster Metrics

Get cluster-level metric data.

Authorizations:
query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both cluster CPU usage and disk usage: cluster_cpu_usage|cluster_disk_size_usage. View available metrics at kubesphere.io.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

type
string

Additional operations. Currently available types is statistics. It retrieves the total number of workspaces, devops projects, namespaces, accounts in the cluster at the moment.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/cluster
./kapis/monitoring.kubesphere.io/v1alpha2/cluster

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Node Metrics

Get node-level metric data of all nodes.

Authorizations:
query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both node CPU usage and disk usage: node_cpu_usage|node_disk_size_usage. View available metrics at kubesphere.io.

resources_filter
string

The node filter consists of a regexp pattern. It specifies which node data to return. For example, the following filter matches both node i-caojnter and i-cmu82ogj: i-caojnter|i-cmu82ogj.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort nodes by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/nodes
./kapis/monitoring.kubesphere.io/v1alpha2/nodes

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get node-level metric data of the specific node.

Authorizations:
path Parameters
node
required
string

Node name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both node CPU usage and disk usage: node_cpu_usage|node_disk_size_usage. View available metrics at kubesphere.io.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/nodes/{node}
./kapis/monitoring.kubesphere.io/v1alpha2/nodes/{node}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Namespace Metrics

Get namespace-level metric data of all namespaces.

Authorizations:
query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both namespace CPU usage and memory usage: namespace_cpu_usage|namespace_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The namespace filter consists of a regexp pattern. It specifies which namespace data to return. For example, the following filter matches both namespace test and kube-system: test|kube-system.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort namespaces by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get namespace-level metric data of the specific namespace.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both namespace CPU usage and memory usage: namespace_cpu_usage|namespace_memory_usage. View available metrics at kubesphere.io.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get namespace-level metric data of a specific workspace.

Authorizations:
path Parameters
workspace
required
string

Workspace name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both namespace CPU usage and memory usage: namespace_cpu_usage|namespace_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The namespace filter consists of a regexp pattern. It specifies which namespace data to return. For example, the following filter matches both namespace test and kube-system: test|kube-system.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort namespaces by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/workspaces/{workspace}/namespaces
./kapis/monitoring.kubesphere.io/v1alpha2/workspaces/{workspace}/namespaces

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Workload Metrics

Get workload-level metric data of a specific namespace's workloads.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both workload CPU usage and memory usage: workload_cpu_usage|workload_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The workload filter consists of a regexp pattern. It specifies which workload data to return. For example, the following filter matches any workload whose name begins with prometheus: prometheus.*.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort workloads by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/workloads
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/workloads

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get workload-level metric data of all workloads which belongs to a specific kind.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

kind
required
string

Workload kind. One of deployment, daemonset, statefulset.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both workload CPU usage and memory usage: workload_cpu_usage|workload_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The workload filter consists of a regexp pattern. It specifies which workload data to return. For example, the following filter matches any workload whose name begins with prometheus: prometheus.*.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort workloads by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/workloads/{kind}
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/workloads/{kind}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Pod Metrics

Get pod-level metric data of the specific namespace's pods.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both pod CPU usage and memory usage: pod_cpu_usage|pod_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The pod filter consists of a regexp pattern. It specifies which pod data to return. For example, the following filter matches any pod whose name begins with redis: redis.*.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort pods by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/pods
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/pods

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get pod-level metric data of a specific pod. Navigate to the pod by the pod's namespace.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

pod
required
string

Pod name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both pod CPU usage and memory usage: pod_cpu_usage|pod_memory_usage. View available metrics at kubesphere.io.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get pod-level metric data of a specific workload's pods. Navigate to the workload by the namespace.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

kind
required
string

Workload kind. One of deployment, daemonset, statefulset.

workload
required
string

Workload name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both pod CPU usage and memory usage: pod_cpu_usage|pod_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The pod filter consists of a regexp pattern. It specifies which pod data to return. For example, the following filter matches any pod whose name begins with redis: redis.*.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort pods by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/workloads/{kind}/{workload}/pods
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/workloads/{kind}/{workload}/pods

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get pod-level metric data of all pods on a specific node.

Authorizations:
path Parameters
node
required
string

Node name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both pod CPU usage and memory usage: pod_cpu_usage|pod_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The pod filter consists of a regexp pattern. It specifies which pod data to return. For example, the following filter matches any pod whose name begins with redis: redis.*.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort pods by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/nodes/{node}/pods
./kapis/monitoring.kubesphere.io/v1alpha2/nodes/{node}/pods

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get pod-level metric data of a specific pod. Navigate to the pod by the node where it is scheduled.

Authorizations:
path Parameters
node
required
string

Node name.

pod
required
string

Pod name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both pod CPU usage and memory usage: pod_cpu_usage|pod_memory_usage. View available metrics at kubesphere.io.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/nodes/{node}/pods/{pod}
./kapis/monitoring.kubesphere.io/v1alpha2/nodes/{node}/pods/{pod}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Container Metrics

Get container-level metric data of a specific pod's containers. Navigate to the pod by the pod's namespace.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

pod
required
string

Pod name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both container CPU usage and memory usage: container_cpu_usage|container_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The container filter consists of a regexp pattern. It specifies which container data to return. For example, the following filter matches container prometheus and prometheus-config-reloader: prometheus|prometheus-config-reloader.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort containers by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}/containers
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}/containers

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get container-level metric data of a specific container. Navigate to the container by the pod name and the namespace.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

pod
required
string

Pod name.

container
required
string

Container name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both container CPU usage and memory usage: container_cpu_usage|container_memory_usage. View available metrics at kubesphere.io.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}/containers/{container}
./kapis/monitoring.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}/containers/{container}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Workspace Metrics

Get workspace-level metric data of all workspaces.

Authorizations:
query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both workspace CPU usage and memory usage: workspace_cpu_usage|workspace_memory_usage. View available metrics at kubesphere.io.

resources_filter
string

The workspace filter consists of a regexp pattern. It specifies which workspace data to return.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

sort_metric
string

Sort workspaces by the specified metric. Not applicable if start and end are provided.

sort_type
string
Default: "desc."

Sort order. One of asc, desc.

page
integer

The page number. This field paginates result data of each metric, then returns a specific page. For example, setting page to 2 returns the second page. It only applies to sorted metric data.

limit
integer
Default: 5

Page size, the maximum number of results in a single page. Defaults to 5.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/workspaces
./kapis/monitoring.kubesphere.io/v1alpha2/workspaces

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Get workspace-level metric data of a specific workspace.

Authorizations:
path Parameters
workspace
required
string

Workspace name.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both workspace CPU usage and memory usage: workspace_cpu_usage|workspace_memory_usage. View available metrics at kubesphere.io.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

type
string

Additional operations. Currently available types is statistics. It retrieves the total number of namespaces, devops projects, members and roles in this workspace at the moment.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/workspaces/{workspace}
./kapis/monitoring.kubesphere.io/v1alpha2/workspaces/{workspace}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Component Metrics

Get component-level metric data of the specific system component.

Authorizations:
path Parameters
component
required
string

system component to monitor. One of etcd, apiserver, scheduler, controller_manager, coredns, prometheus.

query Parameters
metrics_filter
string

The metric name filter consists of a regexp pattern. It specifies which metric data to return. For example, the following filter matches both etcd server list and total size of the underlying database: etcd_server_list|etcd_mvcc_db_size. View available metrics at kubesphere.io.

start
string

Start time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1559347200.

end
string

End time of query. Use start and end to retrieve metric data over a time span. It is a string with Unix time format, eg. 1561939200.

step
string
Default: "10m"

Time interval. Retrieve metric data at a fixed interval within the time range of start and end. It requires both start and end are provided. The format is [0-9]+[smhdwy]. Defaults to 10m (i.e. 10 min).

time
string

A timestamp in Unix time format. Retrieve metric data at a single point in time. Defaults to now. Time and the combination of start, end, step are mutually exclusive.

Responses

200

ok

default

ok

get /kapis/monitoring.kubesphere.io/v1alpha2/components/{component}
./kapis/monitoring.kubesphere.io/v1alpha2/components/{component}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "metrics_level": "string",
  • "page": 0,
  • "results":
    [
    ],
  • "total_item": 0,
  • "total_page": 0
}

Log Query

Query logs against the cluster.

Authorizations:
query Parameters
operation
string
Default: "query"

Operation type. This can be one of four types: query (for querying logs), statistics (for retrieving statistical data), histogram (for displaying log count by time interval) and export (for exporting logs). Defaults to query.

workspaces
string

A comma-separated list of workspaces. This field restricts the query to specified workspaces. For example, the following filter matches the workspace my-ws and demo-ws: my-ws,demo-ws

workspace_query
string

A comma-separated list of keywords. Differing from workspaces, this field performs fuzzy matching on workspaces. For example, the following value limits the query to workspaces whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

namespaces
string

A comma-separated list of namespaces. This field restricts the query to specified namespaces. For example, the following filter matches the namespace my-ns and demo-ns: my-ns,demo-ns

namespace_query
string

A comma-separated list of keywords. Differing from namespaces, this field performs fuzzy matching on namespaces. For example, the following value limits the query to namespaces whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

workloads
string

A comma-separated list of workloads. This field restricts the query to specified workloads. For example, the following filter matches the workload my-wl and demo-wl: my-wl,demo-wl

workload_query
string

A comma-separated list of keywords. Differing from workloads, this field performs fuzzy matching on workloads. For example, the following value limits the query to workloads whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

pods
string

A comma-separated list of pods. This field restricts the query to specified pods. For example, the following filter matches the pod my-po and demo-po: my-po,demo-po

pod_query
string

A comma-separated list of keywords. Differing from pods, this field performs fuzzy matching on pods. For example, the following value limits the query to pods whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

containers
string

A comma-separated list of containers. This field restricts the query to specified containers. For example, the following filter matches the container my-cont and demo-cont: my-cont,demo-cont

container_query
string

A comma-separated list of keywords. Differing from containers, this field performs fuzzy matching on containers. For example, the following value limits the query to containers whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

log_query
string

A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to err,INFO, the query returns any log containing err(ERR,Err,...) OR INFO(info,InFo,...).

interval
string
Default: "15m"

Time interval. It requires operation is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).

start_time
string

Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

end_time
string

End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

sort
string
Default: "desc"

Sort order. One of acs, desc. This field sorts logs by timestamp.

from
integer
Default: 0

The offset from the result set. This field returns query results from the specified offset. It requires operation is set to query. Defaults to 0 (i.e. from the beginning of the result set).

size
integer
Default: 10

Size of result to return. It requires operation is set to query. Defaults to 10 (i.e. 10 log records).

Responses

200

ok

default

ok

get /kapis/logging.kubesphere.io/v1alpha2/cluster
./kapis/logging.kubesphere.io/v1alpha2/cluster

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "resultType": "string"
}

Query logs against the specific namespace.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

query Parameters
operation
string
Default: "query"

Query type. This can be one of three types: query (for querying logs), statistics (for retrieving statistical data), and histogram (for displaying log count by time interval). Defaults to query.

workloads
string

A comma-separated list of workloads. This field restricts the query to specified workloads. For example, the following filter matches the workload my-wl and demo-wl: my-wl,demo-wl

workload_query
string

A comma-separated list of keywords. Differing from workloads, this field performs fuzzy matching on workloads. For example, the following value limits the query to workloads whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

pods
string

A comma-separated list of pods. This field restricts the query to specified pods. For example, the following filter matches the pod my-po and demo-po: my-po,demo-po

pod_query
string

A comma-separated list of keywords. Differing from pods, this field performs fuzzy matching on pods. For example, the following value limits the query to pods whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

containers
string

A comma-separated list of containers. This field restricts the query to specified containers. For example, the following filter matches the container my-cont and demo-cont: my-cont,demo-cont

container_query
string

A comma-separated list of keywords. Differing from containers, this field performs fuzzy matching on containers. For example, the following value limits the query to containers whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

log_query
string

A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to err,INFO, the query returns any log containing err(ERR,Err,...) OR INFO(info,InFo,...).

interval
string
Default: "15m"

Time interval. It requires operation is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).

start_time
string

Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

end_time
string

End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

sort
string
Default: "desc"

Sort order. One of acs, desc. This field sorts logs by timestamp.

from
integer
Default: 0

The offset from the result set. This field returns query results from the specified offset. It requires operation is set to query. Defaults to 0 (i.e. from the beginning of the result set).

size
integer
Default: 10

Size of result to return. It requires operation is set to query. Defaults to 10 (i.e. 10 log records).

Responses

200

ok

default

ok

get /kapis/logging.kubesphere.io/v1alpha2/namespaces/{namespace}
./kapis/logging.kubesphere.io/v1alpha2/namespaces/{namespace}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "resultType": "string"
}

Query logs against the specific pod.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

pod
required
string

Pod name.

query Parameters
operation
string
Default: "query"

Query type. This can be one of three types: query (for querying logs), statistics (for retrieving statistical data), and histogram (for displaying log count by time interval). Defaults to query.

containers
string

A comma-separated list of containers. This field restricts the query to specified containers. For example, the following filter matches the container my-cont and demo-cont: my-cont,demo-cont

container_query
string

A comma-separated list of keywords. Differing from containers, this field performs fuzzy matching on containers. For example, the following value limits the query to containers whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

log_query
string

A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to err,INFO, the query returns any log containing err(ERR,Err,...) OR INFO(info,InFo,...).

interval
string
Default: "15m"

Time interval. It requires operation is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).

start_time
string

Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

end_time
string

End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

sort
string
Default: "desc"

Sort order. One of acs, desc. This field sorts logs by timestamp.

from
integer
Default: 0

The offset from the result set. This field returns query results from the specified offset. It requires operation is set to query. Defaults to 0 (i.e. from the beginning of the result set).

size
integer
Default: 10

Size of result to return. It requires operation is set to query. Defaults to 10 (i.e. 10 log records).

Responses

200

ok

default

ok

get /kapis/logging.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}
./kapis/logging.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "resultType": "string"
}

Query logs against the specific container.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

pod
required
string

Pod name.

container
required
string

Container name.

query Parameters
operation
string
Default: "query"

Operation type. This can be one of four types: query (for querying logs), statistics (for retrieving statistical data), histogram (for displaying log count by time interval) and export (for exporting logs). Defaults to query.

log_query
string

A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to err,INFO, the query returns any log containing err(ERR,Err,...) OR INFO(info,InFo,...).

interval
string
Default: "15m"

Time interval. It requires operation is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).

start_time
string

Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

end_time
string

End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

sort
string
Default: "desc"

Sort order. One of acs, desc. This field sorts logs by timestamp.

from
integer
Default: 0

The offset from the result set. This field returns query results from the specified offset. It requires operation is set to query. Defaults to 0 (i.e. from the beginning of the result set).

size
integer
Default: 10

Size of result to return. It requires operation is set to query. Defaults to 10 (i.e. 10 log records).

Responses

200

ok

default

ok

get /kapis/logging.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}/containers/{container}
./kapis/logging.kubesphere.io/v1alpha2/namespaces/{namespace}/pods/{pod}/containers/{container}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "resultType": "string"
}

Query logs against the specific workload.

Authorizations:
path Parameters
namespace
required
string

The name of the namespace.

workload
required
string

The name of the workload.

query Parameters
operation
string
Default: "query"

Query type. This can be one of three types: query (for querying logs), statistics (for retrieving statistical data), and histogram (for displaying log count by time interval). Defaults to query.

pods
string

A comma-separated list of pods. This field restricts the query to specified pods. For example, the following filter matches the pod my-po and demo-po: my-po,demo-po

pod_query
string

A comma-separated list of keywords. Differing from pods, this field performs fuzzy matching on pods. For example, the following value limits the query to pods whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

containers
string

A comma-separated list of containers. This field restricts the query to specified containers. For example, the following filter matches the container my-cont and demo-cont: my-cont,demo-cont

container_query
string

A comma-separated list of keywords. Differing from containers, this field performs fuzzy matching on containers. For example, the following value limits the query to containers whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

log_query
string

A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to err,INFO, the query returns any log containing err(ERR,Err,...) OR INFO(info,InFo,...).

interval
string
Default: "15m"

Time interval. It requires operation is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).

start_time
string

Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

end_time
string

End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

sort
string
Default: "desc"

Sort order. One of acs, desc. This field sorts logs by timestamp.

from
integer
Default: 0

The offset from the result set. This field returns query results from the specified offset. It requires operation is set to query. Defaults to 0 (i.e. from the beginning of the result set).

size
integer
Default: 10

Size of result to return. It requires operation is set to query. Defaults to 10 (i.e. 10 log records).

Responses

200

ok

default

ok

get /kapis/logging.kubesphere.io/v1alpha2/namespaces/{namespace}/workloads/{workload}
./kapis/logging.kubesphere.io/v1alpha2/namespaces/{namespace}/workloads/{workload}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "resultType": "string"
}

Query logs against the specific workspace.

Authorizations:
path Parameters
workspace
required
string

The name of the workspace.

query Parameters
operation
string
Default: "query"

Query type. This can be one of three types: query (for querying logs), statistics (for retrieving statistical data), and histogram (for displaying log count by time interval). Defaults to query.

namespaces
string

A comma-separated list of namespaces. This field restricts the query to specified namespaces. For example, the following filter matches the namespace my-ns and demo-ns: my-ns,demo-ns

namespace_query
string

A comma-separated list of keywords. Differing from namespaces, this field performs fuzzy matching on namespaces. For example, the following value limits the query to namespaces whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

workloads
string

A comma-separated list of workloads. This field restricts the query to specified workloads. For example, the following filter matches the workload my-wl and demo-wl: my-wl,demo-wl

workload_query
string

A comma-separated list of keywords. Differing from workloads, this field performs fuzzy matching on workloads. For example, the following value limits the query to workloads whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

pods
string

A comma-separated list of pods. This field restricts the query to specified pods. For example, the following filter matches the pod my-po and demo-po: my-po,demo-po

pod_query
string

A comma-separated list of keywords. Differing from pods, this field performs fuzzy matching on pods. For example, the following value limits the query to pods whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

containers
string

A comma-separated list of containers. This field restricts the query to specified containers. For example, the following filter matches the container my-cont and demo-cont: my-cont,demo-cont

container_query
string

A comma-separated list of keywords. Differing from containers, this field performs fuzzy matching on containers. For example, the following value limits the query to containers whose name contains the word my(My,MY,...) OR demo(Demo,DemO,...): my,demo.

log_query
string

A comma-separated list of keywords. The query returns logs which contain at least one keyword. Case-insensitive matching. For example, if the field is set to err,INFO, the query returns any log containing err(ERR,Err,...) OR INFO(info,InFo,...).

interval
string
Default: "15m"

Time interval. It requires operation is set to histogram. The format is [0-9]+[smhdwMqy]. Defaults to 15m (i.e. 15 min).

start_time
string

Start time of query. Default to 0. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

end_time
string

End time of query. Default to now. The format is a string representing milliseconds since the epoch, eg. 1559664000000.

sort
string
Default: "desc"

Sort order. One of acs, desc. This field sorts logs by timestamp.

from
integer
Default: 0

The offset from the result set. This field returns query results from the specified offset. It requires operation is set to query. Defaults to 0 (i.e. from the beginning of the result set).

size
integer
Default: 10

Size of result to return. It requires operation is set to query. Defaults to 10 (i.e. 10 log records).

Responses

200

ok

default

ok

get /kapis/logging.kubesphere.io/v1alpha2/workspaces/{workspace}
./kapis/logging.kubesphere.io/v1alpha2/workspaces/{workspace}

Response samples

Content type
Copy
Expand all Collapse all
{
  • "result":
    [
    ],
  • "resultType": "string"
}

Fluent Bit Setting

List all Fluent bit output plugins.

Authorizations:

Responses

200

ok

default

ok

get /kapis/logging.kubesphere.io/v1alpha2/fluentbit/outputs
./kapis/logging.kubesphere.io/v1alpha2/fluentbit/outputs

Response samples

Content type
Copy
Expand all Collapse all
{
  • "error": "string",
  • "outputs":
    [
    ],
  • "status": 0
}

Add a new Fluent bit output plugin.

Authorizations:
Request Body schema:
enable
required
boolean

active status, one of true, false

id
string

output uuid

name
required
string

output plugin name, eg. fluentbit-output-es

parameters
required
Array of objects (fluentbitclient.Parameter)

output plugin configuration parameters

type
required
string

output plugin type, eg. fluentbit-output-es

updatetime
string <date-time>

last updatetime

Responses

200

ok

default

ok

post /kapis/logging.kubesphere.io/v1alpha2/fluentbit/outputs
./kapis/logging.kubesphere.io/v1alpha2/fluentbit/outputs

Request samples

Content type
Copy
Expand all Collapse all
{
  • "enable": true,
  • "id": "string",
  • "name": "string",
  • "parameters":
    [
    ],
  • "type": "string",
  • "updatetime": "2022-10-14T03:23:08Z"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error": "string",
  • "outputs":
    [
    ],
  • "status": 0
}

Update the specific Fluent bit output plugin.

Authorizations:
path Parameters
output
required
string

ID of the output.

Request Body schema:
enable
required
boolean

active status, one of true, false

id
string

output uuid

name
required
string

output plugin name, eg. fluentbit-output-es

parameters
required
Array of objects (fluentbitclient.Parameter)

output plugin configuration parameters

type
required
string

output plugin type, eg. fluentbit-output-es

updatetime
string <date-time>

last updatetime

Responses

200

ok

default

ok

put /kapis/logging.kubesphere.io/v1alpha2/fluentbit/outputs/{output}
./kapis/logging.kubesphere.io/v1alpha2/fluentbit/outputs/{output}

Request samples

Content type
Copy
Expand all Collapse all
{
  • "enable": true,
  • "id": "string",
  • "name": "string",
  • "parameters":
    [
    ],
  • "type": "string",
  • "updatetime": "2022-10-14T03:23:08Z"
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error": "string",
  • "outputs":
    [
    ],
  • "status": 0
}

Delete the specific Fluent bit output plugin.

Authorizations:
path Parameters
output
required
string

ID of the output.

Responses

200

ok

default

ok

delete /kapis/logging.kubesphere.io/v1alpha2/fluentbit/outputs/{output}
./kapis/logging.kubesphere.io/v1alpha2/fluentbit/outputs/{output}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "error": "string",
  • "outputs":
    [
    ],
  • "status": 0
}