Clean & reformat code

This commit is contained in:
Pierre Lannoy 2024-02-12 11:28:56 +01:00
commit 5180bf1d38
Signed by: Pierre Lannoy
GPG key ID: D27231EF87D53F31
88 changed files with 4317 additions and 4408 deletions

View file

@ -5,72 +5,71 @@ namespace Hosterra\NetBox\Api;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Client;
abstract class AbstractApi implements ApiInterface
{
abstract class AbstractApi implements ApiInterface {
/** @var Client */
public $client;
/**
* AbstractApi constructor.
*
* @param Client $client
*/
public function __construct(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);
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);
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);
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);
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);
protected function delete( $path, array $parameters ): bool {
return $this->client->getHttpClient()->delete( $path, $parameters );
}
}

View file

@ -2,7 +2,6 @@
namespace Hosterra\NetBox\Api;
interface ApiInterface
{
interface ApiInterface {
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Circuits;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class CircuitTerminations extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/circuits/circuit-terminations/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Circuits;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class CircuitTypes extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/circuits/circuit-types/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Circuits;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Circuits extends AbstractApi
{
class Circuits extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/circuits/circuits/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/circuits/circuits/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Circuits;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Providers extends AbstractApi
{
class Providers extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/circuits/providers/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/circuits/providers/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Cables extends AbstractApi
{
class Cables extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/cables/", $params);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/cables/" . $id . "/", $params );
}
}

View file

@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ConnectedDevices extends AbstractApi
{
class ConnectedDevices extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/connected-device/", $params);
public function list( array $params = [] ) {
return $this->get( "/dcim/connected-device/", $params );
}
}

View file

@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ConsoleConnections extends AbstractApi
{
class ConsoleConnections extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/console-connections/", $params);
public function list( array $params = [] ) {
return $this->get( "/dcim/console-connections/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ConsolePortTemplates extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/console-port-templates/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ConsolePorts extends 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);
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);
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);
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);
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);
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);
public function trace( int $id, array $params = [] ) {
return $this->get( "/dcim/console-ports/" . $id . "/trace/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ConsoleServerPortTemplates extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/console-server-port-templates/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ConsoleServerPorts extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/console-server-ports/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class DeviceBayTemplates extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/device-bay-templates/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class DeviceBays extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/device-bays/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class DeviceRoles extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/device-roles/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class DeviceTypes extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/device-types/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Devices extends AbstractApi
{
class Devices extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/devices/", $params);
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);
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);
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);
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);
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);
public function napalm( int $id, array $params = [] ) {
return $this->get( "/dcim/devices/" . $id . "/napalm/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class FrontPortTemplates extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/front-port-templates/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class FrontPorts extends 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);
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);
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);
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);
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);
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);
public function paths( int $id, array $params = [] ) {
return $this->get( "/dcim/front-ports/" . $id . "/paths/", $params );
}
}

View file

@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class InterfaceConnections extends AbstractApi
{
class InterfaceConnections extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/interface-connections/", $params);
public function list( array $params = [] ) {
return $this->get( "/dcim/interface-connections/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class InterfaceTemplates extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/interface-templates/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Interfaces extends AbstractApi
{
class Interfaces extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/interfaces/", $params);
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);
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);
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);
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);
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);
public function trace( int $id, array $params = [] ) {
return $this->get( "/dcim/interfaces/" . $id . "/trace/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class InventoryItems extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/inventory-items/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Manufacturers extends AbstractApi
{
class Manufacturers extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/manufacturers/", $params);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/manufacturers/" . $id . "/", $params );
}
}

View file

@ -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 );
}
}

View file

@ -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 );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Platforms extends AbstractApi
{
class Platforms extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/platforms/", $params);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/platforms/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class PowerFeeds extends 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);
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);
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);
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);
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);
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);
public function trace( int $id, array $params = [] ) {
return $this->get( "/dcim/power-feeds/" . $id . "/trace/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class PowerOutletTemplates extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/power-outlet-templates/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class PowerOutlets extends 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);
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);
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);
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);
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);
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);
public function trace( int $id, array $params = [] ) {
return $this->get( "/dcim/power-outlets/" . $id . "/trace/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class PowerPanels extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/power-panels/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class PowerPortTemplates extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/power-port-templates/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class PowerPorts extends 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);
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);
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);
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);
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);
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);
public function trace( int $id, array $params = [] ) {
return $this->get( "/dcim/power-ports/" . $id . "/trace/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class RackGroups extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/rack-groups/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class RackReservations extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/rack-reservations/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class RackRoles extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/rack-roles/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Racks extends AbstractApi
{
class Racks extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/racks/", $params);
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);
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);
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);
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);
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);
public function elevation( int $id, array $params = [] ) {
return $this->get( "/dcim/racks/" . $id . "/elevation/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class RearPortTemplates extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/rear-port-templates/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class RearPorts extends 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);
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);
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);
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);
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);
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);
public function paths( int $id, array $params = [] ) {
return $this->get( "/dcim/rear-ports/" . $id . "/paths/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Regions extends AbstractApi
{
class Regions extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/regions/", $params);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/regions/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Sites extends AbstractApi
{
class Sites extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/sites/", $params);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/sites/" . $id . "/", $params );
}
}

View file

@ -5,58 +5,57 @@ namespace Hosterra\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class VirtualChassis extends 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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/dcim/virtual-chassis/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ConfigContexts extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/config-contexts/" . $id . "/", $params );
}
}

View file

@ -5,26 +5,25 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ContentTypes extends AbstractApi
{
class ContentTypes extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/extras/content-types/", $params);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/content-types/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class CustomFields extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/custom-fields/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ExportTemplates extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/export-templates/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ImageAttachments extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/image-attachments/" . $id . "/", $params );
}
}

View file

@ -5,26 +5,25 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class JobResults extends AbstractApi
{
class JobResults extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/extras/job-results/", $params);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/job-results/" . $id . "/", $params );
}
}

View file

@ -5,26 +5,25 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ObjectChanges extends AbstractApi
{
class ObjectChanges extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/extras/object-changes/", $params);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/object-changes/" . $id . "/", $params );
}
}

View file

@ -5,37 +5,36 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Reports extends AbstractApi
{
class Reports extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/extras/reports/", $params);
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);
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);
public function run( int $id, array $params = [] ): array {
return $this->post( "/extras/reports/" . $id . "/run/", $params );
}
}

View file

@ -5,26 +5,25 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Scripts extends AbstractApi
{
class Scripts extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/extras/scripts/", $params);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/scripts/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Extras;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Tags extends AbstractApi
{
class Tags extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/extras/tags/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/extras/tags/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Aggregates extends AbstractApi
{
class Aggregates extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/ipam/aggregates/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/aggregates/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Asns extends AbstractApi
{
class Asns extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/ipam/asns/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/asns/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class IpAddresses extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/ip-addresses/" . $id . "/", $params );
}
}

View file

@ -5,113 +5,112 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Prefixes extends AbstractApi
{
class Prefixes extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/ipam/prefixes/", $params);
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);
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);
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);
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);
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);
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);
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);
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);
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);
public function addAvailable( int $id, array $params = [] ): array {
return $this->post( "/ipam/prefixes/" . $id . "/available-prefixes/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Rirs extends AbstractApi
{
class Rirs extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/ipam/rirs/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/rirs/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Roles extends AbstractApi
{
class Roles extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/ipam/roles/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/roles/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class RouteTargets extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/route-targets/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Services extends AbstractApi
{
class Services extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/ipam/services/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/services/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class VlanGroups extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/vlan-groups/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Vlans extends AbstractApi
{
class Vlans extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/ipam/vlans/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/vlans/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\IPAM;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Vrfs extends AbstractApi
{
class Vrfs extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/ipam/vrfs/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/ipam/vrfs/" . $id . "/", $params );
}
}

View file

@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\Secrets;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class KeyGen extends 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);
public function list( array $params = [] ) {
return $this->get( "/secrets/generate-rsa-key-pair/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Secrets;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class SecretRoles extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/secrets/secret-roles/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Secrets;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Secrets extends AbstractApi
{
class Secrets extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/secrets/secrets/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/secrets/secrets/" . $id . "/", $params );
}
}

View file

@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\Secrets;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Session extends 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);
public function list( array $params = [] ): array {
return $this->post( "/secrets/get-session-key/", $params );
}
}

View file

@ -4,15 +4,14 @@ namespace Hosterra\NetBox\Api;
use GuzzleHttp\Exception\GuzzleException;
class Status extends AbstractApi
{
class Status extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function show(array $params = [])
{
return $this->get("/status/", $params);
public function show( array $params = [] ) {
return $this->get( "/status/", $params );
}
}

View file

@ -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 );
}
}

View file

@ -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 );
}
}

