netbox-php/src/Api/Virtualization/Clusters.php

72 lines
1.5 KiB
PHP
Raw Permalink Normal View History

2021-03-12 17:20:32 -04:00
<?php
2024-02-12 10:46:19 +01:00
namespace Hosterra\NetBox\Api\Virtualization;
2021-03-12 17:20:32 -04:00
2022-05-31 12:56:36 +02:00
use GuzzleHttp\Exception\GuzzleException;
2024-02-12 10:46:19 +01:00
use Hosterra\NetBox\Api\AbstractApi;
2024-02-12 11:28:56 +01:00
class Clusters extends AbstractApi {
/**
* @param array $params
*
* @return array
* @throws GuzzleException
*/
public function add( array $params = [] ): array {
return $this->post( "/virtualization/clusters/", $params );
}
2021-03-12 17:20:32 -04:00
2024-02-12 11:28:56 +01:00
/**
* @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 );
}
2021-03-12 17:20:32 -04:00
2024-02-12 11:28:56 +01:00
/**
* @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 );
}
2021-03-12 17:20:32 -04:00
2024-02-12 11:28:56 +01:00
/**
* @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 );
}
2024-02-12 11:28:56 +01:00
/**
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function list( array $params = [] ) {
return $this->get( "/virtualization/clusters/", $params );
}
2021-03-12 17:20:32 -04:00
2024-02-12 11:28:56 +01:00
/**
* @param int $id
* @param array $params
*
* @return mixed
* @throws GuzzleException
*/
public function show( int $id, array $params = [] ) {
return $this->get( "/virtualization/clusters/" . $id . "/", $params );
}
2021-03-12 17:20:32 -04:00
}