Skip to content

Commit

Permalink
updating documentation for the release (#62)
Browse files Browse the repository at this point in the history
* updating documentation for the release

Signed-off-by: Swapnil Wagh <waghswapnil@gmail.com>

* modifying the name for modular platform

Signed-off-by: Swapnil Wagh <waghswapnil@gmail.com>

* fix README.rst

Signed-off-by: Swapnil Wagh <waghswapnil@gmail.com>
  • Loading branch information
waghswapnil authored and vvb committed Nov 25, 2016
1 parent 395cba5 commit 6c380c4
Show file tree
Hide file tree
Showing 18 changed files with 262 additions and 109 deletions.
5 changes: 5 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Report bugs at https://github.com/ciscoucs/imcsdk/issues.

If you are reporting a bug, please include:

* Console logs and stack trace, if any.
* Your operating system name and version.
* Any details about your local setup that might be helpful in troubleshooting.
* Detailed steps to reproduce the bug.
Expand All @@ -36,6 +37,10 @@ maintainers decide they can't be merged.
Please squash your commits to one commit per fix or feature. The resulting
commit should have a single meaningful message.

Additions/Modifications done to the apis layer should conform to the following:-
- add/create/set/modify functions should return the corresponding Managed Object
- as much as possible every api should ideally be accompanied with it's testcase

Testing your code
~~~~~~~~~~~~~~~~~
Some test cases are written to be run against live hardware. You will need a
Expand Down
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
History
=======

0.9.1.0 (2016-11-25)
--------------------
* Support for C3260 platform
* Supports every Managed Object exposed by IMC upto version 2.0(13e)
* Support to invoke APIs on individual server modules in case of C3260 platform
* Support for TLSv1.1/v1.2 and fallback to TLSv1 for older versions
* Support to filter out non-applicable properties based on the C-series platform
* Validation of Managed Object version with the C-series version for better error-handling

0.9.0.3 (2016-08-25)
--------------------
* Added APIs layer to the sdk
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include AUTHORS.rst
include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.md
include README.rst

recursive-include tests *
recursive-include imcsdk/apis *
Expand Down
31 changes: 0 additions & 31 deletions README.md

This file was deleted.

56 changes: 56 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
|image0| |Code Health| |Code Climate|

Python SDK for Cisco IMC
========================

- Apache License, Version 2.0 (the "License")

Documentation
-------------

https://ciscoucs.github.io/imcsdk\_docs/

Installation
------------

The SDK can be installed using any of ways below

From pip:
~~~~~~~~~

Installs the last released version

::

pip install imcsdk


From github:
~~~~~~~~~~~~

Installs the latest top of the tree development version

::

# Install pip (skip if pip is already available):
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py

git clone https://github.com/ciscoucs/imcsdk.git
cd imcsdk
make install


Community:
----------

- We are on Slack - slack requires registration, but the ucspython team
is open invitation to anyone to register
`here <https://ucspython.herokuapp.com>`__

.. |image0| image:: https://ucspython.herokuapp.com/badge.svg
:target: https://ucspython.herokuapp.com
.. |Code Health| image:: https://landscape.io/github/CiscoUcs/imcsdk/master/landscape.svg?style=flat
:target: https://landscape.io/github/CiscoUcs/imcsdk/master
.. |Code Climate| image:: https://codeclimate.com/github/CiscoUcs/imcsdk/badges/gpa.svg
:target: https://codeclimate.com/github/CiscoUcs/imcsdk
128 changes: 121 additions & 7 deletions docs/imcsdk_ug.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ Table of Contents

1. `Backup Imc <#backup-imc>`__
2. `Import Imc <#import-imc>`__
3. `Technical Support <#technical-support>`__
4. `Firmware Installation <#firmware-installation>`__


Overview
--------

Cisco IMC Python SDK is a python module which helps automate all aspects
of Cisco IMC management servers i.e. both C-Series and E-Series.
With the introduction of the modular C-3260 platforms, the latest version
of Cisco IMC Python SDK supports both the classic C-Series (for e.g. C220, C240, C22 etc)
and the modular C-Series (C3260).

Bulk of the Cisco IMC Python SDK work on the IMC Manager’s Management
Information Tree (MIT), performing create, modify or delete actions on
Expand All @@ -62,12 +67,23 @@ The figure below illustrates a sample (partial) MIT for Rack Unit.

::

On a Classic C-series Server
----------------------------
Tree (topRoot) Distinguished Name
|-sys sys
|-ComputeRackUnit sys/rack-unit-1
|-AdaptorUnit sys/rack-unit-1/adaptor-1
|-AdaptorCfgBackup sys/rack-unit-1/adaptor-1/export-config

On a Modular C-series Server
----------------------------
Tree (topRoot) Distinguished Name
|-sys sys
|-EquipmentChassis sys/chassis-1
|-ComputeServerNode sys/chassis-1/server-1
|-AdaptorUnit sys/chassis-1/server-1/adaptor-1
|-AdaptorHostEthIf sys/chassis-1/server-1/adaptor-1/host-eth-eth0


Managed Objects
~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -240,6 +256,10 @@ Refer `ImcHandle API
Reference <https://ciscoucs.github.io/imcsdk_docs/imcsdk.html#module-imcsdk.imchandle>`__
for detailed parameter sets to ``ImcHandle``

The handle maintains a reference to the type of platform (classic or modular) that it is managing.
This can be accessed using the ``handle.platform`` property.


Base APIs
~~~~~~~~~

Expand Down Expand Up @@ -347,13 +367,14 @@ Retrieving Meta Information
---------------------------

``get_meta_info`` is useful for getting information about a Managed
object.
object. Since this information can vary based on the type of platform i.e. classic or modular,
this api will also take ``platform`` as an optional parameter.

::

from imcsdk.imccoreutils import get_meta_info
from imcsdk.imccoreutils import get_meta_info, IMC_PLATFORM

class_meta = get_meta_info("faultInst")
class_meta = get_meta_info("faultInst", platform=IMC_PLATFORM.TYPE_CLASSIC)
print class_meta

The below sample output starts with a tree view of where faultInst
Expand Down Expand Up @@ -452,11 +473,21 @@ Backup Imc

backup_file = “/home/user/backup/config_backup.xml”

For classic platforms :-
------------------------
backup_imc(handle,
remote_file=backup_file,
protocol="ftp", username="user", password="pass",
remote_host="10.10.10.10", passphrase="xxxxxx")

For modular platforms :-
------------------------
backup_imc(handle,
remote_host=remote_host, remote_file='/path/to/filename.xml',
protocol='scp', username="user", password="pass",
passphrase='abc', entity = 'CMC')


`Backup Imc API
Reference <https://ciscoucs.github.io/imcsdk_docs/imcsdk.utils.html?highlight=backup_imc#imcsdk.utils.imcbackup.backup_imc>`__

Expand All @@ -471,9 +502,92 @@ Import Imc

import_file = “/home/user/backup/config_backup.xml”

import_imc_backup(h,remote_file=import_file,
protocol="ftp",username="user",password="pass",
remote_host="10.10.10.10",passphrase="xxxxxx")
For classic platforms :-
------------------------
import_imc_backup(handle, remote_file=import_file,
protocol="ftp", username="user", password="pass",
remote_host="10.10.10.10", passphrase="xxxxxx")

For modular platforms :-
------------------------
import_imc_backup(handle, remote_host=remote_host,
remote_file='/path/to/filename.xml', protocol='scp',
username=username, password=password,
passphrase='abc', entity = 'CMC')


`Import Imc API
Reference <https://ciscoucs.github.io/imcsdk_docs/imcsdk.utils.html?highlight=import_imc_backup#imcsdk.utils.imcbackup.import_imc_backup>`__
Reference <https://ciscoucs.github.io/imcsdk_docs/imcsdk.utils.html?highlight=import_imc_backup#imcsdk.utils.imcbackup.import_imc_backup>`__


Technical Support
~~~~~~~~~~~~~~~~~

``get_imc_tech_support`` is used to import an existing backup to a Imc server

::

from imcsdk.utils.imctechsupport import get_imc_tech_support

For classic platforms :-
------------------------
get_imc_tech_support(handle=handle,
remote_host=remote_host,
remote_file='/path/to/filename.tar.gz',
protocol='scp',
username=username,
password=password)
For modular platforms :-
------------------------
get_imc_tech_support(handle=handle,
remote_host=remote_host,
remote_file='/path/to/filename.tar.gz',
protocol='scp',
username=username,
password=password,
component='all')

`Tech-support Imc API
Reference <https://ciscoucs.github.io/imcsdk_docs/imcsdk.utils.html?highlight=get_imc_tech_support#imcsdk.utils.imctechsupport.get_imc_tech_support>`__


Firmware Installation
~~~~~~~~~~~~~~~~~~~~~

``update_imc_firmware_huu`` is used to import an existing backup to a Imc server

::

from imcsdk.utils.imcfirmwareinstall import update_imc_firmware_huu

For classic platforms :-
------------------------
update_imc_firmware_huu(handle=handle,
remote_ip=remote_ip,
remote_share='/path/image_name.iso',
share_type='nfs',
username=username,
password=password,
update_component='all',
stop_on_error='yes',
verify_update='no',
cimc_secure_boot='no')

For modular platforms :-
------------------------
update_imc_firmware_huu(handle=handle,
remote_ip=remote_ip,
remote_share='/path/image_name.iso',
share_type='nfs',
username=username,
password=password,
update_component='all',
stop_on_error='yes',
verify_update='no',
cimc_secure_boot='no',
server_id=1)
`Firmware Installation Imc API
Reference <https://ciscoucs.github.io/imcsdk_docs/imcsdk.utils.html?highlight=update_imc_firmware_huu#imcsdk.utils.imcfirmwareinstall.update_imc_firmware_huu>`__
2 changes: 1 addition & 1 deletion imcsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ def set_log_level(level=logging.DEBUG):

__author__ = 'Cisco Systems'
__email__ = 'ucs-python@cisco.com'
__version__ = '0.9.0.3'
__version__ = '0.9.1.0'
6 changes: 3 additions & 3 deletions imcsdk/apis/admin/ipmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def enable_ipmi(handle, priv=CommIpmiLanConsts.PRIV_ADMIN,
handle (ImcHandle)
priv (string): Optional privilege level: 'admin', 'user', 'read-only'
key (string): Optional encryption key as hexadecimal string
server_id (int): Server Id to be specified for C3x60 platforms
server_id (int): Server Id to be specified for C3260 platforms
Returns:
CommIpmiLan object
Expand Down Expand Up @@ -87,7 +87,7 @@ def disable_ipmi(handle, server_id=1):
Disable IPMI over LAN.
Args:
handle (ImcHandle)
server_id (int): Server Id to be specified for C3x60 platforms
server_id (int): Server Id to be specified for C3260 platforms
Returns:
CommIpmiLan object
Expand All @@ -107,7 +107,7 @@ def is_ipmi_enabled(handle, server_id=1):
Check if IPMI over LAN is enabled
Args:
handle (ImcHandle)
server_id (int): Server Id to be specified for C3x60 platforms
server_id (int): Server Id to be specified for C3260 platforms
Returns:
True if enabled, else False
Expand Down
Loading

0 comments on commit 6c380c4

Please sign in to comment.