146 lines
2.8 KiB
Plaintext
146 lines
2.8 KiB
Plaintext
@startuml
|
|
|
|
title "Smaug API model"
|
|
|
|
class Protectable {
|
|
name: string
|
|
instances: []Resource
|
|
is_root: bool
|
|
}
|
|
|
|
Protectable --> Resource: lists
|
|
|
|
class Resource {
|
|
id: UUID
|
|
type: ResourceType
|
|
schema: JSONSchema
|
|
dependent_resources: []Resource
|
|
}
|
|
|
|
class Trigger {
|
|
}
|
|
|
|
class TimedTrigger extends Trigger {
|
|
|
|
}
|
|
|
|
class EventTrigger extends Trigger {
|
|
|
|
}
|
|
|
|
class Checkpoint {
|
|
id: UUID
|
|
tenant_id: UUID
|
|
plan: ProtectionPlan
|
|
status: string
|
|
started_at: DateTime
|
|
}
|
|
|
|
Checkpoint *-> ProtectionPlan: stores a copy of
|
|
|
|
class AutomaticOperation {
|
|
id: UUID
|
|
name: string
|
|
comments: string
|
|
tenant_id: UUID
|
|
}
|
|
|
|
class PlanRetention extends AutomaticOperation {
|
|
daily: bool
|
|
weekly: bool
|
|
monthly: bool
|
|
yearly: bool
|
|
protection_plan: ProtectionPlan
|
|
}
|
|
|
|
class ScheduledOperation <<abstract>> extends AutomaticOperation {
|
|
trigger: Trigger
|
|
}
|
|
|
|
ScheduledOperation *- Trigger: when should the operation should trigger
|
|
|
|
|
|
class BackupPlan extends ScheduledOperation {
|
|
protection_plan: ProtectionPlan
|
|
}
|
|
|
|
BackupPlan *--> ProtectionPlan
|
|
|
|
class DeleteCheckpoints extends ScheduledOperation {
|
|
query: string
|
|
protection_provider: ProtectionProvider
|
|
}
|
|
|
|
|
|
class ProtectionProvider {
|
|
name: string
|
|
description: string
|
|
extended_info_schema: [ResourceType]JSONSchema
|
|
options_schema: [ResourceType]JSONSchema
|
|
checkpoints: []Checkpoint
|
|
}
|
|
|
|
ProtectionProvider o-> Checkpoint: lists
|
|
|
|
class ProtectionPlan {
|
|
id: UUID
|
|
is_enabled: boolean
|
|
name: string
|
|
comments: string
|
|
resources: []Resource
|
|
protection_provider: ProtectionProvider
|
|
parameters: dict
|
|
Start()
|
|
Suspend()
|
|
}
|
|
|
|
ProtectionPlan "1" *--> "N" Resource: aggragates
|
|
ProtectionPlan -> ProtectionProvider
|
|
|
|
class RestoreTarget {
|
|
keystone_uri: URI
|
|
}
|
|
|
|
class Restoration {
|
|
template: string
|
|
target: RestoreTarget
|
|
provider: ProtectionProvider
|
|
checkpoint: Checkpoint
|
|
started_at: string
|
|
}
|
|
|
|
Restoration *-> RestoreTarget: restores to
|
|
|
|
@enduml
|
|
@startuml
|
|
|
|
package "Plugin Examples" {
|
|
|
|
interface BackupPlugin <<action set>> {
|
|
<<protect>> create_backup(resource: Resource, bank: Bank)
|
|
<<delete>> delete_backup(backup: Backup)
|
|
}
|
|
|
|
interface ReplicationPlugin <<action set>> {
|
|
<<enable>> start_replication(resource: Resource, replicationType: eReplicationType)
|
|
<<protect>> create_snapshot_from_replicated_target(resource: Resource, replicationType: eReplicationType)
|
|
<<delete>> delete_snapshot(resource: Resource, replicationType: eReplicationType)
|
|
<<disable>> stop_replication(resource: Resource)
|
|
}
|
|
|
|
ReplicationPlugin -> eReplicationType
|
|
|
|
interface SnapshotPlugin <<action set>> {
|
|
<<protect>> create_snapshot(resource: Resource)
|
|
<<delete>> delete_snapshot(snapshot: Snapshot)
|
|
}
|
|
|
|
enum eReplicationType {
|
|
hypervisor
|
|
cinder
|
|
}
|
|
|
|
}
|
|
|
|
@enduml
|