repo stringclasses 85
values | path stringlengths 8 121 | func_name stringlengths 1 82 | original_string stringlengths 112 65.5k | language stringclasses 1
value | code stringlengths 112 65.5k | code_tokens listlengths 20 4.09k | docstring stringlengths 3 46.3k | docstring_tokens listlengths 1 564 | sha stringclasses 85
values | url stringlengths 93 218 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
saltstack/salt | salt/renderers/pass.py | _fetch_secret | def _fetch_secret(pass_path):
'''
Fetch secret from pass based on pass_path. If there is
any error, return back the original pass_path value
'''
cmd = "pass show {0}".format(pass_path.strip())
log.debug('Fetching secret: %s', cmd)
proc = Popen(cmd.split(' '), stdout=PIPE, stderr=PIPE)
p... | python | def _fetch_secret(pass_path):
'''
Fetch secret from pass based on pass_path. If there is
any error, return back the original pass_path value
'''
cmd = "pass show {0}".format(pass_path.strip())
log.debug('Fetching secret: %s', cmd)
proc = Popen(cmd.split(' '), stdout=PIPE, stderr=PIPE)
p... | [
"def",
"_fetch_secret",
"(",
"pass_path",
")",
":",
"cmd",
"=",
"\"pass show {0}\"",
".",
"format",
"(",
"pass_path",
".",
"strip",
"(",
")",
")",
"log",
".",
"debug",
"(",
"'Fetching secret: %s'",
",",
"cmd",
")",
"proc",
"=",
"Popen",
"(",
"cmd",
".",
... | Fetch secret from pass based on pass_path. If there is
any error, return back the original pass_path value | [
"Fetch",
"secret",
"from",
"pass",
"based",
"on",
"pass_path",
".",
"If",
"there",
"is",
"any",
"error",
"return",
"back",
"the",
"original",
"pass_path",
"value"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/pass.py#L79-L95 | train |
saltstack/salt | salt/renderers/pass.py | _decrypt_object | def _decrypt_object(obj):
'''
Recursively try to find a pass path (string) that can be handed off to pass
'''
if isinstance(obj, six.string_types):
return _fetch_secret(obj)
elif isinstance(obj, dict):
for pass_key, pass_path in six.iteritems(obj):
obj[pass_key] = _decryp... | python | def _decrypt_object(obj):
'''
Recursively try to find a pass path (string) that can be handed off to pass
'''
if isinstance(obj, six.string_types):
return _fetch_secret(obj)
elif isinstance(obj, dict):
for pass_key, pass_path in six.iteritems(obj):
obj[pass_key] = _decryp... | [
"def",
"_decrypt_object",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"six",
".",
"string_types",
")",
":",
"return",
"_fetch_secret",
"(",
"obj",
")",
"elif",
"isinstance",
"(",
"obj",
",",
"dict",
")",
":",
"for",
"pass_key",
",",
"pas... | Recursively try to find a pass path (string) that can be handed off to pass | [
"Recursively",
"try",
"to",
"find",
"a",
"pass",
"path",
"(",
"string",
")",
"that",
"can",
"be",
"handed",
"off",
"to",
"pass"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/pass.py#L98-L110 | train |
saltstack/salt | salt/renderers/pass.py | render | def render(pass_info, saltenv='base', sls='', argline='', **kwargs):
'''
Fetch secret from pass based on pass_path
'''
try:
_get_pass_exec()
except SaltRenderError:
raise
# Make sure environment variable HOME is set, since Pass looks for the
# password-store under ~/.passwor... | python | def render(pass_info, saltenv='base', sls='', argline='', **kwargs):
'''
Fetch secret from pass based on pass_path
'''
try:
_get_pass_exec()
except SaltRenderError:
raise
# Make sure environment variable HOME is set, since Pass looks for the
# password-store under ~/.passwor... | [
"def",
"render",
"(",
"pass_info",
",",
"saltenv",
"=",
"'base'",
",",
"sls",
"=",
"''",
",",
"argline",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"_get_pass_exec",
"(",
")",
"except",
"SaltRenderError",
":",
"raise",
"# Make sure environ... | Fetch secret from pass based on pass_path | [
"Fetch",
"secret",
"from",
"pass",
"based",
"on",
"pass_path"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/pass.py#L113-L125 | train |
saltstack/salt | salt/runners/pkg.py | list_upgrades | def list_upgrades(jid,
style='group',
outputter='nested',
ext_source=None):
'''
Show list of available pkg upgrades using a specified format style
CLI Example:
.. code-block:: bash
salt-run pkg.list_upgrades jid=20141120114114417719 style=... | python | def list_upgrades(jid,
style='group',
outputter='nested',
ext_source=None):
'''
Show list of available pkg upgrades using a specified format style
CLI Example:
.. code-block:: bash
salt-run pkg.list_upgrades jid=20141120114114417719 style=... | [
"def",
"list_upgrades",
"(",
"jid",
",",
"style",
"=",
"'group'",
",",
"outputter",
"=",
"'nested'",
",",
"ext_source",
"=",
"None",
")",
":",
"mminion",
"=",
"salt",
".",
"minion",
".",
"MasterMinion",
"(",
"__opts__",
")",
"returner",
"=",
"_get_returner... | Show list of available pkg upgrades using a specified format style
CLI Example:
.. code-block:: bash
salt-run pkg.list_upgrades jid=20141120114114417719 style=group | [
"Show",
"list",
"of",
"available",
"pkg",
"upgrades",
"using",
"a",
"specified",
"format",
"style"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/pkg.py#L28-L66 | train |
saltstack/salt | salt/modules/firewalld.py | __firewall_cmd | def __firewall_cmd(cmd):
'''
Return the firewall-cmd location
'''
firewall_cmd = '{0} {1}'.format(salt.utils.path.which('firewall-cmd'), cmd)
out = __salt__['cmd.run_all'](firewall_cmd)
if out['retcode'] != 0:
if not out['stderr']:
msg = out['stdout']
else:
... | python | def __firewall_cmd(cmd):
'''
Return the firewall-cmd location
'''
firewall_cmd = '{0} {1}'.format(salt.utils.path.which('firewall-cmd'), cmd)
out = __salt__['cmd.run_all'](firewall_cmd)
if out['retcode'] != 0:
if not out['stderr']:
msg = out['stdout']
else:
... | [
"def",
"__firewall_cmd",
"(",
"cmd",
")",
":",
"firewall_cmd",
"=",
"'{0} {1}'",
".",
"format",
"(",
"salt",
".",
"utils",
".",
"path",
".",
"which",
"(",
"'firewall-cmd'",
")",
",",
"cmd",
")",
"out",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"... | Return the firewall-cmd location | [
"Return",
"the",
"firewall",
"-",
"cmd",
"location"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L30-L45 | train |
saltstack/salt | salt/modules/firewalld.py | __mgmt | def __mgmt(name, _type, action):
'''
Perform zone management
'''
# It's permanent because the 4 concerned functions need the permanent option, it's wrong without
cmd = '--{0}-{1}={2} --permanent'.format(action, _type, name)
return __firewall_cmd(cmd) | python | def __mgmt(name, _type, action):
'''
Perform zone management
'''
# It's permanent because the 4 concerned functions need the permanent option, it's wrong without
cmd = '--{0}-{1}={2} --permanent'.format(action, _type, name)
return __firewall_cmd(cmd) | [
"def",
"__mgmt",
"(",
"name",
",",
"_type",
",",
"action",
")",
":",
"# It's permanent because the 4 concerned functions need the permanent option, it's wrong without",
"cmd",
"=",
"'--{0}-{1}={2} --permanent'",
".",
"format",
"(",
"action",
",",
"_type",
",",
"name",
")"... | Perform zone management | [
"Perform",
"zone",
"management"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L48-L55 | train |
saltstack/salt | salt/modules/firewalld.py | list_zones | def list_zones(permanent=True):
'''
List everything added for or enabled in all zones
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_zones
'''
zones = {}
cmd = '--list-all-zones'
if permanent:
cmd += ' --permanent'
for i in __firewall_cmd(cmd).splitli... | python | def list_zones(permanent=True):
'''
List everything added for or enabled in all zones
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_zones
'''
zones = {}
cmd = '--list-all-zones'
if permanent:
cmd += ' --permanent'
for i in __firewall_cmd(cmd).splitli... | [
"def",
"list_zones",
"(",
"permanent",
"=",
"True",
")",
":",
"zones",
"=",
"{",
"}",
"cmd",
"=",
"'--list-all-zones'",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"for",
"i",
"in",
"__firewall_cmd",
"(",
"cmd",
")",
".",
"splitlines",
"(",
")... | List everything added for or enabled in all zones
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_zones | [
"List",
"everything",
"added",
"for",
"or",
"enabled",
"in",
"all",
"zones"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L100-L129 | train |
saltstack/salt | salt/modules/firewalld.py | new_zone | def new_zone(zone, restart=True):
'''
Add a new zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.new_zone my_zone
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
salt '*' firewalld... | python | def new_zone(zone, restart=True):
'''
Add a new zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.new_zone my_zone
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
salt '*' firewalld... | [
"def",
"new_zone",
"(",
"zone",
",",
"restart",
"=",
"True",
")",
":",
"out",
"=",
"__mgmt",
"(",
"zone",
",",
"'zone'",
",",
"'new'",
")",
"if",
"restart",
":",
"if",
"out",
"==",
"'success'",
":",
"return",
"__firewall_cmd",
"(",
"'--reload'",
")",
... | Add a new zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.new_zone my_zone
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
salt '*' firewalld.new_zone my_zone False | [
"Add",
"a",
"new",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L186-L210 | train |
saltstack/salt | salt/modules/firewalld.py | delete_zone | def delete_zone(zone, restart=True):
'''
Delete an existing zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.delete_zone my_zone
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
sal... | python | def delete_zone(zone, restart=True):
'''
Delete an existing zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.delete_zone my_zone
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
sal... | [
"def",
"delete_zone",
"(",
"zone",
",",
"restart",
"=",
"True",
")",
":",
"out",
"=",
"__mgmt",
"(",
"zone",
",",
"'zone'",
",",
"'delete'",
")",
"if",
"restart",
":",
"if",
"out",
"==",
"'success'",
":",
"return",
"__firewall_cmd",
"(",
"'--reload'",
... | Delete an existing zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.delete_zone my_zone
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
salt '*' firewalld.delete_zone my_zone False | [
"Delete",
"an",
"existing",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L213-L237 | train |
saltstack/salt | salt/modules/firewalld.py | new_service | def new_service(name, restart=True):
'''
Add a new service
CLI Example:
.. code-block:: bash
salt '*' firewalld.new_service my_service
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
salt '... | python | def new_service(name, restart=True):
'''
Add a new service
CLI Example:
.. code-block:: bash
salt '*' firewalld.new_service my_service
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
salt '... | [
"def",
"new_service",
"(",
"name",
",",
"restart",
"=",
"True",
")",
":",
"out",
"=",
"__mgmt",
"(",
"name",
",",
"'service'",
",",
"'new'",
")",
"if",
"restart",
":",
"if",
"out",
"==",
"'success'",
":",
"return",
"__firewall_cmd",
"(",
"'--reload'",
... | Add a new service
CLI Example:
.. code-block:: bash
salt '*' firewalld.new_service my_service
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
salt '*' firewalld.new_service my_service False | [
"Add",
"a",
"new",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L253-L277 | train |
saltstack/salt | salt/modules/firewalld.py | delete_service | def delete_service(name, restart=True):
'''
Delete an existing service
CLI Example:
.. code-block:: bash
salt '*' firewalld.delete_service my_service
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
... | python | def delete_service(name, restart=True):
'''
Delete an existing service
CLI Example:
.. code-block:: bash
salt '*' firewalld.delete_service my_service
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
... | [
"def",
"delete_service",
"(",
"name",
",",
"restart",
"=",
"True",
")",
":",
"out",
"=",
"__mgmt",
"(",
"name",
",",
"'service'",
",",
"'delete'",
")",
"if",
"restart",
":",
"if",
"out",
"==",
"'success'",
":",
"return",
"__firewall_cmd",
"(",
"'--reload... | Delete an existing service
CLI Example:
.. code-block:: bash
salt '*' firewalld.delete_service my_service
By default firewalld will be reloaded. However, to avoid reloading
you need to specify the restart as False
.. code-block:: bash
salt '*' firewalld.delete_service my_servic... | [
"Delete",
"an",
"existing",
"service"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L280-L304 | train |
saltstack/salt | salt/modules/firewalld.py | list_all | def list_all(zone=None, permanent=True):
'''
List everything added for or enabled in a zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_all
List a specific zone
.. code-block:: bash
salt '*' firewalld.list_all my_zone
'''
_zone = {}
id_ = ''
i... | python | def list_all(zone=None, permanent=True):
'''
List everything added for or enabled in a zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_all
List a specific zone
.. code-block:: bash
salt '*' firewalld.list_all my_zone
'''
_zone = {}
id_ = ''
i... | [
"def",
"list_all",
"(",
"zone",
"=",
"None",
",",
"permanent",
"=",
"True",
")",
":",
"_zone",
"=",
"{",
"}",
"id_",
"=",
"''",
"if",
"zone",
":",
"cmd",
"=",
"'--zone={0} --list-all'",
".",
"format",
"(",
"zone",
")",
"else",
":",
"cmd",
"=",
"'--... | List everything added for or enabled in a zone
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_all
List a specific zone
.. code-block:: bash
salt '*' firewalld.list_all my_zone | [
"List",
"everything",
"added",
"for",
"or",
"enabled",
"in",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L307-L351 | train |
saltstack/salt | salt/modules/firewalld.py | list_services | def list_services(zone=None, permanent=True):
'''
List services added for zone as a space separated list.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_services
List a specific zone
.. code-block:: bash
salt '*'... | python | def list_services(zone=None, permanent=True):
'''
List services added for zone as a space separated list.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_services
List a specific zone
.. code-block:: bash
salt '*'... | [
"def",
"list_services",
"(",
"zone",
"=",
"None",
",",
"permanent",
"=",
"True",
")",
":",
"if",
"zone",
":",
"cmd",
"=",
"'--zone={0} --list-services'",
".",
"format",
"(",
"zone",
")",
"else",
":",
"cmd",
"=",
"'--list-services'",
"if",
"permanent",
":",... | List services added for zone as a space separated list.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_services
List a specific zone
.. code-block:: bash
salt '*' firewalld.list_services my_zone | [
"List",
"services",
"added",
"for",
"zone",
"as",
"a",
"space",
"separated",
"list",
".",
"If",
"zone",
"is",
"omitted",
"default",
"zone",
"will",
"be",
"used",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L354-L379 | train |
saltstack/salt | salt/modules/firewalld.py | add_service | def add_service(service, zone=None, permanent=True):
'''
Add a service for zone. If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_service ssh
To assign a service to a specific zone:
.. code-block:: bash
salt '*' firewal... | python | def add_service(service, zone=None, permanent=True):
'''
Add a service for zone. If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_service ssh
To assign a service to a specific zone:
.. code-block:: bash
salt '*' firewal... | [
"def",
"add_service",
"(",
"service",
",",
"zone",
"=",
"None",
",",
"permanent",
"=",
"True",
")",
":",
"if",
"zone",
":",
"cmd",
"=",
"'--zone={0} --add-service={1}'",
".",
"format",
"(",
"zone",
",",
"service",
")",
"else",
":",
"cmd",
"=",
"'--add-se... | Add a service for zone. If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_service ssh
To assign a service to a specific zone:
.. code-block:: bash
salt '*' firewalld.add_service ssh my_zone | [
"Add",
"a",
"service",
"for",
"zone",
".",
"If",
"zone",
"is",
"omitted",
"default",
"zone",
"will",
"be",
"used",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L382-L406 | train |
saltstack/salt | salt/modules/firewalld.py | remove_service | def remove_service(service, zone=None, permanent=True):
'''
Remove a service from zone. This option can be specified multiple times.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_service ssh
To remove a service from a speci... | python | def remove_service(service, zone=None, permanent=True):
'''
Remove a service from zone. This option can be specified multiple times.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_service ssh
To remove a service from a speci... | [
"def",
"remove_service",
"(",
"service",
",",
"zone",
"=",
"None",
",",
"permanent",
"=",
"True",
")",
":",
"if",
"zone",
":",
"cmd",
"=",
"'--zone={0} --remove-service={1}'",
".",
"format",
"(",
"zone",
",",
"service",
")",
"else",
":",
"cmd",
"=",
"'--... | Remove a service from zone. This option can be specified multiple times.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_service ssh
To remove a service from a specific zone
.. code-block:: bash
salt '*' firewalld.remov... | [
"Remove",
"a",
"service",
"from",
"zone",
".",
"This",
"option",
"can",
"be",
"specified",
"multiple",
"times",
".",
"If",
"zone",
"is",
"omitted",
"default",
"zone",
"will",
"be",
"used",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L409-L434 | train |
saltstack/salt | salt/modules/firewalld.py | add_service_port | def add_service_port(service, port):
'''
Add a new port to the specified service.
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_service_port zone 80
'''
if service not in get_services(permanent=True):
raise CommandExecutionError('The... | python | def add_service_port(service, port):
'''
Add a new port to the specified service.
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_service_port zone 80
'''
if service not in get_services(permanent=True):
raise CommandExecutionError('The... | [
"def",
"add_service_port",
"(",
"service",
",",
"port",
")",
":",
"if",
"service",
"not",
"in",
"get_services",
"(",
"permanent",
"=",
"True",
")",
":",
"raise",
"CommandExecutionError",
"(",
"'The service does not exist.'",
")",
"cmd",
"=",
"'--permanent --servic... | Add a new port to the specified service.
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_service_port zone 80 | [
"Add",
"a",
"new",
"port",
"to",
"the",
"specified",
"service",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L437-L453 | train |
saltstack/salt | salt/modules/firewalld.py | get_masquerade | def get_masquerade(zone=None, permanent=True):
'''
Show if masquerading is enabled on a zone.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_masquerade zone
'''
zone_info = list_all(zone, permanent)
if 'no' in [zone_inf... | python | def get_masquerade(zone=None, permanent=True):
'''
Show if masquerading is enabled on a zone.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_masquerade zone
'''
zone_info = list_all(zone, permanent)
if 'no' in [zone_inf... | [
"def",
"get_masquerade",
"(",
"zone",
"=",
"None",
",",
"permanent",
"=",
"True",
")",
":",
"zone_info",
"=",
"list_all",
"(",
"zone",
",",
"permanent",
")",
"if",
"'no'",
"in",
"[",
"zone_info",
"[",
"i",
"]",
"[",
"'masquerade'",
"]",
"[",
"0",
"]"... | Show if masquerading is enabled on a zone.
If zone is omitted, default zone will be used.
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_masquerade zone | [
"Show",
"if",
"masquerading",
"is",
"enabled",
"on",
"a",
"zone",
".",
"If",
"zone",
"is",
"omitted",
"default",
"zone",
"will",
"be",
"used",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L541-L557 | train |
saltstack/salt | salt/modules/firewalld.py | add_masquerade | def add_masquerade(zone=None, permanent=True):
'''
Enable masquerade on a zone.
If zone is omitted, default zone will be used.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_masquerade
To enable masquerade on a specific zone
.. code-bloc... | python | def add_masquerade(zone=None, permanent=True):
'''
Enable masquerade on a zone.
If zone is omitted, default zone will be used.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_masquerade
To enable masquerade on a specific zone
.. code-bloc... | [
"def",
"add_masquerade",
"(",
"zone",
"=",
"None",
",",
"permanent",
"=",
"True",
")",
":",
"if",
"zone",
":",
"cmd",
"=",
"'--zone={0} --add-masquerade'",
".",
"format",
"(",
"zone",
")",
"else",
":",
"cmd",
"=",
"'--add-masquerade'",
"if",
"permanent",
"... | Enable masquerade on a zone.
If zone is omitted, default zone will be used.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_masquerade
To enable masquerade on a specific zone
.. code-block:: bash
salt '*' firewalld.add_masquerade dmz | [
"Enable",
"masquerade",
"on",
"a",
"zone",
".",
"If",
"zone",
"is",
"omitted",
"default",
"zone",
"will",
"be",
"used",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L560-L587 | train |
saltstack/salt | salt/modules/firewalld.py | remove_masquerade | def remove_masquerade(zone=None, permanent=True):
'''
Remove masquerade on a zone.
If zone is omitted, default zone will be used.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_masquerade
To remove masquerade on a specific zone
.. cod... | python | def remove_masquerade(zone=None, permanent=True):
'''
Remove masquerade on a zone.
If zone is omitted, default zone will be used.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_masquerade
To remove masquerade on a specific zone
.. cod... | [
"def",
"remove_masquerade",
"(",
"zone",
"=",
"None",
",",
"permanent",
"=",
"True",
")",
":",
"if",
"zone",
":",
"cmd",
"=",
"'--zone={0} --remove-masquerade'",
".",
"format",
"(",
"zone",
")",
"else",
":",
"cmd",
"=",
"'--remove-masquerade'",
"if",
"perman... | Remove masquerade on a zone.
If zone is omitted, default zone will be used.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_masquerade
To remove masquerade on a specific zone
.. code-block:: bash
salt '*' firewalld.remove_masquerade d... | [
"Remove",
"masquerade",
"on",
"a",
"zone",
".",
"If",
"zone",
"is",
"omitted",
"default",
"zone",
"will",
"be",
"used",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L590-L617 | train |
saltstack/salt | salt/modules/firewalld.py | add_port | def add_port(zone, port, permanent=True):
'''
Allow specific ports in a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_port internal 443/tcp
'''
cmd = '--zone={0} --add-port={1}'.format(zone, port)
if permanent:
cmd += ' --p... | python | def add_port(zone, port, permanent=True):
'''
Allow specific ports in a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_port internal 443/tcp
'''
cmd = '--zone={0} --add-port={1}'.format(zone, port)
if permanent:
cmd += ' --p... | [
"def",
"add_port",
"(",
"zone",
",",
"port",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"'--zone={0} --add-port={1}'",
".",
"format",
"(",
"zone",
",",
"port",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
"__firewall_cmd",
... | Allow specific ports in a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_port internal 443/tcp | [
"Allow",
"specific",
"ports",
"in",
"a",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L620-L637 | train |
saltstack/salt | salt/modules/firewalld.py | remove_port | def remove_port(zone, port, permanent=True):
'''
Remove a specific port from a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_port internal 443/tcp
'''
cmd = '--zone={0} --remove-port={1}'.format(zone, port)
if permanent:
... | python | def remove_port(zone, port, permanent=True):
'''
Remove a specific port from a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_port internal 443/tcp
'''
cmd = '--zone={0} --remove-port={1}'.format(zone, port)
if permanent:
... | [
"def",
"remove_port",
"(",
"zone",
",",
"port",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"'--zone={0} --remove-port={1}'",
".",
"format",
"(",
"zone",
",",
"port",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
"__firewall_... | Remove a specific port from a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_port internal 443/tcp | [
"Remove",
"a",
"specific",
"port",
"from",
"a",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L640-L657 | train |
saltstack/salt | salt/modules/firewalld.py | list_ports | def list_ports(zone, permanent=True):
'''
List all ports in a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_ports
'''
cmd = '--zone={0} --list-ports'.format(zone)
if permanent:
cmd += ' --permanent'
return __firewall_... | python | def list_ports(zone, permanent=True):
'''
List all ports in a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_ports
'''
cmd = '--zone={0} --list-ports'.format(zone)
if permanent:
cmd += ' --permanent'
return __firewall_... | [
"def",
"list_ports",
"(",
"zone",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"'--zone={0} --list-ports'",
".",
"format",
"(",
"zone",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
"__firewall_cmd",
"(",
"cmd",
")",
".",
"s... | List all ports in a zone.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_ports | [
"List",
"all",
"ports",
"in",
"a",
"zone",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L660-L677 | train |
saltstack/salt | salt/modules/firewalld.py | add_port_fwd | def add_port_fwd(zone, src, dest, proto='tcp', dstaddr='', permanent=True):
'''
Add port forwarding.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_port_fwd public 80 443 tcp
'''
cmd = '--zone={0} --add-forward-port=port={1}:proto={2}:toport={... | python | def add_port_fwd(zone, src, dest, proto='tcp', dstaddr='', permanent=True):
'''
Add port forwarding.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_port_fwd public 80 443 tcp
'''
cmd = '--zone={0} --add-forward-port=port={1}:proto={2}:toport={... | [
"def",
"add_port_fwd",
"(",
"zone",
",",
"src",
",",
"dest",
",",
"proto",
"=",
"'tcp'",
",",
"dstaddr",
"=",
"''",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"'--zone={0} --add-forward-port=port={1}:proto={2}:toport={3}:toaddr={4}'",
".",
"format",
"(... | Add port forwarding.
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_port_fwd public 80 443 tcp | [
"Add",
"port",
"forwarding",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L680-L703 | train |
saltstack/salt | salt/modules/firewalld.py | list_port_fwd | def list_port_fwd(zone, permanent=True):
'''
List port forwarding
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_port_fwd public
'''
ret = []
cmd = '--zone={0} --list-forward-ports'.format(zone)
if permanent:
cmd += ' --perm... | python | def list_port_fwd(zone, permanent=True):
'''
List port forwarding
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_port_fwd public
'''
ret = []
cmd = '--zone={0} --list-forward-ports'.format(zone)
if permanent:
cmd += ' --perm... | [
"def",
"list_port_fwd",
"(",
"zone",
",",
"permanent",
"=",
"True",
")",
":",
"ret",
"=",
"[",
"]",
"cmd",
"=",
"'--zone={0} --list-forward-ports'",
".",
"format",
"(",
"zone",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"for",
"i",
"in",
... | List port forwarding
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.list_port_fwd public | [
"List",
"port",
"forwarding"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L732-L761 | train |
saltstack/salt | salt/modules/firewalld.py | block_icmp | def block_icmp(zone, icmp, permanent=True):
'''
Block a specific ICMP type on a zone
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.block_icmp zone echo-reply
'''
if icmp not in get_icmp_types(permanent):
log.error('Invalid ICMP type')
... | python | def block_icmp(zone, icmp, permanent=True):
'''
Block a specific ICMP type on a zone
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.block_icmp zone echo-reply
'''
if icmp not in get_icmp_types(permanent):
log.error('Invalid ICMP type')
... | [
"def",
"block_icmp",
"(",
"zone",
",",
"icmp",
",",
"permanent",
"=",
"True",
")",
":",
"if",
"icmp",
"not",
"in",
"get_icmp_types",
"(",
"permanent",
")",
":",
"log",
".",
"error",
"(",
"'Invalid ICMP type'",
")",
"return",
"False",
"if",
"icmp",
"in",
... | Block a specific ICMP type on a zone
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.block_icmp zone echo-reply | [
"Block",
"a",
"specific",
"ICMP",
"type",
"on",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L764-L789 | train |
saltstack/salt | salt/modules/firewalld.py | list_icmp_block | def list_icmp_block(zone, permanent=True):
'''
List ICMP blocks on a zone
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewlld.list_icmp_block zone
'''
cmd = '--zone={0} --list-icmp-blocks'.format(zone)
if permanent:
cmd += ' --permanent'
... | python | def list_icmp_block(zone, permanent=True):
'''
List ICMP blocks on a zone
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewlld.list_icmp_block zone
'''
cmd = '--zone={0} --list-icmp-blocks'.format(zone)
if permanent:
cmd += ' --permanent'
... | [
"def",
"list_icmp_block",
"(",
"zone",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"'--zone={0} --list-icmp-blocks'",
".",
"format",
"(",
"zone",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
"__firewall_cmd",
"(",
"cmd",
")",
... | List ICMP blocks on a zone
.. versionadded:: 2015.8.0
CLI Example:
.. code-block:: bash
salt '*' firewlld.list_icmp_block zone | [
"List",
"ICMP",
"blocks",
"on",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L820-L837 | train |
saltstack/salt | salt/modules/firewalld.py | get_interfaces | def get_interfaces(zone, permanent=True):
'''
List interfaces bound to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_interfaces zone
'''
cmd = '--zone={0} --list-interfaces'.format(zone)
if permanent:
cmd += ' --permanent'... | python | def get_interfaces(zone, permanent=True):
'''
List interfaces bound to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_interfaces zone
'''
cmd = '--zone={0} --list-interfaces'.format(zone)
if permanent:
cmd += ' --permanent'... | [
"def",
"get_interfaces",
"(",
"zone",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"'--zone={0} --list-interfaces'",
".",
"format",
"(",
"zone",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
"__firewall_cmd",
"(",
"cmd",
")",
... | List interfaces bound to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_interfaces zone | [
"List",
"interfaces",
"bound",
"to",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L855-L872 | train |
saltstack/salt | salt/modules/firewalld.py | add_interface | def add_interface(zone, interface, permanent=True):
'''
Bind an interface to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_interface zone eth0
'''
if interface in get_interfaces(zone, permanent):
log.info('Interface is already ... | python | def add_interface(zone, interface, permanent=True):
'''
Bind an interface to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_interface zone eth0
'''
if interface in get_interfaces(zone, permanent):
log.info('Interface is already ... | [
"def",
"add_interface",
"(",
"zone",
",",
"interface",
",",
"permanent",
"=",
"True",
")",
":",
"if",
"interface",
"in",
"get_interfaces",
"(",
"zone",
",",
"permanent",
")",
":",
"log",
".",
"info",
"(",
"'Interface is already bound to zone.'",
")",
"cmd",
... | Bind an interface to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_interface zone eth0 | [
"Bind",
"an",
"interface",
"to",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L875-L895 | train |
saltstack/salt | salt/modules/firewalld.py | get_sources | def get_sources(zone, permanent=True):
'''
List sources bound to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_sources zone
'''
cmd = '--zone={0} --list-sources'.format(zone)
if permanent:
cmd += ' --permanent'
return... | python | def get_sources(zone, permanent=True):
'''
List sources bound to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_sources zone
'''
cmd = '--zone={0} --list-sources'.format(zone)
if permanent:
cmd += ' --permanent'
return... | [
"def",
"get_sources",
"(",
"zone",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"'--zone={0} --list-sources'",
".",
"format",
"(",
"zone",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
"__firewall_cmd",
"(",
"cmd",
")",
".",
... | List sources bound to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_sources zone | [
"List",
"sources",
"bound",
"to",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L921-L938 | train |
saltstack/salt | salt/modules/firewalld.py | add_source | def add_source(zone, source, permanent=True):
'''
Bind a source to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_source zone 192.168.1.0/24
'''
if source in get_sources(zone, permanent):
log.info('Source is already bound to zon... | python | def add_source(zone, source, permanent=True):
'''
Bind a source to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_source zone 192.168.1.0/24
'''
if source in get_sources(zone, permanent):
log.info('Source is already bound to zon... | [
"def",
"add_source",
"(",
"zone",
",",
"source",
",",
"permanent",
"=",
"True",
")",
":",
"if",
"source",
"in",
"get_sources",
"(",
"zone",
",",
"permanent",
")",
":",
"log",
".",
"info",
"(",
"'Source is already bound to zone.'",
")",
"cmd",
"=",
"'--zone... | Bind a source to a zone
.. versionadded:: 2016.3.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_source zone 192.168.1.0/24 | [
"Bind",
"a",
"source",
"to",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L941-L961 | train |
saltstack/salt | salt/modules/firewalld.py | get_rich_rules | def get_rich_rules(zone, permanent=True):
'''
List rich rules bound to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_rich_rules zone
'''
cmd = '--zone={0} --list-rich-rules'.format(zone)
if permanent:
cmd += ' --permanent... | python | def get_rich_rules(zone, permanent=True):
'''
List rich rules bound to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_rich_rules zone
'''
cmd = '--zone={0} --list-rich-rules'.format(zone)
if permanent:
cmd += ' --permanent... | [
"def",
"get_rich_rules",
"(",
"zone",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"'--zone={0} --list-rich-rules'",
".",
"format",
"(",
"zone",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
"__firewall_cmd",
"(",
"cmd",
")",
... | List rich rules bound to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.get_rich_rules zone | [
"List",
"rich",
"rules",
"bound",
"to",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L987-L1004 | train |
saltstack/salt | salt/modules/firewalld.py | add_rich_rule | def add_rich_rule(zone, rule, permanent=True):
'''
Add a rich rule to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_rich_rule zone 'rule'
'''
cmd = "--zone={0} --add-rich-rule='{1}'".format(zone, rule)
if permanent:
cmd +... | python | def add_rich_rule(zone, rule, permanent=True):
'''
Add a rich rule to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_rich_rule zone 'rule'
'''
cmd = "--zone={0} --add-rich-rule='{1}'".format(zone, rule)
if permanent:
cmd +... | [
"def",
"add_rich_rule",
"(",
"zone",
",",
"rule",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"\"--zone={0} --add-rich-rule='{1}'\"",
".",
"format",
"(",
"zone",
",",
"rule",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
"__f... | Add a rich rule to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.add_rich_rule zone 'rule' | [
"Add",
"a",
"rich",
"rule",
"to",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L1007-L1024 | train |
saltstack/salt | salt/modules/firewalld.py | remove_rich_rule | def remove_rich_rule(zone, rule, permanent=True):
'''
Add a rich rule to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_rich_rule zone 'rule'
'''
cmd = "--zone={0} --remove-rich-rule='{1}'".format(zone, rule)
if permanent:
... | python | def remove_rich_rule(zone, rule, permanent=True):
'''
Add a rich rule to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_rich_rule zone 'rule'
'''
cmd = "--zone={0} --remove-rich-rule='{1}'".format(zone, rule)
if permanent:
... | [
"def",
"remove_rich_rule",
"(",
"zone",
",",
"rule",
",",
"permanent",
"=",
"True",
")",
":",
"cmd",
"=",
"\"--zone={0} --remove-rich-rule='{1}'\"",
".",
"format",
"(",
"zone",
",",
"rule",
")",
"if",
"permanent",
":",
"cmd",
"+=",
"' --permanent'",
"return",
... | Add a rich rule to a zone
.. versionadded:: 2016.11.0
CLI Example:
.. code-block:: bash
salt '*' firewalld.remove_rich_rule zone 'rule' | [
"Add",
"a",
"rich",
"rule",
"to",
"a",
"zone"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/firewalld.py#L1027-L1044 | train |
saltstack/salt | salt/grains/mdadm.py | mdadm | def mdadm():
'''
Return list of mdadm devices
'''
devices = set()
try:
with salt.utils.files.fopen('/proc/mdstat', 'r') as mdstat:
for line in mdstat:
line = salt.utils.stringutils.to_unicode(line)
if line.startswith('Personalities : '):
... | python | def mdadm():
'''
Return list of mdadm devices
'''
devices = set()
try:
with salt.utils.files.fopen('/proc/mdstat', 'r') as mdstat:
for line in mdstat:
line = salt.utils.stringutils.to_unicode(line)
if line.startswith('Personalities : '):
... | [
"def",
"mdadm",
"(",
")",
":",
"devices",
"=",
"set",
"(",
")",
"try",
":",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"'/proc/mdstat'",
",",
"'r'",
")",
"as",
"mdstat",
":",
"for",
"line",
"in",
"mdstat",
":",
"line",
"=",
"s... | Return list of mdadm devices | [
"Return",
"list",
"of",
"mdadm",
"devices"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/grains/mdadm.py#L16-L38 | train |
saltstack/salt | salt/modules/vsphere.py | _get_proxy_connection_details | def _get_proxy_connection_details():
'''
Returns the connection details of the following proxies: esxi
'''
proxytype = get_proxy_type()
if proxytype == 'esxi':
details = __salt__['esxi.get_details']()
elif proxytype == 'esxcluster':
details = __salt__['esxcluster.get_details']()
... | python | def _get_proxy_connection_details():
'''
Returns the connection details of the following proxies: esxi
'''
proxytype = get_proxy_type()
if proxytype == 'esxi':
details = __salt__['esxi.get_details']()
elif proxytype == 'esxcluster':
details = __salt__['esxcluster.get_details']()
... | [
"def",
"_get_proxy_connection_details",
"(",
")",
":",
"proxytype",
"=",
"get_proxy_type",
"(",
")",
"if",
"proxytype",
"==",
"'esxi'",
":",
"details",
"=",
"__salt__",
"[",
"'esxi.get_details'",
"]",
"(",
")",
"elif",
"proxytype",
"==",
"'esxcluster'",
":",
"... | Returns the connection details of the following proxies: esxi | [
"Returns",
"the",
"connection",
"details",
"of",
"the",
"following",
"proxies",
":",
"esxi"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L253-L277 | train |
saltstack/salt | salt/modules/vsphere.py | supports_proxies | def supports_proxies(*proxy_types):
'''
Decorator to specify which proxy types are supported by a function
proxy_types:
Arbitrary list of strings with the supported types of proxies
'''
def _supports_proxies(fn):
@wraps(fn)
def __supports_proxies(*args, **kwargs):
... | python | def supports_proxies(*proxy_types):
'''
Decorator to specify which proxy types are supported by a function
proxy_types:
Arbitrary list of strings with the supported types of proxies
'''
def _supports_proxies(fn):
@wraps(fn)
def __supports_proxies(*args, **kwargs):
... | [
"def",
"supports_proxies",
"(",
"*",
"proxy_types",
")",
":",
"def",
"_supports_proxies",
"(",
"fn",
")",
":",
"@",
"wraps",
"(",
"fn",
")",
"def",
"__supports_proxies",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"proxy_type",
"=",
"get_proxy_t... | Decorator to specify which proxy types are supported by a function
proxy_types:
Arbitrary list of strings with the supported types of proxies | [
"Decorator",
"to",
"specify",
"which",
"proxy",
"types",
"are",
"supported",
"by",
"a",
"function"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L280-L297 | train |
saltstack/salt | salt/modules/vsphere.py | gets_service_instance_via_proxy | def gets_service_instance_via_proxy(fn):
'''
Decorator that connects to a target system (vCenter or ESXi host) using the
proxy details and passes the connection (vim.ServiceInstance) to
the decorated function.
Supported proxies: esxi, esxcluster, esxdatacenter.
Notes:
1. The decorated ... | python | def gets_service_instance_via_proxy(fn):
'''
Decorator that connects to a target system (vCenter or ESXi host) using the
proxy details and passes the connection (vim.ServiceInstance) to
the decorated function.
Supported proxies: esxi, esxcluster, esxdatacenter.
Notes:
1. The decorated ... | [
"def",
"gets_service_instance_via_proxy",
"(",
"fn",
")",
":",
"fn_name",
"=",
"fn",
".",
"__name__",
"try",
":",
"arg_names",
",",
"args_name",
",",
"kwargs_name",
",",
"default_values",
",",
"_",
",",
"_",
",",
"_",
"=",
"inspect",
".",
"getfullargspec",
... | Decorator that connects to a target system (vCenter or ESXi host) using the
proxy details and passes the connection (vim.ServiceInstance) to
the decorated function.
Supported proxies: esxi, esxcluster, esxdatacenter.
Notes:
1. The decorated function must have a ``service_instance`` parameter
... | [
"Decorator",
"that",
"connects",
"to",
"a",
"target",
"system",
"(",
"vCenter",
"or",
"ESXi",
"host",
")",
"using",
"the",
"proxy",
"details",
"and",
"passes",
"the",
"connection",
"(",
"vim",
".",
"ServiceInstance",
")",
"to",
"the",
"decorated",
"function"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L300-L392 | train |
saltstack/salt | salt/modules/vsphere.py | esxcli_cmd | def esxcli_cmd(cmd_str, host=None, username=None, password=None, protocol=None, port=None, esxi_hosts=None, credstore=None):
'''
Run an ESXCLI command directly on the host or list of hosts.
host
The location of the host.
username
The username used to login to the host, such as ``root``... | python | def esxcli_cmd(cmd_str, host=None, username=None, password=None, protocol=None, port=None, esxi_hosts=None, credstore=None):
'''
Run an ESXCLI command directly on the host or list of hosts.
host
The location of the host.
username
The username used to login to the host, such as ``root``... | [
"def",
"esxcli_cmd",
"(",
"cmd_str",
",",
"host",
"=",
"None",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"esxi_hosts",
"=",
"None",
",",
"credstore",
"=",
"None",
")",
":"... | Run an ESXCLI command directly on the host or list of hosts.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
cmd_str
The ESXCLI command to run. Note: This should not inc... | [
"Run",
"an",
"ESXCLI",
"command",
"directly",
"on",
"the",
"host",
"or",
"list",
"of",
"hosts",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L436-L505 | train |
saltstack/salt | salt/modules/vsphere.py | get_coredump_network_config | def get_coredump_network_config(host, username, password, protocol=None, port=None, esxi_hosts=None, credstore=None):
'''
Retrieve information on ESXi or vCenter network dump collection and
format it into a dictionary.
host
The location of the host.
username
The username used to lo... | python | def get_coredump_network_config(host, username, password, protocol=None, port=None, esxi_hosts=None, credstore=None):
'''
Retrieve information on ESXi or vCenter network dump collection and
format it into a dictionary.
host
The location of the host.
username
The username used to lo... | [
"def",
"get_coredump_network_config",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"esxi_hosts",
"=",
"None",
",",
"credstore",
"=",
"None",
")",
":",
"cmd",
"=",
"'system coredump network get'",
... | Retrieve information on ESXi or vCenter network dump collection and
format it into a dictionary.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally ... | [
"Retrieve",
"information",
"on",
"ESXi",
"or",
"vCenter",
"network",
"dump",
"collection",
"and",
"format",
"it",
"into",
"a",
"dictionary",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L509-L581 | train |
saltstack/salt | salt/modules/vsphere.py | coredump_network_enable | def coredump_network_enable(host, username, password, enabled, protocol=None, port=None, esxi_hosts=None, credstore=None):
'''
Enable or disable ESXi core dump collection. Returns ``True`` if coredump is enabled
and returns ``False`` if core dump is not enabled. If there was an error, the error
will be ... | python | def coredump_network_enable(host, username, password, enabled, protocol=None, port=None, esxi_hosts=None, credstore=None):
'''
Enable or disable ESXi core dump collection. Returns ``True`` if coredump is enabled
and returns ``False`` if core dump is not enabled. If there was an error, the error
will be ... | [
"def",
"coredump_network_enable",
"(",
"host",
",",
"username",
",",
"password",
",",
"enabled",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"esxi_hosts",
"=",
"None",
",",
"credstore",
"=",
"None",
")",
":",
"if",
"enabled",
":",
"enabl... | Enable or disable ESXi core dump collection. Returns ``True`` if coredump is enabled
and returns ``False`` if core dump is not enabled. If there was an error, the error
will be the value printed in the ``Error`` key dictionary for the given host.
host
The location of the host.
username
... | [
"Enable",
"or",
"disable",
"ESXi",
"core",
"dump",
"collection",
".",
"Returns",
"True",
"if",
"coredump",
"is",
"enabled",
"and",
"returns",
"False",
"if",
"core",
"dump",
"is",
"not",
"enabled",
".",
"If",
"there",
"was",
"an",
"error",
"the",
"error",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L585-L659 | train |
saltstack/salt | salt/modules/vsphere.py | enable_firewall_ruleset | def enable_firewall_ruleset(host,
username,
password,
ruleset_enable,
ruleset_name,
protocol=None,
port=None,
esxi_hosts=Non... | python | def enable_firewall_ruleset(host,
username,
password,
ruleset_enable,
ruleset_name,
protocol=None,
port=None,
esxi_hosts=Non... | [
"def",
"enable_firewall_ruleset",
"(",
"host",
",",
"username",
",",
"password",
",",
"ruleset_enable",
",",
"ruleset_name",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"esxi_hosts",
"=",
"None",
",",
"credstore",
"=",
"None",
")",
":",
"c... | Enable or disable an ESXi firewall rule set.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
ruleset_enable
True to enable the ruleset, false to disable.
ruleset_na... | [
"Enable",
"or",
"disable",
"an",
"ESXi",
"firewall",
"rule",
"set",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L839-L915 | train |
saltstack/salt | salt/modules/vsphere.py | set_syslog_config | def set_syslog_config(host,
username,
password,
syslog_config,
config_value,
protocol=None,
port=None,
firewall=True,
reset_service=True,
... | python | def set_syslog_config(host,
username,
password,
syslog_config,
config_value,
protocol=None,
port=None,
firewall=True,
reset_service=True,
... | [
"def",
"set_syslog_config",
"(",
"host",
",",
"username",
",",
"password",
",",
"syslog_config",
",",
"config_value",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"firewall",
"=",
"True",
",",
"reset_service",
"=",
"True",
",",
"esxi_hosts",
... | Set the specified syslog configuration parameter. By default, this function will
reset the syslog service after the configuration is set.
host
ESXi or vCenter host to connect to.
username
User to connect as, usually root.
password
Password to connect with.
syslog_config
... | [
"Set",
"the",
"specified",
"syslog",
"configuration",
"parameter",
".",
"By",
"default",
"this",
"function",
"will",
"reset",
"the",
"syslog",
"service",
"after",
"the",
"configuration",
"is",
"set",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L984-L1118 | train |
saltstack/salt | salt/modules/vsphere.py | get_syslog_config | def get_syslog_config(host, username, password, protocol=None, port=None, esxi_hosts=None, credstore=None):
'''
Retrieve the syslog configuration.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used t... | python | def get_syslog_config(host, username, password, protocol=None, port=None, esxi_hosts=None, credstore=None):
'''
Retrieve the syslog configuration.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used t... | [
"def",
"get_syslog_config",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"esxi_hosts",
"=",
"None",
",",
"credstore",
"=",
"None",
")",
":",
"cmd",
"=",
"'system syslog config get'",
"ret",
"="... | Retrieve the syslog configuration.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the host is not using the default
... | [
"Retrieve",
"the",
"syslog",
"configuration",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1122-L1185 | train |
saltstack/salt | salt/modules/vsphere.py | reset_syslog_config | def reset_syslog_config(host,
username,
password,
protocol=None,
port=None,
syslog_config=None,
esxi_hosts=None,
credstore=None):
'''
Reset the ... | python | def reset_syslog_config(host,
username,
password,
protocol=None,
port=None,
syslog_config=None,
esxi_hosts=None,
credstore=None):
'''
Reset the ... | [
"def",
"reset_syslog_config",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"syslog_config",
"=",
"None",
",",
"esxi_hosts",
"=",
"None",
",",
"credstore",
"=",
"None",
")",
":",
"if",
"not",
... | Reset the syslog service to its default settings.
Valid syslog_config values are ``logdir``, ``loghost``, ``logdir-unique``,
``default-rotate``, ``default-size``, ``default-timeout``,
or ``all`` for all of these.
host
The location of the host.
username
The username used to login t... | [
"Reset",
"the",
"syslog",
"service",
"to",
"its",
"default",
"settings",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1189-L1283 | train |
saltstack/salt | salt/modules/vsphere.py | upload_ssh_key | def upload_ssh_key(host, username, password, ssh_key=None, ssh_key_file=None,
protocol=None, port=None, certificate_verify=False):
'''
Upload an ssh key for root to an ESXi host via http PUT.
This function only works for ESXi, not vCenter.
Only one ssh key can be uploaded for root. U... | python | def upload_ssh_key(host, username, password, ssh_key=None, ssh_key_file=None,
protocol=None, port=None, certificate_verify=False):
'''
Upload an ssh key for root to an ESXi host via http PUT.
This function only works for ESXi, not vCenter.
Only one ssh key can be uploaded for root. U... | [
"def",
"upload_ssh_key",
"(",
"host",
",",
"username",
",",
"password",
",",
"ssh_key",
"=",
"None",
",",
"ssh_key_file",
"=",
"None",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"certificate_verify",
"=",
"False",
")",
":",
"if",
"proto... | Upload an ssh key for root to an ESXi host via http PUT.
This function only works for ESXi, not vCenter.
Only one ssh key can be uploaded for root. Uploading a second key will
replace any existing key.
:param host: The location of the ESXi Host
:param username: Username to connect as
:param pa... | [
"Upload",
"an",
"ssh",
"key",
"for",
"root",
"to",
"an",
"ESXi",
"host",
"via",
"http",
"PUT",
".",
"This",
"function",
"only",
"works",
"for",
"ESXi",
"not",
"vCenter",
".",
"Only",
"one",
"ssh",
"key",
"can",
"be",
"uploaded",
"for",
"root",
".",
"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1287-L1355 | train |
saltstack/salt | salt/modules/vsphere.py | get_ssh_key | def get_ssh_key(host,
username,
password,
protocol=None,
port=None,
certificate_verify=False):
'''
Retrieve the authorized_keys entry for root.
This function only works for ESXi, not vCenter.
:param host: The location of th... | python | def get_ssh_key(host,
username,
password,
protocol=None,
port=None,
certificate_verify=False):
'''
Retrieve the authorized_keys entry for root.
This function only works for ESXi, not vCenter.
:param host: The location of th... | [
"def",
"get_ssh_key",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"certificate_verify",
"=",
"False",
")",
":",
"if",
"protocol",
"is",
"None",
":",
"protocol",
"=",
"'https'",
"if",
"port",... | Retrieve the authorized_keys entry for root.
This function only works for ESXi, not vCenter.
:param host: The location of the ESXi Host
:param username: Username to connect as
:param password: Password for the ESXi web endpoint
:param protocol: defaults to https, can be http if ssl is disabled on E... | [
"Retrieve",
"the",
"authorized_keys",
"entry",
"for",
"root",
".",
"This",
"function",
"only",
"works",
"for",
"ESXi",
"not",
"vCenter",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1359-L1412 | train |
saltstack/salt | salt/modules/vsphere.py | get_host_datetime | def get_host_datetime(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the date/time information for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
... | python | def get_host_datetime(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the date/time information for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
... | [
"def",
"get_host_datetime",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_ins... | Get the date/time information for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if th... | [
"Get",
"the",
"date",
"/",
"time",
"information",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1417-L1471 | train |
saltstack/salt | salt/modules/vsphere.py | get_ntp_config | def get_ntp_config(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the NTP configuration information for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
... | python | def get_ntp_config(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the NTP configuration information for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
... | [
"def",
"get_ntp_config",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instan... | Get the NTP configuration information for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protoc... | [
"Get",
"the",
"NTP",
"configuration",
"information",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1476-L1529 | train |
saltstack/salt | salt/modules/vsphere.py | get_service_policy | def get_service_policy(host, username, password, service_name, protocol=None, port=None, host_names=None):
'''
Get the service name's policy for a given host or list of hosts.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
passwor... | python | def get_service_policy(host, username, password, service_name, protocol=None, port=None, host_names=None):
'''
Get the service name's policy for a given host or list of hosts.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
passwor... | [
"def",
"get_service_policy",
"(",
"host",
",",
"username",
",",
"password",
",",
"service_name",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",... | Get the service name's policy for a given host or list of hosts.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
service_name
The name of the service for which to retrie... | [
"Get",
"the",
"service",
"name",
"s",
"policy",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"hosts",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1534-L1636 | train |
saltstack/salt | salt/modules/vsphere.py | get_vmotion_enabled | def get_vmotion_enabled(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the VMotion enabled status for a given host or a list of host_names. Returns ``True``
if VMotion is enabled, ``False`` if it is not enabled.
host
The location of the host.
username
... | python | def get_vmotion_enabled(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the VMotion enabled status for a given host or a list of host_names. Returns ``True``
if VMotion is enabled, ``False`` if it is not enabled.
host
The location of the host.
username
... | [
"def",
"get_vmotion_enabled",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_i... | Get the VMotion enabled status for a given host or a list of host_names. Returns ``True``
if VMotion is enabled, ``False`` if it is not enabled.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to logi... | [
"Get",
"the",
"VMotion",
"enabled",
"status",
"for",
"a",
"given",
"host",
"or",
"a",
"list",
"of",
"host_names",
".",
"Returns",
"True",
"if",
"VMotion",
"is",
"enabled",
"False",
"if",
"it",
"is",
"not",
"enabled",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1748-L1805 | train |
saltstack/salt | salt/modules/vsphere.py | get_vsan_enabled | def get_vsan_enabled(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the VSAN enabled status for a given host or a list of host_names. Returns ``True``
if VSAN is enabled, ``False`` if it is not enabled, and ``None`` if a VSAN Host Config
is unset, per host.
host
... | python | def get_vsan_enabled(host, username, password, protocol=None, port=None, host_names=None):
'''
Get the VSAN enabled status for a given host or a list of host_names. Returns ``True``
if VSAN is enabled, ``False`` if it is not enabled, and ``None`` if a VSAN Host Config
is unset, per host.
host
... | [
"def",
"get_vsan_enabled",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_inst... | Get the VSAN enabled status for a given host or a list of host_names. Returns ``True``
if VSAN is enabled, ``False`` if it is not enabled, and ``None`` if a VSAN Host Config
is unset, per host.
host
The location of the host.
username
The username used to login to the host, such as ``ro... | [
"Get",
"the",
"VSAN",
"enabled",
"status",
"for",
"a",
"given",
"host",
"or",
"a",
"list",
"of",
"host_names",
".",
"Returns",
"True",
"if",
"VSAN",
"is",
"enabled",
"False",
"if",
"it",
"is",
"not",
"enabled",
"and",
"None",
"if",
"a",
"VSAN",
"Host",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1810-L1872 | train |
saltstack/salt | salt/modules/vsphere.py | get_vsan_eligible_disks | def get_vsan_eligible_disks(host, username, password, protocol=None, port=None, host_names=None):
'''
Returns a list of VSAN-eligible disks for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
pas... | python | def get_vsan_eligible_disks(host, username, password, protocol=None, port=None, host_names=None):
'''
Returns a list of VSAN-eligible disks for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
pas... | [
"def",
"get_vsan_eligible_disks",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_servi... | Returns a list of VSAN-eligible disks for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protoc... | [
"Returns",
"a",
"list",
"of",
"VSAN",
"-",
"eligible",
"disks",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1877-L1947 | train |
saltstack/salt | salt/modules/vsphere.py | system_info | def system_info(host, username, password, protocol=None, port=None):
'''
Return system information about a VMware environment.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.... | python | def system_info(host, username, password, protocol=None, port=None):
'''
Return system information about a VMware environment.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.... | [
"def",
"system_info",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instance",
"(",
"host",
"=",
"host",
",... | Return system information about a VMware environment.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the host is not us... | [
"Return",
"system",
"information",
"about",
"a",
"VMware",
"environment",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L1973-L2009 | train |
saltstack/salt | salt/modules/vsphere.py | list_datacenters | def list_datacenters(host, username, password, protocol=None, port=None):
'''
Returns a list of datacenters for the the specified host.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to ... | python | def list_datacenters(host, username, password, protocol=None, port=None):
'''
Returns a list of datacenters for the the specified host.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to ... | [
"def",
"list_datacenters",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instance",
"(",
"host",
"=",
"host",... | Returns a list of datacenters for the the specified host.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the host is no... | [
"Returns",
"a",
"list",
"of",
"datacenters",
"for",
"the",
"the",
"specified",
"host",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L2014-L2047 | train |
saltstack/salt | salt/modules/vsphere.py | list_ssds | def list_ssds(host, username, password, protocol=None, port=None, host_names=None):
'''
Returns a list of SSDs for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password ... | python | def list_ssds(host, username, password, protocol=None, port=None, host_names=None):
'''
Returns a list of SSDs for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password ... | [
"def",
"list_ssds",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instance",
... | Returns a list of SSDs for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the hos... | [
"Returns",
"a",
"list",
"of",
"SSDs",
"for",
"the",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L2424-L2480 | train |
saltstack/salt | salt/modules/vsphere.py | set_ntp_config | def set_ntp_config(host, username, password, ntp_servers, protocol=None, port=None, host_names=None):
'''
Set NTP configuration for a given host of list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
... | python | def set_ntp_config(host, username, password, ntp_servers, protocol=None, port=None, host_names=None):
'''
Set NTP configuration for a given host of list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
... | [
"def",
"set_ntp_config",
"(",
"host",
",",
"username",
",",
"password",
",",
"ntp_servers",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".... | Set NTP configuration for a given host of list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
ntp_servers
A list of servers that should be added to and c... | [
"Set",
"NTP",
"configuration",
"for",
"a",
"given",
"host",
"of",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L2553-L2628 | train |
saltstack/salt | salt/modules/vsphere.py | service_start | def service_start(host,
username,
password,
service_name,
protocol=None,
port=None,
host_names=None):
'''
Start the named service for the given host or list of hosts.
host
The location of the... | python | def service_start(host,
username,
password,
service_name,
protocol=None,
port=None,
host_names=None):
'''
Start the named service for the given host or list of hosts.
host
The location of the... | [
"def",
"service_start",
"(",
"host",
",",
"username",
",",
"password",
",",
"service_name",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".... | Start the named service for the given host or list of hosts.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
service_name
The name of the service for which to set the po... | [
"Start",
"the",
"named",
"service",
"for",
"the",
"given",
"host",
"or",
"list",
"of",
"hosts",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L2633-L2739 | train |
saltstack/salt | salt/modules/vsphere.py | set_service_policy | def set_service_policy(host,
username,
password,
service_name,
service_policy,
protocol=None,
port=None,
host_names=None):
'''
Set the service name's p... | python | def set_service_policy(host,
username,
password,
service_name,
service_policy,
protocol=None,
port=None,
host_names=None):
'''
Set the service name's p... | [
"def",
"set_service_policy",
"(",
"host",
",",
"username",
",",
"password",
",",
"service_name",
",",
"service_policy",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
... | Set the service name's policy for a given host or list of hosts.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
service_name
The name of the service for which to set th... | [
"Set",
"the",
"service",
"name",
"s",
"policy",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"hosts",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L2966-L3090 | train |
saltstack/salt | salt/modules/vsphere.py | update_host_datetime | def update_host_datetime(host, username, password, protocol=None, port=None, host_names=None):
'''
Update the date/time on the given host or list of host_names. This function should be
used with caution since network delays and execution delays can result in time skews.
host
The location of the... | python | def update_host_datetime(host, username, password, protocol=None, port=None, host_names=None):
'''
Update the date/time on the given host or list of host_names. This function should be
used with caution since network delays and execution delays can result in time skews.
host
The location of the... | [
"def",
"update_host_datetime",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_... | Update the date/time on the given host or list of host_names. This function should be
used with caution since network delays and execution delays can result in time skews.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
... | [
"Update",
"the",
"date",
"/",
"time",
"on",
"the",
"given",
"host",
"or",
"list",
"of",
"host_names",
".",
"This",
"function",
"should",
"be",
"used",
"with",
"caution",
"since",
"network",
"delays",
"and",
"execution",
"delays",
"can",
"result",
"in",
"ti... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3095-L3157 | train |
saltstack/salt | salt/modules/vsphere.py | update_host_password | def update_host_password(host, username, password, new_password, protocol=None, port=None):
'''
Update the password for a given host.
.. note:: Currently only works with connections to ESXi hosts. Does not work with vCenter servers.
host
The location of the ESXi host.
username
The... | python | def update_host_password(host, username, password, new_password, protocol=None, port=None):
'''
Update the password for a given host.
.. note:: Currently only works with connections to ESXi hosts. Does not work with vCenter servers.
host
The location of the ESXi host.
username
The... | [
"def",
"update_host_password",
"(",
"host",
",",
"username",
",",
"password",
",",
"new_password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instance",
"(... | Update the password for a given host.
.. note:: Currently only works with connections to ESXi hosts. Does not work with vCenter servers.
host
The location of the ESXi host.
username
The username used to login to the ESXi host, such as ``root``.
password
The password used to l... | [
"Update",
"the",
"password",
"for",
"a",
"given",
"host",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3162-L3220 | train |
saltstack/salt | salt/modules/vsphere.py | vmotion_disable | def vmotion_disable(host, username, password, protocol=None, port=None, host_names=None):
'''
Disable vMotion for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password use... | python | def vmotion_disable(host, username, password, protocol=None, port=None, host_names=None):
'''
Disable vMotion for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password use... | [
"def",
"vmotion_disable",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_insta... | Disable vMotion for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the host is not ... | [
"Disable",
"vMotion",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3225-L3289 | train |
saltstack/salt | salt/modules/vsphere.py | vsan_add_disks | def vsan_add_disks(host, username, password, protocol=None, port=None, host_names=None):
'''
Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
p... | python | def vsan_add_disks(host, username, password, protocol=None, port=None, host_names=None):
'''
Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
p... | [
"def",
"vsan_add_disks",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instan... | Add any VSAN-eligible disks to the VSAN System for the given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alter... | [
"Add",
"any",
"VSAN",
"-",
"eligible",
"disks",
"to",
"the",
"VSAN",
"System",
"for",
"the",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3367-L3469 | train |
saltstack/salt | salt/modules/vsphere.py | vsan_disable | def vsan_disable(host, username, password, protocol=None, port=None, host_names=None):
'''
Disable VSAN for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to l... | python | def vsan_disable(host, username, password, protocol=None, port=None, host_names=None):
'''
Disable VSAN for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to l... | [
"def",
"vsan_disable",
"(",
"host",
",",
"username",
",",
"password",
",",
"protocol",
"=",
"None",
",",
"port",
"=",
"None",
",",
"host_names",
"=",
"None",
")",
":",
"service_instance",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_service_instance... | Disable VSAN for a given host or list of host_names.
host
The location of the host.
username
The username used to login to the host, such as ``root``.
password
The password used to login to the host.
protocol
Optionally set to alternate protocol if the host is not usi... | [
"Disable",
"VSAN",
"for",
"a",
"given",
"host",
"or",
"list",
"of",
"host_names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3474-L3554 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvs_config_dict | def _get_dvs_config_dict(dvs_name, dvs_config):
'''
Returns the dict representation of the DVS config
dvs_name
The name of the DVS
dvs_config
The DVS config
'''
log.trace('Building the dict of the DVS \'%s\' config', dvs_name)
conf_dict = {'name': dvs_name,
... | python | def _get_dvs_config_dict(dvs_name, dvs_config):
'''
Returns the dict representation of the DVS config
dvs_name
The name of the DVS
dvs_config
The DVS config
'''
log.trace('Building the dict of the DVS \'%s\' config', dvs_name)
conf_dict = {'name': dvs_name,
... | [
"def",
"_get_dvs_config_dict",
"(",
"dvs_name",
",",
"dvs_config",
")",
":",
"log",
".",
"trace",
"(",
"'Building the dict of the DVS \\'%s\\' config'",
",",
"dvs_name",
")",
"conf_dict",
"=",
"{",
"'name'",
":",
"dvs_name",
",",
"'contact_email'",
":",
"dvs_config"... | Returns the dict representation of the DVS config
dvs_name
The name of the DVS
dvs_config
The DVS config | [
"Returns",
"the",
"dict",
"representation",
"of",
"the",
"DVS",
"config"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3642-L3667 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvs_link_discovery_protocol | def _get_dvs_link_discovery_protocol(dvs_name, dvs_link_disc_protocol):
'''
Returns the dict representation of the DVS link discovery protocol
dvs_name
The name of the DVS
dvs_link_disc_protocl
The DVS link discovery protocol
'''
log.trace('Building the dict of the DVS \'%s\' l... | python | def _get_dvs_link_discovery_protocol(dvs_name, dvs_link_disc_protocol):
'''
Returns the dict representation of the DVS link discovery protocol
dvs_name
The name of the DVS
dvs_link_disc_protocl
The DVS link discovery protocol
'''
log.trace('Building the dict of the DVS \'%s\' l... | [
"def",
"_get_dvs_link_discovery_protocol",
"(",
"dvs_name",
",",
"dvs_link_disc_protocol",
")",
":",
"log",
".",
"trace",
"(",
"'Building the dict of the DVS \\'%s\\' link discovery protocol'",
",",
"dvs_name",
")",
"return",
"{",
"'operation'",
":",
"dvs_link_disc_protocol",... | Returns the dict representation of the DVS link discovery protocol
dvs_name
The name of the DVS
dvs_link_disc_protocl
The DVS link discovery protocol | [
"Returns",
"the",
"dict",
"representation",
"of",
"the",
"DVS",
"link",
"discovery",
"protocol"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3670-L3682 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvs_product_info | def _get_dvs_product_info(dvs_name, dvs_product_info):
'''
Returns the dict representation of the DVS product_info
dvs_name
The name of the DVS
dvs_product_info
The DVS product info
'''
log.trace('Building the dict of the DVS \'%s\' product info', dvs_name)
return {'name': ... | python | def _get_dvs_product_info(dvs_name, dvs_product_info):
'''
Returns the dict representation of the DVS product_info
dvs_name
The name of the DVS
dvs_product_info
The DVS product info
'''
log.trace('Building the dict of the DVS \'%s\' product info', dvs_name)
return {'name': ... | [
"def",
"_get_dvs_product_info",
"(",
"dvs_name",
",",
"dvs_product_info",
")",
":",
"log",
".",
"trace",
"(",
"'Building the dict of the DVS \\'%s\\' product info'",
",",
"dvs_name",
")",
"return",
"{",
"'name'",
":",
"dvs_product_info",
".",
"name",
",",
"'vendor'",
... | Returns the dict representation of the DVS product_info
dvs_name
The name of the DVS
dvs_product_info
The DVS product info | [
"Returns",
"the",
"dict",
"representation",
"of",
"the",
"DVS",
"product_info"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3685-L3698 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvs_capability | def _get_dvs_capability(dvs_name, dvs_capability):
'''
Returns the dict representation of the DVS product_info
dvs_name
The name of the DVS
dvs_capability
The DVS capability
'''
log.trace('Building the dict of the DVS \'%s\' capability', dvs_name)
return {'operation_support... | python | def _get_dvs_capability(dvs_name, dvs_capability):
'''
Returns the dict representation of the DVS product_info
dvs_name
The name of the DVS
dvs_capability
The DVS capability
'''
log.trace('Building the dict of the DVS \'%s\' capability', dvs_name)
return {'operation_support... | [
"def",
"_get_dvs_capability",
"(",
"dvs_name",
",",
"dvs_capability",
")",
":",
"log",
".",
"trace",
"(",
"'Building the dict of the DVS \\'%s\\' capability'",
",",
"dvs_name",
")",
"return",
"{",
"'operation_supported'",
":",
"dvs_capability",
".",
"dvsOperationSupported... | Returns the dict representation of the DVS product_info
dvs_name
The name of the DVS
dvs_capability
The DVS capability | [
"Returns",
"the",
"dict",
"representation",
"of",
"the",
"DVS",
"product_info"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3701-L3715 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvs_infrastructure_traffic_resources | def _get_dvs_infrastructure_traffic_resources(dvs_name,
dvs_infra_traffic_ress):
'''
Returns a list of dict representations of the DVS infrastructure traffic
resource
dvs_name
The name of the DVS
dvs_infra_traffic_ress
The DVS infrastru... | python | def _get_dvs_infrastructure_traffic_resources(dvs_name,
dvs_infra_traffic_ress):
'''
Returns a list of dict representations of the DVS infrastructure traffic
resource
dvs_name
The name of the DVS
dvs_infra_traffic_ress
The DVS infrastru... | [
"def",
"_get_dvs_infrastructure_traffic_resources",
"(",
"dvs_name",
",",
"dvs_infra_traffic_ress",
")",
":",
"log",
".",
"trace",
"(",
"'Building the dicts of the DVS \\'%s\\' infrastructure '",
"'traffic resources'",
",",
"dvs_name",
")",
"res_dicts",
"=",
"[",
"]",
"for"... | Returns a list of dict representations of the DVS infrastructure traffic
resource
dvs_name
The name of the DVS
dvs_infra_traffic_ress
The DVS infrastructure traffic resources | [
"Returns",
"a",
"list",
"of",
"dict",
"representations",
"of",
"the",
"DVS",
"infrastructure",
"traffic",
"resource"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3718-L3741 | train |
saltstack/salt | salt/modules/vsphere.py | list_dvss | def list_dvss(datacenter=None, dvs_names=None, service_instance=None):
'''
Returns a list of distributed virtual switches (DVSs).
The list can be filtered by the datacenter or DVS names.
datacenter
The datacenter to look for DVSs in.
Default value is None.
dvs_names
List of... | python | def list_dvss(datacenter=None, dvs_names=None, service_instance=None):
'''
Returns a list of distributed virtual switches (DVSs).
The list can be filtered by the datacenter or DVS names.
datacenter
The datacenter to look for DVSs in.
Default value is None.
dvs_names
List of... | [
"def",
"list_dvss",
"(",
"datacenter",
"=",
"None",
",",
"dvs_names",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"ret_list",
"=",
"[",
"]",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
"if",
"proxy_type",
"==",
"'esxdatacenter'",
":",
"... | Returns a list of distributed virtual switches (DVSs).
The list can be filtered by the datacenter or DVS names.
datacenter
The datacenter to look for DVSs in.
Default value is None.
dvs_names
List of DVS names to look for. If None, all DVSs are returned.
Default value is No... | [
"Returns",
"a",
"list",
"of",
"distributed",
"virtual",
"switches",
"(",
"DVSs",
")",
".",
"The",
"list",
"can",
"be",
"filtered",
"by",
"the",
"datacenter",
"or",
"DVS",
"names",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3747-L3807 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvs_config | def _apply_dvs_config(config_spec, config_dict):
'''
Applies the values of the config dict dictionary to a config spec
(vim.VMwareDVSConfigSpec)
'''
if config_dict.get('name'):
config_spec.name = config_dict['name']
if config_dict.get('contact_email') or config_dict.get('contact_name'):
... | python | def _apply_dvs_config(config_spec, config_dict):
'''
Applies the values of the config dict dictionary to a config spec
(vim.VMwareDVSConfigSpec)
'''
if config_dict.get('name'):
config_spec.name = config_dict['name']
if config_dict.get('contact_email') or config_dict.get('contact_name'):
... | [
"def",
"_apply_dvs_config",
"(",
"config_spec",
",",
"config_dict",
")",
":",
"if",
"config_dict",
".",
"get",
"(",
"'name'",
")",
":",
"config_spec",
".",
"name",
"=",
"config_dict",
"[",
"'name'",
"]",
"if",
"config_dict",
".",
"get",
"(",
"'contact_email'... | Applies the values of the config dict dictionary to a config spec
(vim.VMwareDVSConfigSpec) | [
"Applies",
"the",
"values",
"of",
"the",
"config",
"dict",
"dictionary",
"to",
"a",
"config",
"spec",
"(",
"vim",
".",
"VMwareDVSConfigSpec",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3810-L3839 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvs_product_info | def _apply_dvs_product_info(product_info_spec, product_info_dict):
'''
Applies the values of the product_info_dict dictionary to a product info
spec (vim.DistributedVirtualSwitchProductSpec)
'''
if product_info_dict.get('name'):
product_info_spec.name = product_info_dict['name']
if produ... | python | def _apply_dvs_product_info(product_info_spec, product_info_dict):
'''
Applies the values of the product_info_dict dictionary to a product info
spec (vim.DistributedVirtualSwitchProductSpec)
'''
if product_info_dict.get('name'):
product_info_spec.name = product_info_dict['name']
if produ... | [
"def",
"_apply_dvs_product_info",
"(",
"product_info_spec",
",",
"product_info_dict",
")",
":",
"if",
"product_info_dict",
".",
"get",
"(",
"'name'",
")",
":",
"product_info_spec",
".",
"name",
"=",
"product_info_dict",
"[",
"'name'",
"]",
"if",
"product_info_dict",... | Applies the values of the product_info_dict dictionary to a product info
spec (vim.DistributedVirtualSwitchProductSpec) | [
"Applies",
"the",
"values",
"of",
"the",
"product_info_dict",
"dictionary",
"to",
"a",
"product",
"info",
"spec",
"(",
"vim",
".",
"DistributedVirtualSwitchProductSpec",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3851-L3861 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvs_capability | def _apply_dvs_capability(capability_spec, capability_dict):
'''
Applies the values of the capability_dict dictionary to a DVS capability
object (vim.vim.DVSCapability)
'''
if 'operation_supported' in capability_dict:
capability_spec.dvsOperationSupported = \
capability_dict[... | python | def _apply_dvs_capability(capability_spec, capability_dict):
'''
Applies the values of the capability_dict dictionary to a DVS capability
object (vim.vim.DVSCapability)
'''
if 'operation_supported' in capability_dict:
capability_spec.dvsOperationSupported = \
capability_dict[... | [
"def",
"_apply_dvs_capability",
"(",
"capability_spec",
",",
"capability_dict",
")",
":",
"if",
"'operation_supported'",
"in",
"capability_dict",
":",
"capability_spec",
".",
"dvsOperationSupported",
"=",
"capability_dict",
"[",
"'operation_supported'",
"]",
"if",
"'port_... | Applies the values of the capability_dict dictionary to a DVS capability
object (vim.vim.DVSCapability) | [
"Applies",
"the",
"values",
"of",
"the",
"capability_dict",
"dictionary",
"to",
"a",
"DVS",
"capability",
"object",
"(",
"vim",
".",
"vim",
".",
"DVSCapability",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3864-L3877 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvs_infrastructure_traffic_resources | def _apply_dvs_infrastructure_traffic_resources(infra_traffic_resources,
resource_dicts):
'''
Applies the values of the resource dictionaries to infra traffic resources,
creating the infra traffic resource if required
(vim.DistributedVirtualSwitchProductSp... | python | def _apply_dvs_infrastructure_traffic_resources(infra_traffic_resources,
resource_dicts):
'''
Applies the values of the resource dictionaries to infra traffic resources,
creating the infra traffic resource if required
(vim.DistributedVirtualSwitchProductSp... | [
"def",
"_apply_dvs_infrastructure_traffic_resources",
"(",
"infra_traffic_resources",
",",
"resource_dicts",
")",
":",
"for",
"res_dict",
"in",
"resource_dicts",
":",
"filtered_traffic_resources",
"=",
"[",
"r",
"for",
"r",
"in",
"infra_traffic_resources",
"if",
"r",
".... | Applies the values of the resource dictionaries to infra traffic resources,
creating the infra traffic resource if required
(vim.DistributedVirtualSwitchProductSpec) | [
"Applies",
"the",
"values",
"of",
"the",
"resource",
"dictionaries",
"to",
"infra",
"traffic",
"resources",
"creating",
"the",
"infra",
"traffic",
"resource",
"if",
"required",
"(",
"vim",
".",
"DistributedVirtualSwitchProductSpec",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3880-L3911 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvs_network_resource_pools | def _apply_dvs_network_resource_pools(network_resource_pools, resource_dicts):
'''
Applies the values of the resource dictionaries to network resource pools,
creating the resource pools if required
(vim.DVSNetworkResourcePoolConfigSpec)
'''
for res_dict in resource_dicts:
ress = [r for r... | python | def _apply_dvs_network_resource_pools(network_resource_pools, resource_dicts):
'''
Applies the values of the resource dictionaries to network resource pools,
creating the resource pools if required
(vim.DVSNetworkResourcePoolConfigSpec)
'''
for res_dict in resource_dicts:
ress = [r for r... | [
"def",
"_apply_dvs_network_resource_pools",
"(",
"network_resource_pools",
",",
"resource_dicts",
")",
":",
"for",
"res_dict",
"in",
"resource_dicts",
":",
"ress",
"=",
"[",
"r",
"for",
"r",
"in",
"network_resource_pools",
"if",
"r",
".",
"key",
"==",
"res_dict",
... | Applies the values of the resource dictionaries to network resource pools,
creating the resource pools if required
(vim.DVSNetworkResourcePoolConfigSpec) | [
"Applies",
"the",
"values",
"of",
"the",
"resource",
"dictionaries",
"to",
"network",
"resource",
"pools",
"creating",
"the",
"resource",
"pools",
"if",
"required",
"(",
"vim",
".",
"DVSNetworkResourcePoolConfigSpec",
")"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3914-L3937 | train |
saltstack/salt | salt/modules/vsphere.py | create_dvs | def create_dvs(dvs_dict, dvs_name, service_instance=None):
'''
Creates a distributed virtual switch (DVS).
Note: The ``dvs_name`` param will override any name set in ``dvs_dict``.
dvs_dict
Dict representation of the new DVS (example in salt.states.dvs)
dvs_name
Name of the DVS to ... | python | def create_dvs(dvs_dict, dvs_name, service_instance=None):
'''
Creates a distributed virtual switch (DVS).
Note: The ``dvs_name`` param will override any name set in ``dvs_dict``.
dvs_dict
Dict representation of the new DVS (example in salt.states.dvs)
dvs_name
Name of the DVS to ... | [
"def",
"create_dvs",
"(",
"dvs_dict",
",",
"dvs_name",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Creating dvs \\'%s\\' with dict = %s'",
",",
"dvs_name",
",",
"dvs_dict",
")",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
"if",... | Creates a distributed virtual switch (DVS).
Note: The ``dvs_name`` param will override any name set in ``dvs_dict``.
dvs_dict
Dict representation of the new DVS (example in salt.states.dvs)
dvs_name
Name of the DVS to be created.
service_instance
Service instance (vim.Service... | [
"Creates",
"a",
"distributed",
"virtual",
"switch",
"(",
"DVS",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L3943-L4008 | train |
saltstack/salt | salt/modules/vsphere.py | update_dvs | def update_dvs(dvs_dict, dvs, service_instance=None):
'''
Updates a distributed virtual switch (DVS).
Note: Updating the product info, capability, uplinks of a DVS is not
supported so the corresponding entries in ``dvs_dict`` will be
ignored.
dvs_dict
Dictionary with the va... | python | def update_dvs(dvs_dict, dvs, service_instance=None):
'''
Updates a distributed virtual switch (DVS).
Note: Updating the product info, capability, uplinks of a DVS is not
supported so the corresponding entries in ``dvs_dict`` will be
ignored.
dvs_dict
Dictionary with the va... | [
"def",
"update_dvs",
"(",
"dvs_dict",
",",
"dvs",
",",
"service_instance",
"=",
"None",
")",
":",
"# Remove ignored properties",
"log",
".",
"trace",
"(",
"'Updating dvs \\'%s\\' with dict = %s'",
",",
"dvs",
",",
"dvs_dict",
")",
"for",
"prop",
"in",
"[",
"'pro... | Updates a distributed virtual switch (DVS).
Note: Updating the product info, capability, uplinks of a DVS is not
supported so the corresponding entries in ``dvs_dict`` will be
ignored.
dvs_dict
Dictionary with the values the DVS should be update with
(example in salt.states... | [
"Updates",
"a",
"distributed",
"virtual",
"switch",
"(",
"DVS",
")",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4014-L4086 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvportgroup_out_shaping | def _get_dvportgroup_out_shaping(pg_name, pg_default_port_config):
'''
Returns the out shaping policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%s... | python | def _get_dvportgroup_out_shaping(pg_name, pg_default_port_config):
'''
Returns the out shaping policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%s... | [
"def",
"_get_dvportgroup_out_shaping",
"(",
"pg_name",
",",
"pg_default_port_config",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving portgroup\\'s \\'%s\\' out shaping config'",
",",
"pg_name",
")",
"out_shaping_policy",
"=",
"pg_default_port_config",
".",
"outShapingPolicy... | Returns the out shaping policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup | [
"Returns",
"the",
"out",
"shaping",
"policy",
"of",
"a",
"distributed",
"virtual",
"portgroup"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4089-L4106 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvportgroup_security_policy | def _get_dvportgroup_security_policy(pg_name, pg_default_port_config):
'''
Returns the security policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%... | python | def _get_dvportgroup_security_policy(pg_name, pg_default_port_config):
'''
Returns the security policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%... | [
"def",
"_get_dvportgroup_security_policy",
"(",
"pg_name",
",",
"pg_default_port_config",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving portgroup\\'s \\'%s\\' security policy config'",
",",
"pg_name",
")",
"sec_policy",
"=",
"pg_default_port_config",
".",
"securityPolicy",... | Returns the security policy of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup | [
"Returns",
"the",
"security",
"policy",
"of",
"a",
"distributed",
"virtual",
"portgroup"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4109-L4125 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvportgroup_teaming | def _get_dvportgroup_teaming(pg_name, pg_default_port_config):
'''
Returns the teaming of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%s\' teaming conf... | python | def _get_dvportgroup_teaming(pg_name, pg_default_port_config):
'''
Returns the teaming of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup
'''
log.trace('Retrieving portgroup\'s \'%s\' teaming conf... | [
"def",
"_get_dvportgroup_teaming",
"(",
"pg_name",
",",
"pg_default_port_config",
")",
":",
"log",
".",
"trace",
"(",
"'Retrieving portgroup\\'s \\'%s\\' teaming config'",
",",
"pg_name",
")",
"teaming_policy",
"=",
"pg_default_port_config",
".",
"uplinkTeamingPolicy",
"if"... | Returns the teaming of a distributed virtual portgroup
pg_name
The name of the portgroup
pg_default_port_config
The dafault port config of the portgroup | [
"Returns",
"the",
"teaming",
"of",
"a",
"distributed",
"virtual",
"portgroup"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4128-L4161 | train |
saltstack/salt | salt/modules/vsphere.py | _get_dvportgroup_dict | def _get_dvportgroup_dict(pg_ref):
'''
Returns a dictionary with a distributed virutal portgroup data
pg_ref
Portgroup reference
'''
props = salt.utils.vmware.get_properties_of_managed_object(
pg_ref, ['name', 'config.description', 'config.numPorts',
'config.type',... | python | def _get_dvportgroup_dict(pg_ref):
'''
Returns a dictionary with a distributed virutal portgroup data
pg_ref
Portgroup reference
'''
props = salt.utils.vmware.get_properties_of_managed_object(
pg_ref, ['name', 'config.description', 'config.numPorts',
'config.type',... | [
"def",
"_get_dvportgroup_dict",
"(",
"pg_ref",
")",
":",
"props",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_properties_of_managed_object",
"(",
"pg_ref",
",",
"[",
"'name'",
",",
"'config.description'",
",",
"'config.numPorts'",
",",
"'config.type'",
","... | Returns a dictionary with a distributed virutal portgroup data
pg_ref
Portgroup reference | [
"Returns",
"a",
"dictionary",
"with",
"a",
"distributed",
"virutal",
"portgroup",
"data"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4164-L4198 | train |
saltstack/salt | salt/modules/vsphere.py | list_dvportgroups | def list_dvportgroups(dvs=None, portgroup_names=None, service_instance=None):
'''
Returns a list of distributed virtual switch portgroups.
The list can be filtered by the portgroup names or by the DVS.
dvs
Name of the DVS containing the portgroups.
Default value is None.
portgroup_... | python | def list_dvportgroups(dvs=None, portgroup_names=None, service_instance=None):
'''
Returns a list of distributed virtual switch portgroups.
The list can be filtered by the portgroup names or by the DVS.
dvs
Name of the DVS containing the portgroups.
Default value is None.
portgroup_... | [
"def",
"list_dvportgroups",
"(",
"dvs",
"=",
"None",
",",
"portgroup_names",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"ret_dict",
"=",
"[",
"]",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
"if",
"proxy_type",
"==",
"'esxdatacenter'",
"... | Returns a list of distributed virtual switch portgroups.
The list can be filtered by the portgroup names or by the DVS.
dvs
Name of the DVS containing the portgroups.
Default value is None.
portgroup_names
List of portgroup names to look for. If None, all portgroups are
ret... | [
"Returns",
"a",
"list",
"of",
"distributed",
"virtual",
"switch",
"portgroups",
".",
"The",
"list",
"can",
"be",
"filtered",
"by",
"the",
"portgroup",
"names",
"or",
"by",
"the",
"DVS",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4204-L4253 | train |
saltstack/salt | salt/modules/vsphere.py | list_uplink_dvportgroup | def list_uplink_dvportgroup(dvs, service_instance=None):
'''
Returns the uplink portgroup of a distributed virtual switch.
dvs
Name of the DVS containing the portgroup.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block::... | python | def list_uplink_dvportgroup(dvs, service_instance=None):
'''
Returns the uplink portgroup of a distributed virtual switch.
dvs
Name of the DVS containing the portgroup.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block::... | [
"def",
"list_uplink_dvportgroup",
"(",
"dvs",
",",
"service_instance",
"=",
"None",
")",
":",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
"if",
"proxy_type",
"==",
"'esxdatacenter'",
":",
"datacenter",
"=",
"__salt__",
"[",
"'esxdatacenter.get_details'",
"]",
"... | Returns the uplink portgroup of a distributed virtual switch.
dvs
Name of the DVS containing the portgroup.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_uplink_dvportgroup dvs=dvs_name | [
"Returns",
"the",
"uplink",
"portgroup",
"of",
"a",
"distributed",
"virtual",
"switch",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4259-L4286 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvportgroup_out_shaping | def _apply_dvportgroup_out_shaping(pg_name, out_shaping, out_shaping_conf):
'''
Applies the values in out_shaping_conf to an out_shaping object
pg_name
The name of the portgroup
out_shaping
The vim.DVSTrafficShapingPolicy to apply the config to
out_shaping_conf
The out sha... | python | def _apply_dvportgroup_out_shaping(pg_name, out_shaping, out_shaping_conf):
'''
Applies the values in out_shaping_conf to an out_shaping object
pg_name
The name of the portgroup
out_shaping
The vim.DVSTrafficShapingPolicy to apply the config to
out_shaping_conf
The out sha... | [
"def",
"_apply_dvportgroup_out_shaping",
"(",
"pg_name",
",",
"out_shaping",
",",
"out_shaping_conf",
")",
":",
"log",
".",
"trace",
"(",
"'Building portgroup\\'s \\'%s\\' out shaping policy'",
",",
"pg_name",
")",
"if",
"out_shaping_conf",
".",
"get",
"(",
"'average_ba... | Applies the values in out_shaping_conf to an out_shaping object
pg_name
The name of the portgroup
out_shaping
The vim.DVSTrafficShapingPolicy to apply the config to
out_shaping_conf
The out shaping config | [
"Applies",
"the",
"values",
"in",
"out_shaping_conf",
"to",
"an",
"out_shaping",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4289-L4315 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvportgroup_security_policy | def _apply_dvportgroup_security_policy(pg_name, sec_policy, sec_policy_conf):
'''
Applies the values in sec_policy_conf to a security policy object
pg_name
The name of the portgroup
sec_policy
The vim.DVSTrafficShapingPolicy to apply the config to
sec_policy_conf
The out s... | python | def _apply_dvportgroup_security_policy(pg_name, sec_policy, sec_policy_conf):
'''
Applies the values in sec_policy_conf to a security policy object
pg_name
The name of the portgroup
sec_policy
The vim.DVSTrafficShapingPolicy to apply the config to
sec_policy_conf
The out s... | [
"def",
"_apply_dvportgroup_security_policy",
"(",
"pg_name",
",",
"sec_policy",
",",
"sec_policy_conf",
")",
":",
"log",
".",
"trace",
"(",
"'Building portgroup\\'s \\'%s\\' security policy '",
",",
"pg_name",
")",
"if",
"'allow_promiscuous'",
"in",
"sec_policy_conf",
":"... | Applies the values in sec_policy_conf to a security policy object
pg_name
The name of the portgroup
sec_policy
The vim.DVSTrafficShapingPolicy to apply the config to
sec_policy_conf
The out shaping config | [
"Applies",
"the",
"values",
"in",
"sec_policy_conf",
"to",
"a",
"security",
"policy",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4318-L4341 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvportgroup_teaming | def _apply_dvportgroup_teaming(pg_name, teaming, teaming_conf):
'''
Applies the values in teaming_conf to a teaming policy object
pg_name
The name of the portgroup
teaming
The vim.VmwareUplinkPortTeamingPolicy to apply the config to
teaming_conf
The teaming config
'''
... | python | def _apply_dvportgroup_teaming(pg_name, teaming, teaming_conf):
'''
Applies the values in teaming_conf to a teaming policy object
pg_name
The name of the portgroup
teaming
The vim.VmwareUplinkPortTeamingPolicy to apply the config to
teaming_conf
The teaming config
'''
... | [
"def",
"_apply_dvportgroup_teaming",
"(",
"pg_name",
",",
"teaming",
",",
"teaming_conf",
")",
":",
"log",
".",
"trace",
"(",
"'Building portgroup\\'s \\'%s\\' teaming'",
",",
"pg_name",
")",
"if",
"'notify_switches'",
"in",
"teaming_conf",
":",
"teaming",
".",
"not... | Applies the values in teaming_conf to a teaming policy object
pg_name
The name of the portgroup
teaming
The vim.VmwareUplinkPortTeamingPolicy to apply the config to
teaming_conf
The teaming config | [
"Applies",
"the",
"values",
"in",
"teaming_conf",
"to",
"a",
"teaming",
"policy",
"object"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4344-L4410 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_dvportgroup_config | def _apply_dvportgroup_config(pg_name, pg_spec, pg_conf):
'''
Applies the values in conf to a distributed portgroup spec
pg_name
The name of the portgroup
pg_spec
The vim.DVPortgroupConfigSpec to apply the config to
pg_conf
The portgroup config
'''
log.trace('Build... | python | def _apply_dvportgroup_config(pg_name, pg_spec, pg_conf):
'''
Applies the values in conf to a distributed portgroup spec
pg_name
The name of the portgroup
pg_spec
The vim.DVPortgroupConfigSpec to apply the config to
pg_conf
The portgroup config
'''
log.trace('Build... | [
"def",
"_apply_dvportgroup_config",
"(",
"pg_name",
",",
"pg_spec",
",",
"pg_conf",
")",
":",
"log",
".",
"trace",
"(",
"'Building portgroup\\'s \\'%s\\' spec'",
",",
"pg_name",
")",
"if",
"'name'",
"in",
"pg_conf",
":",
"pg_spec",
".",
"name",
"=",
"pg_conf",
... | Applies the values in conf to a distributed portgroup spec
pg_name
The name of the portgroup
pg_spec
The vim.DVPortgroupConfigSpec to apply the config to
pg_conf
The portgroup config | [
"Applies",
"the",
"values",
"in",
"conf",
"to",
"a",
"distributed",
"portgroup",
"spec"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4413-L4464 | train |
saltstack/salt | salt/modules/vsphere.py | create_dvportgroup | def create_dvportgroup(portgroup_dict, portgroup_name, dvs,
service_instance=None):
'''
Creates a distributed virtual portgroup.
Note: The ``portgroup_name`` param will override any name already set
in ``portgroup_dict``.
portgroup_dict
Dictionary with the config val... | python | def create_dvportgroup(portgroup_dict, portgroup_name, dvs,
service_instance=None):
'''
Creates a distributed virtual portgroup.
Note: The ``portgroup_name`` param will override any name already set
in ``portgroup_dict``.
portgroup_dict
Dictionary with the config val... | [
"def",
"create_dvportgroup",
"(",
"portgroup_dict",
",",
"portgroup_name",
",",
"dvs",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Creating portgroup\\'%s\\' in dvs \\'%s\\' '",
"'with dict = %s'",
",",
"portgroup_name",
",",
"dvs",
","... | Creates a distributed virtual portgroup.
Note: The ``portgroup_name`` param will override any name already set
in ``portgroup_dict``.
portgroup_dict
Dictionary with the config values the portgroup should be created with
(example in salt.states.dvs).
portgroup_name
Name of the ... | [
"Creates",
"a",
"distributed",
"virtual",
"portgroup",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4470-L4515 | train |
saltstack/salt | salt/modules/vsphere.py | update_dvportgroup | def update_dvportgroup(portgroup_dict, portgroup, dvs, service_instance=True):
'''
Updates a distributed virtual portgroup.
portgroup_dict
Dictionary with the values the portgroup should be update with
(example in salt.states.dvs).
portgroup
Name of the portgroup to be updated.... | python | def update_dvportgroup(portgroup_dict, portgroup, dvs, service_instance=True):
'''
Updates a distributed virtual portgroup.
portgroup_dict
Dictionary with the values the portgroup should be update with
(example in salt.states.dvs).
portgroup
Name of the portgroup to be updated.... | [
"def",
"update_dvportgroup",
"(",
"portgroup_dict",
",",
"portgroup",
",",
"dvs",
",",
"service_instance",
"=",
"True",
")",
":",
"log",
".",
"trace",
"(",
"'Updating portgroup\\'%s\\' in dvs \\'%s\\' '",
"'with dict = %s'",
",",
"portgroup",
",",
"dvs",
",",
"portg... | Updates a distributed virtual portgroup.
portgroup_dict
Dictionary with the values the portgroup should be update with
(example in salt.states.dvs).
portgroup
Name of the portgroup to be updated.
dvs
Name of the DVS containing the portgroups.
service_instance
... | [
"Updates",
"a",
"distributed",
"virtual",
"portgroup",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4521-L4575 | train |
saltstack/salt | salt/modules/vsphere.py | remove_dvportgroup | def remove_dvportgroup(portgroup, dvs, service_instance=None):
'''
Removes a distributed virtual portgroup.
portgroup
Name of the portgroup to be removed.
dvs
Name of the DVS containing the portgroups.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.... | python | def remove_dvportgroup(portgroup, dvs, service_instance=None):
'''
Removes a distributed virtual portgroup.
portgroup
Name of the portgroup to be removed.
dvs
Name of the DVS containing the portgroups.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.... | [
"def",
"remove_dvportgroup",
"(",
"portgroup",
",",
"dvs",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Removing portgroup\\'%s\\' in dvs \\'%s\\''",
",",
"portgroup",
",",
"dvs",
")",
"proxy_type",
"=",
"get_proxy_type",
"(",
")",
... | Removes a distributed virtual portgroup.
portgroup
Name of the portgroup to be removed.
dvs
Name of the DVS containing the portgroups.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphe... | [
"Removes",
"a",
"distributed",
"virtual",
"portgroup",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4581-L4617 | train |
saltstack/salt | salt/modules/vsphere.py | _get_policy_dict | def _get_policy_dict(policy):
'''Returns a dictionary representation of a policy'''
profile_dict = {'name': policy.name,
'description': policy.description,
'resource_type': policy.resourceType.resourceType}
subprofile_dicts = []
if isinstance(policy, pbm.profile.C... | python | def _get_policy_dict(policy):
'''Returns a dictionary representation of a policy'''
profile_dict = {'name': policy.name,
'description': policy.description,
'resource_type': policy.resourceType.resourceType}
subprofile_dicts = []
if isinstance(policy, pbm.profile.C... | [
"def",
"_get_policy_dict",
"(",
"policy",
")",
":",
"profile_dict",
"=",
"{",
"'name'",
":",
"policy",
".",
"name",
",",
"'description'",
":",
"policy",
".",
"description",
",",
"'resource_type'",
":",
"policy",
".",
"resourceType",
".",
"resourceType",
"}",
... | Returns a dictionary representation of a policy | [
"Returns",
"a",
"dictionary",
"representation",
"of",
"a",
"policy"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4620-L4654 | train |
saltstack/salt | salt/modules/vsphere.py | list_storage_policies | def list_storage_policies(policy_names=None, service_instance=None):
'''
Returns a list of storage policies.
policy_names
Names of policies to list. If None, all policies are listed.
Default is None.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | python | def list_storage_policies(policy_names=None, service_instance=None):
'''
Returns a list of storage policies.
policy_names
Names of policies to list. If None, all policies are listed.
Default is None.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | [
"def",
"list_storage_policies",
"(",
"policy_names",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"profile_manager",
"=",
"salt",
".",
"utils",
".",
"pbm",
".",
"get_profile_manager",
"(",
"service_instance",
")",
"if",
"not",
"policy_names",
":"... | Returns a list of storage policies.
policy_names
Names of policies to list. If None, all policies are listed.
Default is None.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_stora... | [
"Returns",
"a",
"list",
"of",
"storage",
"policies",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4660-L4685 | train |
saltstack/salt | salt/modules/vsphere.py | list_default_vsan_policy | def list_default_vsan_policy(service_instance=None):
'''
Returns the default vsan storage policy.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_storage_policies
salt '*' vsphere.list... | python | def list_default_vsan_policy(service_instance=None):
'''
Returns the default vsan storage policy.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_storage_policies
salt '*' vsphere.list... | [
"def",
"list_default_vsan_policy",
"(",
"service_instance",
"=",
"None",
")",
":",
"profile_manager",
"=",
"salt",
".",
"utils",
".",
"pbm",
".",
"get_profile_manager",
"(",
"service_instance",
")",
"policies",
"=",
"salt",
".",
"utils",
".",
"pbm",
".",
"get_... | Returns the default vsan storage policy.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_storage_policies
salt '*' vsphere.list_storage_policy policy_names=[policy_name] | [
"Returns",
"the",
"default",
"vsan",
"storage",
"policy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4691-L4713 | train |
saltstack/salt | salt/modules/vsphere.py | list_capability_definitions | def list_capability_definitions(service_instance=None):
'''
Returns a list of the metadata of all capabilities in the vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_capabilities
'... | python | def list_capability_definitions(service_instance=None):
'''
Returns a list of the metadata of all capabilities in the vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_capabilities
'... | [
"def",
"list_capability_definitions",
"(",
"service_instance",
"=",
"None",
")",
":",
"profile_manager",
"=",
"salt",
".",
"utils",
".",
"pbm",
".",
"get_profile_manager",
"(",
"service_instance",
")",
"ret_list",
"=",
"[",
"_get_capability_definition_dict",
"(",
"c... | Returns a list of the metadata of all capabilities in the vCenter.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.list_capabilities | [
"Returns",
"a",
"list",
"of",
"the",
"metadata",
"of",
"all",
"capabilities",
"in",
"the",
"vCenter",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4730-L4745 | train |
saltstack/salt | salt/modules/vsphere.py | _apply_policy_config | def _apply_policy_config(policy_spec, policy_dict):
'''Applies a policy dictionary to a policy spec'''
log.trace('policy_dict = %s', policy_dict)
if policy_dict.get('name'):
policy_spec.name = policy_dict['name']
if policy_dict.get('description'):
policy_spec.description = policy_dict['d... | python | def _apply_policy_config(policy_spec, policy_dict):
'''Applies a policy dictionary to a policy spec'''
log.trace('policy_dict = %s', policy_dict)
if policy_dict.get('name'):
policy_spec.name = policy_dict['name']
if policy_dict.get('description'):
policy_spec.description = policy_dict['d... | [
"def",
"_apply_policy_config",
"(",
"policy_spec",
",",
"policy_dict",
")",
":",
"log",
".",
"trace",
"(",
"'policy_dict = %s'",
",",
"policy_dict",
")",
"if",
"policy_dict",
".",
"get",
"(",
"'name'",
")",
":",
"policy_spec",
".",
"name",
"=",
"policy_dict",
... | Applies a policy dictionary to a policy spec | [
"Applies",
"a",
"policy",
"dictionary",
"to",
"a",
"policy",
"spec"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4748-L4794 | train |
saltstack/salt | salt/modules/vsphere.py | create_storage_policy | def create_storage_policy(policy_name, policy_dict, service_instance=None):
'''
Creates a storage policy.
Supported capability types: scalar, set, range.
policy_name
Name of the policy to create.
The value of the argument will override any existing name in
``policy_dict``.
... | python | def create_storage_policy(policy_name, policy_dict, service_instance=None):
'''
Creates a storage policy.
Supported capability types: scalar, set, range.
policy_name
Name of the policy to create.
The value of the argument will override any existing name in
``policy_dict``.
... | [
"def",
"create_storage_policy",
"(",
"policy_name",
",",
"policy_dict",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'create storage policy \\'%s\\', dict = %s'",
",",
"policy_name",
",",
"policy_dict",
")",
"profile_manager",
"=",
"salt"... | Creates a storage policy.
Supported capability types: scalar, set, range.
policy_name
Name of the policy to create.
The value of the argument will override any existing name in
``policy_dict``.
policy_dict
Dictionary containing the changes to apply to the policy.
(... | [
"Creates",
"a",
"storage",
"policy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4800-L4835 | train |
saltstack/salt | salt/modules/vsphere.py | update_storage_policy | def update_storage_policy(policy, policy_dict, service_instance=None):
'''
Updates a storage policy.
Supported capability types: scalar, set, range.
policy
Name of the policy to update.
policy_dict
Dictionary containing the changes to apply to the policy.
(example in salt.... | python | def update_storage_policy(policy, policy_dict, service_instance=None):
'''
Updates a storage policy.
Supported capability types: scalar, set, range.
policy
Name of the policy to update.
policy_dict
Dictionary containing the changes to apply to the policy.
(example in salt.... | [
"def",
"update_storage_policy",
"(",
"policy",
",",
"policy_dict",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'updating storage policy, dict = %s'",
",",
"policy_dict",
")",
"profile_manager",
"=",
"salt",
".",
"utils",
".",
"pbm",
... | Updates a storage policy.
Supported capability types: scalar, set, range.
policy
Name of the policy to update.
policy_dict
Dictionary containing the changes to apply to the policy.
(example in salt.states.pbm)
service_instance
Service instance (vim.ServiceInstance) of... | [
"Updates",
"a",
"storage",
"policy",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4841-L4877 | train |
saltstack/salt | salt/modules/vsphere.py | list_default_storage_policy_of_datastore | def list_default_storage_policy_of_datastore(datastore, service_instance=None):
'''
Returns a list of datastores assign the the storage policies.
datastore
Name of the datastore to assign.
The datastore needs to be visible to the VMware entity the proxy
points to.
service_insta... | python | def list_default_storage_policy_of_datastore(datastore, service_instance=None):
'''
Returns a list of datastores assign the the storage policies.
datastore
Name of the datastore to assign.
The datastore needs to be visible to the VMware entity the proxy
points to.
service_insta... | [
"def",
"list_default_storage_policy_of_datastore",
"(",
"datastore",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Listing the default storage policy of datastore \\'%s\\''",
",",
"datastore",
")",
"# Find datastore",
"target_ref",
"=",
"_get_p... | Returns a list of datastores assign the the storage policies.
datastore
Name of the datastore to assign.
The datastore needs to be visible to the VMware entity the proxy
points to.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
... | [
"Returns",
"a",
"list",
"of",
"datastores",
"assign",
"the",
"the",
"storage",
"policies",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4883-L4911 | train |
saltstack/salt | salt/modules/vsphere.py | assign_default_storage_policy_to_datastore | def assign_default_storage_policy_to_datastore(policy, datastore,
service_instance=None):
'''
Assigns a storage policy as the default policy to a datastore.
policy
Name of the policy to assign.
datastore
Name of the datastore to assign.
... | python | def assign_default_storage_policy_to_datastore(policy, datastore,
service_instance=None):
'''
Assigns a storage policy as the default policy to a datastore.
policy
Name of the policy to assign.
datastore
Name of the datastore to assign.
... | [
"def",
"assign_default_storage_policy_to_datastore",
"(",
"policy",
",",
"datastore",
",",
"service_instance",
"=",
"None",
")",
":",
"log",
".",
"trace",
"(",
"'Assigning policy %s to datastore %s'",
",",
"policy",
",",
"datastore",
")",
"profile_manager",
"=",
"salt... | Assigns a storage policy as the default policy to a datastore.
policy
Name of the policy to assign.
datastore
Name of the datastore to assign.
The datastore needs to be visible to the VMware entity the proxy
points to.
service_instance
Service instance (vim.Service... | [
"Assigns",
"a",
"storage",
"policy",
"as",
"the",
"default",
"policy",
"to",
"a",
"datastore",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4917-L4957 | train |
saltstack/salt | salt/modules/vsphere.py | list_datacenters_via_proxy | def list_datacenters_via_proxy(datacenter_names=None, service_instance=None):
'''
Returns a list of dict representations of VMware datacenters.
Connection is done via the proxy details.
Supported proxies: esxdatacenter
datacenter_names
List of datacenter names.
Default is None.
... | python | def list_datacenters_via_proxy(datacenter_names=None, service_instance=None):
'''
Returns a list of dict representations of VMware datacenters.
Connection is done via the proxy details.
Supported proxies: esxdatacenter
datacenter_names
List of datacenter names.
Default is None.
... | [
"def",
"list_datacenters_via_proxy",
"(",
"datacenter_names",
"=",
"None",
",",
"service_instance",
"=",
"None",
")",
":",
"if",
"not",
"datacenter_names",
":",
"dc_refs",
"=",
"salt",
".",
"utils",
".",
"vmware",
".",
"get_datacenters",
"(",
"service_instance",
... | Returns a list of dict representations of VMware datacenters.
Connection is done via the proxy details.
Supported proxies: esxdatacenter
datacenter_names
List of datacenter names.
Default is None.
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
... | [
"Returns",
"a",
"list",
"of",
"dict",
"representations",
"of",
"VMware",
"datacenters",
".",
"Connection",
"is",
"done",
"via",
"the",
"proxy",
"details",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L4963-L4996 | train |
saltstack/salt | salt/modules/vsphere.py | create_datacenter | def create_datacenter(datacenter_name, service_instance=None):
'''
Creates a datacenter.
Supported proxies: esxdatacenter
datacenter_name
The datacenter name
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
... | python | def create_datacenter(datacenter_name, service_instance=None):
'''
Creates a datacenter.
Supported proxies: esxdatacenter
datacenter_name
The datacenter name
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
... | [
"def",
"create_datacenter",
"(",
"datacenter_name",
",",
"service_instance",
"=",
"None",
")",
":",
"salt",
".",
"utils",
".",
"vmware",
".",
"create_datacenter",
"(",
"service_instance",
",",
"datacenter_name",
")",
"return",
"{",
"'create_datacenter'",
":",
"Tru... | Creates a datacenter.
Supported proxies: esxdatacenter
datacenter_name
The datacenter name
service_instance
Service instance (vim.ServiceInstance) of the vCenter.
Default is None.
.. code-block:: bash
salt '*' vsphere.create_datacenter dc1 | [
"Creates",
"a",
"datacenter",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/vsphere.py#L5002-L5020 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.