initial commit
This commit is contained in:
commit
811f80c92c
17 changed files with 549 additions and 0 deletions
44
source/gns3/GnsServer.hpp
Normal file
44
source/gns3/GnsServer.hpp
Normal file
|
@ -0,0 +1,44 @@
|
|||
#pragma once
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
#include "GnsProject.hpp"
|
||||
|
||||
|
||||
namespace gns {
|
||||
|
||||
|
||||
/**
|
||||
* Represent a GNS3 server
|
||||
* Wrapper around the GNS3 API (https://gns3-server.readthedocs.io/en/latest/endpoints.html)
|
||||
*/
|
||||
class GnsServer {
|
||||
public:
|
||||
GnsServer(const std::string& host, std::uint16_t port);
|
||||
|
||||
/**
|
||||
* Get the base prefix for an API request
|
||||
* @return the base prefix for an API request
|
||||
*/
|
||||
[[nodiscard]] std::string getApiBase() const;
|
||||
|
||||
/**
|
||||
* Get all the projects in the server
|
||||
* @return all the projects in the server
|
||||
*/
|
||||
[[nodiscard]] std::vector<GnsProject> getProjects() const;
|
||||
|
||||
/**
|
||||
* Get all the nodes in the server
|
||||
* @return all the nodes in the server
|
||||
*/
|
||||
[[nodiscard]] std::vector<GnsNode> getNodes() const;
|
||||
|
||||
private:
|
||||
std::string host;
|
||||
std::uint16_t port;
|
||||
};
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue