Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CT Reversal endpoint? #6

Open
plsmith451 opened this issue Sep 14, 2023 · 1 comment
Open

New CT Reversal endpoint? #6

plsmith451 opened this issue Sep 14, 2023 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@plsmith451
Copy link

I get a 404 - Not found when hitting the /ivp/meters/ctreversal/{EID} endpoint. Has this changed / is there an alternate?

@Matthew1471
Copy link
Owner

Matthew1471 commented Sep 24, 2023

The endpoint is definitely correct.. interestingly it's the {EID} part which I had incorrect (thus the Not Found), it is of the format /ivp/meters/ctreversal/(?:[pc](?:L[1-3])?/?)?$

For instance a HTTP GET to one of the following:

https://envoy.local/ivp/meters/ctreversal/

https://envoy.local/ivp/meters/ctreversal/p
https://envoy.local/ivp/meters/ctreversal/pL1
https://envoy.local/ivp/meters/ctreversal/pL2
https://envoy.local/ivp/meters/ctreversal/pL3

https://envoy.local/ivp/meters/ctreversal/c
https://envoy.local/ivp/meters/ctreversal/cL1
https://envoy.local/ivp/meters/ctreversal/cL2
https://envoy.local/ivp/meters/ctreversal/cL3

Should all succeed.

This is where the p is Production and the c is Consumption.

..and to change any of these then one has to do a HTTP PUT to one of the above URLs:

{
    "polarityReversal": "reverse",
}

Not specifying a line (aka "phase") number applies it across all lines/phases of that meter type (e.g. c instead of cL1 will apply to all Consumption lines/phases).

I believe an empty PUT (or {} which is what the GET currently returns or maybe "normal" instead of "reverse") should be sent to unset it (haven't tested).

GET requests require any valid token (anybody) but all other HTTP methods (currently just PUT) will require a prov or above token.

@Matthew1471 Matthew1471 self-assigned this Sep 24, 2023
@Matthew1471 Matthew1471 added documentation Improvements or additions to documentation good first issue Good for newcomers labels Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants