Refactor Package to be Standalone

This commit is contained in:
Christian Bönning 2022-05-31 12:56:36 +02:00
commit 025a7edacb
129 changed files with 3386 additions and 3974 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
vendor
composer.lock

View file

@ -1,7 +0,0 @@
# Change log
Major `laravel-netbox` releases are listed below.
## 1.0.0 - 2021-03-12
- First release

View file

@ -1,30 +0,0 @@
# Installation
## Information
The install of this package is pretty straight forward
## Install Steps
### Install
Install this package with composer:
```
composer require wickedsoft/laravel-netbox
```
### Publish configuration
Copy the config files for laravel-netbox
```
php artisan vendor:publish --provider="wickedsoft\NetBox\ServiceProvider" --tag="config"
```
### Environment file
Add the credentials to your environment file (.env)
```
NETBOX_DEFAULT_URL=
NETBOX_DEFAULT_KEY=
```
### MultiInstalls
If you have multiple Netbox sites, you can add this to your environment file (.env), in order to pick a different default site than the default.
```
NETBOX_CONNECTION=
```

View file

@ -1,6 +1,8 @@
MIT License
Copyright (c) 2021 Wicked Software Corp.
Copyright
* 2021 Wicked Software Corp.
* 2022 Christian Bönning
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

792
README.md
View file

@ -1,677 +1,119 @@
## Laravel NetBox
NetBox is an open source web application designed to help manage and document computer networks.
# NetBox PHP
Note, this is a fork of the Wicked Software Corp. "[Laravel NetBox](https://github.com/wickedsoft/laravel-netbox)" Package, original Credits go to them.
The Package was refactored to allow Installation as a standalone composer package (thus is available under the `port389` namespace for this package). The package was tested against [NetBox v3.2.2](https://github.com/netbox-community/netbox/releases/tag/v3.2.2) while implementing NetBox in the company I'm working for in "scratch your own itch"-Mode. We mainly use the IPAM module in NetBox, other components are not heavily tested.
## Installation
```bash
composer require port389/netbox-php
```
### Environment Variables
The package requires 2 environment variables being set accessible through `getenv()`
| Variable | Type | Default | Description |
|-----------------|--------|---------|-----------------------------------------------------------------------------|
| NETBOX_API | string | "" | the NetBox API Endpoint (e.g. `http://localhost:8080/api`) |
| NETBOX_API_KEY | string | "" | The NetBox API Key created from eg `http://127.0.0.1:8080/user/api-tokens/` |
## Example Usage
```php
$api = new \port389\NetBox\Api\IPAM\IpAddresses(new \port389\NetBox\Client());
$result = $api->add([
'address' => '11.22.33.44/32',
'dns_name' => 'foo.example.com'
]);
$result = $api->list(['address' => '11.22.33.44/32'])
```
## Supported NetBox APIs
* Circuits
* [CircuitTerminations](src/Api/Circuits/CircuitTerminations.php)
* [CircuitTypes](src/Api/Circuits/CircuitTypes.php)
* [Circuits](src/Api/Circuits/Circuits.php)
* [Providers](src/Api/Circuits/Providers.php)
* DCIM
* [Cables](src/Api/DCIM/Cables.php)
* [ConnectedDevices](src/Api/DCIM/ConnectedDevices.php)
* [ConsoleConnections](src/Api/DCIM/ConsoleConnections.php)
* [ConsolePortTemplates](src/Api/DCIM/ConsolePortTemplates.php)
* [ConsolePorts](src/Api/DCIM/ConsolePorts.php)
* [ConsoleServerPortTemplates](src/Api/DCIM/ConsoleServerPortTemplates.php)
* [ConsoleServerPorts](src/Api/DCIM/ConsoleServerPorts.php)
* [DeviceBayTemplates](src/Api/DCIM/DeviceBayTemplates.php)
* [DeviceBays](src/Api/DCIM/DeviceBays.php)
* [DeviceRoles](src/Api/DCIM/DeviceRoles.php)
* [DeviceTypes](src/Api/DCIM/DeviceTypes.php)
* [Devices](src/Api/DCIM/Devices.php)
* [FrontPortTemplates](src/Api/DCIM/FrontPortTemplates.php)
* [FrontPorts](src/Api/DCIM/FrontPorts.php)
* [InterfaceConnections](src/Api/DCIM/InterfaceConnections.php)
* [InterfaceTemplates](src/Api/DCIM/InterfaceTemplates.php)
* [Interfaces](src/Api/DCIM/Interfaces.php)
* [InventoryItems](src/Api/DCIM/InventoryItems.php)
* [Manufacturers](src/Api/DCIM/Manufacturers.php)
* [Platforms](src/Api/DCIM/Platforms.php)
* [PowerFeeds](src/Api/DCIM/PowerFeeds.php)
* [PowerOutletTemplates](src/Api/DCIM/PowerOutletTemplates.php)
* [PowerOutlets](src/Api/DCIM/PowerOutlets.php)
* [PowerPanels](src/Api/DCIM/PowerPanels.php)
* [PowerPortTemplates](src/Api/DCIM/PowerPortTemplates.php)
* [PowerPorts](src/Api/DCIM/PowerPorts.php)
* [RackGroups](src/Api/DCIM/RackGroups.php)
* [RackReservations](src/Api/DCIM/RackReservations.php)
* [RackRoles](src/Api/DCIM/RackRoles.php)
* [Racks](src/Api/DCIM/Racks.php)
* [RearPortTemplates](src/Api/DCIM/RearPortTemplates.php)
* [RearPorts](src/Api/DCIM/RearPorts.php)
* [Regions](src/Api/DCIM/Regions.php)
* [Sites](src/Api/DCIM/Sites.php)
* [VirtualChassis](src/Api/DCIM/VirtualChassis.php)
* Extras
* [ConfigContexts](src/Api/Extras/ConfigContexts.php)
* [ContentTypes](src/Api/Extras/ContentTypes.php)
* [CustomFields](src/Api/Extras/CustomFields.php)
* [ExportTemplates](src/Api/Extras/ExportTemplates.php)
* [ImageAttachments](src/Api/Extras/ImageAttachments.php)
* [JobResults](src/Api/Extras/JobResults.php)
* [ObjectChanges](src/Api/Extras/ObjectChanges.php)
* [Reports](src/Api/Extras/Reports.php)
* [Scripts](src/Api/Extras/Scripts.php)
* [Tags](src/Api/Extras/Tags.php)
* IPAM
* [Aggregates](src/Api/IPAM/Aggregates.php)
* [IpAddresses](src/Api/IPAM/IpAddresses.php)
* [Prefixes](src/Api/IPAM/Prefixes.php)
* [Rirs](src/Api/IPAM/Rirs.php)
* [Roles](src/Api/IPAM/Roles.php)
* [RouteTargets](src/Api/IPAM/RouteTargets.php)
* [Services](src/Api/IPAM/Services.php)
* [VlanGroups](src/Api/IPAM/VlanGroups.php)
* [Vlans](src/Api/IPAM/Vlans.php)
* [Vrfs](src/Api/IPAM/Vrfs.php)
* Secrets
* [KeyGen](src/Api/Secrets/KeyGen.php)
* [SecretRoles](src/Api/Secrets/SecretRoles.php)
* [Secrets](src/Api/Secrets/Secrets.php)
* [Session](src/Api/Secrets/Session.php)
* Tenancy
* [TenantGroups](src/Api/Tenancy/TenantGroups.php)
* [Tenants](src/Api/Tenancy/Tenants.php)
* Users
* [Config](src/Api/Users/Config.php)
* [Groups](src/Api/Users/Groups.php)
* [Permissions](src/Api/Users/Permissions.php)
* [Users](src/Api/Users/Users.php)
* Virtualization
* [ClusterGroups](src/Api/Virtualization/ClusterGroups.php)
* [ClusterTypes](src/Api/Virtualization/ClusterTypes.php)
* [Clusters](src/Api/Virtualization/Clusters.php)
* [Interfaces](src/Api/Virtualization/Interfaces.php)
* [VirtualMachines](src/Api/Virtualization/VirtualMachines.php)
### Table of contents
- [Installation](INSTALL.md)
- [Usage](#usage)
- [Authentication](#authentication)
- [MultiInstalls](#multiinstalls)
- [Change log](CHANGELOG.md)
- [License](LICENSE.md)
### Usage
#### Global
```php
NetBox::status()->show(array $params)
```
#### Circuits
```php
NetBox::circuits()->list(array $params)
NetBox::circuits()->add(array $params)
NetBox::circuits()->remove(int $id, array $params)
NetBox::circuits()->edit(int $id, array $params)
NetBox::circuits()->show(int $id, array $params)
```
```php
NetBox::providers()->list(array $params)
NetBox::providers()->add(array $params)
NetBox::providers()->remove(int $id, array $params)
NetBox::providers()->edit(int $id, array $params)
NetBox::providers()->show(int $id, array $params)
```
```php
NetBox::circuitTerminations()->list(array $params)
NetBox::circuitTerminations()->add(array $params)
NetBox::circuitTerminations()->remove(int $id, array $params)
NetBox::circuitTerminations()->edit(int $id, array $params)
NetBox::circuitTerminations()->show(int $id, array $params)
```
```php
NetBox::circuitTypes()->list(array $params)
NetBox::circuitTypes()->add(array $params)
NetBox::circuitTypes()->remove(int $id, array $params)
NetBox::circuitTypes()->edit(int $id, array $params)
NetBox::circuitTypes()->show(int $id, array $params)
```
#### DCIM
```php
NetBox::cables()->list(array $params)
NetBox::cables()->add(array $params)
NetBox::cables()->remove(int $id, array $params)
NetBox::cables()->edit(int $id, array $params)
NetBox::cables()->show(int $id, array $params)
```
```php
NetBox::connectedDevices()->list(array $params)
```
```php
NetBox::consoleConnections()->list(array $params)
```
```php
NetBox::consolePorts()->list(array $params)
NetBox::consolePorts()->add(array $params)
NetBox::consolePorts()->remove(int $id, array $params)
NetBox::consolePorts()->edit(int $id, array $params)
NetBox::consolePorts()->show(int $id, array $params)
NetBox::consolePorts()->trace(int $id, array $params)
```
```php
NetBox::consolePortTemplates()->list(array $params)
NetBox::consolePortTemplates()->add(array $params)
NetBox::consolePortTemplates()->remove(int $id, array $params)
NetBox::consolePortTemplates()->edit(int $id, array $params)
NetBox::consolePortTemplates()->show(int $id, array $params)
```
```php
NetBox::consoleServerPorts()->list(array $params)
NetBox::consoleServerPorts()->add(array $params)
NetBox::consoleServerPorts()->remove(int $id, array $params)
NetBox::consoleServerPorts()->edit(int $id, array $params)
NetBox::consoleServerPorts()->show(int $id, array $params)
```
```php
NetBox::consoleServerPortTemplates()->list(array $params)
NetBox::consoleServerPortTemplates()->add(array $params)
NetBox::consoleServerPortTemplates()->remove(int $id, array $params)
NetBox::consoleServerPortTemplates()->edit(int $id, array $params)
NetBox::consoleServerPortTemplates()->show(int $id, array $params)
```
```php
NetBox::deviceBays()->list(array $params)
NetBox::deviceBays()->add(array $params)
NetBox::deviceBays()->remove(int $id, array $params)
NetBox::deviceBays()->edit(int $id, array $params)
NetBox::deviceBays()->show(int $id, array $params)
```
```php
NetBox::deviceBayTemplates()->list(array $params)
NetBox::deviceBayTemplates()->add(array $params)
NetBox::deviceBayTemplates()->remove(int $id, array $params)
NetBox::deviceBayTemplates()->edit(int $id, array $params)
NetBox::deviceBayTemplates()->show(int $id, array $params)
```
```php
NetBox::deviceRoles()->list(array $params)
NetBox::deviceRoles()->add(array $params)
NetBox::deviceRoles()->remove(int $id, array $params)
NetBox::deviceRoles()->edit(int $id, array $params)
NetBox::deviceRoles()->show(int $id, array $params)
```
```php
NetBox::devices()->list(array $params)
NetBox::devices()->add(array $params)
NetBox::devices()->remove(int $id, array $params)
NetBox::devices()->edit(int $id, array $params)
NetBox::devices()->show(int $id, array $params)
NetBox::devices()->napalm(int $id, array $params)
```
```php
NetBox::deviceTypes()->list(array $params)
NetBox::deviceTypes()->add(array $params)
NetBox::deviceTypes()->remove(int $id, array $params)
NetBox::deviceTypes()->edit(int $id, array $params)
NetBox::deviceTypes()->show(int $id, array $params)
```
```php
NetBox::frontPorts()->list(array $params)
NetBox::frontPorts()->add(array $params)
NetBox::frontPorts()->remove(int $id, array $params)
NetBox::frontPorts()->edit(int $id, array $params)
NetBox::frontPorts()->show(int $id, array $params)
NetBox::frontPorts()->paths(int $id, array $params)
```
```php
NetBox::frontPortTemplates()->list(array $params)
NetBox::frontPortTemplates()->add(array $params)
NetBox::frontPortTemplates()->remove(int $id, array $params)
NetBox::frontPortTemplates()->edit(int $id, array $params)
NetBox::frontPortTemplates()->show(int $id, array $params)
```
```php
NetBox::interfaceConnections()->list(array $params)
```
```php
NetBox::interfaces()->list(array $params)
NetBox::interfaces()->add(array $params)
NetBox::interfaces()->remove(int $id, array $params)
NetBox::interfaces()->edit(int $id, array $params)
NetBox::interfaces()->show(int $id, array $params)
NetBox::interfaces()->trace(int $id, array $params)
```
```php
NetBox::interfaceTemplates()->list(array $params)
NetBox::interfaceTemplates()->add(array $params)
NetBox::interfaceTemplates()->remove(int $id, array $params)
NetBox::interfaceTemplates()->edit(int $id, array $params)
NetBox::interfaceTemplates()->show(int $id, array $params)
```
```php
NetBox::inventoryItems()->list(array $params)
NetBox::inventoryItems()->add(array $params)
NetBox::inventoryItems()->remove(int $id, array $params)
NetBox::inventoryItems()->edit(int $id, array $params)
NetBox::inventoryItems()->show(int $id, array $params)
```
```php
NetBox::manufacturers()->list(array $params)
NetBox::manufacturers()->add(array $params)
NetBox::manufacturers()->remove(int $id, array $params)
NetBox::manufacturers()->edit(int $id, array $params)
NetBox::manufacturers()->show(int $id, array $params)
```
```php
NetBox::platforms()->list(array $params)
NetBox::platforms()->add(array $params)
NetBox::platforms()->remove(int $id, array $params)
NetBox::platforms()->edit(int $id, array $params)
NetBox::platforms()->show(int $id, array $params)
```
```php
NetBox::powerFeeds()->list(array $params)
NetBox::powerFeeds()->add(array $params)
NetBox::powerFeeds()->remove(int $id, array $params)
NetBox::powerFeeds()->edit(int $id, array $params)
NetBox::powerFeeds()->show(int $id, array $params)
NetBox::powerFeeds()->trace(int $id, array $params)
```
```php
NetBox::powerOutlets()->list(array $params)
NetBox::powerOutlets()->add(array $params)
NetBox::powerOutlets()->remove(int $id, array $params)
NetBox::powerOutlets()->edit(int $id, array $params)
NetBox::powerOutlets()->show(int $id, array $params)
NetBox::powerOutlets()->trace(int $id, array $params)
```
```php
NetBox::powerOutletTemplates()->list(array $params)
NetBox::powerOutletTemplates()->add(array $params)
NetBox::powerOutletTemplates()->remove(int $id, array $params)
NetBox::powerOutletTemplates()->edit(int $id, array $params)
NetBox::powerOutletTemplates()->show(int $id, array $params)
```
```php
NetBox::powerPanels()->list(array $params)
NetBox::powerPanels()->add(array $params)
NetBox::powerPanels()->remove(int $id, array $params)
NetBox::powerPanels()->edit(int $id, array $params)
NetBox::powerPanels()->show(int $id, array $params)
```
```php
NetBox::powerPorts()->list(array $params)
NetBox::powerPorts()->add(array $params)
NetBox::powerPorts()->remove(int $id, array $params)
NetBox::powerPorts()->edit(int $id, array $params)
NetBox::powerPorts()->show(int $id, array $params)
NetBox::powerPorts()->trace(int $id, array $params)
```
```php
NetBox::powerPortTemplates()->list(array $params)
NetBox::powerPortTemplates()->add(array $params)
NetBox::powerPortTemplates()->remove(int $id, array $params)
NetBox::powerPortTemplates()->edit(int $id, array $params)
NetBox::powerPortTemplates()->show(int $id, array $params)
```
```php
NetBox::rackGroups()->list(array $params)
NetBox::rackGroups()->add(array $params)
NetBox::rackGroups()->remove(int $id, array $params)
NetBox::rackGroups()->edit(int $id, array $params)
NetBox::rackGroups()->show(int $id, array $params)
```
```php
NetBox::rackReservations()->list(array $params)
NetBox::rackReservations()->add(array $params)
NetBox::rackReservations()->remove(int $id, array $params)
NetBox::rackReservations()->edit(int $id, array $params)
NetBox::rackReservations()->show(int $id, array $params)
```
```php
NetBox::rackRoles()->list(array $params)
NetBox::rackRoles()->add(array $params)
NetBox::rackRoles()->remove(int $id, array $params)
NetBox::rackRoles()->edit(int $id, array $params)
NetBox::rackRoles()->show(int $id, array $params)
```
```php
NetBox::racks()->list(array $params)
NetBox::racks()->add(array $params)
NetBox::racks()->remove(int $id, array $params)
NetBox::racks()->edit(int $id, array $params)
NetBox::racks()->show(int $id, array $params)
NetBox::racks()->elevation(int $id, array $params)
```
```php
NetBox::rearPorts()->list(array $params)
NetBox::rearPorts()->add(array $params)
NetBox::rearPorts()->remove(int $id, array $params)
NetBox::rearPorts()->edit(int $id, array $params)
NetBox::rearPorts()->show(int $id, array $params)
NetBox::rearPorts()->paths(int $id, array $params)
```
```php
NetBox::rearPortTemplates()->list(array $params)
NetBox::rearPortTemplates()->add(array $params)
NetBox::rearPortTemplates()->remove(int $id, array $params)
NetBox::rearPortTemplates()->edit(int $id, array $params)
NetBox::rearPortTemplates()->show(int $id, array $params)
```
```php
NetBox::regions()->list(array $params)
NetBox::regions()->add(array $params)
NetBox::regions()->remove(int $id, array $params)
NetBox::regions()->edit(int $id, array $params)
NetBox::regions()->show(int $id, array $params)
```
```php
NetBox::sites()->list(array $params)
NetBox::sites()->add(array $params)
NetBox::sites()->remove(int $id, array $params)
NetBox::sites()->edit(int $id, array $params)
NetBox::sites()->show(int $id, array $params)
```
```php
NetBox::virtualChassis()->list(array $params)
NetBox::virtualChassis()->add(array $params)
NetBox::virtualChassis()->remove(int $id, array $params)
NetBox::virtualChassis()->edit(int $id, array $params)
NetBox::virtualChassis()->show(int $id, array $params)
```
#### Extras
```php
NetBox::configContexts()->list(array $params)
NetBox::configContexts()->add(array $params)
NetBox::configContexts()->remove(int $id, array $params)
NetBox::configContexts()->edit(int $id, array $params)
NetBox::configContexts()->show(int $id, array $params)
```
```php
NetBox::contentTypes()->list(array $params)
NetBox::contentTypes()->show(int $id, array $params)
```
```php
NetBox::customFields()->list(array $params)
NetBox::customFields()->add(array $params)
NetBox::customFields()->remove(int $id, array $params)
NetBox::customFields()->edit(int $id, array $params)
NetBox::customFields()->show(int $id, array $params)
```
```php
NetBox::exportTemplates()->list(array $params)
NetBox::exportTemplates()->add(array $params)
NetBox::exportTemplates()->remove(int $id, array $params)
NetBox::exportTemplates()->edit(int $id, array $params)
NetBox::exportTemplates()->show(int $id, array $params)
```
```php
NetBox::imageAttachments()->list(array $params)
NetBox::imageAttachments()->add(array $params)
NetBox::imageAttachments()->remove(int $id, array $params)
NetBox::imageAttachments()->edit(int $id, array $params)
NetBox::imageAttachments()->show(int $id, array $params)
```
```php
NetBox::jobResults()->list(array $params)
NetBox::jobResults()->show(int $id, array $params)
```
```php
NetBox::objectChanges()->list(array $params)
NetBox::objectChanges()->show(int $id, array $params)
```
```php
NetBox::reports()->list(array $params)
NetBox::reports()->show(int $id, array $params)
NetBox::reports()->run(int $id, array $params)
```
```php
NetBox::scripts()->list(array $params)
NetBox::scripts()->show(int $id, array $params)
```
```php
NetBox::tags()->list(array $params)
NetBox::tags()->add(array $params)
NetBox::tags()->remove(int $id, array $params)
NetBox::tags()->edit(int $id, array $params)
NetBox::tags()->show(int $id, array $params)
```
#### IPAM
```php
NetBox::aggregates()->list(array $params)
NetBox::aggregates()->add(array $params)
NetBox::aggregates()->remove(int $id, array $params)
NetBox::aggregates()->edit(int $id, array $params)
NetBox::aggregates()->show(int $id, array $params)
```
```php
NetBox::ipAddresses()->list(array $params)
NetBox::ipAddresses()->add(array $params)
NetBox::ipAddresses()->remove(int $id, array $params)
NetBox::ipAddresses()->edit(int $id, array $params)
NetBox::ipAddresses()->show(int $id, array $params)
```
```php
NetBox::prefixes()->list(array $params)
NetBox::prefixes()->add(array $params)
NetBox::prefixes()->remove(int $id, array $params)
NetBox::prefixes()->edit(int $id, array $params)
NetBox::prefixes()->show(int $id, array $params)
NetBox::prefixes()->addAvailableIps(int $id, array $params)
NetBox::prefixes()->showAvailableIps(int $id, array $params)
NetBox::prefixes()->addAvailable(int $id, array $params)
NetBox::prefixes()->showAvailable(int $id, array $params)
```
```php
NetBox::rirs()->list(array $params)
NetBox::rirs()->add(array $params)
NetBox::rirs()->remove(int $id, array $params)
NetBox::rirs()->edit(int $id, array $params)
NetBox::rirs()->show(int $id, array $params)
```
```php
NetBox::roles()->list(array $params)
NetBox::roles()->add(array $params)
NetBox::roles()->remove(int $id, array $params)
NetBox::roles()->edit(int $id, array $params)
NetBox::roles()->show(int $id, array $params)
```
```php
NetBox::routeTargets()->list(array $params)
NetBox::routeTargets()->add(array $params)
NetBox::routeTargets()->remove(int $id, array $params)
NetBox::routeTargets()->edit(int $id, array $params)
NetBox::routeTargets()->show(int $id, array $params)
```
```php
NetBox::services()->list(array $params)
NetBox::services()->add(array $params)
NetBox::services()->remove(int $id, array $params)
NetBox::services()->edit(int $id, array $params)
NetBox::services()->show(int $id, array $params)
```
```php
NetBox::vlanGroups()->list(array $params)
NetBox::vlanGroups()->add(array $params)
NetBox::vlanGroups()->remove(int $id, array $params)
NetBox::vlanGroups()->edit(int $id, array $params)
NetBox::vlanGroups()->show(int $id, array $params)
```
```php
NetBox::vlans()->list(array $params)
NetBox::vlans()->add(array $params)
NetBox::vlans()->remove(int $id, array $params)
NetBox::vlans()->edit(int $id, array $params)
NetBox::vlans()->show(int $id, array $params)
```
```php
NetBox::vrfs()->list(array $params)
NetBox::vrfs()->add(array $params)
NetBox::vrfs()->remove(int $id, array $params)
NetBox::vrfs()->edit(int $id, array $params)
NetBox::vrfs()->show(int $id, array $params)
```
#### Secrets
```php
NetBox::keyGen()->list(array $params)
```
```php
NetBox::secrets()->list(array $params)
NetBox::secrets()->add(array $params)
NetBox::secrets()->remove(int $id, array $params)
NetBox::secrets()->edit(int $id, array $params)
NetBox::secrets()->show(int $id, array $params)
```
```php
NetBox::secretRoles()->list(array $params)
NetBox::secretRoles()->add(array $params)
NetBox::secretRoles()->remove(int $id, array $params)
NetBox::secretRoles()->edit(int $id, array $params)
NetBox::secretRoles()->show(int $id, array $params)
```
```php
NetBox::session()->list(array $params)
```
#### Tenancy
```php
NetBox::tenantGroups()->list(array $params)
NetBox::tenantGroups()->add(array $params)
NetBox::tenantGroups()->remove(int $id, array $params)
NetBox::tenantGroups()->edit(int $id, array $params)
NetBox::tenantGroups()->show(int $id, array $params)
```
```php
NetBox::tenants()->list(array $params)
NetBox::tenants()->add(array $params)
NetBox::tenants()->remove(int $id, array $params)
NetBox::tenants()->edit(int $id, array $params)
NetBox::tenants()->show(int $id, array $params)
```
#### Users
```php
NetBox::config()->list(array $params)
```
```php
NetBox::groups()->list(array $params)
NetBox::groups()->add(array $params)
NetBox::groups()->remove(int $id, array $params)
NetBox::groups()->edit(int $id, array $params)
NetBox::groups()->show(int $id, array $params)
```
```php
NetBox::permissions()->list(array $params)
NetBox::permissions()->add(array $params)
NetBox::permissions()->remove(int $id, array $params)
NetBox::permissions()->edit(int $id, array $params)
NetBox::permissions()->show(int $id, array $params)
```
```php
NetBox::users()->list(array $params)
NetBox::users()->add(array $params)
NetBox::users()->remove(int $id, array $params)
NetBox::users()->edit(int $id, array $params)
NetBox::users()->show(int $id, array $params)
```
#### Virtualization
```php
NetBox::clusterGroups()->list(array $params)
NetBox::clusterGroups()->add(array $params)
NetBox::clusterGroups()->remove(int $id, array $params)
NetBox::clusterGroups()->edit(int $id, array $params)
NetBox::clusterGroups()->show(int $id, array $params)
```
```php
NetBox::clusters()->list(array $params)
NetBox::clusters()->add(array $params)
NetBox::clusters()->remove(int $id, array $params)
NetBox::clusters()->edit(int $id, array $params)
NetBox::clusters()->show(int $id, array $params)
```
```php
NetBox::clusterTypes()->list(array $params)
NetBox::clusterTypes()->add(array $params)
NetBox::clusterTypes()->remove(int $id, array $params)
NetBox::clusterTypes()->edit(int $id, array $params)
NetBox::clusterTypes()->show(int $id, array $params)
```
```php
NetBox::vinterfaces()->list(array $params)
NetBox::vinterfaces()->add(array $params)
NetBox::vinterfaces()->remove(int $id, array $params)
NetBox::vinterfaces()->edit(int $id, array $params)
NetBox::vinterfaces()->show(int $id, array $params)
```
```php
NetBox::virtualMachines()->list(array $params)
NetBox::virtualMachines()->add(array $params)
NetBox::virtualMachines()->remove(int $id, array $params)
NetBox::virtualMachines()->edit(int $id, array $params)
NetBox::virtualMachines()->show(int $id, array $params)
```
### Authentication
It's possible to use a custom `netbox` authentication driver to login users in your application.
*** CURRENTLY AUTHENTICATION DOES NOT WORK CORRECTLY ***
#### Setup
```php
// config/auth.php
'providers' => [
'netbox' => [
'driver' => 'netbox'
],
]
// Auth::attempt
if(Auth::attempt(['username' => $username, 'password' => $password]))
{
dd(Auth::user(), Auth::id());
}
```
#### Caching
By default the UserProfile will be cached for 60 minutes, you can use the command below to clear it, it will refresh the next time it is needed.
```php
cache()->forget('netbox_user_id_' .$user_id);
```
### MultiInstalls
#### Configuration
If you want to work with more Netbox installs, you can define more instances in the `config/netbox.php` file
```php
// config/netbox.php
'sites' => [
'default' => [
'url' => env('NETBOX_DEFAULT_URL'),
'key' => env('NETBOX_DEFAULT_KEY'),
],
'chicago' => [
'url' => env('NETBOX_CHI_URL'),
'key' => env('NETBOX_CHI_KEY'),
],
],
```
#### Default site
If you have multiple Netbox sites, you can add this to your environment file (.env), in order to pick a different default site than the default.
```
NETBOX_CONNECTION=
```
#### Access
To use another netbox than your default one, you can specify it with the site method
```php
// UsersController
public function getIndex()
{
$users = NetBox::site('chicago')->users()->list([
'limit' => 20
]);
//
}
```
#### Dependency injection
```php
// Route
Route::get('/netbox/{netBox}/users', ['as' => 'netbox/users', 'uses' => 'UsersController@getIndex']);
Route::bind('netBox', function ($value, $route) {
app('NetBox')->site($value);
return app('NetBox');
});
// UsersController
public function getIndex(NetBox $netBox)
{
$users = $netBox->users()->list([
'limit' => 20
]);
//
}
```
- - -

View file

@ -1,44 +1,18 @@
{
"name": "wickedsoft/laravel-netbox",
"description": "Netbox for Laravel 8.x",
"keywords": ["netbox", "laravel"],
"name": "port389/netbox",
"description": "Netbox for PHP",
"keywords": ["netbox"],
"license": "MIT",
"require": {
"php": "^8.0|^7.4|^7.3|^7.2",
"laravel/framework": "^8.0",
"guzzlehttp/guzzle": "^7.0.1"
},
"require-dev": {
"phpunit/phpunit" : "^9.3.3",
"orchestra/testbench": "^6.0"
"php": "^8.1|^8.0|^7.4|^7.3|^7.2",
"ext-json": "*",
"guzzlehttp/guzzle": "^6.5.0"
},
"autoload": {
"psr-4": {
"wickedsoft\\NetBox\\": "src/"
},
"files": [
"src/helpers.php"
]
},
"autoload-dev": {
"psr-4": {
"wickedsoft\\NetBox\\tests\\": "tests"
"port389\\NetBox\\": "src/"
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"laravel": {
"providers": [
"wickedsoft\\NetBox\\ServiceProvider"
],
"aliases": {
"NetBox": "wickedsoft\\NetBox\\Facade"
}
}
}
"minimum-stability": "stable",
"prefer-stable": true
}

View file

@ -1,24 +0,0 @@
<?php
return [
'default' => env('NETBOX_CONNECTION', 'default'),
'sites' => [
'default' => [
'url' => env('NETBOX_DEFAULT_URL'),
'key' => env('NETBOX_DEFAULT_KEY'),
],
],
'client_options' => [
\GuzzleHttp\RequestOptions::COOKIES => true,
\GuzzleHttp\RequestOptions::CONNECT_TIMEOUT => 10,
\GuzzleHttp\RequestOptions::TIMEOUT => 10,
\GuzzleHttp\RequestOptions::ALLOW_REDIRECTS => false,
\GuzzleHttp\RequestOptions::HEADERS => [
'Authorization' => "Token ".env('NETBOX_DEFAULT_KEY'),
],
],
];

View file

@ -1,17 +1,18 @@
<?php
namespace wickedsoft\NetBox\Api;
namespace port389\NetBox\Api;
use wickedsoft\NetBox\Client;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Client;
abstract class AbstractApi implements ApiInterface
{
/** @var \wickedsoft\NetBox\Client */
/** @var Client */
public $client;
/**
* AbstractApi constructor.
* @param \wickedsoft\NetBox\Client $client
* @param Client $client
*/
public function __construct(Client $client)
{
@ -19,41 +20,45 @@ abstract class AbstractApi implements ApiInterface
}
/**
* @param $path
* @param array $parameters
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
protected function get($path, $parameters)
protected function get($path, array $parameters)
{
return $this->client->getHttpClient()->get($path, $parameters);
}
/**
* @param $path
* @param array $parameters
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @return array
* @throws GuzzleException
*/
protected function post($path, $parameters)
protected function post($path, array $parameters): array
{
return $this->client->getHttpClient()->post($path, $parameters);
}
/**
* @param $path
* @param array $parameters
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @return array
* @throws GuzzleException
*/
protected function put($path, $parameters)
protected function put($path, array $parameters): array
{
return $this->client->getHttpClient()->put($path, $parameters);
}
/**
* @param $path
* @param array $parameters
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @return bool
* @throws GuzzleException
*/
protected function delete($path, $parameters)
protected function delete($path, array $parameters): bool
{
return $this->client->getHttpClient()->delete($path, $parameters);
}

View file

@ -1,6 +1,6 @@
<?php
namespace wickedsoft\NetBox\Api;
namespace port389\NetBox\Api;
interface ApiInterface
{

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Circuits;
namespace port389\NetBox\Api\Circuits;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class CircuitTerminations extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/circuits/circuit-terminations/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/circuits/circuit-terminations/".$id."/", $params);
return $this->delete("/circuits/circuit-terminations/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/circuits/circuit-terminations/".$id."/", $params);
return $this->put("/circuits/circuit-terminations/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/circuits/circuit-terminations/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/circuits/circuit-terminations/".$id."/", $params);
return $this->get("/circuits/circuit-terminations/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Circuits;
namespace port389\NetBox\Api\Circuits;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class CircuitTypes extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/circuits/circuit-types/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/circuits/circuit-types/".$id."/", $params);
return $this->delete("/circuits/circuit-types/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/circuits/circuit-types/".$id."/", $params);
return $this->put("/circuits/circuit-types/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/circuits/circuit-types/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/circuits/circuit-types/".$id."/", $params);
return $this->get("/circuits/circuit-types/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Circuits;
namespace port389\NetBox\Api\Circuits;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Circuits extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/circuits/circuits/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/circuits/circuits/".$id."/", $params);
return $this->delete("/circuits/circuits/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/circuits/circuits/".$id."/", $params);
return $this->put("/circuits/circuits/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/circuits/circuits/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/circuits/circuits/".$id."/", $params);
return $this->get("/circuits/circuits/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Circuits;
namespace port389\NetBox\Api\Circuits;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Providers extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/circuits/providers/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/circuits/providers/".$id."/", $params);
return $this->delete("/circuits/providers/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/circuits/providers/".$id."/", $params);
return $this->put("/circuits/providers/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/circuits/providers/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/circuits/providers/".$id."/", $params);
return $this->get("/circuits/providers/" . $id . "/", $params);
}
}

62
src/Api/DCIM/Cables.php Normal file
View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Cables extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/cables/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/cables/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/cables/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/cables/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/cables/" . $id . "/", $params);
}
}

View file

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

View file

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

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ConsolePortTemplates extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/console-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/console-port-templates/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/console-port-templates/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/console-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/console-port-templates/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ConsolePorts extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/console-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/console-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/console-ports/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/console-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/console-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function trace(int $id, array $params = [])
{
return $this->get("/dcim/console-ports/" . $id . "/trace/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ConsoleServerPortTemplates extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/console-server-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/console-server-port-templates/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/console-server-port-templates/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/console-server-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/console-server-port-templates/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ConsoleServerPorts extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/console-server-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/console-server-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/console-server-ports/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/console-server-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/console-server-ports/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class DeviceBayTemplates extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/device-bay-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/device-bay-templates/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/device-bay-templates/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/device-bay-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/device-bay-templates/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class DeviceBays extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/device-bays/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/device-bays/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/device-bays/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/device-bays/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/device-bays/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class DeviceRoles extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/device-roles/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/device-roles/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/device-roles/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/device-roles/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/device-roles/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class DeviceTypes extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/device-types/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/device-types/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/device-types/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/device-types/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/device-types/" . $id . "/", $params);
}
}

73
src/Api/DCIM/Devices.php Normal file
View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Devices extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/devices/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/devices/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/devices/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/devices/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/devices/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function napalm(int $id, array $params = [])
{
return $this->get("/dcim/devices/" . $id . "/napalm/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class FrontPortTemplates extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/front-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/front-port-templates/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/front-port-templates/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/front-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/front-port-templates/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class FrontPorts extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/front-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/front-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/front-ports/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/front-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/front-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function paths(int $id, array $params = [])
{
return $this->get("/dcim/front-ports/" . $id . "/paths/", $params);
}
}

View file

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

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class InterfaceTemplates extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/interface-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/interface-templates/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/interface-templates/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/interface-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/interface-templates/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Interfaces extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/interfaces/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/interfaces/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/interfaces/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/interfaces/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/interfaces/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function trace(int $id, array $params = [])
{
return $this->get("/dcim/interfaces/" . $id . "/trace/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class InventoryItems extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/inventory-items/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/inventory-items/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/inventory-items/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/inventory-items/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/inventory-items/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Manufacturers extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/manufacturers/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/manufacturers/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/manufacturers/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/manufacturers/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/manufacturers/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Platforms extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/platforms/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/platforms/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/platforms/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/platforms/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/platforms/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class PowerFeeds extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/power-feeds/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/power-feeds/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/power-feeds/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/power-feeds/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/power-feeds/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function trace(int $id, array $params = [])
{
return $this->get("/dcim/power-feeds/" . $id . "/trace/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class PowerOutletTemplates extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/power-outlet-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/power-outlet-templates/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/power-outlet-templates/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/power-outlet-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/power-outlet-templates/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class PowerOutlets extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/power-outlets/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/power-outlets/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/power-outlets/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/power-outlets/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/power-outlets/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function trace(int $id, array $params = [])
{
return $this->get("/dcim/power-outlets/" . $id . "/trace/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class PowerPanels extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/power-panels/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/power-panels/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/power-panels/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/power-panels/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/power-panels/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class PowerPortTemplates extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/power-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/power-port-templates/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/power-port-templates/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/power-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/power-port-templates/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class PowerPorts extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/power-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/power-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/power-ports/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/power-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/power-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function trace(int $id, array $params = [])
{
return $this->get("/dcim/power-ports/" . $id . "/trace/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class RackGroups extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/rack-groups/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/rack-groups/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/rack-groups/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/rack-groups/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/rack-groups/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class RackReservations extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/rack-reservations/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/rack-reservations/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/rack-reservations/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/rack-reservations/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/rack-reservations/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class RackRoles extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/rack-roles/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/rack-roles/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/rack-roles/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/rack-roles/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/rack-roles/" . $id . "/", $params);
}
}

73
src/Api/DCIM/Racks.php Normal file
View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Racks extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/racks/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/racks/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/racks/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/racks/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/racks/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function elevation(int $id, array $params = [])
{
return $this->get("/dcim/racks/" . $id . "/elevation/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class RearPortTemplates extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/rear-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/rear-port-templates/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/rear-port-templates/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/rear-port-templates/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/rear-port-templates/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,73 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class RearPorts extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/rear-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/rear-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/rear-ports/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/rear-ports/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/rear-ports/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function paths(int $id, array $params = [])
{
return $this->get("/dcim/rear-ports/" . $id . "/paths/", $params);
}
}

62
src/Api/DCIM/Regions.php Normal file
View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Regions extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/regions/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/regions/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/regions/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/regions/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/regions/" . $id . "/", $params);
}
}

62
src/Api/DCIM/Sites.php Normal file
View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Sites extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/sites/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/sites/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/sites/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/sites/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/sites/" . $id . "/", $params);
}
}

View file

@ -0,0 +1,62 @@
<?php
namespace port389\NetBox\Api\DCIM;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class VirtualChassis extends AbstractApi
{
/**
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add(array $params = []): array
{
return $this->post("/dcim/virtual-chassis/", $params);
}
/**
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove(int $id, array $params = []): bool
{
return $this->delete("/dcim/virtual-chassis/" . $id . "/", $params);
}
/**
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit(int $id, array $params = []): array
{
return $this->put("/dcim/virtual-chassis/" . $id . "/", $params);
}
/**
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function list(array $params = [])
{
return $this->get("/dcim/virtual-chassis/", $params);
}
/**
* @param int $id
* @param array $params
* @return mixed
* @throws GuzzleException
*/
public function show(int $id, array $params = [])
{
return $this->get("/dcim/virtual-chassis/" . $id . "/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class Cables extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/cables/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/cables/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/cables/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/cables/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/cables/".$id."/", $params);
}
}

View file

@ -1,18 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class ConnectedDevices extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/connected-device/", $params);
}
}

View file

@ -1,18 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class ConsoleConnections extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/console-connections/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class ConsolePortTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/console-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/console-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/console-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/console-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/console-port-templates/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class ConsolePorts extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/console-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/console-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/console-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/console-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/console-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function trace($id, $params=[])
{
return $this->get("/dcim/console-ports/".$id."/trace/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class ConsoleServerPortTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/console-server-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/console-server-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/console-server-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/console-server-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/console-server-port-templates/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class ConsoleServerPorts extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/console-server-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/console-server-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/console-server-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/console-server-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/console-server-ports/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class DeviceBayTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/device-bay-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/device-bay-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/device-bay-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/device-bay-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/device-bay-templates/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class DeviceBays extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/device-bays/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/device-bays/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/device-bays/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/device-bays/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/device-bays/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class DeviceRoles extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/device-roles/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/device-roles/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/device-roles/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/device-roles/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/device-roles/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class DeviceTypes extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/device-types/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/device-types/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/device-types/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/device-types/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/device-types/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class Devices extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/devices/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/devices/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/devices/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/devices/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/devices/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function napalm($id, $params=[])
{
return $this->get("/dcim/devices/".$id."/napalm/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class FrontPortTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/front-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/front-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/front-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/front-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/front-port-templates/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class FrontPorts extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/front-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/front-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/front-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/front-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/front-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function paths($id, $params=[])
{
return $this->get("/dcim/front-ports/".$id."/paths/", $params);
}
}

View file

@ -1,18 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class InterfaceConnections extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/interface-connections/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class InterfaceTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/interface-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/interface-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/interface-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/interface-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/interface-templates/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class Interfaces extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/interfaces/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/interfaces/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/interfaces/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/interfaces/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/interfaces/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function trace($id, $params=[])
{
return $this->get("/dcim/interfaces/".$id."/trace/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class InventoryItems extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/inventory-items/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/inventory-items/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/inventory-items/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/inventory-items/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/inventory-items/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class Manufacturers extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/manufacturers/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/manufacturers/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/manufacturers/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/manufacturers/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/manufacturers/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class Platforms extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/platforms/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/platforms/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/platforms/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/platforms/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/platforms/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class PowerFeeds extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/power-feeds/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/power-feeds/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/power-feeds/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/power-feeds/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/power-feeds/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function trace($id, $params=[])
{
return $this->get("/dcim/power-feeds/".$id."/trace/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class PowerOutletTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/power-outlet-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/power-outlet-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/power-outlet-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/power-outlet-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/power-outlet-templates/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class PowerOutlets extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/power-outlets/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/power-outlets/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/power-outlets/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/power-outlets/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/power-outlets/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function trace($id, $params=[])
{
return $this->get("/dcim/power-outlets/".$id."/trace/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class PowerPanels extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/power-panels/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/power-panels/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/power-panels/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/power-panels/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/power-panels/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class PowerPortTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/power-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/power-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/power-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/power-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/power-port-templates/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class PowerPorts extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/power-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/power-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/power-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/power-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/power-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function trace($id, $params=[])
{
return $this->get("/dcim/power-ports/".$id."/trace/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class RackGroups extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/rack-groups/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/rack-groups/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/rack-groups/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/rack-groups/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/rack-groups/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class RackReservations extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/rack-reservations/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/rack-reservations/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/rack-reservations/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/rack-reservations/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/rack-reservations/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class RackRoles extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/rack-roles/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/rack-roles/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/rack-roles/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/rack-roles/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/rack-roles/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class Racks extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/racks/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/racks/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/racks/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/racks/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/racks/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function elevation($id, $params=[])
{
return $this->get("/dcim/racks/".$id."/elevation/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class RearPortTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/rear-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/rear-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/rear-port-templates/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/rear-port-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/rear-port-templates/".$id."/", $params);
}
}

View file

@ -1,68 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class RearPorts extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/rear-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/rear-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/rear-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/rear-ports/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/rear-ports/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function paths($id, $params=[])
{
return $this->get("/dcim/rear-ports/".$id."/paths/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class Regions extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/regions/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/regions/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/regions/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/regions/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/regions/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class Sites extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/sites/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/sites/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/sites/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/sites/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/sites/".$id."/", $params);
}
}

View file

@ -1,58 +0,0 @@
<?php
namespace wickedsoft\NetBox\Api\DCMI;
use wickedsoft\NetBox\Api\AbstractApi;
class VirtualChassis extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function add($params=[])
{
return $this->post("/dcim/virtual-chassis/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function remove($id, $params=[])
{
return $this->delete("/dcim/virtual-chassis/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function edit($id, $params=[])
{
return $this->put("/dcim/virtual-chassis/".$id."/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function list($params=[])
{
return $this->get("/dcim/virtual-chassis/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
*/
public function show($id, $params=[])
{
return $this->get("/dcim/virtual-chassis/".$id."/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ConfigContexts extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/extras/config-contexts/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/extras/config-contexts/".$id."/", $params);
return $this->delete("/extras/config-contexts/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/extras/config-contexts/".$id."/", $params);
return $this->put("/extras/config-contexts/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/config-contexts/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/config-contexts/".$id."/", $params);
return $this->get("/extras/config-contexts/" . $id . "/", $params);
}
}

View file

@ -1,28 +1,30 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ContentTypes extends AbstractApi
{
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/content-types/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/content-types/".$id."/", $params);
return $this->get("/extras/content-types/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class CustomFields extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/extras/custom-fields/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/extras/custom-fields/".$id."/", $params);
return $this->delete("/extras/custom-fields/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/extras/custom-fields/".$id."/", $params);
return $this->put("/extras/custom-fields/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/custom-fields/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/custom-fields/".$id."/", $params);
return $this->get("/extras/custom-fields/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ExportTemplates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/extras/export-templates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/extras/export-templates/".$id."/", $params);
return $this->delete("/extras/export-templates/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/extras/export-templates/".$id."/", $params);
return $this->put("/extras/export-templates/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/export-templates/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/export-templates/".$id."/", $params);
return $this->get("/extras/export-templates/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ImageAttachments extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/extras/image-attachments/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/extras/image-attachments/".$id."/", $params);
return $this->delete("/extras/image-attachments/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/extras/image-attachments/".$id."/", $params);
return $this->put("/extras/image-attachments/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/image-attachments/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/image-attachments/".$id."/", $params);
return $this->get("/extras/image-attachments/" . $id . "/", $params);
}
}

View file

@ -1,28 +1,30 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class JobResults extends AbstractApi
{
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/job-results/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/job-results/".$id."/", $params);
return $this->get("/extras/job-results/" . $id . "/", $params);
}
}

View file

@ -1,28 +1,30 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class ObjectChanges extends AbstractApi
{
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/object-changes/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/object-changes/".$id."/", $params);
return $this->get("/extras/object-changes/" . $id . "/", $params);
}
}

View file

@ -1,38 +1,41 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Reports extends AbstractApi
{
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/reports/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/reports/".$id."/", $params);
return $this->get("/extras/reports/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function run($id, $params=[])
public function run(int $id, array $params = []): array
{
return $this->post("/extras/reports/".$id."/run/", $params);
return $this->post("/extras/reports/" . $id . "/run/", $params);
}
}

View file

@ -1,28 +1,30 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Scripts extends AbstractApi
{
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/scripts/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/scripts/".$id."/", $params);
return $this->get("/extras/scripts/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\Extras;
namespace port389\NetBox\Api\Extras;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Tags extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/extras/tags/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/extras/tags/".$id."/", $params);
return $this->delete("/extras/tags/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/extras/tags/".$id."/", $params);
return $this->put("/extras/tags/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/extras/tags/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/extras/tags/".$id."/", $params);
return $this->get("/extras/tags/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\IPAM;
namespace port389\NetBox\Api\IPAM;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Aggregates extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/ipam/aggregates/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/ipam/aggregates/".$id."/", $params);
return $this->delete("/ipam/aggregates/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/ipam/aggregates/".$id."/", $params);
return $this->put("/ipam/aggregates/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/ipam/aggregates/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/ipam/aggregates/".$id."/", $params);
return $this->get("/ipam/aggregates/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\IPAM;
namespace port389\NetBox\Api\IPAM;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class IpAddresses extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/ipam/ip-addresses/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/ipam/ip-addresses/".$id."/", $params);
return $this->delete("/ipam/ip-addresses/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/ipam/ip-addresses/".$id."/", $params);
return $this->put("/ipam/ip-addresses/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/ipam/ip-addresses/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/ipam/ip-addresses/".$id."/", $params);
return $this->get("/ipam/ip-addresses/" . $id . "/", $params);
}
}

View file

@ -1,98 +1,106 @@
<?php
namespace wickedsoft\NetBox\Api\IPAM;
namespace port389\NetBox\Api\IPAM;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Prefixes extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/ipam/prefixes/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/ipam/prefixes/".$id."/", $params);
return $this->delete("/ipam/prefixes/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/ipam/prefixes/".$id."/", $params);
return $this->put("/ipam/prefixes/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/ipam/prefixes/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/ipam/prefixes/".$id."/", $params);
return $this->get("/ipam/prefixes/" . $id . "/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function showAvailableIps($id, $params=[])
public function showAvailableIps(int $id, array $params = [])
{
return $this->get("/ipam/prefixes/".$id."/available-ips/", $params);
return $this->get("/ipam/prefixes/" . $id . "/available-ips/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function addAvailableIps($id, $params=[])
public function addAvailableIps(int $id, array $params = []): array
{
return $this->post("/ipam/prefixes/".$id."/available-ips/", $params);
return $this->post("/ipam/prefixes/" . $id . "/available-ips/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function showAvailable($id, $params=[])
public function showAvailable(int $id, array $params = [])
{
return $this->get("/ipam/prefixes/".$id."/available-prefixes/", $params);
return $this->get("/ipam/prefixes/" . $id . "/available-prefixes/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function addAvailable($id, $params=[])
public function addAvailable(int $id, array $params = []): array
{
return $this->post("/ipam/prefixes/".$id."/available-prefixes/", $params);
return $this->post("/ipam/prefixes/" . $id . "/available-prefixes/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\IPAM;
namespace port389\NetBox\Api\IPAM;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Rirs extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/ipam/rirs/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/ipam/rirs/".$id."/", $params);
return $this->delete("/ipam/rirs/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/ipam/rirs/".$id."/", $params);
return $this->put("/ipam/rirs/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/ipam/rirs/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/ipam/rirs/".$id."/", $params);
return $this->get("/ipam/rirs/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\IPAM;
namespace port389\NetBox\Api\IPAM;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Roles extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/ipam/roles/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/ipam/roles/".$id."/", $params);
return $this->delete("/ipam/roles/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/ipam/roles/".$id."/", $params);
return $this->put("/ipam/roles/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/ipam/roles/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/ipam/roles/".$id."/", $params);
return $this->get("/ipam/roles/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\IPAM;
namespace port389\NetBox\Api\IPAM;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class RouteTargets extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/ipam/route-targets/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/ipam/route-targets/".$id."/", $params);
return $this->delete("/ipam/route-targets/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/ipam/route-targets/".$id."/", $params);
return $this->put("/ipam/route-targets/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/ipam/route-targets/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/ipam/route-targets/".$id."/", $params);
return $this->get("/ipam/route-targets/" . $id . "/", $params);
}
}

View file

@ -1,58 +1,62 @@
<?php
namespace wickedsoft\NetBox\Api\IPAM;
namespace port389\NetBox\Api\IPAM;
use wickedsoft\NetBox\Api\AbstractApi;
use GuzzleHttp\Exception\GuzzleException;
use port389\NetBox\Api\AbstractApi;
class Services extends AbstractApi
{
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param array $params
* @return array
* @throws GuzzleException
*/
public function add($params=[])
public function add(array $params = []): array
{
return $this->post("/ipam/services/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return bool
* @throws GuzzleException
*/
public function remove($id, $params=[])
public function remove(int $id, array $params = []): bool
{
return $this->delete("/ipam/services/".$id."/", $params);
return $this->delete("/ipam/services/" . $id . "/", $params);
}
/**
* @param $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @param int $id
* @param array $params
* @return array
* @throws GuzzleException
*/
public function edit($id, $params=[])
public function edit(int $id, array $params = []): array
{
return $this->put("/ipam/services/".$id."/", $params);
return $this->put("/ipam/services/" . $id . "/", $params);
}
/**
* @param $params
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function list($params=[])
public function list(array $params = [])
{
return $this->get("/ipam/services/", $params);
}
/**
* @param $params
* @param int $id
* @param array $params
* @return mixed
* @throws \GuzzleHttp\Exception\GuzzleException
* @throws GuzzleException
*/
public function show($id, $params=[])
public function show(int $id, array $params = [])
{
return $this->get("/ipam/services/".$id."/", $params);
return $this->get("/ipam/services/" . $id . "/", $params);
}
}

Some files were not shown because too many files have changed in this diff Show more