We need to track whether we are within the current iterator by using an
additional variable.
Ideally we'd use a proper iterator object that is independent from the
object state, but this should do for now and fixes the regression.
Change-Id: Icc8d06f55277f49ef67fbd023fd53daa22962bce
Fixes: commit 155873d532
When moving to per-object options, we switched to set the page rows
directly from the constructor, and switched from the _rows to
_opts.page_rows.
Change-Id: Ia663dbba4a330813d67f6bbdbb50ad37419ad5d5
Fixes: commit 97c0fb6412
We should not be outputting the usage() text when we get a run-time
error, as these are unrelated and depend on the state of the server,
not on how it was called.
Change-Id: I996d52cf2e4f4a834a281f8d85ea7571f61cf2e4
The former will properly parse query strings separated by «?», the
latter will escape the «?» which will break the query arguments.
Change-Id: I29f4916a54f3d49bd5d8b7a2d0a998d57977e1dd
Update copyright years and change license to match the one declared in
debian/copyright, and the other perl programs in the repo.
Change-Id: I8d2cb1d38f267bea8c4f399ce4b921a260e2e862
We should not consider a missing configuration file a fatal problem,
now that we have defaults for almost every configuration setting,
and can override them at constructor time.
Change-Id: I371498e9d75e81c4c759012ec38b44d050bdea8f
We might want to use different values in the constructor, instead
of the ones coming from the configuration file or the global defauls.
Change-Id: Ifc9e3d762cf46a036bffb8073cd3c41a42589510
When we are just using the defaults and there's been no authentication
configured, we should just not use any authentication.
This makes it possible to use the code with no config file.
Change-Id: I9b23cd5ac806f6a56456d70175f9bdfcb436b62c
We should set sane defaults for almost all values. This will make it
possible to execute even when the configuration file is not present.
Change-Id: If85a72ad2b1470bdc9791e59810b4ba483becb9c
Some of these options can be changed via some methods, but these are
module globals that will affect any object created. This will also
make it possible to override specific options in the constructor w/o
affecting other objects.
Change-Id: I542b0bb6a45d0888878736c2d5fc58a0f7a7e653
We should not be running code that loads a configuration file in
a BEGIN block, as that will execute just by loading the module.
This makes using this module conditionally in other programs or testing
that code more difficult, as we would need to mock either this module
or the configuration file.
Just load the configuration file once in the constructor and cache
its contents, to avoid the overhead.
Change-Id: I86986dc81eaa32833b738ffa6df2a5de30159482
Instead of recomputing these every time we do a request, cache them
and reuse to avoid the object construction time, when we do not need
different constructor arguments over time.
Change-Id: I4d6039fc312a4e453a9eac6d59fe28f877613a6b
The to/from_json() are deprecated functions, which we should not be
using. Switch to the new ones, which also means we can stop encoding
the strings to and from UTF-8 explicitly.
Change-Id: Ie29371d532a51a3a62d54c35d22a6d488fe1b513
* ngcp-fraud-daily-lock and ngcp-fraud-auto-lock are
not supported anymore and replacted by ngcp-fraud-notifier
that does not lock contracts/subscribers but sends email
notifications and updates cdr_period_costs "notify_status"
and "nofified_at"
Change-Id: Icacbddc68fb25408a388f52427aab993c085dba3
* Fixed the POST data to correctly
build the primary number hash in
the ngcp-create-subscriber script
Change-Id: I03e2e5270d5f93d518d889584a3657b9ca1b64c3
For the same reason we demoted the Debian dependency from a Depends to a
Recommends, because the NGCP::API do not necessarily need an ngcp-panel
instance running on the same host, we match the perl module metadata.
Change-Id: I43fe985c34db1e3206b607648028389ad0b93c09
The current ngcp-api-tools package name seems to indicate this contains
some actual tool, but it only provides perl modules. Let's rename it to
clarify its actual intent.
At the same time we demote the ngcp-panel from a Depends to a
Recommends, because this is an HTTP client and can be used from a host
that has no panel installed against a host that has it. And remove the
ngcp-api-tools provides as we are not providing any tool.
Change-Id: I3fd3854a91cc680f71d5465bc7c397f292f7b95a
* it is important that next_page() retains the original
query params via links->next->href as otherwise
that leads to unpredicted results and no filtering
Change-Id: I8606a9fa03758eb214c7aa38958f158f2cc1a16e