Update Ip.php

push changes that didnt come through from test env
This commit is contained in:
Tony Roy 2021-03-11 23:00:11 -04:00 committed by GitHub
commit 2fbd9ab040
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,57 +5,52 @@ namespace wickedsoft\NetBox\Api;
class Ip extends AbstractApi
{
/**
* @see https://www.hostfact.nl/developer/api/crediteuren/add
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params)
public function add($params=[])
{
return $this->post(array_merge(['controller' => 'creditor', 'action' => 'add'], $params));
return $this->post("/ipam/ip-addresses/", $params);
}
/**
* @see https://www.hostfact.nl/developer/api/crediteuren/delete
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function delete($params)
public function delete($id, $params=[])
{
return $this->post(array_merge(['controller' => 'creditor', 'action' => 'delete'], $params));
return $this->delete("/ipam/ip-addresses/".$id."/", $params);
}
/**
* @see https://www.hostfact.nl/developer/api/crediteuren/edit
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($params)
public function edit($id, $params=[])
{
return $this->post(array_merge(['controller' => 'creditor', 'action' => 'edit'], $params));
return $this->put("/ipam/ip-addresses/".$id."/", $params);
}
/**
* @see https://www.hostfact.nl/developer/api/crediteuren/list
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params)
public function list($params=[])
{
return $this->post(array_merge(['controller' => 'creditor', 'action' => 'list'], $params));
return $this->get("/ipam/ip-addresses/", $params);
}
/**
* @see https://www.hostfact.nl/developer/api/crediteuren/show
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($params)
public function show($id, $params=[])
{
return $this->post(array_merge(['controller' => 'creditor', 'action' => 'show'], $params));
return $this->get("/ipam/ip-addresses/".$id."/", $params);
}
}