Skip to content

Commit

Permalink
added extra arguments to some endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
kriosmane committed Feb 11, 2019
1 parent 9897903 commit 1f18207
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions src/HiveOs.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,42 +312,46 @@ public function deleteFarm($farm_id)
* Farm's statistics
*
* @param int $farm_id
* @param array $params
*
* @return KriosMane\HiveOs\HiveResponse
*/
public function getFarmStats($farm_id)
public function getFarmStats($farm_id, $params = [])
{
return $this->request('GET', 'farms/'.$farm_id.'/stats');
return $this->request('GET', 'farms/'.$farm_id.'/stats', $params);
}

/**
* Farm's metrics
*
* @param int $farm_id
* @param array $params
*
* @return KriosMane\HiveOs\HiveResponse
*/
public function getFarmMetrics($farm_id)
public function getFarmMetrics($farm_id, $params = [])
{
return $this->request('GET', 'farms/'.$farm_id.'/metrics');
return $this->request('GET', 'farms/'.$farm_id.'/metrics', $params);
}

/**
* Farm events
*
* @param int $farm_id Farm ID
* @param array $params
*
* @return KriosMane\HiveOs\HiveResponse
*/
public function events($farm_id)
public function events($farm_id, $params = [])
{
return $this->request('GET', 'farms/'.$farm_id.'/events');
return $this->request('GET', 'farms/'.$farm_id.'/events', $params);
}

/**
* List farm's workers
*
* @param integer $farm_id
* @param array $params
*
* @return KriosMane\HiveOs\HiveResponse
*/
Expand Down Expand Up @@ -525,12 +529,13 @@ public function getWorkerMinerLog($farm_id, $workers_id)
*
* @param int $farm_id
* @param int $worker_id
* @param array $params
*
* @return KriosMane\HiveOs\HiveResponse
*/
public function getWorkerMessages($farm_id, $worker_id)
public function getWorkerMessages($farm_id, $worker_id, $params = [])
{
return $this->request('GET', 'farms/'.$farm_id.'/workers/'.$worker_id.'/messages');
return $this->request('GET', 'farms/'.$farm_id.'/workers/'.$worker_id.'/messages', $params);
}

/**
Expand All @@ -552,12 +557,13 @@ public function getWorkerMessage($farm_id, $worker_id, $message_id)
*
* @param int $farm_id
* @param int $worker_id
* @param array $params
*
* @return KriosMane\HiveOs\HiveResponse
*/
public function getWorkerMetrics($farm_id, $worker_id)
public function getWorkerMetrics($farm_id, $worker_id, $params = [])
{
return $this->request('GET', 'farms/'.$farm_id.'/workers/'.$worker_id.'/metrics');
return $this->request('GET', 'farms/'.$farm_id.'/workers/'.$worker_id.'/metrics', $params);
}

/**
Expand Down Expand Up @@ -835,12 +841,13 @@ public function algos()
* Returns tags that belong to given farm along with tags that belong to farm’s owner
*
* @param int $farm_id
* @param array $params
*
* @return @return KriosMane\HiveOs\HiveResponse
*/
public function tags($farm_id)
public function tags($farm_id, $params = [])
{
return $this->request('GET', 'farms/'.$farm_id.'/tags');
return $this->request('GET', 'farms/'.$farm_id.'/tags', $params);
}

/**
Expand Down

0 comments on commit 1f18207

Please sign in to comment.