Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
History
=======

0.9.14 (2023-12-13)
---------------------
* Added support for ancient IMCs
* Added support for DNAC DN1 - DN3 servers
* Added support for CNR server
* Added support for Python 3.11

0.9.13 (2022-07-21)
---------------------
* Adds support for IMC version 4.2(2a)

0.9.12 (2021-10-28)
---------------------
* Bug fixes
Expand All @@ -17,7 +28,7 @@ History

0.9.9 (2020-04-22)
---------------------
* Fixes an issue with version meta
* Fixes an issue with version meta

0.9.8 (2020-04-22)
---------------------
Expand Down
7 changes: 3 additions & 4 deletions imcsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def set_log_level(level=logging.DEBUG):
None

Example:
from imcsdk import set_log_level
from imcsdk_ecoen66 import set_log_level
import logging

set_log_level(logging.INFO)
Expand All @@ -55,6 +55,5 @@ def set_log_level(level=logging.DEBUG):
if os.path.exists('/tmp/imcsdk_debug'):
enable_file_logging()

__author__ = 'Cisco Systems'
__email__ = 'ucs-python@cisco.com'
__version__ = '0.9.12'
__author__ = '@ecoen66'
__version__ = '0.9.28'
4 changes: 2 additions & 2 deletions imcsdk/apis/admin/certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def certificate_signing_request_generate(handle, name, org, locality, state,
state="California", locality="San Francisco", self_signed=True)
"""

from imcsdk.mometa.generate.GenerateCertificateSigningRequest import \
from imcsdk_ecoen66.mometa.generate.GenerateCertificateSigningRequest import \
GenerateCertificateSigningRequest

mo = GenerateCertificateSigningRequest(parent_mo_or_dn="sys/cert-mgmt")
Expand Down Expand Up @@ -415,7 +415,7 @@ def certificate_upload(handle, username, password, server, file_name, protocol):
None
"""

from imcsdk.mometa.upload.UploadCertificate import UploadCertificate, \
from imcsdk_ecoen66.mometa.upload.UploadCertificate import UploadCertificate, \
UploadCertificateConsts

mo = UploadCertificate(parent_mo_or_dn="sys/cert-mgmt")
Expand Down
12 changes: 6 additions & 6 deletions imcsdk/apis/admin/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
This module implements the APIs for IP Blocking and IP Filtering
"""
import logging
from imcsdk.mometa.ip.IpBlocking import IpBlocking
from imcsdk.mometa.ip.IpFiltering import IpFiltering, IpFilteringConsts
from imcsdk.apis.utils import _get_mo, _is_valid_arg, _is_invalid_value
from imcsdk.imccoreutils import get_server_dn, IMC_PLATFORM
from imcsdk.imcexception import ImcOperationError
from imcsdk_ecoen66.mometa.ip.IpBlocking import IpBlocking
from imcsdk_ecoen66.mometa.ip.IpFiltering import IpFiltering, IpFilteringConsts
from imcsdk_ecoen66.apis.utils import _get_mo, _is_valid_arg, _is_invalid_value
from imcsdk_ecoen66.imccoreutils import get_server_dn, IMC_PLATFORM
from imcsdk_ecoen66.imcexception import ImcOperationError

log = logging.getLogger('imc')


def _get_mgmt_if_dn(handle, id=1):
from imcsdk.mometa.mgmt.MgmtIf import MgmtIf
from imcsdk_ecoen66.mometa.mgmt.MgmtIf import MgmtIf

if handle.platform == IMC_PLATFORM.TYPE_CLASSIC:
parent_dn = get_server_dn(handle) + '/mgmt'
Expand Down
6 changes: 3 additions & 3 deletions imcsdk/apis/admin/ipmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"""
This module implements all the communication services
"""
from imcsdk.mometa.comm.CommIpmiLan import CommIpmiLan, CommIpmiLanConsts
from imcsdk.imccoreutils import get_server_dn, IMC_PLATFORM
from imcsdk_ecoen66.mometa.comm.CommIpmiLan import CommIpmiLan, CommIpmiLanConsts
from imcsdk_ecoen66.imccoreutils import get_server_dn, IMC_PLATFORM


def _get_comm_mo_dn(handle, server_id=1):
"""
Internal method to get the IPMI mo's parent_dn based \
on the type of platform
"""
from imcsdk.imcexception import ImcValidationException
from imcsdk_ecoen66.imcexception import ImcValidationException

if handle.platform == IMC_PLATFORM.TYPE_CLASSIC:
return("sys/svc-ext")
Expand Down
8 changes: 4 additions & 4 deletions imcsdk/apis/admin/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"""

import logging
from imcsdk.imcexception import ImcOperationError
from imcsdk.apis.utils import _get_mo, _is_valid_arg, _is_invalid_value
from imcsdk.mometa.aaa.AaaLdap import AaaLdap
from imcsdk.mometa.aaa.AaaLdapRoleGroup import AaaLdapRoleGroup
from imcsdk_ecoen66.imcexception import ImcOperationError
from imcsdk_ecoen66.apis.utils import _get_mo, _is_valid_arg, _is_invalid_value
from imcsdk_ecoen66.mometa.aaa.AaaLdap import AaaLdap
from imcsdk_ecoen66.mometa.aaa.AaaLdapRoleGroup import AaaLdapRoleGroup

log = logging.getLogger('imc')

Expand Down
4 changes: 2 additions & 2 deletions imcsdk/apis/admin/ntp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
This module implements all the ntp related functionality
"""

from imcsdk.imcexception import ImcOperationError
from imcsdk.apis.utils import _get_mo, _is_invalid_value, _is_valid_arg
from imcsdk_ecoen66.imcexception import ImcOperationError
from imcsdk_ecoen66.apis.utils import _get_mo, _is_invalid_value, _is_valid_arg

import logging

Expand Down
2 changes: 1 addition & 1 deletion imcsdk/apis/admin/redfish.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""

import logging
from imcsdk.mometa.comm.CommRedfish import CommRedfish, CommRedfishConsts
from imcsdk_ecoen66.mometa.comm.CommRedfish import CommRedfish, CommRedfishConsts

log = logging.getLogger('imc')

Expand Down
20 changes: 10 additions & 10 deletions imcsdk/apis/admin/snmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
This module performs the operations related to snmp server, user and traps.
"""

from imcsdk.imcexception import ImcOperationError
from imcsdk.apis.utils import _get_mo
from imcsdk_ecoen66.imcexception import ImcOperationError
from imcsdk_ecoen66.apis.utils import _get_mo

SNMP_DN = 'sys/svc-ext/snmp-svc'

Expand Down Expand Up @@ -50,7 +50,7 @@ def snmp_enable(handle, community=None,
sys_location="user location")
"""

from imcsdk.mometa.comm.CommSnmp import CommSnmpConsts
from imcsdk_ecoen66.mometa.comm.CommSnmp import CommSnmpConsts

mo = _get_mo(handle, dn=SNMP_DN)

Expand Down Expand Up @@ -87,7 +87,7 @@ def snmp_disable(handle):
snmp_disable(handle)
"""

from imcsdk.mometa.comm.CommSnmp import CommSnmpConsts
from imcsdk_ecoen66.mometa.comm.CommSnmp import CommSnmpConsts

mo = _get_mo(handle, dn=SNMP_DN)

Expand All @@ -110,7 +110,7 @@ def is_snmp_enabled(handle, **kwargs):
Example:
is_snmp_enabled(handle)
"""
from imcsdk.mometa.comm.CommSnmp import CommSnmpConsts
from imcsdk_ecoen66.mometa.comm.CommSnmp import CommSnmpConsts

mo = _get_mo(handle, dn=SNMP_DN)

Expand All @@ -123,7 +123,7 @@ def is_snmp_enabled(handle, **kwargs):

def _get_free_snmp_trap_obj(handle):

from imcsdk.mometa.comm.CommSnmpTrap import CommSnmpTrapConsts
from imcsdk_ecoen66.mometa.comm.CommSnmpTrap import CommSnmpTrapConsts
traps = handle.query_children(in_dn=SNMP_DN,
class_id="CommSnmpTrap")
for trap in traps:
Expand Down Expand Up @@ -162,7 +162,7 @@ def snmp_trap_add(handle, hostname, port, version="v3",
notification_type="informs")
"""

from imcsdk.mometa.comm.CommSnmpTrap import CommSnmpTrapConsts
from imcsdk_ecoen66.mometa.comm.CommSnmpTrap import CommSnmpTrapConsts

mo = _get_free_snmp_trap_obj(handle)

Expand Down Expand Up @@ -267,7 +267,7 @@ def snmp_trap_remove(handle, trap_id):
snmp_trap_remove(handle, trap_id=6)
"""

from imcsdk.mometa.comm.CommSnmpTrap import CommSnmpTrapConsts
from imcsdk_ecoen66.mometa.comm.CommSnmpTrap import CommSnmpTrapConsts

dn = SNMP_DN + '/snmp-trap-' + str(trap_id)
mo = _get_mo(handle, dn=dn)
Expand Down Expand Up @@ -315,7 +315,7 @@ def snmp_user_add(handle, name, security_level="authpriv",
auth="MD5", privacy_pwd="xyz", privacy="DES")
"""

from imcsdk.mometa.comm.CommSnmpUser import CommSnmpUserConsts
from imcsdk_ecoen66.mometa.comm.CommSnmpUser import CommSnmpUserConsts

mo = _get_free_snmp_user(handle)

Expand Down Expand Up @@ -439,7 +439,7 @@ def snmp_user_remove(handle, name):

"""

from imcsdk.mometa.comm.CommSnmpUser import CommSnmpUserConsts
from imcsdk_ecoen66.mometa.comm.CommSnmpUser import CommSnmpUserConsts

found_user = snmp_user_get(handle, name=name)
if found_user is None:
Expand Down
12 changes: 6 additions & 6 deletions imcsdk/apis/admin/syslog.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
This module performs the operations related to system logs
"""

from imcsdk.imcexception import ImcOperationError
from imcsdk_ecoen66.imcexception import ImcOperationError

SYSLOG_DN = 'sys/svc-ext/syslog'

Expand Down Expand Up @@ -152,7 +152,7 @@ def syslog_remote_enable(handle, hostname, name="primary", port="514",
mo = syslog_remote_enable(handle, hostname="10.10.10.10",
name="primary")
"""
from imcsdk.mometa.comm.CommSyslogClient import CommSyslogClientConsts
from imcsdk_ecoen66.mometa.comm.CommSyslogClient import CommSyslogClientConsts

mo = syslog_remote_get(handle, name, caller="syslog_remote_enable")

Expand Down Expand Up @@ -184,7 +184,7 @@ def syslog_remote_disable(handle, name):
Example:
syslog_remote_disable(handle, name)
"""
from imcsdk.mometa.comm.CommSyslogClient import CommSyslogClientConsts
from imcsdk_ecoen66.mometa.comm.CommSyslogClient import CommSyslogClientConsts

mo = syslog_remote_get(handle, name)
mo.admin_state = CommSyslogClientConsts.ADMIN_STATE_DISABLED
Expand All @@ -207,7 +207,7 @@ def is_syslog_remote_enabled(handle, name, **kwargs):
Example:
is_syslog_remote_enabled(handle, name)
"""
from imcsdk.mometa.comm.CommSyslogClient import CommSyslogClientConsts
from imcsdk_ecoen66.mometa.comm.CommSyslogClient import CommSyslogClientConsts

try:
mo = syslog_remote_get(handle, name)
Expand Down Expand Up @@ -236,7 +236,7 @@ def is_syslog_remote_clear(handle, name):
Example:
issyslog_remote_clear(handle, name)
"""
from imcsdk.mometa.comm.CommSyslogClient import CommSyslogClientConsts
from imcsdk_ecoen66.mometa.comm.CommSyslogClient import CommSyslogClientConsts

try:
mo = syslog_remote_get(handle, name)
Expand Down Expand Up @@ -269,7 +269,7 @@ def syslog_remote_clear(handle, name):
Example:
syslog_remote_clear(handle, name)
"""
from imcsdk.mometa.comm.CommSyslogClient import CommSyslogClientConsts
from imcsdk_ecoen66.mometa.comm.CommSyslogClient import CommSyslogClientConsts

mo = syslog_remote_get(handle, name)
mo.admin_action = CommSyslogClientConsts.ADMIN_ACTION_CLEAR
Expand Down
12 changes: 6 additions & 6 deletions imcsdk/apis/admin/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""

import logging
from imcsdk.imcexception import ImcOperationError
from imcsdk_ecoen66.imcexception import ImcOperationError

log = logging.getLogger('imc')

Expand Down Expand Up @@ -83,7 +83,7 @@ def password_expiration_set(handle,
AaaUserPasswordExpiration object
"""

from imcsdk.mometa.aaa.AaaUserPasswordExpiration import \
from imcsdk_ecoen66.mometa.aaa.AaaUserPasswordExpiration import \
AaaUserPasswordExpiration

mo = AaaUserPasswordExpiration(parent_mo_or_dn="sys/user-ext")
Expand All @@ -110,7 +110,7 @@ def password_expiration_exists(handle, **kwargs):
(True, AaaUserPasswordExpiration) is policy exists, else (False, None)

"""
from imcsdk.mometa.aaa.AaaUserPasswordExpiration import \
from imcsdk_ecoen66.mometa.aaa.AaaUserPasswordExpiration import \
AaaUserPasswordExpiration

mo = AaaUserPasswordExpiration(parent_mo_or_dn="sys/user-ext")
Expand Down Expand Up @@ -164,7 +164,7 @@ def _get_local_user(handle, name):


def _get_free_user_id(handle):
from imcsdk.mometa.aaa.AaaUser import AaaUserConsts
from imcsdk_ecoen66.mometa.aaa.AaaUser import AaaUserConsts
users = _get_local_users(handle)
for user in users:
if user.account_status == AaaUserConsts.ACCOUNT_STATUS_INACTIVE and \
Expand Down Expand Up @@ -192,7 +192,7 @@ def local_user_create(handle, name, pwd, priv="read-only"):
Exception when limit on the number of users has exceeded
"""

from imcsdk.mometa.aaa.AaaUser import AaaUser, AaaUserConsts
from imcsdk_ecoen66.mometa.aaa.AaaUser import AaaUser, AaaUserConsts

# (1) local_user_exists(handle, name, pwd, priv) would be used by Ansible.
# (2) local_user_exists(handle, name) would be used by user scripts.
Expand Down Expand Up @@ -278,7 +278,7 @@ def local_user_delete(handle, name):
ImcOperationError if the user is not found
"""

from imcsdk.mometa.aaa.AaaUser import AaaUserConsts
from imcsdk_ecoen66.mometa.aaa.AaaUser import AaaUserConsts

found_user = _get_local_user(handle, name=name)
if found_user is None:
Expand Down
16 changes: 8 additions & 8 deletions imcsdk/apis/server/adaptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
and create vnics and vhbas
"""

from imcsdk.imccoreutils import get_server_dn
from imcsdk.apis.utils import _get_mo
from imcsdk_ecoen66.imccoreutils import get_server_dn
from imcsdk_ecoen66.apis.utils import _get_mo


def _get_adaptor_dn(handle, adaptor_slot, server_id=1):
Expand Down Expand Up @@ -104,7 +104,7 @@ def adaptor_properties_set(handle, adaptor_slot, lldp=None, fip_mode=None,
AdaptorGenProfile object
"""

from imcsdk.mometa.adaptor.AdaptorGenProfile import AdaptorGenProfile
from imcsdk_ecoen66.mometa.adaptor.AdaptorGenProfile import AdaptorGenProfile
adaptor = adaptor_unit_get(handle, adaptor_slot, server_id, **kwargs)
mo = AdaptorGenProfile(parent_mo_or_dn=adaptor.dn)
# VMFEX feature support is discontinued since 3.0(1c) release
Expand Down Expand Up @@ -135,7 +135,7 @@ def adaptor_reset(handle, adaptor_slot, server_id=1, **kwargs):
AdaptorUnit object

"""
from imcsdk.mometa.adaptor.AdaptorUnit import AdaptorUnitConsts
from imcsdk_ecoen66.mometa.adaptor.AdaptorUnit import AdaptorUnitConsts
mo = adaptor_unit_get(handle, adaptor_slot, server_id, **kwargs)
mo.admin_state = AdaptorUnitConsts.ADMIN_STATE_ADAPTOR_RESET
handle.set_mo(mo)
Expand All @@ -156,7 +156,7 @@ def vnic_get(handle, adaptor_slot, name, server_id=1, **kwargs):
AdaptorHostEthIf object
"""

from imcsdk.mometa.adaptor.AdaptorHostEthIf import AdaptorHostEthIf
from imcsdk_ecoen66.mometa.adaptor.AdaptorHostEthIf import AdaptorHostEthIf

mo = adaptor_unit_get(handle, adaptor_slot, server_id, **kwargs)
vnic_mo = AdaptorHostEthIf(parent_mo_or_dn=mo.dn, name=name)
Expand Down Expand Up @@ -206,7 +206,7 @@ def vnic_create(handle,
AdaptorHostEthIf object
"""

from imcsdk.mometa.adaptor.AdaptorHostEthIf import AdaptorHostEthIf
from imcsdk_ecoen66.mometa.adaptor.AdaptorHostEthIf import AdaptorHostEthIf

mo = adaptor_unit_get(handle, adaptor_slot, server_id, **kwargs)
vnic = AdaptorHostEthIf(parent_mo_or_dn=mo.dn, name=name)
Expand Down Expand Up @@ -260,7 +260,7 @@ def vhba_get(handle, adaptor_slot, name, server_id=1, **kwargs):
AdaptorHostEthIf object
"""

from imcsdk.mometa.adaptor.AdaptorHostFcIf import AdaptorHostFcIf
from imcsdk_ecoen66.mometa.adaptor.AdaptorHostFcIf import AdaptorHostFcIf

mo = adaptor_unit_get(handle, adaptor_slot, server_id, **kwargs)
vhba_mo = AdaptorHostFcIf(parent_mo_or_dn=mo.dn, name=name)
Expand Down Expand Up @@ -299,7 +299,7 @@ def vhba_create(handle, adaptor_slot, name, channel_number, wwnn, wwpn,
san_boot=True, uplink_port=0, server_id=2)
"""

from imcsdk.mometa.adaptor.AdaptorHostFcIf import AdaptorHostFcIf
from imcsdk_ecoen66.mometa.adaptor.AdaptorHostFcIf import AdaptorHostFcIf

mo = adaptor_unit_get(handle, adaptor_slot, server_id, **kwargs)
vhba_mo = AdaptorHostFcIf(parent_mo_or_dn=mo.dn, name=name)
Expand Down
Loading