Add Class for IPAM > ASN
This commit is contained in:
parent
e4aff09750
commit
0d1b5231ae
1 changed files with 73 additions and 0 deletions
73
src/Api/IPAM/Asns.php
Normal file
73
src/Api/IPAM/Asns.php
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
namespace port389\NetBox\Api\IPAM;
|
||||
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use port389\NetBox\Api\AbstractApi;
|
||||
|
||||
class Asns extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/asns/", $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/asns/" . $id . "/", $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/asns/" . $id . "/", $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/asns/" . $id . "/", $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/asns/", $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/asns/" . $id . "/", $params);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue