hosterra / netbox
NetBox PHP
3.1.4
2024-03-30 14:17 UTC
Requires
- php: ^8.2
- ext-json: *
- guzzlehttp/guzzle: ^7.8
README
NetBox PHP
A PHP "SDK" to use NetBox APIs.
>Note: this package is a fork of the Christian Bönning NetBox PHP package wich is itself a fork of the Wicked Software Corp. "Laravel NetBox" package; original credits go to them.
Installation
composer require hosterra/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
$api = new \Hosterra\NetBox\Api\IPAM\IpAddresses(new \Hosterra\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
- DCIM
- Cables
- ConnectedDevices
- ConsoleConnections
- ConsolePortTemplates
- ConsolePorts
- ConsoleServerPortTemplates
- ConsoleServerPorts
- DeviceBayTemplates
- DeviceBays
- DeviceRoles
- DeviceTypes
- Devices
- FrontPortTemplates
- FrontPorts
- InterfaceConnections
- InterfaceTemplates
- Interfaces
- InventoryItems
- Manufacturers
- ModuleBays
- Modules
- Platforms
- PowerFeeds
- PowerOutletTemplates
- PowerOutlets
- PowerPanels
- PowerPortTemplates
- PowerPorts
- RackGroups
- RackReservations
- RackRoles
- Racks
- RearPortTemplates
- RearPorts
- Regions
- Sites
- VirtualChassis
- Extras
- IPAM
- Secrets
- Tenancy
- Users
- Virtualization