-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (28 loc) · 838 Bytes
/
main.py
File metadata and controls
39 lines (28 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
import sys
sys.path.append(
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
)
import pydantic_eda.apps.siteinfo.v1alpha1.models as siteinfo
from common.client import EDAClient
from common.logging import setup_logging
setup_logging()
NS = "eda"
def main():
eda = EDAClient(base_url="https://devbox.netdevops.me:9444")
my_banner = siteinfo.Banner(
apiVersion="siteinfo.eda.nokia.com/v1alpha1",
kind="Banner",
metadata=siteinfo.BannerMetadata(
namespace=NS,
name="my-banner",
),
spec=siteinfo.BannerSpec(
loginBanner="Pydantic EDA says Hi",
nodes=["leaf1"],
),
)
eda.add_to_transaction_create(my_banner)
_ = eda.commit_transaction()
if __name__ == "__main__":
main()