更新时间:2022-04-18 GMT+08:00
分享

列出APIGroups

功能介绍

This API is used to list APIGroups.

URI

GET /apis

请求消息

N/A.

响应消息

响应参数:

表1 describes the response parameters.

表1 参数解释

参数

参数类型

描述

kind

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.

groupVersion

String

groupVersion specifies the API group and version in the form "group/version"

groups

groups object

Standard list APIGroup

表2 groups字段数据结构说明

参数

参数类型

描述

apiVersion

String

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

kind

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase.

name

String

name is the name of the group.

preferredVersion

preferredVersion object

preferredVersion is the version preferred by the API server, which probably is the storage version.

serverAddressByClientCIDRs

serverAddressByClientCIDRs object

a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.

versions

preferredVersion object

versions are the versions supported in this group.

表3 serverAddressByClientCIDRs字段数据结构说明

参数

参数类型

描述

clientCIDR

String

The CIDR with which clients can match their IP to figure out the server address that they should use.

serverAddress

String

ddress of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.

表4 preferredVersion字段数据结构说明

参数

参数类型

描述

groupVersion

String

groupVersion specifies the API group and version in the form "group/version"

version

String

version specifies the version in the form of "version". This is to save the clients the trouble of splitting the GroupVersion.

响应示例:

{
    "kind": "APIGroupList",
    "apiVersion": "v1",
    "groups": [
        {
            "name": "apiregistration.k8s.io",
            "versions": [
                {
                    "groupVersion": "apiregistration.k8s.io/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "apiregistration.k8s.io/v1beta1",
                "version": "v1beta1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "extensions",
            "versions": [
                {
                    "groupVersion": "extensions/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "extensions/v1beta1",
                "version": "v1beta1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "apps",
            "versions": [
                {
                    "groupVersion": "apps/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "apps/v1beta1",
                "version": "v1beta1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "authentication.k8s.io",
            "versions": [
                {
                    "groupVersion": "authentication.k8s.io/v1",
                    "version": "v1"
                },
                {
                    "groupVersion": "authentication.k8s.io/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "authentication.k8s.io/v1",
                "version": "v1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "authorization.k8s.io",
            "versions": [
                {
                    "groupVersion": "authorization.k8s.io/v1",
                    "version": "v1"
                },
                {
                    "groupVersion": "authorization.k8s.io/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "authorization.k8s.io/v1",
                "version": "v1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "autoscaling",
            "versions": [
                {
                    "groupVersion": "autoscaling/v1",
                    "version": "v1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "autoscaling/v1",
                "version": "v1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "batch",
            "versions": [
                {
                    "groupVersion": "batch/v1",
                    "version": "v1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "batch/v1",
                "version": "v1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "certificates.k8s.io",
            "versions": [
                {
                    "groupVersion": "certificates.k8s.io/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "certificates.k8s.io/v1beta1",
                "version": "v1beta1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "networking.k8s.io",
            "versions": [
                {
                    "groupVersion": "networking.k8s.io/v1",
                    "version": "v1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "networking.k8s.io/v1",
                "version": "v1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "policy",
            "versions": [
                {
                    "groupVersion": "policy/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "policy/v1beta1",
                "version": "v1beta1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "rbac.authorization.k8s.io",
            "versions": [
                {
                    "groupVersion": "rbac.authorization.k8s.io/v1beta1",
                    "version": "v1beta1"
                },
                {
                    "groupVersion": "rbac.authorization.k8s.io/v1alpha1",
                    "version": "v1alpha1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "rbac.authorization.k8s.io/v1beta1",
                "version": "v1beta1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "settings.k8s.io",
            "versions": [
                {
                    "groupVersion": "settings.k8s.io/v1alpha1",
                    "version": "v1alpha1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "settings.k8s.io/v1alpha1",
                "version": "v1alpha1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "storage.k8s.io",
            "versions": [
                {
                    "groupVersion": "storage.k8s.io/v1",
                    "version": "v1"
                },
                {
                    "groupVersion": "storage.k8s.io/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "storage.k8s.io/v1",
                "version": "v1"
            },
            "serverAddressByClientCIDRs": null
        },
        {
            "name": "apiextensions.k8s.io",
            "versions": [
                {
                    "groupVersion": "apiextensions.k8s.io/v1beta1",
                    "version": "v1beta1"
                }
            ],
            "preferredVersion": {
                "groupVersion": "apiextensions.k8s.io/v1beta1",
                "version": "v1beta1"
            },
            "serverAddressByClientCIDRs": null
        }
    ]
}

状态码

表5描述API的状态码。

表5 状态码

状态码

描述

200

This operation succeeds, and a group of APIGroups resource objects is returned.

异常状态码请参见状态码

分享:

    相关文档

    相关产品

关闭导读