55 lines
922 B
C++
55 lines
922 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "GnsPort.hpp"
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace gns {
|
|
|
|
|
|
class GnsProject;
|
|
|
|
|
|
/**
|
|
* Represent a GNS3 node
|
|
*/
|
|
class GnsNode {
|
|
public:
|
|
GnsNode(const std::shared_ptr<const GnsProject>& project, const std::string& uuid, const std::vector<GnsPort>& ports);
|
|
|
|
/**
|
|
* Get the base URL for the node API
|
|
* @return the base URL for the node API
|
|
*/
|
|
[[nodiscard]] std::string getApiBase() const;
|
|
|
|
/**
|
|
* Get the uuid of the node
|
|
* @return the uuid of the node
|
|
*/
|
|
[[nodiscard]] std::string getUuid() const;
|
|
|
|
/**
|
|
* Get the ports of the node
|
|
* @return the ports of the node
|
|
*/
|
|
[[nodiscard]] std::vector<GnsPort> getPorts() const;
|
|
|
|
/**
|
|
* Start the node
|
|
*/
|
|
void start() const;
|
|
|
|
private:
|
|
std::shared_ptr<const GnsProject> project;
|
|
std::string uuid;
|
|
std::vector<GnsPort> ports;
|
|
};
|
|
|
|
|
|
}
|