"""
create_ucs_sp_template.py

Purpose:
    UCS Manager Create a UCS Service Profile Template
Author:
    John McDonough (jomcdono@cisco.com) github: (@movinalot)
    Cisco Systems, Inc.
"""

from ucsmsdk.ucshandle import UcsHandle
from ucsmsdk.mometa.ls.LsServer import LsServer
from ucsmsdk.mometa.org.OrgOrg import OrgOrg

HANDLE = UcsHandle(
    "sandbox-ucsm1.cisco.com",
    "admin",
    "password"
)

HANDLE.login()

ORG_ORG = OrgOrg(
    parent_mo_or_dn='org-root',
    name="devnet",
)
HANDLE.add_mo(ORG_ORG, modify_present=True)
HANDLE.commit()

SP_TEMPLATE = LsServer(
    parent_mo_or_dn='org-root/org-devnet',
    name="devcore_template",
    type="updating-template"
)

HANDLE.add_mo(SP_TEMPLATE, modify_present=True)
HANDLE.commit()

HANDLE.logout()

[((15, 9, 19, 1), 'ucsmsdk.ucshandle.UcsHandle', 'UcsHandle', ({(16, 4, 16, 29): '"""sandbox-ucsm1.cisco.com"""', (17, 4, 17, 11): '"""admin"""', (18, 4, 18, 14): '"""password"""'}, {}), "('sandbox-ucsm1.cisco.com', 'admin', 'password')", False, 'from ucsmsdk.ucshandle import UcsHandle\n'), ((23, 10, 26, 1), 'ucsmsdk.mometa.org.OrgOrg.OrgOrg', 'OrgOrg', (), '', False, 'from ucsmsdk.mometa.org.OrgOrg import OrgOrg\n'), ((30, 14, 34, 1), 'ucsmsdk.mometa.ls.LsServer.LsServer', 'LsServer', (), '', False, 'from ucsmsdk.mometa.ls.LsServer import LsServer\n')]