orchestrator-core icon indicating copy to clipboard operation
orchestrator-core copied to clipboard

[Feature]: Efficient way to retrieve other subscription data in computed_fields

Open Mark90 opened this issue 9 months ago • 0 comments

Contact Details

No response

What should we build?

At SURF we have a couple of product blocks definitions with a @computed_field property that retrieves another subscription to access a couple of attributes. (see pseudo code below)

This works but has a significant impact on performance for subscriptions with many product blocks.

It's not yet clear what we should build, perhaps a derivative of @computed_field which can be instrumented to retrieve specific fixed_inputs/resource_types of other subscriptions (which must be able to cross more than 1 subscription boundary)

Relevant pseudo code

class PeerBlockProvisioning(PeerBlockInactive, lifecycle=[SubscriptionLifecycle.PROVISIONING])
    port: IpPeerPortBlock

    @computed_field
    @property
    def title(self) -> str:
        sap = self.port.sap
        subscription = SubscriptionModel.from_subscription(sap.owner_subscription_id)
        return f"IP Peering on {subscription.description} vlan {sap.vlanrange}"

Mark90 avatar Mar 28 '25 14:03 Mark90