MT#17173 Remove Moose Roles from API

Conflicts:
	lib/NGCP/Panel/Controller/API/MetaConfigDefs.pm
	lib/NGCP/Panel/Controller/API/Root.pm
Change-Id: I25597baebbec6e2436b15776da17bd6d1bfef838
changes/57/4657/6
Irina Peshinskaya 9 years ago
parent 0b077f3eff
commit 0272c297b8

@ -1,34 +1,30 @@
package NGCP::Panel::Controller::API::Admins;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines admins to log into the system via panel or api.',
);
sub api_description {
return'Defines admins to log into the system via panel or api.';
}
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for admins belonging to a specific reseller',
@ -51,14 +47,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::Admins';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Admins/;
class_has('resource_name', is => 'ro', default => 'admins');
class_has('dispatch_path', is => 'ro', default => '/api/admins/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-admins');
sub resource_name{
return 'admins';
}
sub dispatch_path{
return '/api/admins/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-admins';
}
__PACKAGE__->config(
action => {

@ -1,42 +1,45 @@
package NGCP::Panel::Controller::API::ApplyRewrites;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::ApplyRewrites';
sub allowed_methods{
return [qw/POST OPTIONS/];
}
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Applies rewrite rules to a given number according to the given direction. It can for example be used to normalize user input to E164 using callee_in direction, or to denormalize E164 to user output using caller_out.',
);
use base qw/Catalyst::Controller NGCP::Panel::Role::API::ApplyRewrites/;
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
]},
);
sub api_description {
return 'Applies rewrite rules to a given number according to the given direction. It can for example be used to normalize user input to E164 using callee_in direction, or to denormalize E164 to user output using caller_out.';
};
class_has('resource_name', is => 'ro', default => 'applyrewrites');
class_has('dispatch_path', is => 'ro', default => '/api/applyrewrites/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-applyrewrites');
sub query_params {
return [
];
}
sub resource_name{
return 'applyrewrites';
}
sub dispatch_path{
return '/api/applyrewrites/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-applyrewrites';
}
__PACKAGE__->config(
action => {

@ -1,45 +1,48 @@
package NGCP::Panel::Controller::API::AutoAttendants;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Subscriber;
use NGCP::Panel::Utils::Preferences;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use UUID;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Show a collection of auto attendant slots, belonging to a specific subscriber.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
]},
);
sub api_description {
return 'Show a collection of auto attendant slots, belonging to a specific subscriber.';
};
with 'NGCP::Panel::Role::API::AutoAttendants';
sub query_params {
return [
];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::AutoAttendants/;
class_has('resource_name', is => 'ro', default => 'autoattendants');
class_has('dispatch_path', is => 'ro', default => '/api/autoattendants/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-autoattendants');
sub resource_name{
return 'autoattendants';
}
sub dispatch_path{
return '/api/autoattendants/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-autoattendants';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::AutoAttendantsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::AutoAttendants';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'autoattendants');
class_has('dispatch_path', is => 'ro', default => '/api/autoattendants/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-autoattendants');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::AutoAttendants/;
sub resource_name{
return 'autoattendants';
}
sub dispatch_path{
return '/api/autoattendants/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-autoattendants';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -185,39 +196,8 @@ sub PATCH :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,35 +1,32 @@
package NGCP::Panel::Controller::API::BalanceIntervals;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ProfilePackages qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Histories of contracts\' cash balance intervals.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Histories of contracts\' cash balance intervals.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for actual balance intervals of customers belonging to a specific reseller',
@ -75,15 +72,20 @@ class_has 'query_params' => (
},
second => sub {},
},
},
]},
);
}, ];
}
with 'NGCP::Panel::Role::API::BalanceIntervals';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BalanceIntervals/;
class_has('resource_name', is => 'ro', default => 'balanceintervals');
class_has('dispatch_path', is => 'ro', default => '/api/balanceintervals/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-balanceintervals');
sub resource_name{
return 'balanceintervals';
}
sub dispatch_path{
return '/api/balanceintervals/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-balanceintervals';
}
__PACKAGE__->config(
action => {

@ -1,33 +1,42 @@
package NGCP::Panel::Controller::API::BalanceIntervalsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::BalanceIntervals';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
class_has('resource_name', is => 'ro', default => 'balanceintervals');
class_has('dispatch_path', is => 'ro', default => '/api/balanceintervals/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-balanceintervals');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BalanceIntervals/;
#class_has(@{ __PACKAGE__->get_journal_query_params() });
sub resource_name{
return 'balanceintervals';
}
sub dispatch_path{
return '/api/balanceintervals/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-balanceintervals';
}
#sub journal_query_params {
# my($self,$query_params) = @_;
# return $self->get_journal_query_params($query_params);
#}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'start',
description => 'Filter balance intervals starting after or at the specified time stamp.',
@ -41,8 +50,8 @@ class_has 'query_params' => (
},
},
#the end value of intervals is not constant along the retrieval operations
]},
);
];
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::BillingFees;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use NGCP::Panel::Utils::Billing;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies the fees to be applied for a call if it matches the source or destination number of the call. You can POST fees individually one-by-one using json. To bulk-upload fees, specify the Content-Type as "text/csv" and POST the CSV in the request body to the collection while specifying the the billing profile via URI parameters, like "/api/billingfees/?billing_profile_id=xx&purge_existing=true"'
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Specifies the fees to be applied for a call if it matches the source or destination number of the call. You can POST fees individually one-by-one using json. To bulk-upload fees, specify the Content-Type as "text/csv" and POST the CSV in the request body to the collection while specifying the the billing profile via URI parameters, like "/api/billingfees/?billing_profile_id=xx&purge_existing=true"';
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'billing_profile_id',
description => 'Filter for fees belonging to a specific billing profile',
@ -40,14 +37,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::BillingFees';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BillingFees/;
class_has('resource_name', is => 'ro', default => 'billingfees');
class_has('dispatch_path', is => 'ro', default => '/api/billingfees/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-billingfees');
sub resource_name{
return 'billingfees';
}
sub dispatch_path{
return '/api/billingfees/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-billingfees';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::BillingFeesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::BillingFees';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BillingFees/;
class_has('resource_name', is => 'ro', default => 'billingfees');
class_has('dispatch_path', is => 'ro', default => '/api/billingfees/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-billingfees');
sub resource_name{
return 'billingfees';
}
sub dispatch_path{
return '/api/billingfees/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-billingfees';
}
__PACKAGE__->config(
action => {

@ -1,35 +1,32 @@
package NGCP::Panel::Controller::API::BillingNetworks;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::Reseller qw();
use NGCP::Panel::Utils::BillingNetworks qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'A Billing Network is a container for a number of network ranges.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'A Billing Network is a container for a number of network ranges.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for billing networks belonging to a specific reseller',
@ -64,15 +61,21 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::BillingNetworks';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BillingNetworks/;
class_has('resource_name', is => 'ro', default => 'billingnetworks');
class_has('dispatch_path', is => 'ro', default => '/api/billingnetworks/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-billingnetworks');
sub resource_name{
return 'billingnetworks';
}
sub dispatch_path{
return '/api/billingnetworks/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-billingnetworks';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::BillingNetworksItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::Reseller qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::BillingNetworks';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'billingnetworks');
class_has('dispatch_path', is => 'ro', default => '/api/billingnetworks/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-billingnetworks');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BillingNetworks/;
sub resource_name{
return 'billingnetworks';
}
sub dispatch_path{
return '/api/billingnetworks/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-billingnetworks';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -209,39 +220,8 @@ sub PUT :Allow {
# return;
#}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,35 +1,32 @@
package NGCP::Panel::Controller::API::BillingProfiles;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Reseller qw();
use NGCP::Panel::Utils::Billing qw();
use Path::Tiny qw(path);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines a collection of <a href="#billingfees">Billing Fees</a> and <a href="#billingzones">Billing Zones</a> and can be assigned to <a href="#customers">Customers</a> and <a href="#contracts">System Contracts</a>.'
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines a collection of <a href="#billingfees">Billing Fees</a> and <a href="#billingzones">Billing Zones</a> and can be assigned to <a href="#customers">Customers</a> and <a href="#contracts">System Contracts</a>.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for billing profiles belonging to a specific reseller',
@ -52,14 +49,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::BillingProfiles';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BillingProfiles/;
class_has('resource_name', is => 'ro', default => 'billingprofiles');
class_has('dispatch_path', is => 'ro', default => '/api/billingprofiles/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-billingprofiles');
sub resource_name{
return 'billingprofiles';
}
sub dispatch_path{
return '/api/billingprofiles/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-billingprofiles';
}
__PACKAGE__->config(
action => {

@ -1,27 +1,38 @@
package NGCP::Panel::Controller::API::BillingProfilesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::BillingProfiles';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'billingprofiles');
class_has('dispatch_path', is => 'ro', default => '/api/billingprofiles/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-billingprofiles');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BillingProfiles/;
sub resource_name{
return 'billingprofiles';
}
sub dispatch_path{
return '/api/billingprofiles/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-billingprofiles';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -185,39 +196,9 @@ sub PUT :Allow {
# we don't allow to DELETE a billing profile
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,33 +1,30 @@
package NGCP::Panel::Controller::API::BillingZones;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines zones used to group destinations within <a href="#billingprofiles">Billing Profiles</a>. The zones can be used to group customer\'s calls, like calls within his country or any calls to mobile numbers.'
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines zones used to group destinations within <a href="#billingprofiles">Billing Profiles</a>. The zones can be used to group customer\'s calls, like calls within his country or any calls to mobile numbers.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'billing_profile_id',
description => 'Filter for zones belonging to a specific billing profile',
@ -50,14 +47,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::BillingZones';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BillingZones/;
class_has('resource_name', is => 'ro', default => 'billingzones');
class_has('dispatch_path', is => 'ro', default => '/api/billingzones/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-billingzones');
sub resource_name{
return 'billingzones';
}
sub dispatch_path{
return '/api/billingzones/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-billingzones';
}
__PACKAGE__->config(
action => {

@ -1,27 +1,38 @@
package NGCP::Panel::Controller::API::BillingZonesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::BillingZones';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
class_has('resource_name', is => 'ro', default => 'billingzones');
class_has('dispatch_path', is => 'ro', default => '/api/billingzones/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-billingzones');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::BillingZones/;
sub resource_name{
return 'billingzones';
}
sub dispatch_path{
return '/api/billingzones/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-billingzones';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -210,39 +221,8 @@ sub DELETE :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,43 +1,46 @@
package NGCP::Panel::Controller::API::CCMapEntries;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Creates a calling card mapping entry. For call through, it uses the UUID of the subscriber to attach allowed '.
'CLIs able to perform a call through.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
]},
);
sub api_description {
return 'Creates a calling card mapping entry. For call through, it uses the UUID of the subscriber to attach allowed '.
'CLIs able to perform a call through.';
}
with 'NGCP::Panel::Role::API::CCMapEntries';
sub query_params {
return [
];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CCMapEntries/;
class_has('resource_name', is => 'ro', default => 'ccmapentries');
class_has('dispatch_path', is => 'ro', default => '/api/ccmapentries/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-ccmapentries');
sub resource_name{
return 'ccmapentries';
}
sub dispatch_path{
return '/api/ccmapentries/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-ccmapentries';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::CCMapEntriesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CCMapEntries';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
class_has('resource_name', is => 'ro', default => 'ccmapentries');
class_has('dispatch_path', is => 'ro', default => '/api/ccmapentries/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-ccmapentries');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CCMapEntries/;
sub resource_name{
return 'ccmapentries';
}
sub dispatch_path{
return '/api/ccmapentries/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-ccmapentries';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -214,39 +225,8 @@ sub DELETE :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,33 +1,30 @@
package NGCP::Panel::Controller::API::CFDestinationSets;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines a collection of CallForward Destination Sets, including their destination, which can be set '.
'to define CallForwards using <a href="#cfmappings">CFMappings</a>.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines a collection of CallForward Destination Sets, including their destination, which can be set '.
'to define CallForwards using <a href="#cfmappings">CFMappings</a>.',;
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'subscriber_id',
description => 'Filter for destination sets belonging to a specific subscriber',
@ -52,15 +49,21 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::CFDestinationSets';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CFDestinationSets/;
class_has('resource_name', is => 'ro', default => 'cfdestinationsets');
class_has('dispatch_path', is => 'ro', default => '/api/cfdestinationsets/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-cfdestinationsets');
sub resource_name{
return 'cfdestinationsets';
}
sub dispatch_path{
return '/api/cfdestinationsets/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-cfdestinationsets';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::CFDestinationSetsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CFDestinationSets';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
class_has('resource_name', is => 'ro', default => 'cfdestinationsets');
class_has('dispatch_path', is => 'ro', default => '/api/cfdestinationsets/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-cfdestinationsets');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CFDestinationSets/;
sub resource_name{
return 'cfdestinationsets';
}
sub dispatch_path{
return '/api/cfdestinationsets/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-cfdestinationsets';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -211,39 +222,8 @@ sub DELETE :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,40 +1,36 @@
package NGCP::Panel::Controller::API::CFMappings;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies callforward mappings of a subscriber, where multiple mappings can be specified per type (cfu, cfb, cft cfna) ' .
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Specifies callforward mappings of a subscriber, where multiple mappings can be specified per type (cfu, cfb, cft cfna) ' .
'One mapping consists of destinationset name (see <a href="#cfdestinationsets">CFDestinationSets</a>) and a timeset name ' .
'(see <a href="#cftimesets">CFTimeSets</a>).',
);
'(see <a href="#cftimesets">CFTimeSets</a>).';
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
]},
);
sub query_params {
return [
];
}
class_has 'documentation_sample' => (
is => 'ro',
default => sub { {
sub documentation_sample {
return {
cfb => [{
"destinationset" => "quickset_cfb",
"timeset" => undef,
@ -43,14 +39,20 @@ class_has 'documentation_sample' => (
cft => [],
cft_ringtimeout => "200",
cfu => [],
} },
);
} ;
}
with 'NGCP::Panel::Role::API::CFMappings';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CFMappings/;
class_has('resource_name', is => 'ro', default => 'cfmappings');
class_has('dispatch_path', is => 'ro', default => '/api/cfmappings/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-cfmappings');
sub resource_name{
return 'cfmappings';
}
sub dispatch_path{
return '/api/cfmappings/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-cfmappings';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::CFMappingsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CFMappings';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'cfmappings');
class_has('dispatch_path', is => 'ro', default => '/api/cfmappings/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-cfmappings');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CFMappings/;
sub resource_name{
return 'cfmappings';
}
sub dispatch_path{
return '/api/cfmappings/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-cfmappings';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -184,39 +195,8 @@ sub PUT :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,33 +1,30 @@
package NGCP::Panel::Controller::API::CFTimeSets;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines a collection of CallForward Time Sets, including their times (periods), which can be set '.
'to define CallForwards using <a href="#cfmappings">CFMappings</a>.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines a collection of CallForward Time Sets, including their times (periods), which can be set '.
'to define CallForwards using <a href="#cfmappings">CFMappings</a>.';
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'subscriber_id',
description => 'Filter for timesets belonging to a specific subscriber',
@ -52,15 +49,21 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::CFTimeSets';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CFTimeSets/;
class_has('resource_name', is => 'ro', default => 'cftimesets');
class_has('dispatch_path', is => 'ro', default => '/api/cftimesets/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-cftimesets');
sub resource_name{
return 'cftimesets';
}
sub dispatch_path{
return '/api/cftimesets/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-cftimesets';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::CFTimeSetsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CFTimeSets';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
class_has('resource_name', is => 'ro', default => 'cftimesets');
class_has('dispatch_path', is => 'ro', default => '/api/cftimesets/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-cftimesets');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CFTimeSets/;
sub resource_name{
return 'cftimesets';
}
sub dispatch_path{
return '/api/cftimesets/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-cftimesets';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -211,39 +222,8 @@ sub DELETE :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,45 +1,48 @@
package NGCP::Panel::Controller::API::CallControls;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use NGCP::Panel::Utils::Sems;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Allows to place calls via the API.',
);
sub allowed_methods{
return [qw/POST OPTIONS/];
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
]},
);
sub api_description {
return 'Allows to place calls via the API.';
};
with 'NGCP::Panel::Role::API::CallControls';
sub query_params {
return [
];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CallControls/;
class_has('resource_name', is => 'ro', default => 'callcontrols');
class_has('dispatch_path', is => 'ro', default => '/api/callcontrols/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-callcontrols');
sub resource_name{
return 'callcontrols';
}
sub dispatch_path{
return '/api/callcontrols/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-callcontrols';
}
__PACKAGE__->config(
action => {

@ -1,41 +1,37 @@
package NGCP::Panel::Controller::API::CallForwards;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies basic callforwards of a subscriber, where a number of destinations and times can be specified for each type (cfu, cfb, cft cfna). '.
'For more complex configurations with multiple combinations of Timesets and Destinationsets see <a href="#cfmappings">CFMappings</a>.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[ #TODO
]},
);
sub api_description {
return 'Specifies basic callforwards of a subscriber, where a number of destinations and times can be specified for each type (cfu, cfb, cft cfna). '.
'For more complex configurations with multiple combinations of Timesets and Destinationsets see <a href="#cfmappings">CFMappings</a>.';
};
sub query_params {
return [ #TODO
];
}
class_has 'documentation_sample' => (
is => 'ro',
default => sub { {
sub documentation_sample {
return {
cfb => { "destinations" => [{
"destination" => "voicebox",
"priority" => "1",
@ -46,14 +42,20 @@ class_has 'documentation_sample' => (
cfna => {},
cft => { "ringtimeout" => "199" },
cfu => {},
} },
);
};
}
with 'NGCP::Panel::Role::API::CallForwards';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CallForwards/;
class_has('resource_name', is => 'ro', default => 'callforwards');
class_has('dispatch_path', is => 'ro', default => '/api/callforwards/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-callforwards');
sub resource_name{
return 'callforwards';
}
sub dispatch_path{
return '/api/callforwards/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-callforwards';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::CallForwardsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CallForwards';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
class_has('resource_name', is => 'ro', default => 'callforwards');
class_has('dispatch_path', is => 'ro', default => '/api/callforwards/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-callforwards');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CallForwards/;
sub resource_name{
return 'callforwards';
}
sub dispatch_path{
return '/api/callforwards/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-callforwards';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -221,39 +232,8 @@ sub DELETE :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::CallLists;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines call lists in simplified form for showing call histories of subscribers.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Defines call lists in simplified form for showing call histories of subscribers.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'subscriber_id',
description => 'Filter for calls for a specific subscriber. Either this or customer_id is mandatory if called by admin, reseller or subscriberadmin to filter list down to a specific subscriber in order to properly determine the direction of calls.',
@ -202,14 +199,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::CallLists';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CallLists/;
class_has('resource_name', is => 'ro', default => 'calllists');
class_has('dispatch_path', is => 'ro', default => '/api/calllists/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-calllists');
sub resource_name{
return 'calllists';
}
sub dispatch_path{
return '/api/calllists/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-calllists';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::CallListsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CallLists';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CallLists/;
class_has('resource_name', is => 'ro', default => 'calllists');
class_has('dispatch_path', is => 'ro', default => '/api/calllists/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-calllists');
sub resource_name{
return 'calllists';
}
sub dispatch_path{
return '/api/calllists/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-calllists';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,32 @@
package NGCP::Panel::Controller::API::Calls;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
#use namespace::sweep;
use Moose;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines calls placed or received by a customer.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Defines calls placed or received by a customer.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'customer_id',
description => 'Filter for calls of a specific customer',
@ -63,14 +61,20 @@ class_has 'query_params' => (
return $rs;
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::Calls';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Calls/;
class_has('resource_name', is => 'ro', default => 'calls');
class_has('dispatch_path', is => 'ro', default => '/api/calls/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-calls');
sub resource_name{
return 'calls';
}
sub dispatch_path{
return '/api/calls/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-calls';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::CallsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Calls';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Calls/;
class_has('resource_name', is => 'ro', default => 'calls');
class_has('dispatch_path', is => 'ro', default => '/api/calls/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-calls');
sub resource_name{
return 'calls';
}
sub dispatch_path{
return '/api/calls/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-calls';
}
__PACKAGE__->config(
action => {

@ -1,35 +1,32 @@
package NGCP::Panel::Controller::API::Contracts;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Contract;
use NGCP::Panel::Utils::ProfilePackages qw();
use Path::Tiny qw(path);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines a billing container for peerings and resellers. A <a href="#billingprofiles">Billing Profile</a> is assigned to a contract, and it has <a href="#contractbalances">Contract Balances</a> indicating the saldo of the contract for current and past billing intervals.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines a billing container for peerings and resellers. A <a href="#billingprofiles">Billing Profile</a> is assigned to a contract, and it has <a href="#contractbalances">Contract Balances</a> indicating the saldo of the contract for current and past billing intervals.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'contact_id',
description => 'Filter for contracts with a specific contact id',
@ -63,14 +60,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::Contracts';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Contracts/;
class_has('resource_name', is => 'ro', default => 'contracts');
class_has('dispatch_path', is => 'ro', default => '/api/contracts/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-contracts');
sub resource_name{
return 'contracts';
}
sub dispatch_path{
return '/api/contracts/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-contracts';
}
__PACKAGE__->config(
action => {

@ -1,31 +1,42 @@
package NGCP::Panel::Controller::API::ContractsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Contract qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Contracts';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'contracts');
class_has('dispatch_path', is => 'ro', default => '/api/contracts/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-contracts');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Contracts/;
sub resource_name{
return 'contracts';
}
sub dispatch_path{
return '/api/contracts/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-contracts';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -236,39 +247,8 @@ sub DELETE :Allow {
=cut
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,35 +1,32 @@
package NGCP::Panel::Controller::API::CustomerBalances;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ProfilePackages qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines customer balances to access cash and free time balance.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Defines customer balances to access cash and free time balance.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for customer balances belonging to a specific reseller',
@ -76,14 +73,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::CustomerBalances';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CustomerBalances/;
class_has('resource_name', is => 'ro', default => 'customerbalances');
class_has('dispatch_path', is => 'ro', default => '/api/customerbalances/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerbalances');
sub resource_name{
return 'customerbalances';
}
sub dispatch_path{
return '/api/customerbalances/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerbalances';
}
__PACKAGE__->config(
action => {

@ -1,27 +1,38 @@
package NGCP::Panel::Controller::API::CustomerBalancesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CustomerBalances';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'customerbalances');
class_has('dispatch_path', is => 'ro', default => '/api/customerbalances/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerbalances');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CustomerBalances/;
sub resource_name{
return 'customerbalances';
}
sub dispatch_path{
return '/api/customerbalances/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerbalances';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -188,39 +199,8 @@ sub PUT :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::CustomerContacts;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines a physical or legal person\'s address (postal and/or email) to be used to identify <a href="#customers">Customers</a>.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines a physical or legal person\'s address (postal and/or email) to be used to identify <a href="#customers">Customers</a>.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'email',
description => 'Filter for contacts matching an email pattern',
@ -51,14 +48,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::CustomerContacts';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CustomerContacts/;
class_has('resource_name', is => 'ro', default => 'customercontacts');
class_has('dispatch_path', is => 'ro', default => '/api/customercontacts/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customercontacts');
sub resource_name{
return 'customercontacts';
}
sub dispatch_path{
return '/api/customercontacts/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customercontacts';
}
__PACKAGE__->config(
action => {

@ -1,27 +1,38 @@
package NGCP::Panel::Controller::API::CustomerContactsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CustomerContacts';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
class_has('resource_name', is => 'ro', default => 'customercontacts');
class_has('dispatch_path', is => 'ro', default => '/api/customercontacts/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customercontacts');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CustomerContacts/;
sub resource_name{
return 'customercontacts';
}
sub dispatch_path{
return '/api/customercontacts/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customercontacts';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -212,39 +223,8 @@ sub DELETE :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,7 +1,5 @@
package NGCP::Panel::Controller::API::CustomerFraudEvents;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
use boolean qw(true);
use Data::HAL qw();
@ -10,23 +8,21 @@ use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use Path::Tiny qw(path);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines a list of customers with fraud limits above defined thresholds for a specific interval.'
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Defines a list of customers with fraud limits above defined thresholds for a specific interval.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for fraud events belonging to a specific reseller',
@ -42,14 +38,21 @@ class_has 'query_params' => (
param => 'interval',
description => 'Interval filter. values: day, month. default: month',
},
]},
);
];
}
with 'NGCP::Panel::Role::API::CustomerFraudEvents';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CustomerFraudEvents/;
sub resource_name{
return 'customerfraudevents';
}
sub dispatch_path{
return '/api/customerfraudevents/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerfraudevents';
}
class_has('resource_name', is => 'ro', default => 'customerfraudevents');
class_has('dispatch_path', is => 'ro', default => '/api/customerfraudevents/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerfraudevents');
__PACKAGE__->config(
action => {

@ -1,35 +1,39 @@
package NGCP::Panel::Controller::API::CustomerFraudEventsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CustomerFraudEvents/;
sub resource_name{
return 'customerfraudevents';
}
sub dispatch_path{
return '/api/customerfraudevents/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerfraudevents';
}
sub query_params {
return [
{
param => 'interval',
description => 'Interval filter. values: day, month. default: month',
},
]},
);
with 'NGCP::Panel::Role::API::CustomerFraudEvents';
];
}
class_has('resource_name', is => 'ro', default => 'customerfraudevents');
class_has('dispatch_path', is => 'ro', default => '/api/customerfraudevents/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerfraudevents');
__PACKAGE__->config(
action => {

@ -1,30 +1,38 @@
package NGCP::Panel::Controller::API::CustomerPreferenceDefs;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Preferences;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use JSON::Types qw();
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API/;
class_has('resource_name', is => 'ro', default => 'customerpreferencedefs');
class_has('dispatch_path', is => 'ro', default => '/api/customerpreferencedefs/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerpreferencedefs');
sub resource_name{
return 'customerpreferencedefs';
}
sub dispatch_path{
return '/api/customerpreferencedefs/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerpreferencedefs';
}
__PACKAGE__->config(
action => {

@ -1,35 +1,40 @@
package NGCP::Panel::Controller::API::CustomerPreferences;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies certain properties (preferences) for a <a href="#customers">Customer</a>. The full list of properties can be obtained via <a href="/api/customerpreferencedefs/">CustomerPreferenceDefs</a>.'
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
with 'NGCP::Panel::Role::API::Preferences';
sub api_description {
return 'Specifies certain properties (preferences) for a <a href="#customers">Customer</a>. The full list of properties can be obtained via <a href="/api/customerpreferencedefs/">CustomerPreferenceDefs</a>.';
};
class_has('resource_name', is => 'ro', default => 'customerpreferences');
class_has('dispatch_path', is => 'ro', default => '/api/customerpreferences/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerpreferences');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Preferences/;
sub resource_name{
return 'customerpreferences';
}
sub dispatch_path{
return '/api/customerpreferences/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerpreferences';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::CustomerPreferencesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Preferences';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'customerpreferences');
class_has('dispatch_path', is => 'ro', default => '/api/customerpreferences/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerpreferences');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Preferences/;
sub resource_name{
return 'customerpreferences';
}
sub dispatch_path{
return '/api/customerpreferences/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerpreferences';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -186,39 +197,8 @@ sub PUT :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,32 +1,29 @@
package NGCP::Panel::Controller::API::CustomerZoneCosts;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Returns for each customer, the customer_id and the number of calls, the total duration and the call fees grouped by zone.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Returns for each customer, the customer_id and the number of calls, the total duration and the call fees grouped by zone.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'customer_id',
description => 'Filter for a specific customer.',
@ -48,15 +45,21 @@ class_has 'query_params' => (
param => 'end',
description => 'Filter for a specific end time in format YYYY-MM-DDThhmmss.',
},
]},
);
];
}
with 'NGCP::Panel::Role::API::CustomerZoneCosts';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CustomerZoneCosts/;
class_has('resource_name', is => 'ro', default => 'customerzonecosts');
class_has('dispatch_path', is => 'ro', default => '/api/customerzonecosts/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerzonecosts');
sub resource_name{
return 'customerzonecosts';
}
sub dispatch_path{
return '/api/customerzonecosts/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerzonecosts';
}
__PACKAGE__->config(
action => {

@ -1,28 +1,36 @@
package NGCP::Panel::Controller::API::CustomerZoneCostsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::CustomerZoneCosts';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::CustomerZoneCosts/;
class_has('resource_name', is => 'ro', default => 'customerzonecosts');
class_has('dispatch_path', is => 'ro', default => '/api/customerzonecosts/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customerzonecosts');
sub resource_name{
return 'customerzonecosts';
}
sub dispatch_path{
return '/api/customerzonecosts/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customerzonecosts';
}
__PACKAGE__->config(
action => {

@ -1,46 +1,42 @@
package NGCP::Panel::Controller::API::Customers;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Contract;
use NGCP::Panel::Utils::ProfilePackages qw();
use Path::Tiny qw(path);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines a billing container for end customers. Customers usually have one or more <a href="#subscribers">Subscribers</a>. A <a href="#billingprofiles">Billing Profile</a> is assigned to a customer, and it has <a href="#contractbalances">Contract Balances</a> indicating the saldo of the customer for current and past billing intervals. Customer can be one of the "sipaccount" or "pbxaccount" type. Type should be specified as "type" parameter.',
);
class_has 'documentation_sample' => (
is => 'ro',
default => sub {
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines a billing container for end customers. Customers usually have one or more <a href="#subscribers">Subscribers</a>. A <a href="#billingprofiles">Billing Profile</a> is assigned to a customer, and it has <a href="#contractbalances">Contract Balances</a> indicating the saldo of the customer for current and past billing intervals. Customer can be one of the "sipaccount" or "pbxaccount" type. Type should be specified as "type" parameter.';
};
sub documentation_sample {
return
{
"billing_profile_id" => 4,
"type" => "sipaccount",
"contact_id" => 4,
"status" => "test",
}
},
);
;
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'status',
description => 'Filter for customers with a specific status (comma-separated list of statuses to include possible)',
@ -110,15 +106,20 @@ class_has 'query_params' => (
},
second => sub { },
},
},
]},
);
}, ];
}
with 'NGCP::Panel::Role::API::Customers';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Customers/;
class_has('resource_name', is => 'ro', default => 'customers');
class_has('dispatch_path', is => 'ro', default => '/api/customers/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customers');
sub resource_name{
return 'customers';
}
sub dispatch_path{
return '/api/customers/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customers';
}
__PACKAGE__->config(
action => {

@ -1,31 +1,42 @@
package NGCP::Panel::Controller::API::CustomersItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Contract qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Customers';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'customers');
class_has('dispatch_path', is => 'ro', default => '/api/customers/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-customers');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Customers/;
sub resource_name{
return 'customers';
}
sub dispatch_path{
return '/api/customers/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-customers';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -235,39 +246,8 @@ sub DELETE :Allow {
}
=cut
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,30 +1,38 @@
package NGCP::Panel::Controller::API::DomainPreferenceDefs;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Preferences;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use JSON::Types qw();
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API/;
class_has('resource_name', is => 'ro', default => 'domainpreferencedefs');
class_has('dispatch_path', is => 'ro', default => '/api/domainpreferencedefs/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-domainpreferencedefs');
sub resource_name{
return 'domainpreferencedefs';
}
sub dispatch_path{
return '/api/domainpreferencedefs/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-domainpreferencedefs';
}
__PACKAGE__->config(
action => {

@ -1,35 +1,40 @@
package NGCP::Panel::Controller::API::DomainPreferences;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies certain properties (preferences) for a <a href="#domains">Domain</a>. The full list of properties can be obtained via <a href="/api/domainpreferencedefs/">DomainPreferenceDefs</a>.'
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
with 'NGCP::Panel::Role::API::Preferences';
sub api_description {
return 'Specifies certain properties (preferences) for a <a href="#domains">Domain</a>. The full list of properties can be obtained via <a href="/api/domainpreferencedefs/">DomainPreferenceDefs</a>.';
};
class_has('resource_name', is => 'ro', default => 'domainpreferences');
class_has('dispatch_path', is => 'ro', default => '/api/domainpreferences/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-domainpreferences');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Preferences/;
sub resource_name{
return 'domainpreferences';
}
sub dispatch_path{
return '/api/domainpreferences/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-domainpreferences';
}
__PACKAGE__->config(
action => {

@ -1,28 +1,36 @@
package NGCP::Panel::Controller::API::DomainPreferencesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Preferences';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Preferences/;
class_has('resource_name', is => 'ro', default => 'domainpreferences');
class_has('dispatch_path', is => 'ro', default => '/api/domainpreferences/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-domainpreferences');
sub resource_name{
return 'domainpreferences';
}
sub dispatch_path{
return '/api/domainpreferences/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-domainpreferences';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::Domains;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies a SIP Domain to be used as host part for SIP <a href="#subscribers">Subscribers</a>. You need a domain before you can create a subscriber. Multiple domains can be created. A domain could also be an IPv4 or IPv6 address (whereas the latter needs to be enclosed in square brackets, e.g. [::1]).'
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Specifies a SIP Domain to be used as host part for SIP <a href="#subscribers">Subscribers</a>. You need a domain before you can create a subscriber. Multiple domains can be created. A domain could also be an IPv4 or IPv6 address (whereas the latter needs to be enclosed in square brackets, e.g. [::1]).';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for domains belonging to a specific reseller',
@ -53,14 +50,20 @@ class_has 'query_params' => (
second => sub { },
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::Domains';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Domains/;
class_has('resource_name', is => 'ro', default => 'domains');
class_has('dispatch_path', is => 'ro', default => '/api/domains/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-domains');
sub resource_name{
return 'domains';
}
sub dispatch_path{
return '/api/domains/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-domains';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::DomainsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Domains';
sub allowed_methods{
return [qw/GET OPTIONS HEAD DELETE/];
}
class_has('resource_name', is => 'ro', default => 'domains');
class_has('dispatch_path', is => 'ro', default => '/api/domains/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-domains');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Domains/;
sub resource_name{
return 'domains';
}
sub dispatch_path{
return '/api/domains/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-domains';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -143,39 +154,8 @@ sub DELETE :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::EmailTemplates;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines email templates to be send when new subscribers are created or when passwords are reset.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines email templates to be send when new subscribers are created or when passwords are reset.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for email templates belonging to a specific reseller',
@ -40,14 +37,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::EmailTemplates';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::EmailTemplates/;
class_has('resource_name', is => 'ro', default => 'emailtemplates');
class_has('dispatch_path', is => 'ro', default => '/api/emailtemplates/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-emailtemplates');
sub resource_name{
return 'emailtemplates';
}
sub dispatch_path{
return '/api/emailtemplates/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-emailtemplates';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::EmailTemplatesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::EmailTemplates';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::EmailTemplates/;
class_has('resource_name', is => 'ro', default => 'emailtemplates');
class_has('dispatch_path', is => 'ro', default => '/api/emailtemplates/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-emailtemplates');
sub resource_name{
return 'emailtemplates';
}
sub dispatch_path{
return '/api/emailtemplates/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-emailtemplates';
}
__PACKAGE__->config(
action => {

@ -1,35 +1,40 @@
package NGCP::Panel::Controller::API::FaxRecordings;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines the actual recording of fax messages. It is referred to by the <a href="#faxes">Faxes</a> relation. A GET on an item returns the binary blob of the recording with Content-Type "audio/x-wav".',
);
sub allowed_methods{
return [qw/OPTIONS/];
}
with 'NGCP::Panel::Role::API::FaxRecordings';
sub api_description {
return 'Defines the actual recording of fax messages. It is referred to by the <a href="#faxes">Faxes</a> relation. A GET on an item returns the binary blob of the recording with Content-Type "audio/x-wav".';
};
class_has('resource_name', is => 'ro', default => 'faxrecordings');
class_has('dispatch_path', is => 'ro', default => '/api/faxrecordings/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-faxrecordings');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::FaxRecordings/;
sub resource_name{
return 'faxrecordings';
}
sub dispatch_path{
return '/api/faxrecordings/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-faxrecordings';
}
__PACKAGE__->config(
action => {

@ -1,27 +1,35 @@
package NGCP::Panel::Controller::API::FaxRecordingsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use File::Type;
use File::Slurp;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::FaxRecordings';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::FaxRecordings/;
class_has('resource_name', is => 'ro', default => 'faxrecordings');
class_has('dispatch_path', is => 'ro', default => '/api/faxrecordings/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-faxrecordings');
sub resource_name{
return 'faxrecordings';
}
sub dispatch_path{
return '/api/faxrecordings/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-faxrecordings';
}
__PACKAGE__->config(
action => {

@ -1,44 +1,41 @@
package NGCP::Panel::Controller::API::Faxes;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
#use namespace::sweep;
use Moose;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use NGCP::Panel::Utils::API::Subscribers;
use NGCP::Panel::Utils::Fax;
use Encode qw( encode_utf8 );
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines the meta information like duration, sender etc for fax recordings. The actual recordings can be fetched via the <a href="#faxrecordings">FaxRecordings</a> relation. NOTE: There is no Location header in the POST method response, as creation is asynchronous.',
);
class_has 'properties' => (
is => 'ro',
isa => 'HashRef',
default => sub { {
asynchronous => 1,
}; },
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines the meta information like duration, sender etc for fax recordings. The actual recordings can be fetched via the <a href="#faxrecordings">FaxRecordings</a> relation. NOTE: There is no Location header in the POST method response, as creation is asynchronous.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
#sub properties {
# return {
# asynchronous => 1,
# };
#}
sub query_params {
return [
{
param => 'subscriber_id',
description => 'Filter for faxes belonging to a specific subscriber',
@ -51,14 +48,20 @@ class_has 'query_params' => (
second => sub { },
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::Faxes';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Faxes/;
class_has('resource_name', is => 'ro', default => 'faxes');
class_has('dispatch_path', is => 'ro', default => '/api/faxes/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-faxes');
sub resource_name{
return 'faxes';
}
sub dispatch_path{
return '/api/faxes/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-faxes';
}
__PACKAGE__->config(
action => {

@ -1,26 +1,34 @@
package NGCP::Panel::Controller::API::FaxesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::Subscriber;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Faxes';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Faxes/;
class_has('resource_name', is => 'ro', default => 'faxes');
class_has('dispatch_path', is => 'ro', default => '/api/faxes/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-faxes');
sub resource_name{
return 'faxes';
}
sub dispatch_path{
return '/api/faxes/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-faxes';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::FaxserverSettings;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies faxserver settings for a specific subscriber.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Specifies faxserver settings for a specific subscriber.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'name_or_password',
description => 'Filter for items (subscribers) where name or password field match given pattern',
@ -62,14 +59,20 @@ class_has 'query_params' => (
},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::FaxserverSettings';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::FaxserverSettings/;
class_has('resource_name', is => 'ro', default => 'faxserversettings');
class_has('dispatch_path', is => 'ro', default => '/api/faxserversettings/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-faxserversettings');
sub resource_name{
return 'faxserversettings';
}
sub dispatch_path{
return '/api/faxserversettings/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-faxserversettings';
}
__PACKAGE__->config(
action => {

@ -1,31 +1,42 @@
package NGCP::Panel::Controller::API::FaxserverSettingsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use Clone qw/clone/;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::FaxserverSettings';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'faxserversettings');
class_has('dispatch_path', is => 'ro', default => '/api/faxserversettings/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-faxserversettings');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::FaxserverSettings/;
sub resource_name{
return 'faxserversettings';
}
sub dispatch_path{
return '/api/faxserversettings/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-faxserversettings';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -186,39 +197,8 @@ sub PUT :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

@ -1,36 +1,33 @@
package NGCP::Panel::Controller::API::Interceptions;
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Interception;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use UUID qw/generate unparse/;
use NGCP::Panel::Utils::DateTime;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines lawful interceptions of subscribers.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines lawful interceptions of subscribers.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'liid',
description => 'Filter for interceptions of a specific interception id',
@ -53,14 +50,20 @@ class_has 'query_params' => (
second => sub { },
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::Interceptions';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Interceptions/;
class_has('resource_name', is => 'ro', default => 'interceptions');
class_has('dispatch_path', is => 'ro', default => '/api/interceptions/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-interceptions');
sub resource_name{
return 'interceptions';
}
sub dispatch_path{
return '/api/interceptions/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-interceptions';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::InterceptionsItem;
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::Interception;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Interceptions';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Interceptions/;
class_has('resource_name', is => 'ro', default => 'interceptions');
class_has('dispatch_path', is => 'ro', default => '/api/interceptions/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-interceptions');
sub resource_name{
return 'interceptions';
}
sub dispatch_path{
return '/api/interceptions/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-interceptions';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::InvoiceTemplates;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines invoice templates used to generate customer invoices. Only returns meta data at this point.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Defines invoice templates used to generate customer invoices. Only returns meta data at this point.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for invoice templates belonging to a specific reseller',
@ -40,14 +37,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::InvoiceTemplates';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::InvoiceTemplates/;
class_has('resource_name', is => 'ro', default => 'invoicetemplates');
class_has('dispatch_path', is => 'ro', default => '/api/invoicetemplates/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-invoicetemplates');
sub resource_name{
return 'invoicetemplates';
}
sub dispatch_path{
return '/api/invoicetemplates/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-invoicetemplates';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::InvoiceTemplatesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::InvoiceTemplates';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::InvoiceTemplates/;
class_has('resource_name', is => 'ro', default => 'invoicetemplates');
class_has('dispatch_path', is => 'ro', default => '/api/invoicetemplates/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-invoicetemplates');
sub resource_name{
return 'invoicetemplates';
}
sub dispatch_path{
return '/api/invoicetemplates/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-invoicetemplates';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::Invoices;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines invoices generated by the system.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Defines invoices generated by the system.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'period_start_ge',
description => 'Filter for invoices newer or equal to the given date (YYYY-MM-DDThh:mm:ss)',
@ -86,14 +83,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::Invoices';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Invoices/;
class_has('resource_name', is => 'ro', default => 'invoices');
class_has('dispatch_path', is => 'ro', default => '/api/invoices/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-invoices');
sub resource_name{
return 'invoices';
}
sub dispatch_path{
return '/api/invoices/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-invoices';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::InvoicesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Invoices';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Invoices/;
class_has('resource_name', is => 'ro', default => 'invoices');
class_has('dispatch_path', is => 'ro', default => '/api/invoices/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-invoices');
sub resource_name{
return 'invoices';
}
sub dispatch_path{
return '/api/invoices/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-invoices';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::LnpCarriers;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Reseller qw();
use Path::Tiny qw(path);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines an LNP carrier with its routing prefix and holds a collection of <a href="#lnpnumbers">LNP Numbers</a>.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines an LNP carrier with its routing prefix and holds a collection of <a href="#lnpnumbers">LNP Numbers</a>.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'prefix',
description => 'Filter for LNP carriers with a specific prefix (wildcards possible)',
@ -51,14 +48,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::LnpCarriers';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::LnpCarriers/;
class_has('resource_name', is => 'ro', default => 'lnpcarriers');
class_has('dispatch_path', is => 'ro', default => '/api/lnpcarriers/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-lnpcarriers');
sub resource_name{
return 'lnpcarriers';
}
sub dispatch_path{
return '/api/lnpcarriers/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-lnpcarriers';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::LnpCarriersItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::LnpCarriers';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::LnpCarriers/;
class_has('resource_name', is => 'ro', default => 'lnpcarriers');
class_has('dispatch_path', is => 'ro', default => '/api/lnpcarriers/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-lnpcarriers');
sub resource_name{
return 'lnpcarriers';
}
sub dispatch_path{
return '/api/lnpcarriers/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-lnpcarriers';
}
__PACKAGE__->config(
action => {

@ -1,14 +1,13 @@
package NGCP::Panel::Controller::API::LnpNumbers;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
@ -16,24 +15,22 @@ use Safe::Isa qw($_isa);
use NGCP::Panel::Utils::Lnp;
use NGCP::Panel::Utils::MySQL;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines LNP number entries ported to a specific <a href="#lnpcarriers">LNP Carrier</a>. You can POST numbers individually one-by-one using json. To bulk-upload numbers, specify the Content-Type as "text/csv" and POST the CSV in the request body to the collection with an optional parameter "purge_existing=true", like "/api/lnpnumbers/?purge_existing=true"',
);
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub api_description {
return 'Defines LNP number entries ported to a specific <a href="#lnpcarriers">LNP Carrier</a>. You can POST numbers individually one-by-one using json. To bulk-upload numbers, specify the Content-Type as "text/csv" and POST the CSV in the request body to the collection with an optional parameter "purge_existing=true", like "/api/lnpnumbers/?purge_existing=true"';
};
sub query_params {
return [
{
param => 'carrier_id',
description => 'Filter for LNP numbers belonging to a specific LNP carrier',
@ -56,14 +53,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::LnpNumbers';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::LnpNumbers/;
class_has('resource_name', is => 'ro', default => 'lnpnumbers');
class_has('dispatch_path', is => 'ro', default => '/api/lnpnumbers/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-lnpnumbers');
sub resource_name{
return 'lnpnumbers';
}
sub dispatch_path{
return '/api/lnpnumbers/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-lnpnumbers';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::LnpNumbersItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::LnpNumbers';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::LnpNumbers/;
class_has('resource_name', is => 'ro', default => 'lnpnumbers');
class_has('dispatch_path', is => 'ro', default => '/api/lnpnumbers/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-lnpnumbers');
sub resource_name{
return 'lnpnumbers';
}
sub dispatch_path{
return '/api/lnpnumbers/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-lnpnumbers';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,29 @@
package NGCP::Panel::Controller::API::MailToFaxSettings;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
use TryCatch;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies mail to fax settings for a specific subscriber.',
);
sub api_description {
return 'Specifies mail to fax settings for a specific subscriber.';
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'active',
description => 'Filter for items (subscribers) with active mail to fax settings',
@ -63,14 +58,20 @@ class_has 'query_params' => (
},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::MailToFaxSettings';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::MailToFaxSettings/;
class_has('resource_name', is => 'ro', default => 'mailtofaxsettings');
class_has('dispatch_path', is => 'ro', default => '/api/mailtofaxsettings/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-mailtofaxsettings');
sub resource_name{
return 'mailtofaxsettings';
}
sub dispatch_path{
return '/api/mailtofaxsettings/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-mailtofaxsettings';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::MailToFaxSettingsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
use TryCatch;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::MailToFaxSettings';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::MailToFaxSettings/;
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'mailtofaxsettings');
class_has('dispatch_path', is => 'ro', default => '/api/mailtofaxsettings/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-mailtofaxsettings');
sub resource_name{
return 'mailtofaxsettings';
}
sub dispatch_path{
return '/api/mailtofaxsettings/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-mailtofaxsettings';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::MaliciousCalls;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines a registered malicious calls list.',
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
sub api_description {
return 'Defines a registered malicious calls list.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for malicious calls belonging to a specific reseller',
@ -44,14 +41,20 @@ class_has 'query_params' => (
},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::MaliciousCalls';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::MaliciousCalls/;
class_has('resource_name', is => 'ro', default => 'maliciouscalls');
class_has('dispatch_path', is => 'ro', default => '/api/maliciouscalls/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-maliciouscalls');
sub resource_name{
return 'maliciouscalls';
}
sub dispatch_path{
return '/api/maliciouscalls/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-maliciouscalls';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::MaliciousCallsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::MaliciousCalls';
sub allowed_methods{
return [qw/GET OPTIONS HEAD DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::MaliciousCalls/;
class_has('resource_name', is => 'ro', default => 'maliciouscalls');
class_has('dispatch_path', is => 'ro', default => '/api/maliciouscalls/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-maliciouscalls');
sub resource_name{
return 'maliciouscalls';
}
sub dispatch_path{
return '/api/maliciouscalls/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-maliciouscalls';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::NcosLevels;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines NCOS levels to be used to restrict subscriber call destinations.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines NCOS levels to be used to restrict subscriber call destinations.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for ncos levels belonging to a specific reseller',
@ -40,14 +37,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::NcosLevels';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::NcosLevels/;
class_has('resource_name', is => 'ro', default => 'ncoslevels');
class_has('dispatch_path', is => 'ro', default => '/api/ncoslevels/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-ncoslevels');
sub resource_name{
return 'ncoslevels';
}
sub dispatch_path{
return '/api/ncoslevels/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-ncoslevels';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::NcosLevelsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::NcosLevels';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::NcosLevels/;
class_has('resource_name', is => 'ro', default => 'ncoslevels');
class_has('dispatch_path', is => 'ro', default => '/api/ncoslevels/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-ncoslevels');
sub resource_name{
return 'ncoslevels';
}
sub dispatch_path{
return '/api/ncoslevels/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-ncoslevels';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::NcosLnpCarriers;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Allows to permit or reject calls to specific LNP carriers as part of an NCOS level.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Allows to permit or reject calls to specific LNP carriers as part of an NCOS level.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'ncos_level_id',
description => 'Filter for NCOS LNP entries belonging to a specific NCOS level.',
@ -51,14 +48,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::NcosLnpCarriers';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::NcosLnpCarriers/;
class_has('resource_name', is => 'ro', default => 'ncoslnpcarriers');
class_has('dispatch_path', is => 'ro', default => '/api/ncoslnpcarriers/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-ncoslnpcarriers');
sub resource_name{
return 'ncoslnpcarriers';
}
sub dispatch_path{
return '/api/ncoslnpcarriers/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-ncoslnpcarriers';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::NcosLnpCarriersItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::NcosLnpCarriers';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::NcosLnpCarriers/;
class_has('resource_name', is => 'ro', default => 'ncoslnpcarriers');
class_has('dispatch_path', is => 'ro', default => '/api/ncoslnpcarriers/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-ncoslnpcarriers');
sub resource_name{
return 'ncoslnpcarriers';
}
sub dispatch_path{
return '/api/ncoslnpcarriers/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-ncoslnpcarriers';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::NcosPatterns;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines email templates to be send when new subscribers are created or when passwords are reset.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines email templates to be send when new subscribers are created or when passwords are reset.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'ncos_level_id',
description => 'Filter for NCOS patterns belonging to a specific NCOS level.',
@ -40,14 +37,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::NcosPatterns';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::NcosPatterns/;
class_has('resource_name', is => 'ro', default => 'ncospatterns');
class_has('dispatch_path', is => 'ro', default => '/api/ncospatterns/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-ncospatterns');
sub resource_name{
return 'ncospatterns';
}
sub dispatch_path{
return '/api/ncospatterns/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-ncospatterns';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::NcosPatternsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::NcosPatterns';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::NcosPatterns/;
class_has('resource_name', is => 'ro', default => 'ncospatterns');
class_has('dispatch_path', is => 'ro', default => '/api/ncospatterns/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-ncospatterns');
sub resource_name{
return 'ncospatterns';
}
sub dispatch_path{
return '/api/ncospatterns/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-ncospatterns';
}
__PACKAGE__->config(
action => {

@ -1,42 +1,45 @@
package NGCP::Panel::Controller::API::PbxDeviceConfigFiles;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines the actual <a href="#pbxdevicefirmwares">PbxDeviceConfigs</a> Files.',
);
sub allowed_methods{
return [qw/OPTIONS/];
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
]},
);
sub api_description {
return 'Defines the actual <a href="#pbxdevicefirmwares">PbxDeviceConfigs</a> Files.';
};
with 'NGCP::Panel::Role::API::PbxDeviceFirmwares';
sub query_params {
return [
];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceFirmwares/;
class_has('resource_name', is => 'ro', default => 'pbxdeviceconfigfiles');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdeviceconfigfiles/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceconfigfiles');
sub resource_name{
return 'pbxdeviceconfigfiles';
}
sub dispatch_path{
return '/api/pbxdeviceconfigfiles/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceconfigfiles';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::PbxDeviceConfigFilesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PbxDeviceConfigs';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceConfigs/;
class_has('resource_name', is => 'ro', default => 'pbxdeviceconfigfiles');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdeviceconfigfiles/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceconfigfiles');
sub resource_name{
return 'pbxdeviceconfigfiles';
}
sub dispatch_path{
return '/api/pbxdeviceconfigfiles/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceconfigfiles';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::PbxDeviceConfigs;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines configs for a <a href="#pbxdevicemodels">PbxDeviceModel</a>. To create or update a config, do a POST or PUT with the proper Content-Type (e.g. text/xml) and pass the properties via query parameters, e.g. <span>/api/pbxdeviceconfigs/?device_id=1&amp;version=1.0</span>',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines configs for a <a href="#pbxdevicemodels">PbxDeviceModel</a>. To create or update a config, do a POST or PUT with the proper Content-Type (e.g. text/xml) and pass the properties via query parameters, e.g. <span>/api/pbxdeviceconfigs/?device_id=1&amp;version=1.0</span>';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'device_id',
description => 'Filter for configs of a specific device model',
@ -62,14 +59,20 @@ class_has 'query_params' => (
second => sub { },
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::PbxDeviceConfigs';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceConfigs/;
class_has('resource_name', is => 'ro', default => 'pbxdeviceconfigs');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdeviceconfigs/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceconfigs');
sub resource_name{
return 'pbxdeviceconfigs';
}
sub dispatch_path{
return '/api/pbxdeviceconfigs/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceconfigs';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::PbxDeviceConfigsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PbxDeviceConfigs';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PUT/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceConfigs/;
class_has('resource_name', is => 'ro', default => 'pbxdeviceconfigs');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdeviceconfigs/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceconfigs');
sub resource_name{
return 'pbxdeviceconfigs';
}
sub dispatch_path{
return '/api/pbxdeviceconfigs/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceconfigs';
}
__PACKAGE__->config(
action => {

@ -1,42 +1,45 @@
package NGCP::Panel::Controller::API::PbxDeviceFirmwareBinaries;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines the actual <a href="#pbxdevicefirmwares">PbxDeviceFirmwares</a> Binary.',
);
sub allowed_methods{
return [qw/OPTIONS/];
}
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
]},
);
sub api_description {
return 'Defines the actual <a href="#pbxdevicefirmwares">PbxDeviceFirmwares</a> Binary.';
};
with 'NGCP::Panel::Role::API::PbxDeviceFirmwares';
sub query_params {
return [
];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceFirmwares/;
class_has('resource_name', is => 'ro', default => 'pbxdevicefirmwarebinaries');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevicefirmwarebinaries/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicefirmwarebinaries');
sub resource_name{
return 'pbxdevicefirmwarebinaries';
}
sub dispatch_path{
return '/api/pbxdevicefirmwarebinaries/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicefirmwarebinaries';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::PbxDeviceFirmwareBinariesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PbxDeviceFirmwares';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceFirmwares/;
class_has('resource_name', is => 'ro', default => 'pbxdevicefirmwarebinaries');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevicefirmwarebinaries/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicefirmwarebinaries');
sub resource_name{
return 'pbxdevicefirmwarebinaries';
}
sub dispatch_path{
return '/api/pbxdevicefirmwarebinaries/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicefirmwarebinaries';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::PbxDeviceFirmwares;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines firmwares for a <a href="#pbxdevicemodels">PbxDeviceModel</a>. To create or update a firmware, do a POST or PUT with Content-Type application/octet-stream and pass the properties via query parameters, e.g. <span>/api/pbxdevicefirmwares/?device_id=1&amp;filename=test.bin&amp;version=1.0</span>',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines firmwares for a <a href="#pbxdevicemodels">PbxDeviceModel</a>. To create or update a firmware, do a POST or PUT with Content-Type application/octet-stream and pass the properties via query parameters, e.g. <span>/api/pbxdevicefirmwares/?device_id=1&amp;filename=test.bin&amp;version=1.0</span>';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'device_id',
description => 'Filter for firmwares of a specific device model',
@ -62,14 +59,20 @@ class_has 'query_params' => (
second => sub { },
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::PbxDeviceFirmwares';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceFirmwares/;
class_has('resource_name', is => 'ro', default => 'pbxdevicefirmwares');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevicefirmwares/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicefirmwares');
sub resource_name{
return 'pbxdevicefirmwares';
}
sub dispatch_path{
return '/api/pbxdevicefirmwares/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicefirmwares';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::PbxDeviceFirmwaresItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PbxDeviceFirmwares';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PUT/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceFirmwares/;
class_has('resource_name', is => 'ro', default => 'pbxdevicefirmwares');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevicefirmwares/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicefirmwares');
sub resource_name{
return 'pbxdevicefirmwares';
}
sub dispatch_path{
return '/api/pbxdevicefirmwares/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicefirmwares';
}
__PACKAGE__->config(
action => {

@ -1,34 +1,31 @@
package NGCP::Panel::Controller::API::PbxDeviceModelImages;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Used to download the front and mac image of a <a href="#pbxdevicemodels">PbxDeviceModel</a>. Returns a binary attachment with the correct content type (e.g. image/jpeg) of the image.',
);
sub allowed_methods{
return [qw/OPTIONS/];
}
sub api_description {
return 'Used to download the front and mac image of a <a href="#pbxdevicemodels">PbxDeviceModel</a>. Returns a binary attachment with the correct content type (e.g. image/jpeg) of the image.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'type',
description => 'Either "front" (default) or "mac" to download one or the other.',
@ -38,15 +35,20 @@ class_has 'query_params' => (
second => sub {},
}
}
]},
);
];
}
with 'NGCP::Panel::Role::API::PbxDeviceModelImages';
with 'NGCP::Panel::Role::API::PbxDeviceModels';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceModelImages NGCP::Panel::Role::API::PbxDeviceModels/;
class_has('resource_name', is => 'ro', default => 'pbxdevicemodelimages');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevicemodelimages/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicemodelimages');
sub resource_name{
return 'pbxdevicemodelimages';
}
sub dispatch_path{
return '/api/pbxdevicemodelimages/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicemodelimages';
}
__PACKAGE__->config(
action => {

@ -1,26 +1,34 @@
package NGCP::Panel::Controller::API::PbxDeviceModelImagesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PbxDeviceModelImages';
with 'NGCP::Panel::Role::API::PbxDeviceModels';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceModelImages/;
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceModels/;
class_has('resource_name', is => 'ro', default => 'pbxdevicemodelimages');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevicemodelimages/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicemodelimages');
sub resource_name{
return 'pbxdevicemodelimages';
}
sub dispatch_path{
return '/api/pbxdevicemodelimages/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicemodelimages';
}
__PACKAGE__->config(
action => {

@ -1,37 +1,34 @@
package NGCP::Panel::Controller::API::PbxDeviceModels;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use Data::Dumper;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::DeviceBootstrap;
use NGCP::Panel::Utils::Device;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
# curl -v -X POST --user $USER --insecure -F front_image=@sandbox/spa504g-front.jpg -F mac_image=@sandbox/spa504g-back.jpg -F json='{"reseller_id":1, "vendor":"Cisco", "model":"SPA999", "linerange":[{"name": "Phone Keys", "can_private":true, "can_shared":true, "can_blf":true, "keys":[{"labelpos":"top", "x":5110, "y":5120},{"labelpos":"top", "x":5310, "y":5320}]}]}' https://localhost:4443/api/pbxdevicemodels/
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies a model to be set in <a href="#pbxdeviceconfigs">PbxDeviceConfigs</a>. Use a Content-Type "multipart/form-data", provide front_image and mac_image parts with the actual images, and an additional json part with the properties specified below, e.g.: <code>curl -X POST --user $USER -F front_image=@/path/to/front.png -F mac_image=@/path/to/mac.png -F json=\'{"reseller_id":...}\' https://example.org:1443/api/pbxdevicemodels/</code>',
);
sub api_description {
return 'Specifies a model to be set in <a href="#pbxdeviceconfigs">PbxDeviceConfigs</a>. Use a Content-Type "multipart/form-data", provide front_image and mac_image parts with the actual images, and an additional json part with the properties specified below, e.g.: <code>curl -X POST --user $USER -F front_image=@/path/to/front.png -F mac_image=@/path/to/mac.png -F json=\'{"reseller_id":...}\' https://example.org:1443/api/pbxdevicemodels/</code>';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'reseller_id',
description => 'Filter for models belonging to a certain reseller',
@ -65,12 +62,11 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
class_has 'documentation_sample' => (
is => 'ro',
default => sub { {
sub documentation_sample {
return {
vendor => "testvendor",
model => "testmodel",
reseller_id => 1,
@ -97,15 +93,21 @@ class_has 'documentation_sample' => (
],
},
],
} },
);
} ;
}
with 'NGCP::Panel::Role::API::PbxDeviceModels';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceModels/;
class_has('resource_name', is => 'ro', default => 'pbxdevicemodels');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevicemodels/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicemodels');
sub resource_name{
return 'pbxdevicemodels';
}
sub dispatch_path{
return '/api/pbxdevicemodels/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicemodels';
}
__PACKAGE__->config(
action => {

@ -1,29 +1,37 @@
package NGCP::Panel::Controller::API::PbxDeviceModelsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use Clone qw/clone/;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PbxDeviceModels';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceModels/;
class_has('resource_name', is => 'ro', default => 'pbxdevicemodels');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevicemodels/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicemodels');
sub resource_name{
return 'pbxdevicemodels';
}
sub dispatch_path{
return '/api/pbxdevicemodels/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevicemodels';
}
__PACKAGE__->config(
action => {

@ -1,32 +1,29 @@
package NGCP::Panel::Controller::API::PbxDeviceProfiles;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies a profile to be set in <a href="#pbxdevices">PbxDevices</a>.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Specifies a profile to be set in <a href="#pbxdevices">PbxDevices</a>.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'name',
description => 'Filter for profiles matching a name pattern',
@ -49,15 +46,21 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::PbxDeviceProfiles';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceProfiles/;
class_has('resource_name', is => 'ro', default => 'pbxdeviceprofiles');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdeviceprofiles/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceprofiles');
sub resource_name{
return 'pbxdeviceprofiles';
}
sub dispatch_path{
return '/api/pbxdeviceprofiles/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceprofiles';
}
__PACKAGE__->config(
action => {

@ -1,28 +1,36 @@
package NGCP::Panel::Controller::API::PbxDeviceProfilesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PbxDeviceProfiles';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDeviceProfiles/;
class_has('resource_name', is => 'ro', default => 'pbxdeviceprofiles');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdeviceprofiles/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceprofiles');
sub resource_name{
return 'pbxdeviceprofiles';
}
sub dispatch_path{
return '/api/pbxdeviceprofiles/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdeviceprofiles';
}
__PACKAGE__->config(
action => {

@ -1,33 +1,30 @@
package NGCP::Panel::Controller::API::PbxDevices;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::DeviceBootstrap;
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies a PBX device deployed at a customer.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Specifies a PBX device deployed at a customer.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'customer_id',
description => 'Search for PBX devices belonging to a specific customer',
@ -61,15 +58,21 @@ class_has 'query_params' => (
second => sub {},
},
}
]},
);
];
}
with 'NGCP::Panel::Role::API::PbxDevices';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDevices/;
class_has('resource_name', is => 'ro', default => 'pbxdevices');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevices/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevices');
sub resource_name{
return 'pbxdevices';
}
sub dispatch_path{
return '/api/pbxdevices/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevices';
}
__PACKAGE__->config(
action => {

@ -1,28 +1,36 @@
package NGCP::Panel::Controller::API::PbxDevicesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PbxDevices';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PbxDevices/;
class_has('resource_name', is => 'ro', default => 'pbxdevices');
class_has('dispatch_path', is => 'ro', default => '/api/pbxdevices/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevices');
sub resource_name{
return 'pbxdevices';
}
sub dispatch_path{
return '/api/pbxdevices/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-pbxdevices';
}
__PACKAGE__->config(
action => {

@ -1,35 +1,34 @@
package NGCP::Panel::Controller::API::PeeringGroups;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
#
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Peering;
use Path::Tiny qw(path);
use TryCatch;
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PeeringGroups/;#Catalyst::Controller
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines peering groups.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines peering groups.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'name',
description => 'Filter for peering group name',
@ -52,14 +51,8 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
with 'NGCP::Panel::Role::API::PeeringGroups';
class_has('resource_name', is => 'ro', default => 'peeringgroups');
class_has('dispatch_path', is => 'ro', default => '/api/peeringgroups/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-peeringgroups');
];
}
__PACKAGE__->config(
action => {
@ -182,7 +175,7 @@ sub POST :Allow {
try {
$item = $c->model('DB')->resultset('voip_peer_groups')->create($resource);
NGCP::Panel::Utils::Peering::_sip_lcr_reload(c => $c);
} catch($e) {
} catch($e){
$c->log->error("failed to create peering group: $e"); # TODO: user, message, trace, ...
$self->error($c, HTTP_INTERNAL_SERVER_ERROR, "Failed to create peering group.");
last;

@ -1,25 +1,22 @@
package NGCP::Panel::Controller::API::PeeringGroupsItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PeeringGroups/;
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PeeringGroups';
class_has('resource_name', is => 'ro', default => 'peeringgroups');
class_has('dispatch_path', is => 'ro', default => '/api/peeringgroups/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-peeringgroups');
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
__PACKAGE__->config(
action => {

@ -1,35 +1,32 @@
package NGCP::Panel::Controller::API::PeeringRules;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Peering;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Defines peering groups.',
);
sub allowed_methods{
return [qw/GET POST OPTIONS HEAD/];
}
sub api_description {
return 'Defines peering groups.';
};
class_has 'query_params' => (
is => 'ro',
isa => 'ArrayRef',
default => sub {[
sub query_params {
return [
{
param => 'group_id',
description => 'Filter for peering rule group',
@ -63,14 +60,20 @@ class_has 'query_params' => (
second => sub {},
},
},
]},
);
];
}
with 'NGCP::Panel::Role::API::PeeringRules';
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PeeringRules/;
class_has('resource_name', is => 'ro', default => 'peeringrules');
class_has('dispatch_path', is => 'ro', default => '/api/peeringrules/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-peeringrules');
sub resource_name{
return 'peeringrules';
}
sub dispatch_path{
return '/api/peeringrules/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-peeringrules';
}
__PACKAGE__->config(
action => {

@ -1,25 +1,33 @@
package NGCP::Panel::Controller::API::PeeringRulesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::ValidateJSON qw();
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::PeeringRules';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT DELETE/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API::PeeringRules/;
class_has('resource_name', is => 'ro', default => 'peeringrules');
class_has('dispatch_path', is => 'ro', default => '/api/peeringrules/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-peeringrules');
sub resource_name{
return 'peeringrules';
}
sub dispatch_path{
return '/api/peeringrules/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-peeringrules';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,38 @@
package NGCP::Panel::Controller::API::PeeringServerPreferenceDefs;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::Preferences;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
use JSON::Types qw();
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API';
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
use base qw/Catalyst::Controller NGCP::Panel::Role::API/;
class_has('resource_name', is => 'ro', default => 'peeringserverpreferencedefs');
class_has('dispatch_path', is => 'ro', default => '/api/peeringserverpreferencedefs/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-peeringserverpreferencedefs');
sub resource_name{
return 'peeringserverpreferencedefs';
}
sub dispatch_path{
return '/api/peeringserverpreferencedefs/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-peeringserverpreferencedefs';
}
__PACKAGE__->config(
action => {

@ -1,35 +1,40 @@
package NGCP::Panel::Controller::API::PeeringServerPreferences;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::CheckTrailingSlash;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
class_has 'api_description' => (
is => 'ro',
isa => 'Str',
default =>
'Specifies certain properties (preferences) for a <a href="#peeringservers">Peering servers</a>. The full list of properties can be obtained via <a href="/api/peeringserverpreferencedefs/">PeeringSserverPreferenceDefs</a>.'
);
sub allowed_methods{
return [qw/GET OPTIONS HEAD/];
}
with 'NGCP::Panel::Role::API::Preferences';
sub api_description {
return 'Specifies certain properties (preferences) for a <a href="#peeringservers">Peering servers</a>. The full list of properties can be obtained via <a href="/api/peeringserverpreferencedefs/">PeeringSserverPreferenceDefs</a>.';
};
class_has('resource_name', is => 'ro', default => 'peeringserverpreferences');
class_has('dispatch_path', is => 'ro', default => '/api/peeringserverpreferences/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-peeringserverpreferences');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Preferences/;
sub resource_name{
return 'peeringserverpreferences';
}
sub dispatch_path{
return '/api/peeringserverpreferences/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-peeringserverpreferences';
}
__PACKAGE__->config(
action => {

@ -1,30 +1,41 @@
package NGCP::Panel::Controller::API::PeeringServerPreferencesItem;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use Moose;
#use namespace::sweep;
no Moose;
use boolean qw(true);
use Data::HAL qw();
use Data::HAL::Link qw();
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use MooseX::ClassAttribute qw(class_has);
use TryCatch;
use NGCP::Panel::Utils::ValidateJSON qw();
use NGCP::Panel::Utils::DateTime;
use Path::Tiny qw(path);
use Safe::Isa qw($_isa);
BEGIN { extends 'Catalyst::Controller::ActionRole'; }
require Catalyst::ActionRole::ACL;
require Catalyst::ActionRole::HTTPMethods;
require Catalyst::ActionRole::RequireSSL;
with 'NGCP::Panel::Role::API::Preferences';
sub allowed_methods{
return [qw/GET OPTIONS HEAD PATCH PUT/];
}
class_has('resource_name', is => 'ro', default => 'peeringserverpreferences');
class_has('dispatch_path', is => 'ro', default => '/api/peeringserverpreferences/');
class_has('relation', is => 'ro', default => 'http://purl.org/sipwise/ngcp-api/#rel-peeringserverpreferences');
use base qw/Catalyst::Controller NGCP::Panel::Role::API::Preferences/;
sub resource_name{
return 'peeringserverpreferences';
}
sub dispatch_path{
return '/api/peeringserverpreferences/';
}
sub relation{
return 'http://purl.org/sipwise/ngcp-api/#rel-peeringserverpreferences';
}
class_has(@{ __PACKAGE__->get_journal_query_params() });
sub journal_query_params {
my($self,$query_params) = @_;
return $self->get_journal_query_params($query_params);
}
__PACKAGE__->config(
action => {
@ -193,39 +204,8 @@ sub PUT :Allow {
return;
}
sub item_base_journal :Journal {
my $self = shift @_;
return $self->handle_item_base_journal(@_);
}
sub journals_get :Journal {
my $self = shift @_;
return $self->handle_journals_get(@_);
}
sub journalsitem_get :Journal {
my $self = shift @_;
return $self->handle_journalsitem_get(@_);
}
sub journals_options :Journal {
my $self = shift @_;
return $self->handle_journals_options(@_);
}
sub journalsitem_options :Journal {
my $self = shift @_;
return $self->handle_journalsitem_options(@_);
}
sub journals_head :Journal {
my $self = shift @_;
return $self->handle_journals_head(@_);
}
sub journalsitem_head :Journal {
my $self = shift @_;
return $self->handle_journalsitem_head(@_);
sub get_journal_methods{
return [qw/handle_item_base_journal handle_journals_get handle_journalsitem_get handle_journals_options handle_journalsitem_options handle_journals_head handle_journalsitem_head/];
}
sub end : Private {

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

Loading…
Cancel
Save