File tree Expand file tree Collapse file tree 4 files changed +73
-0
lines changed Expand file tree Collapse file tree 4 files changed +73
-0
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,14 @@ public function loadBalancerSpecs()
313
313
return (new LoadBalancerSpecClient ($ this ->httpClient ))->auth ($ this ->token );
314
314
}
315
315
316
+ /**
317
+ * @return BaseClient
318
+ */
319
+ public function loadBalancerNetworks ()
320
+ {
321
+ return (new LoadBalancerNetworkClient ($ this ->httpClient ))->auth ($ this ->token );
322
+ }
323
+
316
324
/**
317
325
* @return BaseClient
318
326
*/
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace UKFast \SDK \eCloud \Entities ;
4
+
5
+ use UKFast \SDK \Entity ;
6
+
7
+ /**
8
+ * @property string $id
9
+ * @property string $name
10
+ * @property string $loadBalancerId
11
+ * @property string $networkId
12
+ * @property string $sync
13
+ * @property string $createdAt
14
+ * @property string $updatedAt
15
+ */
16
+ class LoadBalancerNetwork extends Entity
17
+ {
18
+ protected $ dates = ['createdAt ' , 'updatedAt ' ];
19
+ }
Original file line number Diff line number Diff line change @@ -33,4 +33,9 @@ public function loadEntity($data)
33
33
$ this ->apiToFriendly ($ data , $ this ->getEntityMap ())
34
34
);
35
35
}
36
+
37
+ public function getNetworks ($ id )
38
+ {
39
+ return $ this ->loadBalancerNetworks ()->getAllByLoadBalancerId ($ id );
40
+ }
36
41
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace UKFast \SDK \eCloud ;
4
+
5
+ use UKFast \SDK \Entities \ClientEntityInterface ;
6
+ use UKFast \SDK \Traits \PageItems ;
7
+ use UKFast \SDK \eCloud \Entities \LoadBalancerNetwork ;
8
+
9
+ class LoadBalancerNetworkClient extends Client implements ClientEntityInterface
10
+ {
11
+ use PageItems;
12
+
13
+ protected $ collectionPath = 'v2/load-balancer-networks ' ;
14
+
15
+ public function getEntityMap ()
16
+ {
17
+ return [
18
+ 'id ' => 'id ' ,
19
+ 'name ' => 'name ' ,
20
+ 'load_balancer_id ' => 'loadBalancerId ' ,
21
+ 'network_id ' => 'networkId ' ,
22
+ 'sync ' => 'sync ' ,
23
+ 'created_at ' => 'createdAt ' ,
24
+ 'updated_at ' => 'updatedAt ' ,
25
+ ];
26
+ }
27
+
28
+ public function loadEntity ($ data )
29
+ {
30
+ return new LoadBalancerNetwork (
31
+ $ this ->apiToFriendly ($ data , $ this ->getEntityMap ())
32
+ );
33
+ }
34
+
35
+ public function getAllByLoadBalancerId ($ id )
36
+ {
37
+ return $ this ->getAll ([
38
+ 'load_balancer_id ' => $ id
39
+ ]);
40
+ }
41
+ }
You can’t perform that action at this time.
0 commit comments