ovpm icon indicating copy to clipboard operation
ovpm copied to clipboard

document rest and rpc api

Open cad opened this issue 7 years ago • 9 comments

Write a documentation for the ovpm REST and gRPC APIs. Put it up on the Wiki.

cad avatar Aug 29 '17 13:08 cad

Was there any movement on this...? Or any documentation elsewhere that can be used...?

j-cimb-barker avatar Dec 10 '17 17:12 j-cimb-barker

@j-cimb-barker Unfortunately detailed wiki document for APIs are currently missing. Nowadays I am super busy with another project within the company. I plan to get back to contributing to OVPM at the beginning of the new year.

Untill then you can do the following to reach to reference docs for REST API.

First you need to launch ovpmd as explained here and then you can access to the docs for each service by visiting the following url http://localhost:9090/api/docs/<service-name> where can be one of these:

  • auth
  • user
  • network
  • vpn

gRPC API is similiar with the REST API. Proto files for the gRPC services can be examined here.

cad avatar Dec 10 '17 18:12 cad

Thanks for getting back to me. I have had some success by following the code and have been able to authenticate and use the Rest api. :)

j-cimb-barker avatar Dec 10 '17 18:12 j-cimb-barker

How can I submit the authentication token or username/password to the user/list endpoint once I authenticate ?

I mean what are the params I need to submit in my post request ?

shyaminayesh avatar Aug 30 '18 18:08 shyaminayesh

@shyaminayesh

You should include an Authorization HTTP header in your request:

Authorization: Bearer <your_token>

cad avatar Aug 31 '18 08:08 cad

How can I send a curl request for rest APIs.

I mean what are the params I need to submit in my get and post request?

vvek82 avatar Feb 04 '20 10:02 vvek82

Hi,

Now I am able to get REST API response using curl command through token as below,

curl -H "Accept: application/json" -H "Authorization: Bearer <Token>" MY_SERVER:8080/api/v1/auth/status

In my case, I want to do all the things with ca-certificates. Is it possible to prepare a public key and private key paring for communication? From where I can get ca-certificates of ovpmd server to generate certificate and key for the client.

vvek82 avatar Feb 05 '20 05:02 vvek82

@vvek82 Unfortunately OVPM does not export internal PKI parameters to users at this point.

cad avatar Feb 08 '20 21:02 cad

Please add the doc links to the homepage :)

artificialai223 avatar Feb 09 '21 12:02 artificialai223