Skip to content

Commit

Permalink
Initial Release
Browse files Browse the repository at this point in the history
  • Loading branch information
ncsamiam committed Aug 4, 2021
1 parent 423a9ce commit 9ff9dae
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 85,178 deletions.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
Inital main code for cucm_service_do.py
Goal is to use AXL SOAP API to allow admins to manupulate the state of a service
on multiple CUCM systems with a single CLI command.
In a large cluster this removes the need to open the servicability web page and
manually step through the process on each workload.
Inital main release for cucm_service_do.py

The script performs a specified action on a list of Cisco CUCM servers.

Uses AXL SOAP API with Cisco Control Center Services wsdl to perform actions.
(https://developer.cisco.com/docs/sxml/#control-center-services-api-reference).
Code assumes ControlCenterServices.wsdl is in working python folder.

Create ucmlist.txt in same folder as application to drive CUCM selection.
It contains simple list of UCM IP addresses or FQDNs. See included example.

Execute the script with no command line parameters to display help text:
Syntax:
cucm_service_do.py axl_username axl_password (in Single quotes), UCM Service Name (in Single quotes), Action (Start,Stop,Restart)

The default Action is Restart.

This release uses basic authentication. If required, uncomment appropriate lines to
enable certificate checking.


17 changes: 5 additions & 12 deletions cucm_service_do.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import sys
import time

# Escape codes for terminal text colors
class bcolors:
RESET = '\033[39m'
HEADER = '\033[95m'
Expand All @@ -55,9 +56,9 @@ class bcolors:

AXL_USERNAME = str(sys.argv[1])
#Comment Out for Production
AXL_PASSWORD = "C!sc0123"
#AXL_PASSWORD = "C!sc0123"
#Un-Comment for Production
#AXL_PASSWORD = str(sys.argv[2]
AXL_PASSWORD = str(sys.argv[2])

# Get Service Name
SVC_NAME = str(sys.argv[3])
Expand All @@ -77,23 +78,16 @@ class bcolors:
else:
sys.exit("Invalid Action. Choices are Start, Stop, or Restart (default)")





# Edit .env file to specify your Webex site/user details
from dotenv import load_dotenv
load_dotenv()

# Set DEBUG=True in .env to enable output of request/response headers and XML
DEBUG = os.getenv( 'DEBUG' ) == 'True'


# The WSDL is a local file in the working directory, see README
WSDL_FILE = './schema/ControlCenterServices.wsdl'

# This class lets you view the incoming and outgoing HTTP headers and XML

# This class lets you view the incoming and outgoing HTTP headers and XML
class MyLoggingPlugin( Plugin ):

Expand Down Expand Up @@ -150,9 +144,8 @@ def ingress( self, envelope, http_headers, operation ):
start_time=time.time()

print('\nBeginning '+SVC_ACTION+' '+time.strftime("%H:%M:%S"))
# Open file of UCM server addresses
# Could use ENV filespec = os.getenv("UCM_FILE")
# Hard coding for now.
# Open file containing list of UCM server addresses

filespec = './ucmlist.txt'
with open(filespec, 'r') as ucmlist:
# Execute requested action for each UCM server listed in the file
Expand Down
Binary file modified schema/.DS_Store
Binary file not shown.
Loading

0 comments on commit 9ff9dae

Please sign in to comment.