-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Joe writes:
> There are plenty of things that can't be done from the api alone.
>
> One would be changing the jonny5 doc, what is the best command to run after
> doing this?
Most system config settings can be set via SUP:
sup whapps_config set jonny5 this_key this_value
There isn't support for setting nested keys or values other than scalars
like numbers, boolean, and string. These would make good functions to
add to jonny5_maintenance so you can set the specific values. Something
like:
sup jonny5_maintenance set_some_nested_key new_value
which would call whapps_config:set(<<"jonny5">>, [<<"some">>,
<<"nested">>, <<"key">>], NewValue) in the module.
>
> Another would be changing the regex in a `resource` document for a carrier.
> i think for this one i run a stepswitch flush or something like that. is
> that correct?
You should be able to POST the new resource doc (and we should add PATCH
support). If a global carrier, as superduper admin:
curl -x POST /v2/resources/{RESOURCE_ID} \
-d '{"data":{resource_doc_with_new_rules}}'
Once PATCH support is added:
curl -x PATCH /v2/resources/{RESOURCE_ID} \
-d '{"data":{"rules":["new_regex"]}}'
This should flush stepswitch's cache and reload the resource
automatically.
>
> Another would be adding a crossbar module to be autoloaded, or a whapp to
> be autoloaded in whapp_controller. Is there a better way to do this?
sup crossbar_maintenance start_module cb_whatever
This should persist the cb_whatever module to be auto-started on the
next boot. If its not, please file a ticket.
For whapps_controller, as I said, it isn't often that people start/stop
apps in an ad-hoc manner like this. But, we could easily add a second
argument to flag whether to persist the change. Something like:
sup whapps_controller start_app crossbar true
would persist the starting of crossbar on the local node.
>
> Another would be sometimes i am told to change the value of a key in an
> account document, what is the best way to invalidate a single account's
> cache? It seems to be 3 different commands for this and the difference is
> hard to ascertain.
curl -x PATCH /v2/accounts/{ACCOUNT_ID} \
-d '{"data":{"key":"value"}}'
This will patch the account doc with "key":"value" and flush any
relevant entries in the caches.
>
> For completeness I think changing service plans and adding new service
> plans is another thing that can't be done from the api (overriding can
> however). But I have never had a problem with this kind of thing being
> cached so far, so it's not something I'm completely worried about.
It does appear changing system-level service plans isn't feasible via
APIs. This should be a feature request ticket.
>
> On Friday, May 6, 2016 at 7:25:20 PM UTC-4, Darren Schreiber wrote:
>>
>> Caching regularly defeats the point of the cache.
>>
>> As your system grows, this will backfire on you. The cache is actually
>> really important when you start getting into the thousands-of-phones realm.
>> What you're doing here would cause one change to the DB, followed by the
>> flushes, to inherently cause thousands of hits to the DB for no reason.
>>
>> I agree with James. Let's fix the problem of WHY the caches aren't
>> invalidated when you need them to be invalidated. If that's because you're
>> going direct to the DB, then let's learn why that is as well and fix /
>> improve it.
>>
>>
>>
>>
>> >
sip:...@2600hz.com <javascript:>
>> >tel:
415.886.7905
>> >irc:mc_ @ freenode
>> >-----BEGIN PGP SIGNATURE-----
>> >Version: GnuPG v2
>> >
>> >iQEcBAEBCAAGBQJXLSRzAAoJENTKa+JPXCVgzgAH/2iBgMLcKABsZdNCaRGsI4gc
>> >5nHa3pRRsARpg3QbfNmZIEqd+j5fWaypmKwg6XPVgfB0w3DwrELEVOj4TkCHZgCU
>> >ZJ5cuo2VgUOwWsmpKz4dXrUp8mstgXFgjsPX39bSi+YR4sEWdrTTz0oDEIWvwmCC
>> >LYLGAyn2G5vjyVDwyQ5+gFKN8tigLtrUN3/BoHiuPGSL2RzagZwVNwpBbLxitYt3
>> >h5ZZIz7xF/4qCRNL9gDSS005HZ25nv78TincHyVlR9EMFJgSRPfz0HEIg82JCS5P
>> >OKEyX1oBbyxIdHeIYmctIWxxOebusTSqFspg5TH0iWN0OblpRLWCq05UvkG4t8M=
>> >=TLF5
>> >-----END PGP SIGNATURE-----
>> >
>> >--
>> >You received this message because you are subscribed to the Google Groups
>> "2600hz-dev" group.
>> >To unsubscribe from this group and stop receiving emails from it, send an
>> email to
2600hz-dev+...@googlegroups.com <javascript:>.
- --
James Aimonetti
Lead Systems Architect
"If Dialyzer don't care, I don't care"
2600HzPDX |
http://2600hz.com
sip:ja...@2600hz.com
tel:
415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJXMkjzAAoJENTKa+JPXCVgPU4IAJlRetSWRfkJuYcbPhkM45vU
m0p5gSUnZ9Y6No8ctnsxBpkSl1e1aLkAr70pnXhrc/8VI/A/R983bE1pVNrws9a9
0OehJFgCxvMPGh1PXyTh5J3SnZJmMrp9nHXc0B45gPlO4IpDQeTEQqWm4SonXRCH
/QPTWFixO4gyP/I/k/i65navDzgiKhAoSTYnSxByRhwEmqFIIoMNv1nazOOMr9Z9
Khry4EWKISgmQlhtKaBsGa/9OvOAHpmrUw53iwhcho3wWH1p1IF5w4P0lOuiTCag
59I9Ge1rSfwsG0Nge99SPOuqMJTOnpuzakQoEgIL6ck3823SxvWD1voYxKMxTd8=
=Z3Fd
-----END PGP SIGNATURE-----