Skip to content

Commit

Permalink
Merge pull request #540 from DawidVH/ecloud-instance-backup-properties
Browse files Browse the repository at this point in the history
support for new eCloud Instance backup properties
  • Loading branch information
DawidVH authored Dec 2, 2024
2 parents 1b06b5b + 1f01b2e commit 4d93795
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 24 deletions.
29 changes: 29 additions & 0 deletions src/eCloud/Entities/Instance.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* @property boolean $online
* @property boolean $agentRunning
* @property boolean $backupEnabled
* @property boolean $backupVmEnabled
* @property boolean $backupAgentEnabled
* @property boolean $isEncrypted
* @property string $hostGroupId
* @property string $volumeGroupId
Expand All @@ -30,4 +32,31 @@
class Instance extends Entity
{
protected $dates = ['createdAt', 'updatedAt'];

public static $entityMap = [
'id' => 'id',
'name' => 'name',
'vpc_id' => 'vpcId',
'availability_zone_id' => 'availabilityZoneId',
'image_id' => 'imageId',
'platform' => 'platform',
'vcpu_cores' => 'vcpuCores',
'vcpu_sockets' => 'vcpuSockets',
'vcpu_cores_per_socket' => 'vcpuCoresPerSocket',
'ram_capacity' => 'ramCapacity',
'volume_capacity' => 'volumeCapacity',
'locked' => 'locked',
'status' => 'status',
'online' => 'online',
'agent_running' => 'agentRunning',
'backup_enabled' => 'backupEnabled',
'backup_vm_enabled' => 'backupVmEnabled',
'backup_agent_enabled' => 'backupAgentEnabled',
'backup_gateway_id' => 'backupGatewayId',
'is_encrypted' => 'isEncrypted',
'host_group_id' => 'hostGroupId',
'volume_group_id' => 'volumeGroupId',
'created_at' => 'createdAt',
'updated_at' => 'updatedAt',
];
}
25 changes: 1 addition & 24 deletions src/eCloud/InstanceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,7 @@ class InstanceClient extends Client implements ClientEntityInterface

public function getEntityMap()
{
return [
'id' => 'id',
'name' => 'name',
'vpc_id' => 'vpcId',
'availability_zone_id' => 'availabilityZoneId',
'image_id' => 'imageId',
'platform' => 'platform',
'vcpu_cores' => 'vcpuCores',
'vcpu_sockets' => 'vcpuSockets',
'vcpu_cores_per_socket' => 'vcpuCoresPerSocket',
'ram_capacity' => 'ramCapacity',
'volume_capacity' => 'volumeCapacity',
'locked' => 'locked',
'status' => 'status',
'online' => 'online',
'agent_running' => 'agentRunning',
'backup_enabled' => 'backupEnabled',
'backup_gateway_id' => 'backupGatewayId',
'is_encrypted' => 'isEncrypted',
'host_group_id' => 'hostGroupId',
'volume_group_id' => 'volumeGroupId',
'created_at' => 'createdAt',
'updated_at' => 'updatedAt',
];
return Instance::$entityMap;
}

public function loadEntity($data)
Expand Down

0 comments on commit 4d93795

Please sign in to comment.