Skip to content

Commit 5b6e394

Browse files
committed
adds common interfaces
1 parent 4cd1cbd commit 5b6e394

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package io.kubernetes.client.common;
2+
3+
import io.kubernetes.client.openapi.models.V1ListMeta;
4+
5+
import java.util.List;
6+
7+
/**
8+
* Common accessors for kubernetes list object.
9+
*/
10+
public interface KubernetesListObject extends KubernetesType {
11+
12+
/**
13+
* Gets list metadata.
14+
*
15+
* ListMeta describes metadata that synthetic resources must have, including lists and
16+
* various status objects. A resource may have only one of {ObjectMeta, ListMeta}.
17+
*
18+
*
19+
* @return the metadata
20+
*/
21+
V1ListMeta getMetadata();
22+
23+
/**
24+
* Gets the object items.
25+
*
26+
* @return the items
27+
*/
28+
List<? extends KubernetesObject> getItems();
29+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package io.kubernetes.client.common;
2+
3+
import io.kubernetes.client.openapi.models.V1ObjectMeta;
4+
5+
/**
6+
* Common accessors for kubernetes object.
7+
*/
8+
public interface KubernetesObject extends KubernetesType {
9+
10+
/**
11+
* Gets metadata.
12+
*
13+
* ObjectMeta is metadata that all persisted resources must have, which includes all objects
14+
* users must create.
15+
*
16+
* @return the metadata
17+
*/
18+
V1ObjectMeta getMetadata();
19+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package io.kubernetes.client.common;
2+
3+
4+
/**
5+
* Equivalence to TypeMeta from kubernetes/client-go.
6+
*
7+
* TypeMeta describes an individual object in an API response or request
8+
* with strings representing the type of the object and its API schema version.
9+
* Structures that are versioned or persisted should inline TypeMeta.
10+
*/
11+
public interface KubernetesType {
12+
13+
/**
14+
* Gets api version.
15+
*
16+
* APIVersion defines the versioned schema of this representation of an object.
17+
* Servers should convert recognized schemas to the latest internal value, and
18+
* may reject unrecognized values.
19+
* More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
20+
*
21+
* @return the api version
22+
*/
23+
String getApiVersion();
24+
25+
/**
26+
* Gets kind.
27+
*
28+
* Kind is a string value representing the REST resource this object represents.
29+
* Servers may infer this from the endpoint the client submits requests to.
30+
* Cannot be updated.
31+
* In CamelCase.
32+
* More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
33+
*
34+
* @return the kind
35+
*/
36+
String getKind();
37+
}

0 commit comments

Comments
 (0)