-
Notifications
You must be signed in to change notification settings - Fork 83
Adapt network to the new config based HTTP API. #2840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 16 commits
4a2206b
427ab70
c3f4532
7cb2a9d
10512cd
8ddd736
87f91ea
7a4ec26
3c23b08
53ae796
4d0650b
af1d748
a8e943c
6f2d19a
2df7aad
df72d6a
d49dc09
f8abcc7
bb17a26
120ddc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |||||
| // To contact SUSE LLC about this file by physical or electronic mail, you may | ||||||
| // find current contact information at www.suse.com. | ||||||
|
|
||||||
| use crate::{l10n, service::Service, storage}; | ||||||
| use crate::{l10n, network, service::Service, storage}; | ||||||
| use agama_utils::{ | ||||||
| actor::{self, Handler}, | ||||||
| api::event, | ||||||
|
|
@@ -35,6 +35,8 @@ pub enum Error { | |||||
| L10n(#[from] l10n::start::Error), | ||||||
| #[error(transparent)] | ||||||
| Storage(#[from] storage::start::Error), | ||||||
| #[error(transparent)] | ||||||
| NetworkSystem(#[from] network::NetworkSystemError), | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally, why are you using
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea was to move it to agama_network::error::Error instead of NetworkSystemError or NetworkAdapterError but probably defined it but didn't moved it yet. |
||||||
| } | ||||||
|
|
||||||
| /// Starts the manager service. | ||||||
|
|
@@ -51,8 +53,12 @@ pub async fn start( | |||||
| let progress = progress::start(events.clone()).await?; | ||||||
| let l10n = l10n::start(issues.clone(), events.clone()).await?; | ||||||
| let storage = storage::start(progress.clone(), issues.clone(), events.clone(), dbus).await?; | ||||||
| let network_adapter = network::NetworkManagerAdapter::from_system() | ||||||
| .await | ||||||
| .expect("Could not connect to NetworkManager"); | ||||||
| let network = network::NetworkSystem::new(network_adapter).start().await?; | ||||||
|
teclator marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| let service = Service::new(l10n, storage, issues, progress, questions, events); | ||||||
| let service = Service::new(l10n, network, storage, issues, progress, questions, events); | ||||||
| let handler = actor::spawn(service); | ||||||
| Ok(handler) | ||||||
| } | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,12 +18,13 @@ | |
| // To contact SUSE LLC about this file by physical or electronic mail, you may | ||
| // find current contact information at www.suse.com. | ||
|
|
||
| use crate::model::{AccessPoint, Connection, Device}; | ||
| use crate::types::{ConnectionState, DeviceType}; | ||
| use crate::model::{Connection, GeneralState}; | ||
| use crate::types::{AccessPoint, ConnectionState, Device, DeviceType, Proposal, SystemInfo}; | ||
| use agama_utils::api::network::Config; | ||
| use tokio::sync::oneshot; | ||
| use uuid::Uuid; | ||
|
|
||
| use super::{error::NetworkStateError, model::GeneralState, NetworkAdapterError}; | ||
| use super::{error::NetworkStateError, NetworkAdapterError}; | ||
|
|
||
| pub type Responder<T> = oneshot::Sender<T>; | ||
| pub type ControllerConnection = (Connection, Vec<String>); | ||
|
|
@@ -42,6 +43,15 @@ pub enum Action { | |
| GetConnection(String, Responder<Option<Connection>>), | ||
| /// Gets a connection by its Uuid | ||
| GetConnectionByUuid(Uuid, Responder<Option<Connection>>), | ||
| /// Gets the internal state of the network configuration | ||
| GetConfig(Responder<Config>), | ||
| /// Gets the internal state of the network configuration proposal | ||
| GetProposal(Responder<Proposal>), | ||
| /// Updates th internal state of the network configuration | ||
|
teclator marked this conversation as resolved.
Outdated
|
||
| UpdateConfig(Box<Config>, Responder<Result<(), NetworkStateError>>), | ||
| /// Gets the current network configuration containing connections, devices, access_points and | ||
| /// also the general state | ||
| GetSystemConfig(Responder<SystemInfo>), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not the config, but the system itself. The name could be misleading. |
||
| /// Gets a connection | ||
| GetConnections(Responder<Vec<Connection>>), | ||
| /// Gets a controller connection | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,6 @@ pub mod adapter; | |
| pub mod error; | ||
| pub mod model; | ||
| mod nm; | ||
| pub mod settings; | ||
| mod system; | ||
| pub mod types; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.