Clean & reformat code
This commit is contained in:
parent
9e323171fd
commit
5180bf1d38
88 changed files with 4317 additions and 4408 deletions
|
|
@ -5,72 +5,71 @@ namespace Hosterra\NetBox\Api;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Client;
|
||||
|
||||
abstract class AbstractApi implements ApiInterface
|
||||
{
|
||||
/** @var Client */
|
||||
public $client;
|
||||
abstract class AbstractApi implements ApiInterface {
|
||||
/** @var Client */
|
||||
public $client;
|
||||
|
||||
/**
|
||||
* AbstractApi constructor.
|
||||
* @param Client $client
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
/**
|
||||
* AbstractApi constructor.
|
||||
*
|
||||
* @param Client $client
|
||||
*/
|
||||
public function __construct( Client $client ) {
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function get($path, array $parameters)
|
||||
{
|
||||
return $this->client->getHttpClient()->get($path, $parameters);
|
||||
}
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function get( $path, array $parameters ) {
|
||||
return $this->client->getHttpClient()->get( $path, $parameters );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function post($path, array $parameters): array
|
||||
{
|
||||
return $this->client->getHttpClient()->post($path, $parameters);
|
||||
}
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function post( $path, array $parameters ): array {
|
||||
return $this->client->getHttpClient()->post( $path, $parameters );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function put($path, array $parameters): array
|
||||
{
|
||||
return $this->client->getHttpClient()->put($path, $parameters);
|
||||
}
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function put( $path, array $parameters ): array {
|
||||
return $this->client->getHttpClient()->put( $path, $parameters );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function patch($path, array $parameters): array
|
||||
{
|
||||
return $this->client->getHttpClient()->patch($path, $parameters);
|
||||
}
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function patch( $path, array $parameters ): array {
|
||||
return $this->client->getHttpClient()->patch( $path, $parameters );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function delete($path, array $parameters): bool
|
||||
{
|
||||
return $this->client->getHttpClient()->delete($path, $parameters);
|
||||
}
|
||||
/**
|
||||
* @param $path
|
||||
* @param array $parameters
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
protected function delete( $path, array $parameters ): bool {
|
||||
return $this->client->getHttpClient()->delete( $path, $parameters );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Hosterra\NetBox\Api;
|
||||
|
||||
interface ApiInterface
|
||||
{
|
||||
interface ApiInterface {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Circuits;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class CircuitTerminations extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/circuits/circuit-terminations/", $params);
|
||||
}
|
||||
class CircuitTerminations extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/circuits/circuit-terminations/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/circuits/circuit-terminations/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/circuits/circuit-terminations/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/circuits/circuit-terminations/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/circuits/circuit-terminations/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/circuits/circuit-terminations/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/circuits/circuit-terminations/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/circuits/circuit-terminations/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/circuits/circuit-terminations/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/circuits/circuit-terminations/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/circuits/circuit-terminations/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Circuits;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class CircuitTypes extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/circuits/circuit-types/", $params);
|
||||
}
|
||||
class CircuitTypes extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/circuits/circuit-types/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/circuits/circuit-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/circuits/circuit-types/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/circuits/circuit-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/circuits/circuit-types/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/circuits/circuit-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/circuits/circuit-types/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/circuits/circuit-types/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/circuits/circuit-types/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/circuits/circuit-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/circuits/circuit-types/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Circuits;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Circuits extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/circuits/circuits/", $params);
|
||||
}
|
||||
class Circuits extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/circuits/circuits/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/circuits/circuits/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/circuits/circuits/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/circuits/circuits/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/circuits/circuits/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/circuits/circuits/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/circuits/circuits/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/circuits/circuits/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/circuits/circuits/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/circuits/circuits/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/circuits/circuits/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Circuits;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Providers extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/circuits/providers/", $params);
|
||||
}
|
||||
class Providers extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/circuits/providers/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/circuits/providers/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/circuits/providers/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/circuits/providers/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/circuits/providers/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/circuits/providers/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/circuits/providers/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/circuits/providers/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/circuits/providers/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/circuits/providers/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/circuits/providers/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Cables extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/cables/", $params);
|
||||
}
|
||||
class Cables extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/cables/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/cables/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/cables/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/cables/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/cables/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/cables/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/cables/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/cables/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/cables/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ConnectedDevices extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/connected-device/", $params);
|
||||
}
|
||||
class ConnectedDevices extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/connected-device/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ConsoleConnections extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-connections/", $params);
|
||||
}
|
||||
class ConsoleConnections extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/console-connections/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ConsolePortTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/console-port-templates/", $params);
|
||||
}
|
||||
class ConsolePortTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/console-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/console-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/console-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/console-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/console-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-port-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/console-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/console-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ConsolePorts extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/console-ports/", $params);
|
||||
}
|
||||
class ConsolePorts extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/console-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/console-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/console-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/console-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/console-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-ports/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/console-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/console-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-ports/" . $id . "/trace/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/console-ports/" . $id . "/trace/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ConsoleServerPortTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/console-server-port-templates/", $params);
|
||||
}
|
||||
class ConsoleServerPortTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/console-server-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/console-server-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/console-server-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/console-server-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/console-server-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-server-port-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/console-server-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-server-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/console-server-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ConsoleServerPorts extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/console-server-ports/", $params);
|
||||
}
|
||||
class ConsoleServerPorts extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/console-server-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/console-server-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/console-server-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/console-server-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/console-server-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-server-ports/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/console-server-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/console-server-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/console-server-ports/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class DeviceBayTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/device-bay-templates/", $params);
|
||||
}
|
||||
class DeviceBayTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/device-bay-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/device-bay-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/device-bay-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/device-bay-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/device-bay-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/device-bay-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/device-bay-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/device-bay-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/device-bay-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class DeviceBays extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/device-bays/", $params);
|
||||
}
|
||||
class DeviceBays extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/device-bays/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/device-bays/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/device-bays/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/device-bays/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/device-bays/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/device-bays/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/device-bays/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/device-bays/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/device-bays/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class DeviceRoles extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/device-roles/", $params);
|
||||
}
|
||||
class DeviceRoles extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/device-roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/device-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/device-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/device-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/device-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/device-roles/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/device-roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/device-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/device-roles/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class DeviceTypes extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/device-types/", $params);
|
||||
}
|
||||
class DeviceTypes extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/device-types/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/device-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/device-types/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/device-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/device-types/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/device-types/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/device-types/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/device-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/device-types/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Devices extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/devices/", $params);
|
||||
}
|
||||
class Devices extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/devices/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/devices/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/devices/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/devices/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/devices/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/devices/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/devices/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/devices/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/devices/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function napalm(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/devices/" . $id . "/napalm/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function napalm( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/devices/" . $id . "/napalm/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class FrontPortTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/front-port-templates/", $params);
|
||||
}
|
||||
class FrontPortTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/front-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/front-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/front-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/front-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/front-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/front-port-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/front-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/front-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/front-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class FrontPorts extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/front-ports/", $params);
|
||||
}
|
||||
class FrontPorts extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/front-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/front-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/front-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/front-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/front-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/front-ports/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/front-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/front-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/front-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function paths(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/front-ports/" . $id . "/paths/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function paths( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/front-ports/" . $id . "/paths/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class InterfaceConnections extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/interface-connections/", $params);
|
||||
}
|
||||
class InterfaceConnections extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/interface-connections/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class InterfaceTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/interface-templates/", $params);
|
||||
}
|
||||
class InterfaceTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/interface-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/interface-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/interface-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/interface-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/interface-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/interface-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/interface-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/interface-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/interface-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Interfaces extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/interfaces/", $params);
|
||||
}
|
||||
class Interfaces extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/interfaces/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/interfaces/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/interfaces/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/interfaces/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/interfaces/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/interfaces/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/interfaces/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/interfaces/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/interfaces/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/interfaces/" . $id . "/trace/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/interfaces/" . $id . "/trace/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class InventoryItems extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/inventory-items/", $params);
|
||||
}
|
||||
class InventoryItems extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/inventory-items/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/inventory-items/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/inventory-items/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/inventory-items/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/inventory-items/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/inventory-items/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/inventory-items/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/inventory-items/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/inventory-items/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Manufacturers extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/manufacturers/", $params);
|
||||
}
|
||||
class Manufacturers extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/manufacturers/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/manufacturers/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/manufacturers/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/manufacturers/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/manufacturers/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/manufacturers/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/manufacturers/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/manufacturers/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/manufacturers/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ModuleBays extends AbstractApi
|
||||
{
|
||||
class ModuleBays extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/module-bays/", $params);
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/module-bays/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/module-bays/" . $id . "/", $params);
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/module-bays/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/module-bays/" . $id . "/", $params);
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/module-bays/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/dcim/module-bays/" . $id . "/", $params);
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/dcim/module-bays/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/module-bays/", $params);
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/module-bays/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/module-bays/" . $id . "/", $params);
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/module-bays/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Modules extends AbstractApi
|
||||
{
|
||||
class Modules extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/modules/", $params);
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/modules/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/modules/" . $id . "/", $params);
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/modules/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/modules/" . $id . "/", $params);
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/modules/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/dcim/modules/" . $id . "/", $params);
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/dcim/modules/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/modules/", $params);
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/modules/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/modules/" . $id . "/", $params);
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/modules/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Platforms extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/platforms/", $params);
|
||||
}
|
||||
class Platforms extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/platforms/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/platforms/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/platforms/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/platforms/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/platforms/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/platforms/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/platforms/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/platforms/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/platforms/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class PowerFeeds extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/power-feeds/", $params);
|
||||
}
|
||||
class PowerFeeds extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/power-feeds/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/power-feeds/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/power-feeds/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/power-feeds/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/power-feeds/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-feeds/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/power-feeds/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-feeds/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-feeds/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-feeds/" . $id . "/trace/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-feeds/" . $id . "/trace/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class PowerOutletTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/power-outlet-templates/", $params);
|
||||
}
|
||||
class PowerOutletTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/power-outlet-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/power-outlet-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/power-outlet-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/power-outlet-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/power-outlet-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-outlet-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/power-outlet-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-outlet-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-outlet-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class PowerOutlets extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/power-outlets/", $params);
|
||||
}
|
||||
class PowerOutlets extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/power-outlets/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/power-outlets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/power-outlets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/power-outlets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/power-outlets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-outlets/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/power-outlets/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-outlets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-outlets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-outlets/" . $id . "/trace/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-outlets/" . $id . "/trace/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class PowerPanels extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/power-panels/", $params);
|
||||
}
|
||||
class PowerPanels extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/power-panels/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/power-panels/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/power-panels/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/power-panels/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/power-panels/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-panels/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/power-panels/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-panels/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-panels/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class PowerPortTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/power-port-templates/", $params);
|
||||
}
|
||||
class PowerPortTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/power-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/power-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/power-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/power-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/power-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-port-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/power-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class PowerPorts extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/power-ports/", $params);
|
||||
}
|
||||
class PowerPorts extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/power-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/power-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/power-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/power-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/power-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-ports/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/power-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/power-ports/" . $id . "/trace/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function trace( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/power-ports/" . $id . "/trace/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class RackGroups extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/rack-groups/", $params);
|
||||
}
|
||||
class RackGroups extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/rack-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/rack-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/rack-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/rack-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/rack-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rack-groups/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/rack-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rack-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/rack-groups/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class RackReservations extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/rack-reservations/", $params);
|
||||
}
|
||||
class RackReservations extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/rack-reservations/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/rack-reservations/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/rack-reservations/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/rack-reservations/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/rack-reservations/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rack-reservations/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/rack-reservations/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rack-reservations/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/rack-reservations/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class RackRoles extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/rack-roles/", $params);
|
||||
}
|
||||
class RackRoles extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/rack-roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/rack-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/rack-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/rack-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/rack-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rack-roles/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/rack-roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rack-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/rack-roles/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Racks extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/racks/", $params);
|
||||
}
|
||||
class Racks extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/racks/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/racks/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/racks/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/racks/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/racks/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/racks/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/racks/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/racks/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/racks/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function elevation(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/racks/" . $id . "/elevation/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function elevation( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/racks/" . $id . "/elevation/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class RearPortTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/rear-port-templates/", $params);
|
||||
}
|
||||
class RearPortTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/rear-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/rear-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/rear-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/rear-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/rear-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rear-port-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/rear-port-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rear-port-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/rear-port-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class RearPorts extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/rear-ports/", $params);
|
||||
}
|
||||
class RearPorts extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/rear-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/rear-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/rear-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/rear-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/rear-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rear-ports/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/rear-ports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rear-ports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/rear-ports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function paths(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/rear-ports/" . $id . "/paths/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function paths( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/rear-ports/" . $id . "/paths/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Regions extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/regions/", $params);
|
||||
}
|
||||
class Regions extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/regions/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/regions/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/regions/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/regions/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/regions/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/regions/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/regions/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/regions/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/regions/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Sites extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/sites/", $params);
|
||||
}
|
||||
class Sites extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/sites/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/sites/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/sites/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/sites/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/sites/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/sites/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/sites/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/sites/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/sites/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class VirtualChassis extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/dcim/virtual-chassis/", $params);
|
||||
}
|
||||
class VirtualChassis extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/dcim/virtual-chassis/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/dcim/virtual-chassis/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/dcim/virtual-chassis/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/dcim/virtual-chassis/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/dcim/virtual-chassis/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/virtual-chassis/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/dcim/virtual-chassis/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/dcim/virtual-chassis/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/dcim/virtual-chassis/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ConfigContexts extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/extras/config-contexts/", $params);
|
||||
}
|
||||
class ConfigContexts extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/extras/config-contexts/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/extras/config-contexts/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/extras/config-contexts/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/extras/config-contexts/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/extras/config-contexts/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/extras/config-contexts/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/extras/config-contexts/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/config-contexts/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/config-contexts/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/config-contexts/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/config-contexts/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,26 +5,25 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ContentTypes extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/content-types/", $params);
|
||||
}
|
||||
class ContentTypes extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/content-types/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/content-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/content-types/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class CustomFields extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/extras/custom-fields/", $params);
|
||||
}
|
||||
class CustomFields extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/extras/custom-fields/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/extras/custom-fields/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/extras/custom-fields/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/extras/custom-fields/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/extras/custom-fields/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/extras/custom-fields/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/extras/custom-fields/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/custom-fields/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/custom-fields/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/custom-fields/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/custom-fields/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ExportTemplates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/extras/export-templates/", $params);
|
||||
}
|
||||
class ExportTemplates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/extras/export-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/extras/export-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/extras/export-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/extras/export-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/extras/export-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/extras/export-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/extras/export-templates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/export-templates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/export-templates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/export-templates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/export-templates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ImageAttachments extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/extras/image-attachments/", $params);
|
||||
}
|
||||
class ImageAttachments extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/extras/image-attachments/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/extras/image-attachments/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/extras/image-attachments/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/extras/image-attachments/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/extras/image-attachments/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/extras/image-attachments/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/extras/image-attachments/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/image-attachments/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/image-attachments/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/image-attachments/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/image-attachments/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,26 +5,25 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class JobResults extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/job-results/", $params);
|
||||
}
|
||||
class JobResults extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/job-results/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/job-results/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/job-results/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,26 +5,25 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ObjectChanges extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/object-changes/", $params);
|
||||
}
|
||||
class ObjectChanges extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/object-changes/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/object-changes/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/object-changes/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,37 +5,36 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Reports extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/reports/", $params);
|
||||
}
|
||||
class Reports extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/reports/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/reports/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/reports/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function run(int $id, array $params = []): array
|
||||
{
|
||||
return $this->post("/extras/reports/" . $id . "/run/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function run( int $id, array $params = [] ): array {
|
||||
return $this->post( "/extras/reports/" . $id . "/run/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,26 +5,25 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Scripts extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/scripts/", $params);
|
||||
}
|
||||
class Scripts extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/scripts/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/scripts/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/scripts/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Tags extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/extras/tags/", $params);
|
||||
}
|
||||
class Tags extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/extras/tags/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/extras/tags/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/extras/tags/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/extras/tags/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/extras/tags/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/extras/tags/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/extras/tags/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/extras/tags/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/extras/tags/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/extras/tags/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/extras/tags/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Aggregates extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/aggregates/", $params);
|
||||
}
|
||||
class Aggregates extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/aggregates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/aggregates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/aggregates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/aggregates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/aggregates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/aggregates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/aggregates/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/aggregates/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/aggregates/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/aggregates/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/aggregates/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\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);
|
||||
}
|
||||
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 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 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 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 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);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/asns/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class IpAddresses extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/ip-addresses/", $params);
|
||||
}
|
||||
class IpAddresses extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/ip-addresses/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/ip-addresses/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/ip-addresses/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/ip-addresses/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/ip-addresses/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/ip-addresses/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/ip-addresses/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/ip-addresses/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/ip-addresses/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/ip-addresses/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/ip-addresses/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,113 +5,112 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Prefixes extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/prefixes/", $params);
|
||||
}
|
||||
class Prefixes extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/prefixes/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/prefixes/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/prefixes/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/prefixes/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/prefixes/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/prefixes/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/prefixes/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/prefixes/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/prefixes/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/prefixes/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/prefixes/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function showAvailableIps(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/prefixes/" . $id . "/available-ips/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function showAvailableIps( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/prefixes/" . $id . "/available-ips/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function addAvailableIps(int $id, array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/prefixes/" . $id . "/available-ips/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function addAvailableIps( int $id, array $params = [] ): array {
|
||||
return $this->post( "/ipam/prefixes/" . $id . "/available-ips/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function showAvailable(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/prefixes/" . $id . "/available-prefixes/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function showAvailable( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/prefixes/" . $id . "/available-prefixes/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function addAvailable(int $id, array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/prefixes/" . $id . "/available-prefixes/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function addAvailable( int $id, array $params = [] ): array {
|
||||
return $this->post( "/ipam/prefixes/" . $id . "/available-prefixes/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Rirs extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/rirs/", $params);
|
||||
}
|
||||
class Rirs extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/rirs/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/rirs/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/rirs/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/rirs/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/rirs/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/rirs/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/rirs/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/rirs/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/rirs/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/rirs/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/rirs/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Roles extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/roles/", $params);
|
||||
}
|
||||
class Roles extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/roles/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/roles/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class RouteTargets extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/route-targets/", $params);
|
||||
}
|
||||
class RouteTargets extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/route-targets/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/route-targets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/route-targets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/route-targets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/route-targets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/route-targets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/route-targets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/route-targets/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/route-targets/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/route-targets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/route-targets/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Services extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/services/", $params);
|
||||
}
|
||||
class Services extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/services/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/services/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/services/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/services/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/services/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/services/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/services/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/services/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/services/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/services/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/services/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class VlanGroups extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/vlan-groups/", $params);
|
||||
}
|
||||
class VlanGroups extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/vlan-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/vlan-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/vlan-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/vlan-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/vlan-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/vlan-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/vlan-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/vlan-groups/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/vlan-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/vlan-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/vlan-groups/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Vlans extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/vlans/", $params);
|
||||
}
|
||||
class Vlans extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/vlans/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/vlans/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/vlans/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/vlans/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/vlans/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/vlans/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/vlans/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/vlans/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/vlans/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/vlans/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/vlans/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Vrfs extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/ipam/vrfs/", $params);
|
||||
}
|
||||
class Vrfs extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/ipam/vrfs/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/ipam/vrfs/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/ipam/vrfs/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/ipam/vrfs/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/ipam/vrfs/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/ipam/vrfs/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/ipam/vrfs/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/vrfs/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/ipam/vrfs/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/ipam/vrfs/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/ipam/vrfs/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\Secrets;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class KeyGen extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/secrets/generate-rsa-key-pair/", $params);
|
||||
}
|
||||
class KeyGen extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/secrets/generate-rsa-key-pair/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Secrets;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class SecretRoles extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/secrets/secret-roles/", $params);
|
||||
}
|
||||
class SecretRoles extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/secrets/secret-roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/secrets/secret-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/secrets/secret-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/secrets/secret-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/secrets/secret-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/secrets/secret-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/secrets/secret-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/secrets/secret-roles/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/secrets/secret-roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/secrets/secret-roles/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/secrets/secret-roles/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Secrets;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Secrets extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/secrets/secrets/", $params);
|
||||
}
|
||||
class Secrets extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/secrets/secrets/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/secrets/secrets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/secrets/secrets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/secrets/secrets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/secrets/secrets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/secrets/secrets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/secrets/secrets/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/secrets/secrets/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/secrets/secrets/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/secrets/secrets/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/secrets/secrets/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\Secrets;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Session extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = []): array
|
||||
{
|
||||
return $this->post("/secrets/get-session-key/", $params);
|
||||
}
|
||||
class Session extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ): array {
|
||||
return $this->post( "/secrets/get-session-key/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,15 +4,14 @@ namespace Hosterra\NetBox\Api;
|
|||
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
|
||||
class Status extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(array $params = [])
|
||||
{
|
||||
return $this->get("/status/", $params);
|
||||
}
|
||||
class Status extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( array $params = [] ) {
|
||||
return $this->get( "/status/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Tenancy;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ContactAssignments extends AbstractApi
|
||||
{
|
||||
class ContactAssignments extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/tenancy/contact-assignments/", $params);
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/tenancy/contact-assignments/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/tenancy/contact-assignments/" . $id . "/", $params);
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/tenancy/contact-assignments/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/tenancy/contact-assignments/" . $id . "/", $params);
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/tenancy/contact-assignments/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/tenancy/contact-assignments/" . $id . "/", $params);
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/tenancy/contact-assignments/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/contact-assignments/", $params);
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/tenancy/contact-assignments/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/contact-assignments/" . $id . "/", $params);
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/tenancy/contact-assignments/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Tenancy;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ContactGroups extends AbstractApi
|
||||
{
|
||||
class ContactGroups extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/tenancy/contact-groups/", $params);
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/tenancy/contact-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/tenancy/contact-groups/" . $id . "/", $params);
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/tenancy/contact-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/tenancy/contact-groups/" . $id . "/", $params);
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/tenancy/contact-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/tenancy/contact-groups/" . $id . "/", $params);
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/tenancy/contact-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/contact-groups/", $params);
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/tenancy/contact-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/contact-groups/" . $id . "/", $params);
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/tenancy/contact-groups/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Tenancy;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ContactRoles extends AbstractApi
|
||||
{
|
||||
class ContactRoles extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/tenancy/contact-roles/", $params);
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/tenancy/contact-roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/tenancy/contact-roles/" . $id . "/", $params);
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/tenancy/contact-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/tenancy/contact-roles/" . $id . "/", $params);
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/tenancy/contact-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/tenancy/contact-roles/" . $id . "/", $params);
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/tenancy/contact-roles/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/contact-roles/", $params);
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/tenancy/contact-roles/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/contact-roles/" . $id . "/", $params);
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/tenancy/contact-roles/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Tenancy;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Contacts extends AbstractApi
|
||||
{
|
||||
class Contacts extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/tenancy/contacts/", $params);
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/tenancy/contacts/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/tenancy/contacts/" . $id . "/", $params);
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/tenancy/contacts/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/tenancy/contacts/" . $id . "/", $params);
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/tenancy/contacts/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/tenancy/contacts/" . $id . "/", $params);
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/tenancy/contacts/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/contacts/", $params);
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/tenancy/contacts/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/contacts/" . $id . "/", $params);
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/tenancy/contacts/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Tenancy;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class TenantGroups extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/tenancy/tenant-groups/", $params);
|
||||
}
|
||||
class TenantGroups extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/tenancy/tenant-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/tenancy/tenant-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/tenancy/tenant-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/tenancy/tenant-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/tenancy/tenant-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/tenancy/tenant-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/tenancy/tenant-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/tenant-groups/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/tenancy/tenant-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/tenant-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/tenancy/tenant-groups/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Tenancy;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Tenants extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/tenancy/tenants/", $params);
|
||||
}
|
||||
class Tenants extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/tenancy/tenants/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/tenancy/tenants/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/tenancy/tenants/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/tenancy/tenants/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/tenancy/tenants/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/tenancy/tenants/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/tenancy/tenants/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/tenants/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/tenancy/tenants/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/tenancy/tenants/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/tenancy/tenants/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\Users;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Config extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/users/users/", $params);
|
||||
}
|
||||
class Config extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/users/users/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Users;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Groups extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/users/groups/", $params);
|
||||
}
|
||||
class Groups extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/users/groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/users/groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/users/groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/users/groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/users/groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/users/groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/users/groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/users/groups/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/users/groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/users/groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/users/groups/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Users;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Permissions extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/users/permissions/", $params);
|
||||
}
|
||||
class Permissions extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/users/permissions/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/users/permissions/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/users/permissions/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/users/permissions/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/users/permissions/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/users/permissions/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/users/permissions/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/users/permissions/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/users/permissions/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/users/permissions/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/users/permissions/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,81 +5,80 @@ namespace Hosterra\NetBox\Api\Users;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Users extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function checkLogin(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/users/users/" . $id . "/", $params);
|
||||
//return $this->post(array_merge(['controller' => 'debtor', 'action' => 'checkLogin'], $params));
|
||||
}
|
||||
class Users extends AbstractApi {
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function checkLogin( int $id, array $params = [] ) {
|
||||
return $this->get( "/users/users/" . $id . "/", $params );
|
||||
//return $this->post(array_merge(['controller' => 'debtor', 'action' => 'checkLogin'], $params));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/users/users/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/users/users/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/users/users/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/users/users/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/users/users/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/users/users/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/users/users/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/users/users/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/users/users/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/users/users/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/users/users/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/users/users/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ClusterGroups extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/virtualization/cluster-groups/", $params);
|
||||
}
|
||||
class ClusterGroups extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/virtualization/cluster-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/virtualization/cluster-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/virtualization/cluster-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/virtualization/cluster-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/virtualization/cluster-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/virtualization/cluster-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/virtualization/cluster-groups/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/cluster-groups/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/virtualization/cluster-groups/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/cluster-groups/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/virtualization/cluster-groups/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class ClusterTypes extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/virtualization/cluster-types/", $params);
|
||||
}
|
||||
class ClusterTypes extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/virtualization/cluster-types/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/virtualization/cluster-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/virtualization/cluster-types/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/virtualization/cluster-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/virtualization/cluster-types/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/virtualization/cluster-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/virtualization/cluster-types/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/cluster-types/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/virtualization/cluster-types/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/cluster-types/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/virtualization/cluster-types/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Clusters extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/virtualization/clusters/", $params);
|
||||
}
|
||||
class Clusters extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/virtualization/clusters/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/virtualization/clusters/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/virtualization/clusters/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/virtualization/clusters/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/virtualization/clusters/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/virtualization/clusters/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/virtualization/clusters/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/clusters/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/virtualization/clusters/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/clusters/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/virtualization/clusters/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class Interfaces extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/virtualization/interfaces/", $params);
|
||||
}
|
||||
class Interfaces extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/virtualization/interfaces/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/virtualization/interfaces/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/virtualization/interfaces/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/virtualization/interfaces/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/virtualization/interfaces/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/virtualization/interfaces/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/virtualization/interfaces/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/interfaces/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/virtualization/interfaces/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/interfaces/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/virtualization/interfaces/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hosterra\NetBox\Api\AbstractApi;
|
||||
|
||||
class VirtualMachines extends AbstractApi
|
||||
{
|
||||
/**
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add(array $params = []): array
|
||||
{
|
||||
return $this->post("/virtualization/virtual-machines/", $params);
|
||||
}
|
||||
class VirtualMachines extends AbstractApi {
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function add( array $params = [] ): array {
|
||||
return $this->post( "/virtualization/virtual-machines/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove(int $id, array $params = []): bool
|
||||
{
|
||||
return $this->delete("/virtualization/virtual-machines/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function remove( int $id, array $params = [] ): bool {
|
||||
return $this->delete( "/virtualization/virtual-machines/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit(int $id, array $params = []): array
|
||||
{
|
||||
return $this->put("/virtualization/virtual-machines/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function edit( int $id, array $params = [] ): array {
|
||||
return $this->put( "/virtualization/virtual-machines/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update(int $id, array $params = []): array
|
||||
{
|
||||
return $this->patch("/virtualization/virtual-machines/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function update( int $id, array $params = [] ): array {
|
||||
return $this->patch( "/virtualization/virtual-machines/" . $id . "/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list(array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/virtual-machines/", $params);
|
||||
}
|
||||
/**
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function list( array $params = [] ) {
|
||||
return $this->get( "/virtualization/virtual-machines/", $params );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show(int $id, array $params = [])
|
||||
{
|
||||
return $this->get("/virtualization/virtual-machines/" . $id . "/", $params);
|
||||
}
|
||||
/**
|
||||
* @param int $id
|
||||
* @param array $params
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function show( int $id, array $params = [] ) {
|
||||
return $this->get( "/virtualization/virtual-machines/" . $id . "/", $params );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
321
src/Client.php
321
src/Client.php
|
|
@ -7,186 +7,181 @@ use InvalidArgumentException;
|
|||
use Hosterra\NetBox\HttpClient\HttpClient;
|
||||
use RuntimeException;
|
||||
|
||||
class Client
|
||||
{
|
||||
class Client {
|
||||
const VERSION = '3.0.0';
|
||||
|
||||
/** @var array */
|
||||
protected $classes = [
|
||||
// Circuits
|
||||
'circuits' => 'Circuits\Circuits',
|
||||
'providers' => 'Circuits\Providers',
|
||||
'circuitTerminations' => 'Circuits\CircuitTerminations',
|
||||
'circuitTypes' => 'Circuits\CircuitTypes',
|
||||
|
||||
// DCIM
|
||||
'cables' => 'DCIM\Cables',
|
||||
'connectedDevices' => 'DCIM\ConnectedDevices',
|
||||
'consoleConnections' => 'DCIM\ConsoleConnections',
|
||||
'consolePorts' => 'DCIM\ConsolePorts',
|
||||
'consolePortTemplates' => 'DCIM\ConsolePortTemplates',
|
||||
'consoleServerPorts' => 'DCIM\ConsoleServerPorts',
|
||||
'consoleServerPortTemplates' => 'DCIM\ConsoleServerPortTemplates',
|
||||
'deviceBays' => 'DCIM\DeviceBays',
|
||||
'deviceBayTemplates' => 'DCIM\DeviceBayTemplates',
|
||||
'deviceRoles' => 'DCIM\DeviceRoles',
|
||||
'devices' => 'DCIM\Devices',
|
||||
'deviceTypes' => 'DCIM\DeviceTypes',
|
||||
'frontPorts' => 'DCIM\FrontPorts',
|
||||
'frontPortTemplates' => 'DCIM\FrontPortTemplates',
|
||||
'interfaceConnections' => 'DCIM\InterfaceConnections',
|
||||
'interfaces' => 'DCIM\Interfaces',
|
||||
'interfaceTemplates' => 'DCIM\InterfaceTemplates',
|
||||
'inventoryItems' => 'DCIM\InventoryItems',
|
||||
'manufacturers' => 'DCIM\Manufacturers',
|
||||
'moduleBays' => 'DCIM\ModuleBays',
|
||||
'modules' => 'DCIM\Modules',
|
||||
'platforms' => 'DCIM\Platforms',
|
||||
'powerFeeds' => 'DCIM\PowerFeeds',
|
||||
'powerOutlets' => 'DCIM\PowerOutlets',
|
||||
'powerOutletTemplates' => 'DCIM\PowerOutletTemplates',
|
||||
'powerPanels' => 'DCIM\PowerPanels',
|
||||
'powerPorts' => 'DCIM\PowerPorts',
|
||||
'powerPortTemplates' => 'DCIM\PowerPortTemplates',
|
||||
'rackGroups' => 'DCIM\RackGroups',
|
||||
'rackReservations' => 'DCIM\RackReservations',
|
||||
'rackRoles' => 'DCIM\RackRoles',
|
||||
'racks' => 'DCIM\Racks',
|
||||
'rearPorts' => 'DCIM\RearPorts',
|
||||
'rearPortTemplates' => 'DCIM\RearPortTemplates',
|
||||
'regions' => 'DCIM\Regions',
|
||||
'sites' => 'DCIM\Sites',
|
||||
'virtualChassis' => 'DCIM\VirtualChassis',
|
||||
/** @var array */
|
||||
protected $classes = [
|
||||
// Circuits
|
||||
'circuits' => 'Circuits\Circuits',
|
||||
'providers' => 'Circuits\Providers',
|
||||
'circuitTerminations' => 'Circuits\CircuitTerminations',
|
||||
'circuitTypes' => 'Circuits\CircuitTypes',
|
||||
|
||||
// Extras
|
||||
'configContexts' => 'Extras\ConfigContexts',
|
||||
'contentTypes' => 'Extras\ContentTypes',
|
||||
'customFields' => 'Extras\CustomFields',
|
||||
'exportTemplates' => 'Extras\ExportTemplates',
|
||||
'imageAttachments' => 'Extras\ImageAttachments',
|
||||
'jobResults' => 'Extras\JobResults',
|
||||
'objectChanges' => 'Extras\ObjectChanges',
|
||||
'reports' => 'Extras\Reports',
|
||||
'scripts' => 'Extras\Scripts',
|
||||
'tags' => 'Extras\Tags',
|
||||
// DCIM
|
||||
'cables' => 'DCIM\Cables',
|
||||
'connectedDevices' => 'DCIM\ConnectedDevices',
|
||||
'consoleConnections' => 'DCIM\ConsoleConnections',
|
||||
'consolePorts' => 'DCIM\ConsolePorts',
|
||||
'consolePortTemplates' => 'DCIM\ConsolePortTemplates',
|
||||
'consoleServerPorts' => 'DCIM\ConsoleServerPorts',
|
||||
'consoleServerPortTemplates' => 'DCIM\ConsoleServerPortTemplates',
|
||||
'deviceBays' => 'DCIM\DeviceBays',
|
||||
'deviceBayTemplates' => 'DCIM\DeviceBayTemplates',
|
||||
'deviceRoles' => 'DCIM\DeviceRoles',
|
||||
'devices' => 'DCIM\Devices',
|
||||
'deviceTypes' => 'DCIM\DeviceTypes',
|
||||
'frontPorts' => 'DCIM\FrontPorts',
|
||||
'frontPortTemplates' => 'DCIM\FrontPortTemplates',
|
||||
'interfaceConnections' => 'DCIM\InterfaceConnections',
|
||||
'interfaces' => 'DCIM\Interfaces',
|
||||
'interfaceTemplates' => 'DCIM\InterfaceTemplates',
|
||||
'inventoryItems' => 'DCIM\InventoryItems',
|
||||
'manufacturers' => 'DCIM\Manufacturers',
|
||||
'moduleBays' => 'DCIM\ModuleBays',
|
||||
'modules' => 'DCIM\Modules',
|
||||
'platforms' => 'DCIM\Platforms',
|
||||
'powerFeeds' => 'DCIM\PowerFeeds',
|
||||
'powerOutlets' => 'DCIM\PowerOutlets',
|
||||
'powerOutletTemplates' => 'DCIM\PowerOutletTemplates',
|
||||
'powerPanels' => 'DCIM\PowerPanels',
|
||||
'powerPorts' => 'DCIM\PowerPorts',
|
||||
'powerPortTemplates' => 'DCIM\PowerPortTemplates',
|
||||
'rackGroups' => 'DCIM\RackGroups',
|
||||
'rackReservations' => 'DCIM\RackReservations',
|
||||
'rackRoles' => 'DCIM\RackRoles',
|
||||
'racks' => 'DCIM\Racks',
|
||||
'rearPorts' => 'DCIM\RearPorts',
|
||||
'rearPortTemplates' => 'DCIM\RearPortTemplates',
|
||||
'regions' => 'DCIM\Regions',
|
||||
'sites' => 'DCIM\Sites',
|
||||
'virtualChassis' => 'DCIM\VirtualChassis',
|
||||
|
||||
// IPAM
|
||||
'aggregates' => 'IPAM\Aggregates',
|
||||
'ipAddresses' => 'IPAM\IpAddresses',
|
||||
'prefixes' => 'IPAM\Prefixes',
|
||||
'rirs' => 'IPAM\Rirs',
|
||||
'roles' => 'IPAM\Roles',
|
||||
'routeTargets' => 'IPAM\RouteTargets',
|
||||
'services' => 'IPAM\Services',
|
||||
'vlanGroups' => 'IPAM\VlanGroups',
|
||||
'vlans' => 'IPAM\Vlans',
|
||||
'vrfs' => 'IPAM\Vrfs',
|
||||
// Extras
|
||||
'configContexts' => 'Extras\ConfigContexts',
|
||||
'contentTypes' => 'Extras\ContentTypes',
|
||||
'customFields' => 'Extras\CustomFields',
|
||||
'exportTemplates' => 'Extras\ExportTemplates',
|
||||
'imageAttachments' => 'Extras\ImageAttachments',
|
||||
'jobResults' => 'Extras\JobResults',
|
||||
'objectChanges' => 'Extras\ObjectChanges',
|
||||
'reports' => 'Extras\Reports',
|
||||
'scripts' => 'Extras\Scripts',
|
||||
'tags' => 'Extras\Tags',
|
||||
|
||||
// Secrets
|
||||
'keyGen' => 'Secrets\KeyGen',
|
||||
'secrets' => 'Secrets\Secrets',
|
||||
'secretRoles' => 'Secrets\SecretRoles',
|
||||
'session' => 'Secrets\Session',
|
||||
// IPAM
|
||||
'aggregates' => 'IPAM\Aggregates',
|
||||
'ipAddresses' => 'IPAM\IpAddresses',
|
||||
'prefixes' => 'IPAM\Prefixes',
|
||||
'rirs' => 'IPAM\Rirs',
|
||||
'roles' => 'IPAM\Roles',
|
||||
'routeTargets' => 'IPAM\RouteTargets',
|
||||
'services' => 'IPAM\Services',
|
||||
'vlanGroups' => 'IPAM\VlanGroups',
|
||||
'vlans' => 'IPAM\Vlans',
|
||||
'vrfs' => 'IPAM\Vrfs',
|
||||
|
||||
// Tenancy
|
||||
'contactAssignments' => 'Tenancy\ContactAssignments',
|
||||
'contactGroups' => 'Tenancy\ContactGroups',
|
||||
'contactRoles' => 'Tenancy\ContactRoles',
|
||||
'contacts' => 'Tenancy\Contacts',
|
||||
'tenantGroups' => 'Tenancy\TenantGroups',
|
||||
'tenants' => 'Tenancy\Tenants',
|
||||
// Secrets
|
||||
'keyGen' => 'Secrets\KeyGen',
|
||||
'secrets' => 'Secrets\Secrets',
|
||||
'secretRoles' => 'Secrets\SecretRoles',
|
||||
'session' => 'Secrets\Session',
|
||||
|
||||
// Users
|
||||
'config' => 'Users\Config',
|
||||
'groups' => 'Users\Groups',
|
||||
'permissions' => 'Users\Permissions',
|
||||
'users' => 'Users\Users',
|
||||
// Tenancy
|
||||
'contactAssignments' => 'Tenancy\ContactAssignments',
|
||||
'contactGroups' => 'Tenancy\ContactGroups',
|
||||
'contactRoles' => 'Tenancy\ContactRoles',
|
||||
'contacts' => 'Tenancy\Contacts',
|
||||
'tenantGroups' => 'Tenancy\TenantGroups',
|
||||
'tenants' => 'Tenancy\Tenants',
|
||||
|
||||
// Virtualization
|
||||
'clusterGroups' => 'Virtualization\ClusterGroups',
|
||||
'clusters' => 'Virtualization\Clusters',
|
||||
'clusterTypes' => 'Virtualization\ClusterTypes',
|
||||
'vinterfaces' => 'Virtualization\Interfaces',
|
||||
'virtualMachines' => 'Virtualization\VirtualMachines',
|
||||
// Users
|
||||
'config' => 'Users\Config',
|
||||
'groups' => 'Users\Groups',
|
||||
'permissions' => 'Users\Permissions',
|
||||
'users' => 'Users\Users',
|
||||
|
||||
'status' => 'Status',
|
||||
];
|
||||
// Virtualization
|
||||
'clusterGroups' => 'Virtualization\ClusterGroups',
|
||||
'clusters' => 'Virtualization\Clusters',
|
||||
'clusterTypes' => 'Virtualization\ClusterTypes',
|
||||
'vinterfaces' => 'Virtualization\Interfaces',
|
||||
'virtualMachines' => 'Virtualization\VirtualMachines',
|
||||
|
||||
/** @var HttpClient */
|
||||
protected $httpClient;
|
||||
'status' => 'Status',
|
||||
];
|
||||
|
||||
/** @var array */
|
||||
protected $options = [];
|
||||
/** @var HttpClient */
|
||||
protected $httpClient;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if (strlen(getenv('NETBOX_API')) === 0 || strlen(getenv('NETBOX_API_KEY')) === 0) {
|
||||
throw new RuntimeException(
|
||||
sprintf(
|
||||
'Environment Variables not found (NETBOX_API, NETBOX_API_KEY): "%s" "redacted(%s(%s))"',
|
||||
getenv('NETBOX_API'),
|
||||
gettype(getenv('NETBOX_API_KEY')),
|
||||
strlen(getenv('NETBOX_API_KEY'))
|
||||
),
|
||||
1653901216
|
||||
);
|
||||
}
|
||||
}
|
||||
/** @var array */
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* @param $method
|
||||
* @param $args
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $args)
|
||||
{
|
||||
try {
|
||||
return $this->api($method);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
throw new BadMethodCallException(sprintf('Undefined method called: "%s"', $method));
|
||||
}
|
||||
}
|
||||
public function __construct() {
|
||||
if ( strlen( getenv( 'NETBOX_API' ) ) === 0 || strlen( getenv( 'NETBOX_API_KEY' ) ) === 0 ) {
|
||||
throw new RuntimeException(
|
||||
sprintf(
|
||||
'Environment Variables not found (NETBOX_API, NETBOX_API_KEY): "%s" "redacted(%s(%s))"',
|
||||
getenv( 'NETBOX_API' ),
|
||||
gettype( getenv( 'NETBOX_API_KEY' ) ),
|
||||
strlen( getenv( 'NETBOX_API_KEY' ) )
|
||||
),
|
||||
1653901216
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @return mixed
|
||||
*/
|
||||
public function api($name)
|
||||
{
|
||||
if (!isset($this->classes[$name])) {
|
||||
throw new InvalidArgumentException(sprintf('Undefined method called: "%s"', $name));
|
||||
}
|
||||
$class = '\\Hosterra\\NetBox\\Api\\' . $this->classes[$name];
|
||||
/**
|
||||
* @param $method
|
||||
* @param $args
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call( $method, $args ) {
|
||||
try {
|
||||
return $this->api( $method );
|
||||
} catch ( InvalidArgumentException $e ) {
|
||||
throw new BadMethodCallException( sprintf( 'Undefined method called: "%s"', $method ) );
|
||||
}
|
||||
}
|
||||
|
||||
return new $class($this);
|
||||
}
|
||||
/**
|
||||
* @param $name
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function api( $name ) {
|
||||
if ( ! isset( $this->classes[ $name ] ) ) {
|
||||
throw new InvalidArgumentException( sprintf( 'Undefined method called: "%s"', $name ) );
|
||||
}
|
||||
$class = '\\Hosterra\\NetBox\\Api\\' . $this->classes[ $name ];
|
||||
|
||||
/**
|
||||
* @return HttpClient
|
||||
*/
|
||||
public function getHttpClient(): HttpClient
|
||||
{
|
||||
if (!isset($this->httpClient)) {
|
||||
$this->httpClient = new HttpClient();
|
||||
}
|
||||
$this->httpClient->setOptions($this->getOptions());
|
||||
return new $class( $this );
|
||||
}
|
||||
|
||||
return $this->httpClient;
|
||||
}
|
||||
/**
|
||||
* @return HttpClient
|
||||
*/
|
||||
public function getHttpClient(): HttpClient {
|
||||
if ( ! isset( $this->httpClient ) ) {
|
||||
$this->httpClient = new HttpClient();
|
||||
}
|
||||
$this->httpClient->setOptions( $this->getOptions() );
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions(): array
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
return $this->httpClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
$this->options = $options;
|
||||
}
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions(): array {
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*/
|
||||
public function setOptions( array $options ) {
|
||||
$this->options = $options;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Hosterra\NetBox;
|
||||
|
||||
interface ClientInterface
|
||||
{
|
||||
interface ClientInterface {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,158 +6,154 @@ use GuzzleHttp\Client;
|
|||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\RequestOptions;
|
||||
|
||||
class HttpClient implements HttpClientInterface
|
||||
{
|
||||
/** @var Client */
|
||||
protected $client;
|
||||
class HttpClient implements HttpClientInterface {
|
||||
/** @var Client */
|
||||
protected $client;
|
||||
|
||||
/** @var array */
|
||||
protected $options = [];
|
||||
/** @var array */
|
||||
protected $options = [];
|
||||
|
||||
/**
|
||||
* @return Client
|
||||
*/
|
||||
public function getClient(): Client
|
||||
{
|
||||
if (!isset($this->client)) {
|
||||
$this->client = new Client([
|
||||
'base_uri' => getenv('NETBOX_API'),
|
||||
RequestOptions::TIMEOUT => 180,
|
||||
RequestOptions::COOKIES => true,
|
||||
RequestOptions::CONNECT_TIMEOUT => 180,
|
||||
RequestOptions::ALLOW_REDIRECTS => false,
|
||||
RequestOptions::HEADERS => [
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => sprintf("Token %s", getenv('NETBOX_API_KEY')),
|
||||
]
|
||||
]);
|
||||
/**
|
||||
* @return Client
|
||||
*/
|
||||
public function getClient(): Client {
|
||||
if ( ! isset( $this->client ) ) {
|
||||
$this->client = new Client( [
|
||||
'base_uri' => getenv( 'NETBOX_API' ),
|
||||
RequestOptions::TIMEOUT => 180,
|
||||
RequestOptions::COOKIES => true,
|
||||
RequestOptions::CONNECT_TIMEOUT => 180,
|
||||
RequestOptions::ALLOW_REDIRECTS => false,
|
||||
RequestOptions::HEADERS => [
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => sprintf( "Token %s", getenv( 'NETBOX_API_KEY' ) ),
|
||||
]
|
||||
] );
|
||||
|
||||
return $this->client;
|
||||
}
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
return $this->client;
|
||||
}
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Client $client
|
||||
* @return Client
|
||||
*/
|
||||
public function setClient(Client $client): Client
|
||||
{
|
||||
$this->client = $client;
|
||||
/**
|
||||
* @param Client $client
|
||||
*
|
||||
* @return Client
|
||||
*/
|
||||
public function setClient( Client $client ): Client {
|
||||
$this->client = $client;
|
||||
|
||||
return $this->client;
|
||||
}
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $query
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function get(string $path = "", array $query = []): array
|
||||
{
|
||||
$response = $this->getClient()->request(
|
||||
'GET',
|
||||
getenv('NETBOX_API') . $path,
|
||||
[
|
||||
'query' => $query
|
||||
]
|
||||
);
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $query
|
||||
*
|
||||
* @return mixed
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function get( string $path = "", array $query = [] ): array {
|
||||
$response = $this->getClient()->request(
|
||||
'GET',
|
||||
getenv( 'NETBOX_API' ) . $path,
|
||||
[
|
||||
'query' => $query
|
||||
]
|
||||
);
|
||||
|
||||
return json_decode($response->getBody()->getContents(), true);
|
||||
}
|
||||
return json_decode( $response->getBody()->getContents(), true );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function post(string $path = "", array $body = []): array
|
||||
{
|
||||
$response = $this->getClient()->request(
|
||||
'POST',
|
||||
getenv('NETBOX_API') . $path,
|
||||
[
|
||||
'json' => $body
|
||||
]
|
||||
);
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function post( string $path = "", array $body = [] ): array {
|
||||
$response = $this->getClient()->request(
|
||||
'POST',
|
||||
getenv( 'NETBOX_API' ) . $path,
|
||||
[
|
||||
'json' => $body
|
||||
]
|
||||
);
|
||||
|
||||
return json_decode($response->getBody()->getContents(), true);
|
||||
}
|
||||
return json_decode( $response->getBody()->getContents(), true );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function put(string $path = "", array $body = []): array
|
||||
{
|
||||
$response = $this->getClient()->request(
|
||||
'PUT',
|
||||
getenv('NETBOX_API') . $path,
|
||||
[
|
||||
'json' => $body
|
||||
]
|
||||
);
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function put( string $path = "", array $body = [] ): array {
|
||||
$response = $this->getClient()->request(
|
||||
'PUT',
|
||||
getenv( 'NETBOX_API' ) . $path,
|
||||
[
|
||||
'json' => $body
|
||||
]
|
||||
);
|
||||
|
||||
return json_decode($response->getBody()->getContents(), true);
|
||||
}
|
||||
return json_decode( $response->getBody()->getContents(), true );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function patch(string $path = "", array $body = []): array
|
||||
{
|
||||
$response = $this->getClient()->request(
|
||||
'PATCH',
|
||||
getenv('NETBOX_API') . $path,
|
||||
[
|
||||
'json' => $body
|
||||
]
|
||||
);
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
*
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function patch( string $path = "", array $body = [] ): array {
|
||||
$response = $this->getClient()->request(
|
||||
'PATCH',
|
||||
getenv( 'NETBOX_API' ) . $path,
|
||||
[
|
||||
'json' => $body
|
||||
]
|
||||
);
|
||||
|
||||
return json_decode($response->getBody()->getContents(), true);
|
||||
}
|
||||
return json_decode( $response->getBody()->getContents(), true );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function delete(string $path = "", array $body = []): ?bool
|
||||
{
|
||||
$response = $this->getClient()->request(
|
||||
'DELETE',
|
||||
getenv('NETBOX_API') . $path,
|
||||
[
|
||||
'json' => $body
|
||||
]
|
||||
);
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
*
|
||||
* @return bool
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function delete( string $path = "", array $body = [] ): ?bool {
|
||||
$response = $this->getClient()->request(
|
||||
'DELETE',
|
||||
getenv( 'NETBOX_API' ) . $path,
|
||||
[
|
||||
'json' => $body
|
||||
]
|
||||
);
|
||||
|
||||
return $response->getStatusCode() === 204;
|
||||
}
|
||||
return $response->getStatusCode() === 204;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions(): array
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions(): array {
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
$this->options = array_merge($this->options, $options);
|
||||
}
|
||||
/**
|
||||
* @param array $options
|
||||
*/
|
||||
public function setOptions( array $options ) {
|
||||
$this->options = array_merge( $this->options, $options );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,43 +2,46 @@
|
|||
|
||||
namespace Hosterra\NetBox\HttpClient;
|
||||
|
||||
interface HttpClientInterface
|
||||
{
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions(): array;
|
||||
interface HttpClientInterface {
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getOptions(): array;
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $query
|
||||
* @return array
|
||||
*/
|
||||
public function get(string $path = "", array $query = []): array;
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $query
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get( string $path = "", array $query = [] ): array;
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
* @return array
|
||||
*/
|
||||
public function post(string $path = "", array $body = []): array;
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function post( string $path = "", array $body = [] ): array;
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
* @return array
|
||||
*/
|
||||
public function put(string $path = "", array $body = []): array;
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function put( string $path = "", array $body = [] ): array;
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
* @return bool
|
||||
*/
|
||||
public function delete(string $path = "", array $body = []): ?bool;
|
||||
/**
|
||||
* @param string $path
|
||||
* @param array $body
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function delete( string $path = "", array $body = [] ): ?bool;
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
*/
|
||||
public function setOptions(array $options);
|
||||
/**
|
||||
* @param array $options
|
||||
*/
|
||||
public function setOptions( array $options );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue