Skip to content

Commit a7f1466

Browse files
author
k8s-merge-robot
committed
Merge pull request kubernetes#19577 from caesarxuchao/expose-swagger-for-discovery-types
Auto commit by PR queue bot
2 parents cda4583 + 051865a commit a7f1466

18 files changed

+1041
-30
lines changed

api/swagger-spec/api.json

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"description": "get available API versions",
1010
"operations": [
1111
{
12-
"type": "void",
12+
"type": "unversioned.APIVersions",
1313
"method": "GET",
1414
"summary": "get available API versions",
1515
"nickname": "getAPIVersions",
@@ -26,5 +26,56 @@
2626
]
2727
}
2828
],
29-
"models": {}
29+
"models": {
30+
"unversioned.APIVersions": {
31+
"id": "unversioned.APIVersions",
32+
"description": "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.",
33+
"required": [
34+
"versions",
35+
"serverAddressByClientCIDRs"
36+
],
37+
"properties": {
38+
"kind": {
39+
"type": "string",
40+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
41+
},
42+
"apiVersion": {
43+
"type": "string",
44+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
45+
},
46+
"versions": {
47+
"type": "array",
48+
"items": {
49+
"type": "string"
50+
},
51+
"description": "versions are the api versions that are available."
52+
},
53+
"serverAddressByClientCIDRs": {
54+
"type": "array",
55+
"items": {
56+
"$ref": "unversioned.ServerAddressByClientCIDR"
57+
},
58+
"description": "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."
59+
}
60+
}
61+
},
62+
"unversioned.ServerAddressByClientCIDR": {
63+
"id": "unversioned.ServerAddressByClientCIDR",
64+
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
65+
"required": [
66+
"clientCIDR",
67+
"serverAddress"
68+
],
69+
"properties": {
70+
"clientCIDR": {
71+
"type": "string",
72+
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
73+
},
74+
"serverAddress": {
75+
"type": "string",
76+
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
77+
}
78+
}
79+
}
80+
}
3081
}

api/swagger-spec/apis.json

Lines changed: 104 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"description": "get available API versions",
1010
"operations": [
1111
{
12-
"type": "void",
12+
"type": "unversioned.APIGroupList",
1313
"method": "GET",
1414
"summary": "get available API versions",
1515
"nickname": "getAPIVersions",
@@ -26,5 +26,107 @@
2626
]
2727
}
2828
],
29-
"models": {}
29+
"models": {
30+
"unversioned.APIGroupList": {
31+
"id": "unversioned.APIGroupList",
32+
"description": "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.",
33+
"required": [
34+
"groups"
35+
],
36+
"properties": {
37+
"kind": {
38+
"type": "string",
39+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
40+
},
41+
"apiVersion": {
42+
"type": "string",
43+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
44+
},
45+
"groups": {
46+
"type": "array",
47+
"items": {
48+
"$ref": "unversioned.APIGroup"
49+
},
50+
"description": "groups is a list of APIGroup."
51+
}
52+
}
53+
},
54+
"unversioned.APIGroup": {
55+
"id": "unversioned.APIGroup",
56+
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
57+
"required": [
58+
"name",
59+
"versions",
60+
"serverAddressByClientCIDRs"
61+
],
62+
"properties": {
63+
"kind": {
64+
"type": "string",
65+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
66+
},
67+
"apiVersion": {
68+
"type": "string",
69+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
70+
},
71+
"name": {
72+
"type": "string",
73+
"description": "name is the name of the group."
74+
},
75+
"versions": {
76+
"type": "array",
77+
"items": {
78+
"$ref": "unversioned.GroupVersionForDiscovery"
79+
},
80+
"description": "versions are the versions supported in this group."
81+
},
82+
"preferredVersion": {
83+
"$ref": "unversioned.GroupVersionForDiscovery",
84+
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version."
85+
},
86+
"serverAddressByClientCIDRs": {
87+
"type": "array",
88+
"items": {
89+
"$ref": "unversioned.ServerAddressByClientCIDR"
90+
},
91+
"description": "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."
92+
}
93+
}
94+
},
95+
"unversioned.GroupVersionForDiscovery": {
96+
"id": "unversioned.GroupVersionForDiscovery",
97+
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensiblity.",
98+
"required": [
99+
"groupVersion",
100+
"version"
101+
],
102+
"properties": {
103+
"groupVersion": {
104+
"type": "string",
105+
"description": "groupVersion specifies the API group and version in the form \"group/version\""
106+
},
107+
"version": {
108+
"type": "string",
109+
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion."
110+
}
111+
}
112+
},
113+
"unversioned.ServerAddressByClientCIDR": {
114+
"id": "unversioned.ServerAddressByClientCIDR",
115+
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
116+
"required": [
117+
"clientCIDR",
118+
"serverAddress"
119+
],
120+
"properties": {
121+
"clientCIDR": {
122+
"type": "string",
123+
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
124+
},
125+
"serverAddress": {
126+
"type": "string",
127+
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
128+
}
129+
}
130+
}
131+
}
30132
}

api/swagger-spec/autoscaling.json

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"description": "get information of a group",
1010
"operations": [
1111
{
12-
"type": "void",
12+
"type": "unversioned.APIGroup",
1313
"method": "GET",
1414
"summary": "get information of a group",
1515
"nickname": "getAPIGroup",
@@ -26,5 +26,83 @@
2626
]
2727
}
2828
],
29-
"models": {}
29+
"models": {
30+
"unversioned.APIGroup": {
31+
"id": "unversioned.APIGroup",
32+
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
33+
"required": [
34+
"name",
35+
"versions",
36+
"serverAddressByClientCIDRs"
37+
],
38+
"properties": {
39+
"kind": {
40+
"type": "string",
41+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
42+
},
43+
"apiVersion": {
44+
"type": "string",
45+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
46+
},
47+
"name": {
48+
"type": "string",
49+
"description": "name is the name of the group."
50+
},
51+
"versions": {
52+
"type": "array",
53+
"items": {
54+
"$ref": "unversioned.GroupVersionForDiscovery"
55+
},
56+
"description": "versions are the versions supported in this group."
57+
},
58+
"preferredVersion": {
59+
"$ref": "unversioned.GroupVersionForDiscovery",
60+
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version."
61+
},
62+
"serverAddressByClientCIDRs": {
63+
"type": "array",
64+
"items": {
65+
"$ref": "unversioned.ServerAddressByClientCIDR"
66+
},
67+
"description": "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."
68+
}
69+
}
70+
},
71+
"unversioned.GroupVersionForDiscovery": {
72+
"id": "unversioned.GroupVersionForDiscovery",
73+
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensiblity.",
74+
"required": [
75+
"groupVersion",
76+
"version"
77+
],
78+
"properties": {
79+
"groupVersion": {
80+
"type": "string",
81+
"description": "groupVersion specifies the API group and version in the form \"group/version\""
82+
},
83+
"version": {
84+
"type": "string",
85+
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion."
86+
}
87+
}
88+
},
89+
"unversioned.ServerAddressByClientCIDR": {
90+
"id": "unversioned.ServerAddressByClientCIDR",
91+
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
92+
"required": [
93+
"clientCIDR",
94+
"serverAddress"
95+
],
96+
"properties": {
97+
"clientCIDR": {
98+
"type": "string",
99+
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
100+
},
101+
"serverAddress": {
102+
"type": "string",
103+
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
104+
}
105+
}
106+
}
107+
}
30108
}

api/swagger-spec/autoscaling_v1.json

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@
834834
"description": "API at /apis/autoscaling/v1",
835835
"operations": [
836836
{
837-
"type": "void",
837+
"type": "unversioned.APIResourceList",
838838
"method": "GET",
839839
"summary": "get available resources",
840840
"nickname": "getAPIResources",
@@ -1187,6 +1187,58 @@
11871187
"description": "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately."
11881188
}
11891189
}
1190+
},
1191+
"unversioned.APIResourceList": {
1192+
"id": "unversioned.APIResourceList",
1193+
"description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.",
1194+
"required": [
1195+
"groupVersion",
1196+
"resources"
1197+
],
1198+
"properties": {
1199+
"kind": {
1200+
"type": "string",
1201+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
1202+
},
1203+
"apiVersion": {
1204+
"type": "string",
1205+
"description": "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. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
1206+
},
1207+
"groupVersion": {
1208+
"type": "string",
1209+
"description": "groupVersion is the group and version this APIResourceList is for."
1210+
},
1211+
"resources": {
1212+
"type": "array",
1213+
"items": {
1214+
"$ref": "unversioned.APIResource"
1215+
},
1216+
"description": "resources contains the name of the resources and if they are namespaced."
1217+
}
1218+
}
1219+
},
1220+
"unversioned.APIResource": {
1221+
"id": "unversioned.APIResource",
1222+
"description": "APIResource specifies the name of a resource and whether it is namespaced.",
1223+
"required": [
1224+
"name",
1225+
"namespaced",
1226+
"kind"
1227+
],
1228+
"properties": {
1229+
"name": {
1230+
"type": "string",
1231+
"description": "name is the name of the resource."
1232+
},
1233+
"namespaced": {
1234+
"type": "boolean",
1235+
"description": "namespaced indicates if a resource is namespaced or not."
1236+
},
1237+
"kind": {
1238+
"type": "string",
1239+
"description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')"
1240+
}
1241+
}
11901242
}
11911243
}
11921244
}

0 commit comments

Comments
 (0)