Skip to content

Commit

Permalink
Merge pull request #9 from shellrent/new-api
Browse files Browse the repository at this point in the history
New API calls: Organizations, all Sites and Backup Servers
  • Loading branch information
svdigital-development authored Aug 27, 2024
2 parents e93d7fa + a5e0fdc commit 79074ef
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Repositories/BackupServerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ public function getBackupRepository( string $backupServerUid, string $repository
public function getAllJobs(): RequestBuilder {
return $this->createGetRequest( '/jobs' );
}

public function getBackupServer( string $backupServerUid ): RequestBuilder {
return $this->createGetRequest( sprintf('/%s', $backupServerUid ) );
}
}
4 changes: 4 additions & 0 deletions src/Repositories/CompanyRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public function getAll(): RequestBuilder {
return $this->createGetRequest( '/' );
}

public function getAllSites( string $companyUid ): RequestBuilder {
return $this->createGetRequest( sprintf( '/%s/sites', $companyUid ) );
}

public function getAllCompanyBackupResources( string $companyUid, string $siteUid ): RequestBuilder {
return $this->createGetRequest( sprintf( '/%s/sites/%s/backupResources', $companyUid, $siteUid ) );
}
Expand Down
18 changes: 18 additions & 0 deletions src/Repositories/OrganizationRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Shellrent\VeeamVspcApiClient\Repositories;

use Shellrent\VeeamVspcApiClient\Support\CreateGetRequest;
use Shellrent\VeeamVspcApiClient\Support\RequestBuilder;

class OrganizationRepository implements Repository {
use CreateGetRequest;

public function getBaseRoute(): string {
return 'organizations';
}

public function getOrganization( string $organizationUid ): RequestBuilder {
return $this->createGetRequest( sprintf( '/%s', $organizationUid ) );
}
}

0 comments on commit 79074ef

Please sign in to comment.