cterasdk.core.templates module#

class cterasdk.core.templates.TemplateAutoAssignPolicy(portal)#

Bases: BaseCommand

apply_changes(wait=False)#

Apply provisioning changes.

Parameters:

wait (bool,optional) – Wait for all changes to apply, defaults to False

get_policy()#

Get templates auto assignment policy

set_policy(rules, apply_default=None, default=None, apply_changes=True)#

Set templates auto assignment policy

Parameters:
  • rules (list[cterasdk.common.types.PolicyRule]) – List of policy rules

  • apply_default (bool,optional) – If no match found, apply default template. If not passed, the current config will be kept

  • default (str,optional) – Name of a template to assign if no match found. Ignored unless the apply_default is set to True

  • apply_changes (bool,optional) – Apply changes upon update, defaults to True

class cterasdk.core.templates.Templates(portal)#

Bases: BaseCommand

Portal Configuration Template APIs

add(name, description=None, include_sets=None, exclude_sets=None, apps=None, backup_schedule=None, versions=None, update_settings=None, scripts=None, cli_commands=None, consent_page=None)#

Add a Configuration Template

Parameters:
by_name(names, include=None)#

Get Templates by their names

Parameters:
  • names (list[str],optional) – List of names of templates

  • include (list[str],optional) – List of fields to retrieve, defaults to [‘name’]

Returns:

Iterator for all matching Templates

Return type:

cterasdk.lib.iterator.Iterator

default = ['name']#
delete(name)#

Delete a Configuration Template

Parameters:

name (str) – Name of the template

get(name, include=None)#

Get a Configuration Template

Parameters:
  • name (str) – Name of the template

  • include (list[str]) – List of fields to retrieve, defaults to ['name']

list_templates(include=None, filters=None)#

List Configuration Templates.

To retrieve templates, you must first browse the tenant, using: GlobalAdmin.portals.browse()

Parameters:
  • include (list[str],optional) – List of fields to retrieve, defaults to ['name']

  • filters (list[],optional) – List of additional filters, defaults to None

remove_default(name, wait=False)#

Set a Configuration Template not to be the default template

Parameters:
  • name (str) – Name of the template

  • wait (bool,optional) – Wait for all changes to apply, defaults to False

set_default(name, wait=False)#

Set a Configuration Template as the default template

Parameters:
  • name (str) – Name of the template

  • wait (bool,optional) – Wait for all changes to apply, defaults to False