23
23
*/
24
24
25
25
namespace DevStub \KubernetesAPIClient ;
26
+ use Binarygoo \KubernetesAPIClient \Endpoint \v1beta1 \ReplicationControllers ;
27
+ use DevStub \KubernetesAPIClient \Endpoint \v1beta1 \Endpoints ;
28
+ use DevStub \KubernetesAPIClient \Endpoint \v1beta1 \Minions ;
29
+ use DevStub \KubernetesAPIClient \Entity \v1beta1 \ReplicationController ;
26
30
use DevStub \KubernetesAPIClient \Exception \ClientException ;
27
31
use DevStub \KubernetesAPIClient \Exception \ConfigException ;
28
32
@@ -74,7 +78,7 @@ public function config($config = null) {
74
78
/**
75
79
* Returns the Pods api endpoint object.
76
80
*
77
- * @return \DevStub\KubernetesAPIClient\Endpoint\v1
81
+ * @return \DevStub\KubernetesAPIClient\Endpoint\v1beta1\Pods
78
82
*/
79
83
public function pods () {
80
84
if ($ this ->_podsEndpointObject === null ) {
@@ -91,28 +95,115 @@ public function pods() {
91
95
return $ this ->_podsEndpointObject ;
92
96
}
93
97
98
+ /**
99
+ * Returns the Replication Controllers api endpoint object
100
+ *
101
+ * @return \DevStub\KubernetesAPIClient\Endpoint\v1beta1\ReplicationControllers
102
+ */
94
103
public function replicationControllers () {
95
- // TODO
104
+ if ($ this ->_podsEndpointObject === null ) {
105
+ $ podsClass = "\\DevStub \\KubernetesAPIClient \\Endpoint \\" .$ this ->_config ->getAPIVersion ()."\\ReplicationControllers " ;
106
+ if (class_exists ($ podsClass )) {
107
+ $ this ->_podsEndpointObject = new $ podsClass ($ this ->_config );
108
+ }
109
+ else {
110
+ throw new ClientException ("API Version : " .$ this ->_config ->getAPIVersion ()." is not currently supported with this client " );
111
+ }
112
+
113
+ }
114
+
115
+ return $ this ->_podsEndpointObject ;
96
116
}
97
117
118
+ /**
119
+ * Returns the Endpoints api endpoint object
120
+ *
121
+ * @return \DevStub\KubernetesAPIClient\Endpoint\v1beta1\Endpoints
122
+ */
98
123
public function endpoints () {
99
- // TODO
124
+ if ($ this ->_podsEndpointObject === null ) {
125
+ $ podsClass = "\\DevStub \\KubernetesAPIClient \\Endpoint \\" .$ this ->_config ->getAPIVersion ()."\\Endpoints " ;
126
+ if (class_exists ($ podsClass )) {
127
+ $ this ->_podsEndpointObject = new $ podsClass ($ this ->_config );
128
+ }
129
+ else {
130
+ throw new ClientException ("API Version : " .$ this ->_config ->getAPIVersion ()." is not currently supported with this client " );
131
+ }
132
+
133
+ }
134
+
135
+ return $ this ->_podsEndpointObject ;
100
136
}
101
137
138
+ /**
139
+ * Returns the Services api endpoint object
140
+ *
141
+ * @return \DevStub\KubernetesAPIClient\Endpoint\v1beta1\Services
142
+ */
102
143
public function services () {
103
- // TODO
144
+ if ($ this ->_podsEndpointObject === null ) {
145
+ $ podsClass = "\\DevStub \\KubernetesAPIClient \\Endpoint \\" .$ this ->_config ->getAPIVersion ()."\\Services " ;
146
+ if (class_exists ($ podsClass )) {
147
+ $ this ->_podsEndpointObject = new $ podsClass ($ this ->_config );
148
+ }
149
+ else {
150
+ throw new ClientException ("API Version : " .$ this ->_config ->getAPIVersion ()." is not currently supported with this client " );
151
+ }
152
+
153
+ }
154
+
155
+ return $ this ->_podsEndpointObject ;
104
156
}
105
157
158
+ /**
159
+ * @return \DevStub\KubernetesAPIClient\Endpoint\v1beta1\Minions
160
+ */
106
161
public function minions () {
107
- // TODO
162
+ if ($ this ->_podsEndpointObject === null ) {
163
+ $ podsClass = "\\DevStub \\KubernetesAPIClient \\Endpoint \\" .$ this ->_config ->getAPIVersion ()."\\Minions " ;
164
+ if (class_exists ($ podsClass )) {
165
+ $ this ->_podsEndpointObject = new $ podsClass ($ this ->_config );
166
+ }
167
+ else {
168
+ throw new ClientException ("API Version : " .$ this ->_config ->getAPIVersion ()." is not currently supported with this client " );
169
+ }
170
+
171
+ }
172
+
173
+ return $ this ->_podsEndpointObject ;
108
174
}
109
175
176
+ /**
177
+ * @return \DevStub\KubernetesAPIClient\Endpoint\v1beta1\Events
178
+ */
110
179
public function events () {
111
- // TODO
180
+ if ($ this ->_podsEndpointObject === null ) {
181
+ $ podsClass = "\\DevStub \\KubernetesAPIClient \\Endpoint \\" .$ this ->_config ->getAPIVersion ()."\\Events " ;
182
+ if (class_exists ($ podsClass )) {
183
+ $ this ->_podsEndpointObject = new $ podsClass ($ this ->_config );
184
+ }
185
+ else {
186
+ throw new ClientException ("API Version : " .$ this ->_config ->getAPIVersion ()." is not currently supported with this client " );
187
+ }
188
+
189
+ }
190
+
191
+ return $ this ->_podsEndpointObject ;
112
192
}
113
193
114
194
public function bindings () {
115
- // TODO
195
+ if ($ this ->_podsEndpointObject === null ) {
196
+ $ podsClass = "\\DevStub \\KubernetesAPIClient \\Endpoint \\" .$ this ->_config ->getAPIVersion ()."\\Bindings " ;
197
+ if (class_exists ($ podsClass )) {
198
+ $ this ->_podsEndpointObject = new $ podsClass ($ this ->_config );
199
+ }
200
+ else {
201
+ throw new ClientException ("API Version : " .$ this ->_config ->getAPIVersion ()." is not currently supported with this client " );
202
+ }
203
+
204
+ }
205
+
206
+ return $ this ->_podsEndpointObject ;
116
207
}
117
208
118
209
}
0 commit comments