Skip to content

Commit 30de55e

Browse files
authored
Merge pull request #46 from ukfast/master
Merge in UKFast Master
2 parents ef455d7 + 759b25c commit 30de55e

File tree

7 files changed

+20
-32
lines changed

7 files changed

+20
-32
lines changed

src/eCloud/Client.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ public function iops()
8484
return (new IopsClient($this->httpClient))->auth($this->token);
8585
}
8686

87+
/**
88+
* @return BaseClient
89+
*/
90+
public function ipAddresses()
91+
{
92+
return (new IpAddressesClient($this->httpClient))->auth($this->token);
93+
}
94+
8795
/**
8896
* @return BaseClient
8997
*/
@@ -92,7 +100,6 @@ public function appliances()
92100
return (new ApplianceClient($this->httpClient))->auth($this->token);
93101
}
94102

95-
96103
/**
97104
* eCloud v2
98105
*/
@@ -313,14 +320,6 @@ public function loadBalancerSpecs()
313320
return (new LoadBalancerSpecClient($this->httpClient))->auth($this->token);
314321
}
315322

316-
/**
317-
* @return BaseClient
318-
*/
319-
public function loadBalancerNetworks()
320-
{
321-
return (new LoadBalancerNetworkClient($this->httpClient))->auth($this->token);
322-
}
323-
324323
/**
325324
* @return BaseClient
326325
*/

src/eCloud/Entities/LoadBalancerNetwork.php renamed to src/eCloud/Entities/IpAddress.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
/**
88
* @property string $id
99
* @property string $name
10-
* @property string $loadBalancerId
10+
* @property string $ipAddress
1111
* @property string $networkId
12-
* @property string $sync
1312
* @property string $createdAt
1413
* @property string $updatedAt
1514
*/
16-
class LoadBalancerNetwork extends Entity
15+
class IpAddress extends Entity
1716
{
1817
protected $dates = ['createdAt', 'updatedAt'];
1918
}

src/eCloud/Entities/LoadBalancer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @property string $name
1010
* @property string $vpcId
1111
* @property string $availabilityZoneId
12+
* @property string $networkId
1213
* @property string $specId
1314
* @property int $configId
1415
* @property string $sync

src/eCloud/Entities/Vip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* @property string $id
99
* @property string $name
10-
* @property string $loadBalancerNetworkId
10+
* @property string $loadBalancerId
1111
* @property string $ipAddressId
1212
* @property integer $configId
1313
* @property string $sync

src/eCloud/LoadBalancerNetworkClient.php renamed to src/eCloud/IpAddressesClient.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,32 @@
33
namespace UKFast\SDK\eCloud;
44

55
use UKFast\SDK\Entities\ClientEntityInterface;
6+
7+
use UKFast\SDK\eCloud\Entities\IpAddress;
68
use UKFast\SDK\Traits\PageItems;
7-
use UKFast\SDK\eCloud\Entities\LoadBalancerNetwork;
89

9-
class LoadBalancerNetworkClient extends Client implements ClientEntityInterface
10+
class IpAddressesClient extends Client implements ClientEntityInterface
1011
{
1112
use PageItems;
1213

13-
protected $collectionPath = 'v2/load-balancer-networks';
14+
private $collectionPath = "v2/ip-addresses";
1415

1516
public function getEntityMap()
1617
{
1718
return [
1819
'id' => 'id',
1920
'name' => 'name',
20-
'load_balancer_id' => 'loadBalancerId',
21+
'ip_address' => 'ipAddress',
2122
'network_id' => 'networkId',
22-
'sync' => 'sync',
2323
'created_at' => 'createdAt',
2424
'updated_at' => 'updatedAt',
2525
];
2626
}
2727

2828
public function loadEntity($data)
2929
{
30-
return new LoadBalancerNetwork(
30+
return new IpAddress(
3131
$this->apiToFriendly($data, $this->getEntityMap())
3232
);
3333
}
34-
35-
public function getAllByLoadBalancerId($id)
36-
{
37-
return $this->getAll([
38-
'load_balancer_id' => $id
39-
]);
40-
}
4134
}

src/eCloud/LoadBalancerClient.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function getEntityMap()
1919
'name' => 'name',
2020
'vpc_id' => 'vpcId',
2121
'availability_zone_id' => 'availabilityZoneId',
22+
'network_id' => 'networkId',
2223
'load_balancer_spec_id' => 'specId',
2324
'config_id' => 'configId',
2425
'sync' => 'sync',
@@ -33,9 +34,4 @@ public function loadEntity($data)
3334
$this->apiToFriendly($data, $this->getEntityMap())
3435
);
3536
}
36-
37-
public function getNetworks($id)
38-
{
39-
return $this->loadBalancerNetworks()->getAllByLoadBalancerId($id);
40-
}
4137
}

src/eCloud/VipClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function getEntityMap()
1717
return [
1818
'id' => 'id',
1919
'name' => 'name',
20-
'load_balancer_network_id' => 'loadBalancerNetworkId',
20+
'load_balancer_id' => 'loadBalancerId',
2121
'ip_address_id' => 'ipAddressId',
2222
'config_id' => 'configId',
2323
'sync' => 'sync',

0 commit comments

Comments
 (0)