View file

@ -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 );
}
}

View file

@ -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 );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Tenancy;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class TenantGroups extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/tenancy/tenant-groups/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Tenancy;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Tenants extends AbstractApi
{
class Tenants extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/tenancy/tenants/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/tenancy/tenants/" . $id . "/", $params );
}
}

View file

@ -5,15 +5,14 @@ namespace Hosterra\NetBox\Api\Users;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Config extends AbstractApi
{
class Config extends AbstractApi {
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/users/users/", $params);
public function list( array $params = [] ) {
return $this->get( "/users/users/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Users;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Groups extends AbstractApi
{
class Groups extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/users/groups/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/users/groups/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Users;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Permissions extends AbstractApi
{
class Permissions extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/users/permissions/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/users/permissions/" . $id . "/", $params );
}
}

View file

@ -5,81 +5,80 @@ namespace Hosterra\NetBox\Api\Users;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Users extends 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);
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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/users/users/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ClusterGroups extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/virtualization/cluster-groups/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class ClusterTypes extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/virtualization/cluster-types/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Clusters extends AbstractApi
{
class Clusters extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/virtualization/clusters/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/virtualization/clusters/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class Interfaces extends AbstractApi
{
class Interfaces extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/virtualization/interfaces/", $params);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/virtualization/interfaces/" . $id . "/", $params );
}
}

View file

@ -5,69 +5,68 @@ namespace Hosterra\NetBox\Api\Virtualization;
use GuzzleHttp\Exception\GuzzleException;
use Hosterra\NetBox\Api\AbstractApi;
class VirtualMachines extends 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);
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);
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);
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);
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);
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);
public function show( int $id, array $params = [] ) {
return $this->get( "/virtualization/virtual-machines/" . $id . "/", $params );
}
}

View file

@ -7,8 +7,7 @@ use InvalidArgumentException;
use Hosterra\NetBox\HttpClient\HttpClient;
use RuntimeException;
class Client
{
class Client {
const VERSION = '3.0.0';
/** @var array */
@ -118,15 +117,14 @@ class Client
/** @var array */
protected $options = [];
public function __construct()
{
if (strlen(getenv('NETBOX_API')) === 0 || strlen(getenv('NETBOX_API_KEY')) === 0) {
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'))
getenv( 'NETBOX_API' ),
gettype( getenv( 'NETBOX_API_KEY' ) ),
strlen( getenv( 'NETBOX_API_KEY' ) )
),
1653901216
);
@ -136,40 +134,39 @@ class Client
/**
* @param $method
* @param $args
*
* @return mixed
*/
public function __call($method, $args)
{
public function __call( $method, $args ) {
try {
return $this->api($method);
} catch (InvalidArgumentException $e) {
throw new BadMethodCallException(sprintf('Undefined method called: "%s"', $method));
return $this->api( $method );
} catch ( InvalidArgumentException $e ) {
throw new BadMethodCallException( sprintf( 'Undefined method called: "%s"', $method ) );
}
}
/**
* @param $name
*
* @return mixed
*/
public function api($name)
{
if (!isset($this->classes[$name])) {
throw new InvalidArgumentException(sprintf('Undefined method called: "%s"', $name));
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];
$class = '\\Hosterra\\NetBox\\Api\\' . $this->classes[ $name ];
return new $class($this);
return new $class( $this );
}
/**
* @return HttpClient
*/
public function getHttpClient(): HttpClient
{
if (!isset($this->httpClient)) {
public function getHttpClient(): HttpClient {
if ( ! isset( $this->httpClient ) ) {
$this->httpClient = new HttpClient();
}
$this->httpClient->setOptions($this->getOptions());
$this->httpClient->setOptions( $this->getOptions() );
return $this->httpClient;
}
@ -177,16 +174,14 @@ class Client
/**
* @return array
*/
public function getOptions(): array
{
public function getOptions(): array {
return $this->options;
}
/**
* @param array $options
*/
public function setOptions(array $options)
{
public function setOptions( array $options ) {
$this->options = $options;
}
}

View file

@ -2,7 +2,6 @@
namespace Hosterra\NetBox;
interface ClientInterface
{
interface ClientInterface {
}

View file

@ -6,8 +6,7 @@ use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\RequestOptions;
class HttpClient implements HttpClientInterface
{
class HttpClient implements HttpClientInterface {
/** @var Client */
protected $client;
@ -17,11 +16,10 @@ class HttpClient implements HttpClientInterface
/**
* @return Client
*/
public function getClient(): Client
{
if (!isset($this->client)) {
$this->client = new Client([
'base_uri' => getenv('NETBOX_API'),
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,
@ -29,9 +27,9 @@ class HttpClient implements HttpClientInterface
RequestOptions::HEADERS => [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
'Authorization' => sprintf("Token %s", getenv('NETBOX_API_KEY')),
'Authorization' => sprintf( "Token %s", getenv( 'NETBOX_API_KEY' ) ),
]
]);
] );
return $this->client;
}
@ -41,10 +39,10 @@ class HttpClient implements HttpClientInterface
/**
* @param Client $client
*
* @return Client
*/
public function setClient(Client $client): Client
{
public function setClient( Client $client ): Client {
$this->client = $client;
return $this->client;
@ -53,90 +51,90 @@ class HttpClient implements HttpClientInterface
/**
* @param string $path
* @param array $query
*
* @return mixed
* @throws GuzzleException
*/
public function get(string $path = "", array $query = []): array
{
public function get( string $path = "", array $query = [] ): array {
$response = $this->getClient()->request(
'GET',
getenv('NETBOX_API') . $path,
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
{
public function post( string $path = "", array $body = [] ): array {
$response = $this->getClient()->request(
'POST',
getenv('NETBOX_API') . $path,
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
{
public function put( string $path = "", array $body = [] ): array {
$response = $this->getClient()->request(
'PUT',
getenv('NETBOX_API') . $path,
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
{
public function patch( string $path = "", array $body = [] ): array {
$response = $this->getClient()->request(
'PATCH',
getenv('NETBOX_API') . $path,
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
{
public function delete( string $path = "", array $body = [] ): ?bool {
$response = $this->getClient()->request(
'DELETE',
getenv('NETBOX_API') . $path,
getenv( 'NETBOX_API' ) . $path,
[
'json' => $body
]
@ -148,16 +146,14 @@ class HttpClient implements HttpClientInterface
/**
* @return array
*/
public function getOptions(): array
{
public function getOptions(): array {
return $this->options;
}
/**
* @param array $options
*/
public function setOptions(array $options)
{
$this->options = array_merge($this->options, $options);
public function setOptions( array $options ) {
$this->options = array_merge( $this->options, $options );
}
}

View file

@ -2,8 +2,7 @@
namespace Hosterra\NetBox\HttpClient;
interface HttpClientInterface
{
interface HttpClientInterface {
/**
* @return array
*/
@ -12,33 +11,37 @@ interface HttpClientInterface
/**
* @param string $path
* @param array $query
*
* @return array
*/
public function get(string $path = "", array $query = []): 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;
public function post( string $path = "", array $body = [] ): array;
/**
* @param string $path
* @param array $body
*
* @return array
*/
public function put(string $path = "", array $body = []): 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;
public function delete( string $path = "", array $body = [] ): ?bool;
/**
* @param array $options
*/
public function setOptions(array $options);
public function setOptions( array $options );
}