Updated partition and image input
testing/ogcore-api/pipeline/head This commit looks good
Details
testing/ogcore-api/pipeline/head This commit looks good
Details
parent
4759f3e24f
commit
f8bfffebf1
|
@ -72,9 +72,18 @@ final class ImageInput
|
|||
$this->revision = $image->getRevision();
|
||||
$this->info = $image->getInfo();
|
||||
$this->size = $image->getSize();
|
||||
$this->client = new ClientOutput($image->getClient());
|
||||
$this->softwareProfile = new SoftwareProfileOutput($image->getSoftwareProfile());
|
||||
$this->organizationalUnit = new OrganizationalUnitOutput($image->getOrganizationalUnit());
|
||||
|
||||
if ($image->getClient()) {
|
||||
$this->client = new ClientOutput($image->getClient());
|
||||
}
|
||||
|
||||
if ($image->getSoftwareProfile()) {
|
||||
$this->softwareProfile = new SoftwareProfileOutput($image->getSoftwareProfile());
|
||||
}
|
||||
|
||||
if ($image->getOrganizationalUnit()) {
|
||||
$this->organizationalUnit = new OrganizationalUnitOutput($image->getOrganizationalUnit());
|
||||
}
|
||||
}
|
||||
|
||||
public function createOrUpdateEntity(?Image $image = null): Image
|
||||
|
|
|
@ -40,7 +40,6 @@ final class PartitionInput
|
|||
#[ApiProperty(description: 'The filesystem of the partition', example: "filesystem")]
|
||||
public ?string $filesystem = null;
|
||||
|
||||
#[Assert\NotNull()]
|
||||
#[Groups(['partition:write'])]
|
||||
#[ApiProperty(description: 'The operative system name of the partition', example: "Ubuntu")]
|
||||
public ?OperativeSystemOutput $operativeSystem = null;
|
||||
|
@ -71,10 +70,19 @@ final class PartitionInput
|
|||
$this->size = $partition->getSize();
|
||||
$this->cacheContent = $partition->getCacheContent();
|
||||
$this->filesystem = $partition->getFilesystem();
|
||||
$this->operativeSystem = new OperativeSystemOutput($partition->getOperativeSystem());
|
||||
$this->client = new ClientOutput($partition->getClient());
|
||||
|
||||
if ($partition->getOperativeSystem()) {
|
||||
$this->operativeSystem = new OperativeSystemOutput($partition->getOperativeSystem());
|
||||
}
|
||||
|
||||
if ($partition->getClient()) {
|
||||
$this->client = new ClientOutput($partition->getClient());
|
||||
}
|
||||
$this->memoryUsage = $partition->getMemoryUsage();
|
||||
$this->image = new ImageOutput($partition->getImage());
|
||||
|
||||
if ($partition->getImage()) {
|
||||
$this->image = new ImageOutput($partition->getImage());
|
||||
}
|
||||
}
|
||||
|
||||
public function createOrUpdateEntity(?Partition $partition = null): Partition
|
||||
|
|
|
@ -54,8 +54,8 @@ final class ImageOutput extends AbstractOutput
|
|||
$this->revision = $image->getRevision();
|
||||
$this->info = $image->getInfo();
|
||||
$this->size = $image->getSize();
|
||||
$this->clientOutput = new ClientOutput($image->getClient());
|
||||
$this->softwareProfile = new SoftwareProfileOutput($image->getSoftwareProfile());
|
||||
$this->organizationalUnit = new OrganizationalUnitOutput($image->getOrganizationalUnit());
|
||||
$this->clientOutput = $image->getClient() ? new ClientOutput($image->getClient()) : null;
|
||||
$this->softwareProfile = $image->getSoftwareProfile() ? new SoftwareProfileOutput($image->getSoftwareProfile()) : null;
|
||||
$this->organizationalUnit = $image->getOrganizationalUnit() ? new OrganizationalUnitOutput($image->getOrganizationalUnit()) : null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue