-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |