Skip to content
Snippets Groups Projects
Commit 5922b50e authored by Fabian Seidl's avatar Fabian Seidl
Browse files

rename pnd requests in API to fit definition

parent 1746a763
No related branches found
No related tags found
1 merge request!790Resolve "Update gRPC abstraction API with missing calls and refactoring"
......@@ -50,7 +50,7 @@ A description must be passed as positional argument.`,
Run: func(cmd *cobra.Command, args []string) {
spinner, _ := pterm.DefaultSpinner.Start("Creating new PND")
_, err := api.AddPnd(createContextWithAuthorization(), viper.GetString("controllerApiEndpoint"), pndName, pndDescription)
_, err := api.CreatePnd(createContextWithAuthorization(), viper.GetString("controllerApiEndpoint"), pndName, pndDescription)
if err != nil {
spinner.Fail("Failed creating the PND with name: ", pndName)
spinner.Fail(err)
......
......@@ -47,7 +47,7 @@ var pndListCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
spinner, _ := pterm.DefaultSpinner.Start("Fetching PND list from controller")
resp, err := api.GetPnds(createContextWithAuthorization(), pndAdapter.Endpoint())
resp, err := api.GetPndList(createContextWithAuthorization(), pndAdapter.Endpoint())
if err != nil {
spinner.Fail(err)
return
......
......@@ -55,7 +55,7 @@ func ensureStoreFileForTestsIsRemoved(storeName string) {
func Test_AddPnd(t *testing.T) {
defer ensureFilesForTestsAreRemoved()
resp, err := AddPnd(context.TODO(), bufnet, "test", "test pnd")
resp, err := CreatePnd(context.TODO(), bufnet, "test", "test pnd")
if err != nil {
t.Error(err)
return
......
......@@ -9,9 +9,9 @@ import (
nbi "code.fbi.h-da.de/danet/gosdn/controller/northbound/client"
)
// AddPnd takes a name, description and SBI UUID to create a new
// CreatePnd takes an address, a name and a description to create a new
// PrincipalNetworkDomain on the controller.
func AddPnd(ctx context.Context, addr, name, description string) (*ppb.CreatePndListResponse, error) {
func CreatePnd(ctx context.Context, addr, name, description string) (*ppb.CreatePndListResponse, error) {
pndClient, err := nbi.PndClient(addr, dialOptions...)
if err != nil {
return nil, err
......@@ -48,9 +48,9 @@ func GetPnd(ctx context.Context, addr string, args string) (*ppb.GetPndResponse,
return pndClient.GetPnd(ctx, req)
}
// GetPnds requests all PrincipalNetworkDomains from the
// GetPndList requests all PrincipalNetworkDomains from the
// controller.
func GetPnds(ctx context.Context, addr string, args ...string) (*ppb.GetPndListResponse, error) {
func GetPndList(ctx context.Context, addr string, args ...string) (*ppb.GetPndListResponse, error) {
pndClient, err := nbi.PndClient(addr, dialOptions...)
if err != nil {
return nil, err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment