Skip to content

Commit 79074ef

Browse files
Merge pull request #9 from shellrent/new-api
New API calls: Organizations, all Sites and Backup Servers
2 parents e93d7fa + a5e0fdc commit 79074ef

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

src/Repositories/BackupServerRepository.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@ public function getBackupRepository( string $backupServerUid, string $repository
2727
public function getAllJobs(): RequestBuilder {
2828
return $this->createGetRequest( '/jobs' );
2929
}
30+
31+
public function getBackupServer( string $backupServerUid ): RequestBuilder {
32+
return $this->createGetRequest( sprintf('/%s', $backupServerUid ) );
33+
}
3034
}

src/Repositories/CompanyRepository.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ public function getAll(): RequestBuilder {
3333
return $this->createGetRequest( '/' );
3434
}
3535

36+
public function getAllSites( string $companyUid ): RequestBuilder {
37+
return $this->createGetRequest( sprintf( '/%s/sites', $companyUid ) );
38+
}
39+
3640
public function getAllCompanyBackupResources( string $companyUid, string $siteUid ): RequestBuilder {
3741
return $this->createGetRequest( sprintf( '/%s/sites/%s/backupResources', $companyUid, $siteUid ) );
3842
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Shellrent\VeeamVspcApiClient\Repositories;
4+
5+
use Shellrent\VeeamVspcApiClient\Support\CreateGetRequest;
6+
use Shellrent\VeeamVspcApiClient\Support\RequestBuilder;
7+
8+
class OrganizationRepository implements Repository {
9+
use CreateGetRequest;
10+
11+
public function getBaseRoute(): string {
12+
return 'organizations';
13+
}
14+
15+
public function getOrganization( string $organizationUid ): RequestBuilder {
16+
return $this->createGetRequest( sprintf( '/%s', $organizationUid ) );
17+
}
18+
}

0 commit comments

Comments
 (0)