-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[orc8r][NetworkProbe] Support NetworkProbe APIs in swagger (#4962)
* [orc8r][NetworkProbe] Support NetworkProbe APIs in swagger Signed-off-by: YOUSSEF EL MASMOUDI <ymasmoudi@fb.com> * [orc8r][NetworkProbe] add unit tests Signed-off-by: YOUSSEF EL MASMOUDI <ymasmoudi@fb.com> * [orc8r][NetworkProbe] move swagger definitions to a separate service Signed-off-by: YOUSSEF EL MASMOUDI <ymasmoudi@fb.com> * [orc8r][NetworkProbe] update correlation field Signed-off-by: YOUSSEF EL MASMOUDI <ymasmoudi@fb.com> * [orc8r][NetworkProbe] fix nits and change correlation_id type to uint64 Signed-off-by: YOUSSEF EL MASMOUDI <ymasmoudi@fb.com> * Fix review comments Signed-off-by: YOUSSEF EL MASMOUDI <ymasmoudi@fb.com>
- Loading branch information
Showing
21 changed files
with
2,284 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
# Copyright 2020 The Magma Authors. | ||
|
||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
Copyright 2020 The Magma Authors. | ||
This source code is licensed under the BSD-style license found in the | ||
LICENSE file in the root directory of this source tree. | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package nprobe provides the network probe service. | ||
package nprobe | ||
|
||
const ServiceName = "nprobe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
Copyright 2020 The Magma Authors. | ||
This source code is licensed under the BSD-style license found in the | ||
LICENSE file in the root directory of this source tree. | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package main | ||
|
||
import ( | ||
"magma/lte/cloud/go/lte" | ||
"magma/lte/cloud/go/services/nprobe" | ||
"magma/lte/cloud/go/services/nprobe/obsidian/handlers" | ||
|
||
"magma/orc8r/cloud/go/obsidian" | ||
"magma/orc8r/cloud/go/obsidian/swagger" | ||
"magma/orc8r/cloud/go/obsidian/swagger/protos" | ||
"magma/orc8r/cloud/go/service" | ||
|
||
"github.com/golang/glog" | ||
) | ||
|
||
func main() { | ||
// Create service | ||
srv, err := service.NewOrchestratorService(lte.ModuleName, nprobe.ServiceName) | ||
if err != nil { | ||
glog.Fatalf("Error creating service: %v", err) | ||
} | ||
|
||
// Attach handlers | ||
obsidian.AttachHandlers(srv.EchoServer, handlers.GetHandlers()) | ||
protos.RegisterSwaggerSpecServer(srv.GrpcServer, swagger.NewSpecServicerFromFile(nprobe.ServiceName)) | ||
|
||
// Run service | ||
err = srv.Run() | ||
if err != nil { | ||
glog.Fatalf("Error while running service and echo server: %v", err) | ||
} | ||
|
||
} |
Oops, something went wrong.