Skip to content

Instantly share code, notes, and snippets.

@joseivanlopez
Last active August 21, 2024 06:29
Show Gist options
  • Save joseivanlopez/f15976c6217b4334cd9b37df949feab2 to your computer and use it in GitHub Desktop.
Save joseivanlopez/f15976c6217b4334cd9b37df949feab2 to your computer and use it in GitHub Desktop.

Changes in storage APIs

D-Bus API

org.opensuse.Agama.Storage1
  #ProductDefinition  - JSON {transactional, volumes, encryptionMethods}
  #Probe              - probes the system (*without calculating a proposal?)
  #SetConfig          - set JSON config ({storage}, {legacyAutoyastStorage})
  #GetConfig          - get JSON config
  #Install
  #Finish
  #ProbeDone (signal)
  #SetConfigDone (signal)

org.opensuse.Agama.Storage1.Proposal
  #UsableDevices (as)
  #Calculate(settings: s) - receives JSON guided settings
  #GetSettings            - JSON guided settings

org.opensuse.Agama.Storage1.Devices
  System (s)  - JSON list of system devices
  Target (s)  - JSON list of target devices
  Actions (s) - JSON list of actions
  Dirty (b)   - whether the system has changed
  • org.opensuse.Agama.Storage1.Proposal#GetSettings:

    • Reports settings only if the storage config can be converted to guided settings.
    • Propably it would be better to separate settings and computed values: {settings, computedSizes, defaultBootDevice}.
  • To check the result of a proposal:

    • Success if Devices#Actions is not empty.
    • UI gets settings from Proposal#GetSettings.
    • UI reacts to Storage1#SetConfigDone.
    • UI is able to show the proposal page only if Proposal#GetSettings reports something.

HTTP API

POST  storage/probe                   --> org.opensuse.Agama.Storage1#Probe
GET   storage/config                  --> org.opensuse.Agama.Storage1#GetConfig
POST  storage/config                  --> org.opensuse.Agama.Storage1#SetConfig
GET   storage/product                 --> org.opensuse.Agama.Storage1#ProductDefinition
GET   storage/proposal/usable_devices --> org.opensuse.Agama.Storage1.Proposal#UsableDevices
POST  storage/proposal/calculate      --> org.opensuse.Agama.Storage1.Proposal#Calculate
GET   storage/proposal/settings       --> org.opensuse.Agama.Storage1.Proposal#GetSettings
GET   storage/devices/system          --> org.opensuse.Agama.Storage1.Devices#System
GET   storage/devices/target          --> org.opensuse.Agama.Storage1.Devices#Target
GET   storage/devices/actions         --> org.opensuse.Agama.Storage1.Devices#Actions
GET   storage/devices/dirty           --> org.opensuse.Agama.Storage1.Devices#Dirty

Required settings conversions

              Service                       HTTP
Product
config  --> ProposalSettings        --> storage/proposal/result
               (guided)             <-- storage/proposal/calculate
                  |
            Storage::Settings       <-- storage/set_config
              (extended)            --> storage/get_config
                  |
               Proposal
  • From ProposalSettings to Storage::Settings.
  • From Storage::Settings to ProposalSetting, if possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment