Skip to content

Commit 4d93795

Browse files
authored
Merge pull request #540 from DawidVH/ecloud-instance-backup-properties
support for new eCloud Instance backup properties
2 parents 1b06b5b + 1f01b2e commit 4d93795

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

src/eCloud/Entities/Instance.php

+29
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* @property boolean $online
2222
* @property boolean $agentRunning
2323
* @property boolean $backupEnabled
24+
* @property boolean $backupVmEnabled
25+
* @property boolean $backupAgentEnabled
2426
* @property boolean $isEncrypted
2527
* @property string $hostGroupId
2628
* @property string $volumeGroupId
@@ -30,4 +32,31 @@
3032
class Instance extends Entity
3133
{
3234
protected $dates = ['createdAt', 'updatedAt'];
35+
36+
public static $entityMap = [
37+
'id' => 'id',
38+
'name' => 'name',
39+
'vpc_id' => 'vpcId',
40+
'availability_zone_id' => 'availabilityZoneId',
41+
'image_id' => 'imageId',
42+
'platform' => 'platform',
43+
'vcpu_cores' => 'vcpuCores',
44+
'vcpu_sockets' => 'vcpuSockets',
45+
'vcpu_cores_per_socket' => 'vcpuCoresPerSocket',
46+
'ram_capacity' => 'ramCapacity',
47+
'volume_capacity' => 'volumeCapacity',
48+
'locked' => 'locked',
49+
'status' => 'status',
50+
'online' => 'online',
51+
'agent_running' => 'agentRunning',
52+
'backup_enabled' => 'backupEnabled',
53+
'backup_vm_enabled' => 'backupVmEnabled',
54+
'backup_agent_enabled' => 'backupAgentEnabled',
55+
'backup_gateway_id' => 'backupGatewayId',
56+
'is_encrypted' => 'isEncrypted',
57+
'host_group_id' => 'hostGroupId',
58+
'volume_group_id' => 'volumeGroupId',
59+
'created_at' => 'createdAt',
60+
'updated_at' => 'updatedAt',
61+
];
3362
}

src/eCloud/InstanceClient.php

+1-24
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,7 @@ class InstanceClient extends Client implements ClientEntityInterface
1515

1616
public function getEntityMap()
1717
{
18-
return [
19-
'id' => 'id',
20-
'name' => 'name',
21-
'vpc_id' => 'vpcId',
22-
'availability_zone_id' => 'availabilityZoneId',
23-
'image_id' => 'imageId',
24-
'platform' => 'platform',
25-
'vcpu_cores' => 'vcpuCores',
26-
'vcpu_sockets' => 'vcpuSockets',
27-
'vcpu_cores_per_socket' => 'vcpuCoresPerSocket',
28-
'ram_capacity' => 'ramCapacity',
29-
'volume_capacity' => 'volumeCapacity',
30-
'locked' => 'locked',
31-
'status' => 'status',
32-
'online' => 'online',
33-
'agent_running' => 'agentRunning',
34-
'backup_enabled' => 'backupEnabled',
35-
'backup_gateway_id' => 'backupGatewayId',
36-
'is_encrypted' => 'isEncrypted',
37-
'host_group_id' => 'hostGroupId',
38-
'volume_group_id' => 'volumeGroupId',
39-
'created_at' => 'createdAt',
40-
'updated_at' => 'updatedAt',
41-
];
18+
return Instance::$entityMap;
4219
}
4320

4421
public function loadEntity($data)

0 commit comments

Comments
 (0)