Package: viptela
Cisco Viptela vManage Python SDK/CLI/AnsibleThis repo contains a Python SDK for Cisco Viptela vManage as well as a CLI and Ansible modules that leverage the SDK.
Stable releases are found in pypi.  Themasterbranch is under active development and may not offer a stable interface.SDKCLIAnsible ModulesRequirementsPython 3.6+InstallationCreating Python virtual environmentpython3-mvenvenv
.env/bin/activateInstallation from PyPIpipinstallviptelaInstallation from githubpipinstallgit+https://github.com/CiscoDevNet/python-viptela.git@specific_branchInstallation from within repogitclonehttps://github.com/CiscoDevNet/python-viptela.gitcdpython-viptela
pipinstall-e.Environment VariablesIP/DNS, port and credentials for the vManage server can be set for the SDK via environment variableVMANAGE_HOSTVMANAGE_PORTVMANAGE_USERNAMEVMANAGE_PASSWORDvManage Command Line InterfaceUsage:vmanage[OPTIONS]COMMAND[ARGS]...

Options:--hostTEXTvManageHost(env:VMANAGE_HOST)[required]--portINTEGERvManagePort(env:VMANAGE_PORT,default=443)--usernameTEXTvManageUsername(env:VMANAGE_USERNAME)[required]--passwordTEXTvManagePassword(env:VMANAGE_PASSWORD)[required]--helpShowthismessageandexit.

Commands:activateActivatecommandscertificateCertficatecommandscleanCleanvManagedeactivateDeactivatecommandsexportExportcommandsimportImportcommandssetvManageSettingssetcommandsshowShowcommandsvManage host and credentials can be also specified via command line options.  The
command line options override the environment variables. If no password is specified,
the user will be prompted for one.Importing and exporting of templates and policyData file formatAll template information is exported to a single file with to lists:feature_templatesanddevice_templates.  Each list contains dictionaries as pulled from the vManage API with a few
additions and modifications.  First, a list of attached devices and a list of input variables
is added to the device template.  Then instance IDs are translated into name so that the templates
can be imported into another vManage.All policy template information is exported to a single file with four lists:policy_lists,policy_definitions,central_policies,local_policies.  Each list contains dictionaries as
pulled from the vManage API with the instance IDs converted to names so that policies can be
imported into another vManage.Import Options--check: Just check. No changes. (default=False)--update: Update if exists (default=False)--diff: Show diffs (default=False)The CLI/SDK will import templates and policy idempotently and as non-destructivly as possible.
It will only add templates and policies that are not there.  When a template or policy does exist
but is different than what is in the import file, it will not he updates unless the--updateoption is given.Export TemplatesExport all templates to a filevmanageexporttemplates--filevmanage-templates.jsonExport templates from a specific vManangevmanage--host=192.133.178.54exporttemplates--filevmanage-templates.jsonExport specific device templatesvmanageexporttemplates--type=device--filevmanage-templates.json--name=isr4331--name=ISR1111-8PExport just feature templatesvmanageexporttemplates--type=feature--filevmanage-templates.jsonImport TemplatesImport all templatesvmanageimporttemplates--filevmanage-templates.jsonImport feature templatesvmanageimporttemplates--type=feature--filevmanage-templates.jsonImport specific device templatesvmanageimporttemplates--type=device--filevmanage-templates.json--name=isr4331--name=ISR1111-8PExport Policiesvmanageexportpolicies--filevmanage-policies.jsonImport Policiesvmanageimportpolicies--filevmanage-policies.jsonDiff two templatesvmanageshowtemplateg0/0/0-R1--diffg0/0/0-R2[('change','templateDefinition.tunnel-interface.color.value.vipType',('ignore','constant')),('change','templateDefinition.tunnel-interface.color.value.vipValue',('default','custom2')),('add','templateDefinition.tunnel-interface.color.restrict',[('vipVariableName','vpn_if_tunnel_color_restrict')]),('change','templateId',('2a0481f4-a5b2-44bf-baad-59de4d3b4e99','1dc123db-7a14-40f5-9653-1c87ccd5eaa2')),('change','createdOn',(1569072320921,1569072320260)),('change','@rid',(843,839)),('change','templateDescription',('G0/0/0 Interface for R1 router with TLOC extension, adds NAT','G0/0/0 Interface for R2 router with TLOC extension, adds NAT, changes ''color to custom2')),('change','lastUpdatedOn',(1569072320921,1569072320260))]LicenseGNU General Public License v3.0