blindsidenetworks / scalelite

Scalable load balancer for BigBlueButton.
GNU Affero General Public License v3.0
465 stars 249 forks source link

Migrate a list of recordings to a tenant #963

Open lunika opened 1 year ago

lunika commented 1 year ago

Problem to solve:

There is an existing rake command allowing to migrate all existing recording to a tenant. But there is no rake command to migrate a specific list of recording to a tenant. This command can be useful to migrate an existing scalelite instance from version before tenancy was available but used by multiple API client. Moreover, in some scenarios 2 tenancies can be merged in one and we would like to migrate recording from one to another one.

Purposed solution:

Modify the existing rake command with a list of recording options like this :

$ ./bin/rake recordings:addToTenant[tenant-id] --recording=xxxx --recording=xxx

Considered alternatives:

There is a tenancy API, maybe a new endpoint can be added managing this issue ?

farhatahmad commented 1 year ago

It's difficult to extend the rake task to accept an infinitely long list of recordings. You could do it manually using these commands:

docker exec -t scalelite-api bin/rails c
recordings = ['123123123','123123123', ...]
tenant_id = Tenant.find_by_name("TENANT_NAME").id

Recording.where(record_id: recordings).each do |rec| Metadatum.create!(recording_id: rec, key: 'tenant-id', value: tenant_id) end
lunika commented 1 year ago

Is it easier if only one recording id is provided ? In that case, an API endpoint could be easier to use for developer like us. WDYT ?

farhatahmad commented 1 year ago

Potentially yes, we would just need to find the time to implement the API call