Skip to content
Snippets Groups Projects
Commit b1a5f91f authored by cyberta's avatar cyberta
Browse files

new bridges api

parent 720e70ef
Branches bridges_api
No related tags found
No related merge requests found
Pipeline #230033 passed
......@@ -268,6 +268,13 @@ type GatewayParams struct {
CC string
}
type BridgesParams struct {
Location string
Port string
Transport string
Type string
}
// GetGateways returns a list of gateways (it it's enabled by the menshen
// API). It optionally accepts a GatewayParams object where you can set
// different filters.
......@@ -287,7 +294,27 @@ func (api *API) GetGateways(p *GatewayParams) ([]*models.ModelsGateway, error) {
if err != nil {
return nil, err
}
return gateways.Payload, err
return gateways.Payload, nil
}
func (api *API) GetBridges(p *BridgesParams) ([]*models.ModelsBridge, error) {
params := provisioning.NewGet5BridgesParams()
if p != nil {
params.Loc = &p.Location
params.Port = &p.Port
params.Tr = &p.Transport
params.Type = &p.Type
}
if api.httpClient != nil {
params = params.WithHTTPClient(api.httpClient)
}
bridges, err := api.client.Provisioning.Get5Bridges(params)
if err != nil {
return nil, err
}
return bridges.Payload, nil
}
// GetOpenVPNCert returns valid OpenVPN client credentials (certificate and
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment