diff --git a/harmony/src/domain/data/id.rs b/harmony/src/domain/data/id.rs index 05717b4..a710721 100644 --- a/harmony/src/domain/data/id.rs +++ b/harmony/src/domain/data/id.rs @@ -1,6 +1,6 @@ use serde::{Deserialize, Serialize}; -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Id { value: String, } diff --git a/harmony/src/domain/topology/tenant/manager.rs b/harmony/src/domain/topology/tenant/manager.rs index 2aeb772..b1b7eb3 100644 --- a/harmony/src/domain/topology/tenant/manager.rs +++ b/harmony/src/domain/topology/tenant/manager.rs @@ -13,23 +13,7 @@ pub trait TenantManager: Send + Sync + std::fmt::Debug { /// /// # Arguments /// * `config`: The desired configuration for the new tenant. - /// - /// # Returns - /// A `TenantContext` representing the provisioned tenant. - async fn provision_tenant(&self, config: &TenantConfig) - -> Result; - - /// Retrieves the current details and context of an existing tenant. - /// - /// # Arguments - /// * `tenant_name`: The logical name of the tenant to retrieve. - /// - /// # Returns - /// An `Option`, which is `None` if the tenant does not exist. - async fn get_tenant_details( - &self, - tenant_name: &str, - ) -> Result, ExecutorError>; + async fn provision_tenant(&self, config: &TenantConfig) -> Result<(), ExecutorError>; /// Updates the resource limits for an existing tenant. /// @@ -59,7 +43,4 @@ pub trait TenantManager: Send + Sync + std::fmt::Debug { /// # Arguments /// * `tenant_name`: The logical name of the tenant to deprovision. async fn deprovision_tenant(&self, tenant_name: &str) -> Result<(), ExecutorError>; - - /// Lists the logical names of all tenants currently managed by this `TenantManager` instance. - async fn list_tenant_names(&self) -> Result, ExecutorError>; } diff --git a/harmony/src/domain/topology/tenant/mod.rs b/harmony/src/domain/topology/tenant/mod.rs index 383f8f5..0704a34 100644 --- a/harmony/src/domain/topology/tenant/mod.rs +++ b/harmony/src/domain/topology/tenant/mod.rs @@ -4,14 +4,16 @@ use serde::{Deserialize, Serialize}; use std::collections::HashMap; +use crate::data::Id; + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] // Assuming serde for Scores pub struct TenantConfig { - /// A unique, human-readable name for the tenant (e.g., "client-alpha", "project-phoenix"). - /// This will be used as the primary identifier for management operations. - pub name: String, + /// This will be used as the primary unique identifier for management operations and will never + /// change for the entire lifetime of the tenant + pub id: Id, - /// An optional description for the tenant. - pub description: Option, + /// A human-readable name for the tenant (e.g., "client-alpha", "project-phoenix"). + pub name: String, /// Desired resource allocations and limits for the tenant. pub resource_limits: ResourceLimits, @@ -22,26 +24,6 @@ pub struct TenantConfig { /// Key-value pairs for provider-specific tagging, labeling, or metadata. /// Useful for billing, organization, or filtering within the provider's console. pub labels_or_tags: HashMap, - // Note: User/group management for the tenant is deferred to a future ADR. - // For now, the TenantManager sets up the space; how it's accessed internally - // by the tenant's own users is a separate concern. -} - -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct TenantContext { - /// The provider-specific internal identifier for the tenant's primary isolation unit - /// (e.g., Kubernetes namespace name, OpenStack project ID, AWS Account ID). - pub provider_internal_id: String, - - /// The logical name of the tenant, matching `TenantConfig.name`. - pub name: String, - - /// Effective resource limits currently applied to the tenant. - /// This might differ slightly from requested if the provider adjusted them. - pub effective_resource_limits: ResourceLimits, - - /// Effective network policy currently applied. - pub effective_network_policy: TenantNetworkPolicy, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] @@ -57,15 +39,7 @@ pub struct ResourceLimits { pub memory_limit_gb: Option, /// Total persistent storage allocation in Gigabytes across all volumes. - pub storage_total_gb: Option, - /// Maximum number of distinct persistent volumes/claims. - pub persistent_volume_claim_count: Option, - // /// Optional: Storage limits per class, if needed for more granular control. - // pub storage_gb_per_class: Option>, - /// Maximum number of load balancers. - pub load_balancer_count: Option, - /// Maximum number of public IP addresses. - pub public_ip_count: Option, + pub storage_total_gb: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]