« blib/lib/RackTables/Schema/Result/viewIPv4AddressNetwork.pm
↑ Summary
blib/lib/RackTables/Schema/Result/viewRack.pm »
| 1 | package RackTables::Schema::Result::viewIPv4AddressRange; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use MooseX::NonMoose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use RackTables::Types; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | extends 'DBIx::Class::Core'; | |
| 8 | |||
| 9 | |||
| 10 | 1 | __PACKAGE__->table_class("DBIx::Class::ResultSource::View"); | |
| 11 | 1 | __PACKAGE__->table("ipv4_address_range"); | |
| 12 | 1 | __PACKAGE__->result_source_instance->is_virtual(1); | |
| 13 | 1 | __PACKAGE__->result_source_instance->view_definition(q{ | |
| 14 | SELECT name as iface, type, inet_ntoa(ip) as addr, object_id | ||
| 15 | FROM IPv4Allocation | ||
| 16 | WHERE ip between ? and ? | ||
| 17 | }); | ||
| 18 | |||
| 19 | |||
| 20 | 1 | __PACKAGE__->add_columns( | |
| 21 | iface => { RT_STRING, is_nullable => 0 }, | ||
| 22 | type => { RT_STRING, is_nullable => 0 }, | ||
| 23 | addr => { RT_STRING, is_nullable => 0 }, | ||
| 24 | object_id => { RT_UNSIGNED }, | ||
| 25 | ); | ||
| 26 | |||
| 27 | |||
| 28 | 1 | __PACKAGE__->meta->make_immutable; | |
| 29 | |||
| 30 | __END__ | ||