brn: Introduce BRN as a class
This commit is contained in:
parent
8c411e39bc
commit
a0da4d4641
8 changed files with 116 additions and 9 deletions
|
@ -1,5 +1,4 @@
|
|||
from flask import current_app
|
||||
|
||||
from app.brm.brn import BRN
|
||||
from app.extensions import db
|
||||
from app.models import AbstractConfiguration, AbstractResource
|
||||
|
||||
|
@ -21,5 +20,11 @@ class Eotk(AbstractResource):
|
|||
group = db.relationship("Group", back_populates="eotks")
|
||||
|
||||
@property
|
||||
def brn(self) -> str:
|
||||
return f"brn:{current_app.config['GLOBAL_NAMESPACE']}:{self.group_id}:eotk:{self.provider}:instance/{self.region}"
|
||||
def brn(self) -> BRN:
|
||||
return BRN(
|
||||
group_id=self.group_id,
|
||||
provider=self.provider,
|
||||
product="eotk",
|
||||
resource_type="instance",
|
||||
resource_id=self.region
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue