Add support for more server functionality
This commit is contained in:
parent
acbc52506c
commit
5144e0126b
16 changed files with 1049 additions and 119 deletions
|
@ -93,4 +93,36 @@ class ServerRepository extends BaseRepository implements ServerRepositoryInterfa
|
|||
'json' => $data,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function reinstall()
|
||||
{
|
||||
return $this->getHttpClient()->request('POST', '/server/reinstall');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rebuild()
|
||||
{
|
||||
return $this->getHttpClient()->request('POST', '/server/rebuild');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function suspend()
|
||||
{
|
||||
return $this->getHttpClient()->request('POST', '/server/suspend');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function unsuspend()
|
||||
{
|
||||
return $this->getHttpClient()->request('POST', '/server/unsuspend');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,4 +76,26 @@ class LocationRepository extends EloquentRepository implements LocationRepositor
|
|||
|
||||
return $location->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function allWithDetails()
|
||||
{
|
||||
return $this->getBuilder()->withCount('nodes', 'servers')->get($this->getColumns());
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getWithNodes($id)
|
||||
{
|
||||
$instance = $this->getBuilder()->with('nodes.servers')->find($id, $this->getColumns());
|
||||
|
||||
if (! $instance) {
|
||||
throw new RecordNotFoundException();
|
||||
}
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue