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/utils/minions.py | parse_target | def parse_target(target_expression):
'''Parse `target_expressing` splitting it into `engine`, `delimiter`,
`pattern` - returns a dict'''
match = TARGET_REX.match(target_expression)
if not match:
log.warning('Unable to parse target "%s"', target_expression)
ret = {
'engine':... | python | def parse_target(target_expression):
'''Parse `target_expressing` splitting it into `engine`, `delimiter`,
`pattern` - returns a dict'''
match = TARGET_REX.match(target_expression)
if not match:
log.warning('Unable to parse target "%s"', target_expression)
ret = {
'engine':... | [
"def",
"parse_target",
"(",
"target_expression",
")",
":",
"match",
"=",
"TARGET_REX",
".",
"match",
"(",
"target_expression",
")",
"if",
"not",
"match",
":",
"log",
".",
"warning",
"(",
"'Unable to parse target \"%s\"'",
",",
"target_expression",
")",
"ret",
"=... | Parse `target_expressing` splitting it into `engine`, `delimiter`,
`pattern` - returns a dict | [
"Parse",
"target_expressing",
"splitting",
"it",
"into",
"engine",
"delimiter",
"pattern",
"-",
"returns",
"a",
"dict"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L50-L64 | train |
saltstack/salt | salt/utils/minions.py | get_minion_data | def get_minion_data(minion, opts):
'''
Get the grains/pillar for a specific minion. If minion is None, it
will return the grains/pillar for the first minion it finds.
Return value is a tuple of the minion ID, grains, and pillar
'''
grains = None
pillar = None
if opts.get('minion_data_c... | python | def get_minion_data(minion, opts):
'''
Get the grains/pillar for a specific minion. If minion is None, it
will return the grains/pillar for the first minion it finds.
Return value is a tuple of the minion ID, grains, and pillar
'''
grains = None
pillar = None
if opts.get('minion_data_c... | [
"def",
"get_minion_data",
"(",
"minion",
",",
"opts",
")",
":",
"grains",
"=",
"None",
"pillar",
"=",
"None",
"if",
"opts",
".",
"get",
"(",
"'minion_data_cache'",
",",
"False",
")",
":",
"cache",
"=",
"salt",
".",
"cache",
".",
"factory",
"(",
"opts",... | Get the grains/pillar for a specific minion. If minion is None, it
will return the grains/pillar for the first minion it finds.
Return value is a tuple of the minion ID, grains, and pillar | [
"Get",
"the",
"grains",
"/",
"pillar",
"for",
"a",
"specific",
"minion",
".",
"If",
"minion",
"is",
"None",
"it",
"will",
"return",
"the",
"grains",
"/",
"pillar",
"for",
"the",
"first",
"minion",
"it",
"finds",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L67-L88 | train |
saltstack/salt | salt/utils/minions.py | nodegroup_comp | def nodegroup_comp(nodegroup, nodegroups, skip=None, first_call=True):
'''
Recursively expand ``nodegroup`` from ``nodegroups``; ignore nodegroups in ``skip``
If a top-level (non-recursive) call finds no nodegroups, return the original
nodegroup definition (for backwards compatibility). Keep track of r... | python | def nodegroup_comp(nodegroup, nodegroups, skip=None, first_call=True):
'''
Recursively expand ``nodegroup`` from ``nodegroups``; ignore nodegroups in ``skip``
If a top-level (non-recursive) call finds no nodegroups, return the original
nodegroup definition (for backwards compatibility). Keep track of r... | [
"def",
"nodegroup_comp",
"(",
"nodegroup",
",",
"nodegroups",
",",
"skip",
"=",
"None",
",",
"first_call",
"=",
"True",
")",
":",
"expanded_nodegroup",
"=",
"False",
"if",
"skip",
"is",
"None",
":",
"skip",
"=",
"set",
"(",
")",
"elif",
"nodegroup",
"in"... | Recursively expand ``nodegroup`` from ``nodegroups``; ignore nodegroups in ``skip``
If a top-level (non-recursive) call finds no nodegroups, return the original
nodegroup definition (for backwards compatibility). Keep track of recursive
calls via `first_call` argument | [
"Recursively",
"expand",
"nodegroup",
"from",
"nodegroups",
";",
"ignore",
"nodegroups",
"in",
"skip"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L91-L179 | train |
saltstack/salt | salt/utils/minions.py | mine_get | def mine_get(tgt, fun, tgt_type='glob', opts=None):
'''
Gathers the data from the specified minions' mine, pass in the target,
function to look up and the target type
'''
ret = {}
serial = salt.payload.Serial(opts)
checker = CkMinions(opts)
_res = checker.check_minions(
tgt,
... | python | def mine_get(tgt, fun, tgt_type='glob', opts=None):
'''
Gathers the data from the specified minions' mine, pass in the target,
function to look up and the target type
'''
ret = {}
serial = salt.payload.Serial(opts)
checker = CkMinions(opts)
_res = checker.check_minions(
tgt,
... | [
"def",
"mine_get",
"(",
"tgt",
",",
"fun",
",",
"tgt_type",
"=",
"'glob'",
",",
"opts",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"}",
"serial",
"=",
"salt",
".",
"payload",
".",
"Serial",
"(",
"opts",
")",
"checker",
"=",
"CkMinions",
"(",
"opts",
... | Gathers the data from the specified minions' mine, pass in the target,
function to look up and the target type | [
"Gathers",
"the",
"data",
"from",
"the",
"specified",
"minions",
"mine",
"pass",
"in",
"the",
"target",
"function",
"to",
"look",
"up",
"and",
"the",
"target",
"type"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L1130-L1166 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_nodegroup_minions | def _check_nodegroup_minions(self, expr, greedy): # pylint: disable=unused-argument
'''
Return minions found by looking at nodegroups
'''
return self._check_compound_minions(nodegroup_comp(expr, self.opts['nodegroups']),
DEFAULT_TARGET_DELIM,
greedy) | python | def _check_nodegroup_minions(self, expr, greedy): # pylint: disable=unused-argument
'''
Return minions found by looking at nodegroups
'''
return self._check_compound_minions(nodegroup_comp(expr, self.opts['nodegroups']),
DEFAULT_TARGET_DELIM,
greedy) | [
"def",
"_check_nodegroup_minions",
"(",
"self",
",",
"expr",
",",
"greedy",
")",
":",
"# pylint: disable=unused-argument",
"return",
"self",
".",
"_check_compound_minions",
"(",
"nodegroup_comp",
"(",
"expr",
",",
"self",
".",
"opts",
"[",
"'nodegroups'",
"]",
")"... | Return minions found by looking at nodegroups | [
"Return",
"minions",
"found",
"by",
"looking",
"at",
"nodegroups"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L201-L207 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_list_minions | def _check_list_minions(self, expr, greedy, ignore_missing=False): # pylint: disable=unused-argument
'''
Return the minions found by looking via a list
'''
if isinstance(expr, six.string_types):
expr = [m for m in expr.split(',') if m]
minions = self._pki_minions()
... | python | def _check_list_minions(self, expr, greedy, ignore_missing=False): # pylint: disable=unused-argument
'''
Return the minions found by looking via a list
'''
if isinstance(expr, six.string_types):
expr = [m for m in expr.split(',') if m]
minions = self._pki_minions()
... | [
"def",
"_check_list_minions",
"(",
"self",
",",
"expr",
",",
"greedy",
",",
"ignore_missing",
"=",
"False",
")",
":",
"# pylint: disable=unused-argument",
"if",
"isinstance",
"(",
"expr",
",",
"six",
".",
"string_types",
")",
":",
"expr",
"=",
"[",
"m",
"for... | Return the minions found by looking via a list | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"a",
"list"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L216-L224 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_pcre_minions | def _check_pcre_minions(self, expr, greedy): # pylint: disable=unused-argument
'''
Return the minions found by looking via regular expressions
'''
reg = re.compile(expr)
return {'minions': [m for m in self._pki_minions() if reg.match(m)],
'missing': []} | python | def _check_pcre_minions(self, expr, greedy): # pylint: disable=unused-argument
'''
Return the minions found by looking via regular expressions
'''
reg = re.compile(expr)
return {'minions': [m for m in self._pki_minions() if reg.match(m)],
'missing': []} | [
"def",
"_check_pcre_minions",
"(",
"self",
",",
"expr",
",",
"greedy",
")",
":",
"# pylint: disable=unused-argument",
"reg",
"=",
"re",
".",
"compile",
"(",
"expr",
")",
"return",
"{",
"'minions'",
":",
"[",
"m",
"for",
"m",
"in",
"self",
".",
"_pki_minion... | Return the minions found by looking via regular expressions | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"regular",
"expressions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L226-L232 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._pki_minions | def _pki_minions(self):
'''
Retreive complete minion list from PKI dir.
Respects cache if configured
'''
minions = []
pki_cache_fn = os.path.join(self.opts['pki_dir'], self.acc, '.key_cache')
try:
os.makedirs(os.path.dirname(pki_cache_fn))
exce... | python | def _pki_minions(self):
'''
Retreive complete minion list from PKI dir.
Respects cache if configured
'''
minions = []
pki_cache_fn = os.path.join(self.opts['pki_dir'], self.acc, '.key_cache')
try:
os.makedirs(os.path.dirname(pki_cache_fn))
exce... | [
"def",
"_pki_minions",
"(",
"self",
")",
":",
"minions",
"=",
"[",
"]",
"pki_cache_fn",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"opts",
"[",
"'pki_dir'",
"]",
",",
"self",
".",
"acc",
",",
"'.key_cache'",
")",
"try",
":",
"os",
".",
... | Retreive complete minion list from PKI dir.
Respects cache if configured | [
"Retreive",
"complete",
"minion",
"list",
"from",
"PKI",
"dir",
".",
"Respects",
"cache",
"if",
"configured"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L234-L264 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_cache_minions | def _check_cache_minions(self,
expr,
delimiter,
greedy,
search_type,
regex_match=False,
exact_match=False):
'''
Helper function to... | python | def _check_cache_minions(self,
expr,
delimiter,
greedy,
search_type,
regex_match=False,
exact_match=False):
'''
Helper function to... | [
"def",
"_check_cache_minions",
"(",
"self",
",",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"search_type",
",",
"regex_match",
"=",
"False",
",",
"exact_match",
"=",
"False",
")",
":",
"cache_enabled",
"=",
"self",
".",
"opts",
".",
"get",
"(",
"'minion... | Helper function to search for minions in master caches If 'greedy',
then return accepted minions matched by the condition or those absent
from the cache. If not 'greedy' return the only minions have cache
data and matched by the condition. | [
"Helper",
"function",
"to",
"search",
"for",
"minions",
"in",
"master",
"caches",
"If",
"greedy",
"then",
"return",
"accepted",
"minions",
"matched",
"by",
"the",
"condition",
"or",
"those",
"absent",
"from",
"the",
"cache",
".",
"If",
"not",
"greedy",
"retu... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L266-L321 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_grain_minions | def _check_grain_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via grains
'''
return self._check_cache_minions(expr, delimiter, greedy, 'grains') | python | def _check_grain_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via grains
'''
return self._check_cache_minions(expr, delimiter, greedy, 'grains') | [
"def",
"_check_grain_minions",
"(",
"self",
",",
"expr",
",",
"delimiter",
",",
"greedy",
")",
":",
"return",
"self",
".",
"_check_cache_minions",
"(",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"'grains'",
")"
] | Return the minions found by looking via grains | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"grains"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L323-L327 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_grain_pcre_minions | def _check_grain_pcre_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via grains with PCRE
'''
return self._check_cache_minions(expr,
delimiter,
greedy,
... | python | def _check_grain_pcre_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via grains with PCRE
'''
return self._check_cache_minions(expr,
delimiter,
greedy,
... | [
"def",
"_check_grain_pcre_minions",
"(",
"self",
",",
"expr",
",",
"delimiter",
",",
"greedy",
")",
":",
"return",
"self",
".",
"_check_cache_minions",
"(",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"'grains'",
",",
"regex_match",
"=",
"True",
")"
] | Return the minions found by looking via grains with PCRE | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"grains",
"with",
"PCRE"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L329-L337 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_pillar_minions | def _check_pillar_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via pillar
'''
return self._check_cache_minions(expr, delimiter, greedy, 'pillar') | python | def _check_pillar_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via pillar
'''
return self._check_cache_minions(expr, delimiter, greedy, 'pillar') | [
"def",
"_check_pillar_minions",
"(",
"self",
",",
"expr",
",",
"delimiter",
",",
"greedy",
")",
":",
"return",
"self",
".",
"_check_cache_minions",
"(",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"'pillar'",
")"
] | Return the minions found by looking via pillar | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"pillar"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L339-L343 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_pillar_pcre_minions | def _check_pillar_pcre_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via pillar with PCRE
'''
return self._check_cache_minions(expr,
delimiter,
greedy,
... | python | def _check_pillar_pcre_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via pillar with PCRE
'''
return self._check_cache_minions(expr,
delimiter,
greedy,
... | [
"def",
"_check_pillar_pcre_minions",
"(",
"self",
",",
"expr",
",",
"delimiter",
",",
"greedy",
")",
":",
"return",
"self",
".",
"_check_cache_minions",
"(",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"'pillar'",
",",
"regex_match",
"=",
"True",
")"
] | Return the minions found by looking via pillar with PCRE | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"pillar",
"with",
"PCRE"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L345-L353 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_pillar_exact_minions | def _check_pillar_exact_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via pillar
'''
return self._check_cache_minions(expr,
delimiter,
greedy,
... | python | def _check_pillar_exact_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via pillar
'''
return self._check_cache_minions(expr,
delimiter,
greedy,
... | [
"def",
"_check_pillar_exact_minions",
"(",
"self",
",",
"expr",
",",
"delimiter",
",",
"greedy",
")",
":",
"return",
"self",
".",
"_check_cache_minions",
"(",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"'pillar'",
",",
"exact_match",
"=",
"True",
")"
] | Return the minions found by looking via pillar | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"pillar"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L355-L363 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_ipcidr_minions | def _check_ipcidr_minions(self, expr, greedy):
'''
Return the minions found by looking via ipcidr
'''
cache_enabled = self.opts.get('minion_data_cache', False)
if greedy:
minions = self._pki_minions()
elif cache_enabled:
minions = self.cache.list(... | python | def _check_ipcidr_minions(self, expr, greedy):
'''
Return the minions found by looking via ipcidr
'''
cache_enabled = self.opts.get('minion_data_cache', False)
if greedy:
minions = self._pki_minions()
elif cache_enabled:
minions = self.cache.list(... | [
"def",
"_check_ipcidr_minions",
"(",
"self",
",",
"expr",
",",
"greedy",
")",
":",
"cache_enabled",
"=",
"self",
".",
"opts",
".",
"get",
"(",
"'minion_data_cache'",
",",
"False",
")",
"if",
"greedy",
":",
"minions",
"=",
"self",
".",
"_pki_minions",
"(",
... | Return the minions found by looking via ipcidr | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"ipcidr"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L365-L421 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_range_minions | def _check_range_minions(self, expr, greedy):
'''
Return the minions found by looking via range expression
'''
if not HAS_RANGE:
raise CommandExecutionError(
'Range matcher unavailable (unable to import seco.range, '
'module most likely not ins... | python | def _check_range_minions(self, expr, greedy):
'''
Return the minions found by looking via range expression
'''
if not HAS_RANGE:
raise CommandExecutionError(
'Range matcher unavailable (unable to import seco.range, '
'module most likely not ins... | [
"def",
"_check_range_minions",
"(",
"self",
",",
"expr",
",",
"greedy",
")",
":",
"if",
"not",
"HAS_RANGE",
":",
"raise",
"CommandExecutionError",
"(",
"'Range matcher unavailable (unable to import seco.range, '",
"'module most likely not installed)'",
")",
"if",
"not",
"... | Return the minions found by looking via range expression | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"range",
"expression"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L423-L453 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_compound_pillar_exact_minions | def _check_compound_pillar_exact_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via compound matcher
Disable pillar glob matching
'''
return self._check_compound_minions(expr,
delimiter,
... | python | def _check_compound_pillar_exact_minions(self, expr, delimiter, greedy):
'''
Return the minions found by looking via compound matcher
Disable pillar glob matching
'''
return self._check_compound_minions(expr,
delimiter,
... | [
"def",
"_check_compound_pillar_exact_minions",
"(",
"self",
",",
"expr",
",",
"delimiter",
",",
"greedy",
")",
":",
"return",
"self",
".",
"_check_compound_minions",
"(",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"pillar_exact",
"=",
"True",
")"
] | Return the minions found by looking via compound matcher
Disable pillar glob matching | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"compound",
"matcher"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L455-L464 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._check_compound_minions | def _check_compound_minions(self,
expr,
delimiter,
greedy,
pillar_exact=False): # pylint: disable=unused-argument
'''
Return the minions found by looking via compound matcher
... | python | def _check_compound_minions(self,
expr,
delimiter,
greedy,
pillar_exact=False): # pylint: disable=unused-argument
'''
Return the minions found by looking via compound matcher
... | [
"def",
"_check_compound_minions",
"(",
"self",
",",
"expr",
",",
"delimiter",
",",
"greedy",
",",
"pillar_exact",
"=",
"False",
")",
":",
"# pylint: disable=unused-argument",
"if",
"not",
"isinstance",
"(",
"expr",
",",
"six",
".",
"string_types",
")",
"and",
... | Return the minions found by looking via compound matcher | [
"Return",
"the",
"minions",
"found",
"by",
"looking",
"via",
"compound",
"matcher"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L466-L620 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.connected_ids | def connected_ids(self, subset=None, show_ip=False, show_ipv4=None, include_localhost=None):
'''
Return a set of all connected minion ids, optionally within a subset
'''
if include_localhost is not None:
salt.utils.versions.warn_until(
'Sodium',
... | python | def connected_ids(self, subset=None, show_ip=False, show_ipv4=None, include_localhost=None):
'''
Return a set of all connected minion ids, optionally within a subset
'''
if include_localhost is not None:
salt.utils.versions.warn_until(
'Sodium',
... | [
"def",
"connected_ids",
"(",
"self",
",",
"subset",
"=",
"None",
",",
"show_ip",
"=",
"False",
",",
"show_ipv4",
"=",
"None",
",",
"include_localhost",
"=",
"None",
")",
":",
"if",
"include_localhost",
"is",
"not",
"None",
":",
"salt",
".",
"utils",
".",... | Return a set of all connected minion ids, optionally within a subset | [
"Return",
"a",
"set",
"of",
"all",
"connected",
"minion",
"ids",
"optionally",
"within",
"a",
"subset"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L622-L681 | train |
saltstack/salt | salt/utils/minions.py | CkMinions._all_minions | def _all_minions(self, expr=None):
'''
Return a list of all minions that have auth'd
'''
mlist = []
for fn_ in salt.utils.data.sorted_ignorecase(os.listdir(os.path.join(self.opts['pki_dir'], self.acc))):
if not fn_.startswith('.') and os.path.isfile(os.path.join(self.... | python | def _all_minions(self, expr=None):
'''
Return a list of all minions that have auth'd
'''
mlist = []
for fn_ in salt.utils.data.sorted_ignorecase(os.listdir(os.path.join(self.opts['pki_dir'], self.acc))):
if not fn_.startswith('.') and os.path.isfile(os.path.join(self.... | [
"def",
"_all_minions",
"(",
"self",
",",
"expr",
"=",
"None",
")",
":",
"mlist",
"=",
"[",
"]",
"for",
"fn_",
"in",
"salt",
".",
"utils",
".",
"data",
".",
"sorted_ignorecase",
"(",
"os",
".",
"listdir",
"(",
"os",
".",
"path",
".",
"join",
"(",
... | Return a list of all minions that have auth'd | [
"Return",
"a",
"list",
"of",
"all",
"minions",
"that",
"have",
"auth",
"d"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L683-L691 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.check_minions | def check_minions(self,
expr,
tgt_type='glob',
delimiter=DEFAULT_TARGET_DELIM,
greedy=True):
'''
Check the passed regex against the available minions' public keys
stored for authentication. This should return... | python | def check_minions(self,
expr,
tgt_type='glob',
delimiter=DEFAULT_TARGET_DELIM,
greedy=True):
'''
Check the passed regex against the available minions' public keys
stored for authentication. This should return... | [
"def",
"check_minions",
"(",
"self",
",",
"expr",
",",
"tgt_type",
"=",
"'glob'",
",",
"delimiter",
"=",
"DEFAULT_TARGET_DELIM",
",",
"greedy",
"=",
"True",
")",
":",
"try",
":",
"if",
"expr",
"is",
"None",
":",
"expr",
"=",
"''",
"check_func",
"=",
"g... | Check the passed regex against the available minions' public keys
stored for authentication. This should return a set of ids which
match the regex, this will then be used to parse the returns to
make sure everyone has checked back in. | [
"Check",
"the",
"passed",
"regex",
"against",
"the",
"available",
"minions",
"public",
"keys",
"stored",
"for",
"authentication",
".",
"This",
"should",
"return",
"a",
"set",
"of",
"ids",
"which",
"match",
"the",
"regex",
"this",
"will",
"then",
"be",
"used"... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L693-L731 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.validate_tgt | def validate_tgt(self, valid, expr, tgt_type, minions=None, expr_form=None):
'''
Return a Bool. This function returns if the expression sent in is
within the scope of the valid expression
'''
v_minions = set(self.check_minions(valid, 'compound').get('minions', []))
if mi... | python | def validate_tgt(self, valid, expr, tgt_type, minions=None, expr_form=None):
'''
Return a Bool. This function returns if the expression sent in is
within the scope of the valid expression
'''
v_minions = set(self.check_minions(valid, 'compound').get('minions', []))
if mi... | [
"def",
"validate_tgt",
"(",
"self",
",",
"valid",
",",
"expr",
",",
"tgt_type",
",",
"minions",
"=",
"None",
",",
"expr_form",
"=",
"None",
")",
":",
"v_minions",
"=",
"set",
"(",
"self",
".",
"check_minions",
"(",
"valid",
",",
"'compound'",
")",
".",... | Return a Bool. This function returns if the expression sent in is
within the scope of the valid expression | [
"Return",
"a",
"Bool",
".",
"This",
"function",
"returns",
"if",
"the",
"expression",
"sent",
"in",
"is",
"within",
"the",
"scope",
"of",
"the",
"valid",
"expression"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L733-L748 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.match_check | def match_check(self, regex, fun):
'''
Validate a single regex to function comparison, the function argument
can be a list of functions. It is all or nothing for a list of
functions
'''
vals = []
if isinstance(fun, six.string_types):
fun = [fun]
... | python | def match_check(self, regex, fun):
'''
Validate a single regex to function comparison, the function argument
can be a list of functions. It is all or nothing for a list of
functions
'''
vals = []
if isinstance(fun, six.string_types):
fun = [fun]
... | [
"def",
"match_check",
"(",
"self",
",",
"regex",
",",
"fun",
")",
":",
"vals",
"=",
"[",
"]",
"if",
"isinstance",
"(",
"fun",
",",
"six",
".",
"string_types",
")",
":",
"fun",
"=",
"[",
"fun",
"]",
"for",
"func",
"in",
"fun",
":",
"try",
":",
"... | Validate a single regex to function comparison, the function argument
can be a list of functions. It is all or nothing for a list of
functions | [
"Validate",
"a",
"single",
"regex",
"to",
"function",
"comparison",
"the",
"function",
"argument",
"can",
"be",
"a",
"list",
"of",
"functions",
".",
"It",
"is",
"all",
"or",
"nothing",
"for",
"a",
"list",
"of",
"functions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L750-L767 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.any_auth | def any_auth(self, form, auth_list, fun, arg, tgt=None, tgt_type='glob'):
'''
Read in the form and determine which auth check routine to execute
'''
# This function is only called from salt.auth.Authorize(), which is also
# deprecated and will be removed in Neon.
salt.uti... | python | def any_auth(self, form, auth_list, fun, arg, tgt=None, tgt_type='glob'):
'''
Read in the form and determine which auth check routine to execute
'''
# This function is only called from salt.auth.Authorize(), which is also
# deprecated and will be removed in Neon.
salt.uti... | [
"def",
"any_auth",
"(",
"self",
",",
"form",
",",
"auth_list",
",",
"fun",
",",
"arg",
",",
"tgt",
"=",
"None",
",",
"tgt_type",
"=",
"'glob'",
")",
":",
"# This function is only called from salt.auth.Authorize(), which is also",
"# deprecated and will be removed in Neo... | Read in the form and determine which auth check routine to execute | [
"Read",
"in",
"the",
"form",
"and",
"determine",
"which",
"auth",
"check",
"routine",
"to",
"execute"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L769-L791 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.auth_check | def auth_check(self,
auth_list,
funs,
args,
tgt,
tgt_type='glob',
groups=None,
publish_validate=False,
minions=None,
whitelist=None):
'''
... | python | def auth_check(self,
auth_list,
funs,
args,
tgt,
tgt_type='glob',
groups=None,
publish_validate=False,
minions=None,
whitelist=None):
'''
... | [
"def",
"auth_check",
"(",
"self",
",",
"auth_list",
",",
"funs",
",",
"args",
",",
"tgt",
",",
"tgt_type",
"=",
"'glob'",
",",
"groups",
"=",
"None",
",",
"publish_validate",
"=",
"False",
",",
"minions",
"=",
"None",
",",
"whitelist",
"=",
"None",
")"... | Returns a bool which defines if the requested function is authorized.
Used to evaluate the standard structure under external master
authentication interfaces, like eauth, peer, peer_run, etc. | [
"Returns",
"a",
"bool",
"which",
"defines",
"if",
"the",
"requested",
"function",
"is",
"authorized",
".",
"Used",
"to",
"evaluate",
"the",
"standard",
"structure",
"under",
"external",
"master",
"authentication",
"interfaces",
"like",
"eauth",
"peer",
"peer_run",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L908-L979 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.fill_auth_list_from_groups | def fill_auth_list_from_groups(self, auth_provider, user_groups, auth_list):
'''
Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in.
'''
group_nam... | python | def fill_auth_list_from_groups(self, auth_provider, user_groups, auth_list):
'''
Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in.
'''
group_nam... | [
"def",
"fill_auth_list_from_groups",
"(",
"self",
",",
"auth_provider",
",",
"user_groups",
",",
"auth_list",
")",
":",
"group_names",
"=",
"[",
"item",
"for",
"item",
"in",
"auth_provider",
"if",
"item",
".",
"endswith",
"(",
"'%'",
")",
"]",
"if",
"group_n... | Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in. | [
"Returns",
"a",
"list",
"of",
"authorisation",
"matchers",
"that",
"a",
"user",
"is",
"eligible",
"for",
".",
"This",
"list",
"is",
"a",
"combination",
"of",
"the",
"provided",
"personal",
"matchers",
"plus",
"the",
"matchers",
"of",
"any",
"group",
"the",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L981-L993 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.fill_auth_list | def fill_auth_list(self, auth_provider, name, groups, auth_list=None, permissive=None):
'''
Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in.
'''
... | python | def fill_auth_list(self, auth_provider, name, groups, auth_list=None, permissive=None):
'''
Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in.
'''
... | [
"def",
"fill_auth_list",
"(",
"self",
",",
"auth_provider",
",",
"name",
",",
"groups",
",",
"auth_list",
"=",
"None",
",",
"permissive",
"=",
"None",
")",
":",
"if",
"auth_list",
"is",
"None",
":",
"auth_list",
"=",
"[",
"]",
"if",
"permissive",
"is",
... | Returns a list of authorisation matchers that a user is eligible for.
This list is a combination of the provided personal matchers plus the
matchers of any group the user is in. | [
"Returns",
"a",
"list",
"of",
"authorisation",
"matchers",
"that",
"a",
"user",
"is",
"eligible",
"for",
".",
"This",
"list",
"is",
"a",
"combination",
"of",
"the",
"provided",
"personal",
"matchers",
"plus",
"the",
"matchers",
"of",
"any",
"group",
"the",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L995-L1018 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.wheel_check | def wheel_check(self, auth_list, fun, args):
'''
Check special API permissions
'''
return self.spec_check(auth_list, fun, args, 'wheel') | python | def wheel_check(self, auth_list, fun, args):
'''
Check special API permissions
'''
return self.spec_check(auth_list, fun, args, 'wheel') | [
"def",
"wheel_check",
"(",
"self",
",",
"auth_list",
",",
"fun",
",",
"args",
")",
":",
"return",
"self",
".",
"spec_check",
"(",
"auth_list",
",",
"fun",
",",
"args",
",",
"'wheel'",
")"
] | Check special API permissions | [
"Check",
"special",
"API",
"permissions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L1020-L1024 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.runner_check | def runner_check(self, auth_list, fun, args):
'''
Check special API permissions
'''
return self.spec_check(auth_list, fun, args, 'runner') | python | def runner_check(self, auth_list, fun, args):
'''
Check special API permissions
'''
return self.spec_check(auth_list, fun, args, 'runner') | [
"def",
"runner_check",
"(",
"self",
",",
"auth_list",
",",
"fun",
",",
"args",
")",
":",
"return",
"self",
".",
"spec_check",
"(",
"auth_list",
",",
"fun",
",",
"args",
",",
"'runner'",
")"
] | Check special API permissions | [
"Check",
"special",
"API",
"permissions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L1026-L1030 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.spec_check | def spec_check(self, auth_list, fun, args, form):
'''
Check special API permissions
'''
if not auth_list:
return False
if form != 'cloud':
comps = fun.split('.')
if len(comps) != 2:
# Hint at a syntax error when command is passe... | python | def spec_check(self, auth_list, fun, args, form):
'''
Check special API permissions
'''
if not auth_list:
return False
if form != 'cloud':
comps = fun.split('.')
if len(comps) != 2:
# Hint at a syntax error when command is passe... | [
"def",
"spec_check",
"(",
"self",
",",
"auth_list",
",",
"fun",
",",
"args",
",",
"form",
")",
":",
"if",
"not",
"auth_list",
":",
"return",
"False",
"if",
"form",
"!=",
"'cloud'",
":",
"comps",
"=",
"fun",
".",
"split",
"(",
"'.'",
")",
"if",
"len... | Check special API permissions | [
"Check",
"special",
"API",
"permissions"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L1032-L1066 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.__fun_check | def __fun_check(self, valid, fun, args=None, kwargs=None):
'''
Check the given function name (fun) and its arguments (args) against the list of conditions.
'''
if not isinstance(valid, list):
valid = [valid]
for cond in valid:
# Function name match
... | python | def __fun_check(self, valid, fun, args=None, kwargs=None):
'''
Check the given function name (fun) and its arguments (args) against the list of conditions.
'''
if not isinstance(valid, list):
valid = [valid]
for cond in valid:
# Function name match
... | [
"def",
"__fun_check",
"(",
"self",
",",
"valid",
",",
"fun",
",",
"args",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"valid",
",",
"list",
")",
":",
"valid",
"=",
"[",
"valid",
"]",
"for",
"cond",
"in",
"va... | Check the given function name (fun) and its arguments (args) against the list of conditions. | [
"Check",
"the",
"given",
"function",
"name",
"(",
"fun",
")",
"and",
"its",
"arguments",
"(",
"args",
")",
"against",
"the",
"list",
"of",
"conditions",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L1068-L1088 | train |
saltstack/salt | salt/utils/minions.py | CkMinions.__args_check | def __args_check(self, valid, args=None, kwargs=None):
'''
valid is a dicts: {'args': [...], 'kwargs': {...}} or a list of such dicts.
'''
if not isinstance(valid, list):
valid = [valid]
for cond in valid:
if not isinstance(cond, dict):
# I... | python | def __args_check(self, valid, args=None, kwargs=None):
'''
valid is a dicts: {'args': [...], 'kwargs': {...}} or a list of such dicts.
'''
if not isinstance(valid, list):
valid = [valid]
for cond in valid:
if not isinstance(cond, dict):
# I... | [
"def",
"__args_check",
"(",
"self",
",",
"valid",
",",
"args",
"=",
"None",
",",
"kwargs",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"valid",
",",
"list",
")",
":",
"valid",
"=",
"[",
"valid",
"]",
"for",
"cond",
"in",
"valid",
":",
... | valid is a dicts: {'args': [...], 'kwargs': {...}} or a list of such dicts. | [
"valid",
"is",
"a",
"dicts",
":",
"{",
"args",
":",
"[",
"...",
"]",
"kwargs",
":",
"{",
"...",
"}}",
"or",
"a",
"list",
"of",
"such",
"dicts",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/minions.py#L1090-L1127 | train |
saltstack/salt | salt/cloud/clouds/clc.py | list_nodes_full | def list_nodes_full(call=None, for_output=True):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --function.'
)
creds = get_creds()
clc.v1.SetCredentials(... | python | def list_nodes_full(call=None, for_output=True):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be called with -f or --function.'
)
creds = get_creds()
clc.v1.SetCredentials(... | [
"def",
"list_nodes_full",
"(",
"call",
"=",
"None",
",",
"for_output",
"=",
"True",
")",
":",
"if",
"call",
"==",
"'action'",
":",
"raise",
"SaltCloudSystemExit",
"(",
"'The list_nodes_full function must be called with -f or --function.'",
")",
"creds",
"=",
"get_cred... | Return a list of the VMs that are on the provider | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/clc.py#L150-L163 | train |
saltstack/salt | salt/cloud/clouds/clc.py | get_monthly_estimate | def get_monthly_estimate(call=None, for_output=True):
'''
Return a list of the VMs that are on the provider
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be... | python | def get_monthly_estimate(call=None, for_output=True):
'''
Return a list of the VMs that are on the provider
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes_full function must be... | [
"def",
"get_monthly_estimate",
"(",
"call",
"=",
"None",
",",
"for_output",
"=",
"True",
")",
":",
"creds",
"=",
"get_creds",
"(",
")",
"clc",
".",
"v1",
".",
"SetCredentials",
"(",
"creds",
"[",
"\"token\"",
"]",
",",
"creds",
"[",
"\"token_pass\"",
"]"... | Return a list of the VMs that are on the provider | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/clc.py#L173-L190 | train |
saltstack/salt | salt/cloud/clouds/clc.py | get_server_alerts | def get_server_alerts(call=None, for_output=True, **kwargs):
'''
Return a list of alerts from CLC as reported by their infra
'''
for key, value in kwargs.items():
servername = ""
if key == "servername":
servername = value
creds = get_creds()
clc.v2.SetCredentials(cred... | python | def get_server_alerts(call=None, for_output=True, **kwargs):
'''
Return a list of alerts from CLC as reported by their infra
'''
for key, value in kwargs.items():
servername = ""
if key == "servername":
servername = value
creds = get_creds()
clc.v2.SetCredentials(cred... | [
"def",
"get_server_alerts",
"(",
"call",
"=",
"None",
",",
"for_output",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"key",
",",
"value",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"servername",
"=",
"\"\"",
"if",
"key",
"==",
"\"servern... | Return a list of alerts from CLC as reported by their infra | [
"Return",
"a",
"list",
"of",
"alerts",
"from",
"CLC",
"as",
"reported",
"by",
"their",
"infra"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/clc.py#L213-L224 | train |
saltstack/salt | salt/cloud/clouds/clc.py | get_group_estimate | def get_group_estimate(call=None, for_output=True, **kwargs):
'''
Return a list of the VMs that are on the provider
usage: "salt-cloud -f get_group_estimate clc group=Dev location=VA1"
'''
for key, value in kwargs.items():
group = ""
location = ""
if key == "group":
... | python | def get_group_estimate(call=None, for_output=True, **kwargs):
'''
Return a list of the VMs that are on the provider
usage: "salt-cloud -f get_group_estimate clc group=Dev location=VA1"
'''
for key, value in kwargs.items():
group = ""
location = ""
if key == "group":
... | [
"def",
"get_group_estimate",
"(",
"call",
"=",
"None",
",",
"for_output",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"key",
",",
"value",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"group",
"=",
"\"\"",
"location",
"=",
"\"\"",
"if",
... | Return a list of the VMs that are on the provider
usage: "salt-cloud -f get_group_estimate clc group=Dev location=VA1" | [
"Return",
"a",
"list",
"of",
"the",
"VMs",
"that",
"are",
"on",
"the",
"provider",
"usage",
":",
"salt",
"-",
"cloud",
"-",
"f",
"get_group_estimate",
"clc",
"group",
"=",
"Dev",
"location",
"=",
"VA1"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/clc.py#L227-L253 | train |
saltstack/salt | salt/cloud/clouds/clc.py | avail_images | def avail_images(call=None):
'''
returns a list of images available to you
'''
all_servers = list_nodes_full()
templates = {}
for server in all_servers:
if server["IsTemplate"]:
templates.update({"Template Name": server["Name"]})
return templates | python | def avail_images(call=None):
'''
returns a list of images available to you
'''
all_servers = list_nodes_full()
templates = {}
for server in all_servers:
if server["IsTemplate"]:
templates.update({"Template Name": server["Name"]})
return templates | [
"def",
"avail_images",
"(",
"call",
"=",
"None",
")",
":",
"all_servers",
"=",
"list_nodes_full",
"(",
")",
"templates",
"=",
"{",
"}",
"for",
"server",
"in",
"all_servers",
":",
"if",
"server",
"[",
"\"IsTemplate\"",
"]",
":",
"templates",
".",
"update",
... | returns a list of images available to you | [
"returns",
"a",
"list",
"of",
"images",
"available",
"to",
"you"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/clc.py#L256-L265 | train |
saltstack/salt | salt/cloud/clouds/clc.py | avail_locations | def avail_locations(call=None):
'''
returns a list of locations available to you
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
locations = clc.v1.Account.GetLocations()
return locations | python | def avail_locations(call=None):
'''
returns a list of locations available to you
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
locations = clc.v1.Account.GetLocations()
return locations | [
"def",
"avail_locations",
"(",
"call",
"=",
"None",
")",
":",
"creds",
"=",
"get_creds",
"(",
")",
"clc",
".",
"v1",
".",
"SetCredentials",
"(",
"creds",
"[",
"\"token\"",
"]",
",",
"creds",
"[",
"\"token_pass\"",
"]",
")",
"locations",
"=",
"clc",
"."... | returns a list of locations available to you | [
"returns",
"a",
"list",
"of",
"locations",
"available",
"to",
"you"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/clc.py#L268-L275 | train |
saltstack/salt | salt/cloud/clouds/clc.py | get_build_status | def get_build_status(req_id, nodename):
'''
get the build status from CLC to make sure we dont return to early
'''
counter = 0
req_id = six.text_type(req_id)
while counter < 10:
queue = clc.v1.Blueprint.GetStatus(request_id=(req_id))
if queue["PercentComplete"] == 100:
... | python | def get_build_status(req_id, nodename):
'''
get the build status from CLC to make sure we dont return to early
'''
counter = 0
req_id = six.text_type(req_id)
while counter < 10:
queue = clc.v1.Blueprint.GetStatus(request_id=(req_id))
if queue["PercentComplete"] == 100:
... | [
"def",
"get_build_status",
"(",
"req_id",
",",
"nodename",
")",
":",
"counter",
"=",
"0",
"req_id",
"=",
"six",
".",
"text_type",
"(",
"req_id",
")",
"while",
"counter",
"<",
"10",
":",
"queue",
"=",
"clc",
".",
"v1",
".",
"Blueprint",
".",
"GetStatus"... | get the build status from CLC to make sure we dont return to early | [
"get",
"the",
"build",
"status",
"from",
"CLC",
"to",
"make",
"sure",
"we",
"dont",
"return",
"to",
"early"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/clc.py#L285-L304 | train |
saltstack/salt | salt/cloud/clouds/clc.py | create | def create(vm_):
'''
get the system build going
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
cloud_profile = config.is_provider_configured(
__opts__,
__active_provider_name__ or __virtualname__,
('token',)
)
group = config.get... | python | def create(vm_):
'''
get the system build going
'''
creds = get_creds()
clc.v1.SetCredentials(creds["token"], creds["token_pass"])
cloud_profile = config.is_provider_configured(
__opts__,
__active_provider_name__ or __virtualname__,
('token',)
)
group = config.get... | [
"def",
"create",
"(",
"vm_",
")",
":",
"creds",
"=",
"get_creds",
"(",
")",
"clc",
".",
"v1",
".",
"SetCredentials",
"(",
"creds",
"[",
"\"token\"",
"]",
",",
"creds",
"[",
"\"token_pass\"",
"]",
")",
"cloud_profile",
"=",
"config",
".",
"is_provider_con... | get the system build going | [
"get",
"the",
"system",
"build",
"going"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/cloud/clouds/clc.py#L307-L366 | train |
saltstack/salt | salt/states/lvs_service.py | present | def present(name,
protocol=None,
service_address=None,
scheduler='wlc',
):
'''
Ensure that the named service is present.
name
The LVS service name
protocol
The service protocol
service_address
The LVS service address
sche... | python | def present(name,
protocol=None,
service_address=None,
scheduler='wlc',
):
'''
Ensure that the named service is present.
name
The LVS service name
protocol
The service protocol
service_address
The LVS service address
sche... | [
"def",
"present",
"(",
"name",
",",
"protocol",
"=",
"None",
",",
"service_address",
"=",
"None",
",",
"scheduler",
"=",
"'wlc'",
",",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
... | Ensure that the named service is present.
name
The LVS service name
protocol
The service protocol
service_address
The LVS service address
scheduler
Algorithm for allocating TCP connections and UDP datagrams to real servers.
.. code-block:: yaml
lvstest:
... | [
"Ensure",
"that",
"the",
"named",
"service",
"is",
"present",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lvs_service.py#L18-L94 | train |
saltstack/salt | salt/states/lvs_service.py | absent | def absent(name, protocol=None, service_address=None):
'''
Ensure the LVS service is absent.
name
The name of the LVS service
protocol
The service protocol
service_address
The LVS service address
'''
ret = {'name': name,
'changes': {},
'result... | python | def absent(name, protocol=None, service_address=None):
'''
Ensure the LVS service is absent.
name
The name of the LVS service
protocol
The service protocol
service_address
The LVS service address
'''
ret = {'name': name,
'changes': {},
'result... | [
"def",
"absent",
"(",
"name",
",",
"protocol",
"=",
"None",
",",
"service_address",
"=",
"None",
")",
":",
"ret",
"=",
"{",
"'name'",
":",
"name",
",",
"'changes'",
":",
"{",
"}",
",",
"'result'",
":",
"True",
",",
"'comment'",
":",
"''",
"}",
"#ch... | Ensure the LVS service is absent.
name
The name of the LVS service
protocol
The service protocol
service_address
The LVS service address | [
"Ensure",
"the",
"LVS",
"service",
"is",
"absent",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/lvs_service.py#L97-L136 | train |
saltstack/salt | salt/matchers/glob_match.py | match | def match(tgt, opts=None):
'''
Returns true if the passed glob matches the id
'''
if not opts:
opts = __opts__
if not isinstance(tgt, six.string_types):
return False
return fnmatch.fnmatch(opts['id'], tgt) | python | def match(tgt, opts=None):
'''
Returns true if the passed glob matches the id
'''
if not opts:
opts = __opts__
if not isinstance(tgt, six.string_types):
return False
return fnmatch.fnmatch(opts['id'], tgt) | [
"def",
"match",
"(",
"tgt",
",",
"opts",
"=",
"None",
")",
":",
"if",
"not",
"opts",
":",
"opts",
"=",
"__opts__",
"if",
"not",
"isinstance",
"(",
"tgt",
",",
"six",
".",
"string_types",
")",
":",
"return",
"False",
"return",
"fnmatch",
".",
"fnmatch... | Returns true if the passed glob matches the id | [
"Returns",
"true",
"if",
"the",
"passed",
"glob",
"matches",
"the",
"id"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/matchers/glob_match.py#L11-L20 | train |
saltstack/salt | salt/modules/openbsd_sysctl.py | show | def show(config_file=False):
'''
Return a list of sysctl parameters for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.show
'''
cmd = 'sysctl'
ret = {}
out = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace')
for line in out.splitlines():
if no... | python | def show(config_file=False):
'''
Return a list of sysctl parameters for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.show
'''
cmd = 'sysctl'
ret = {}
out = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace')
for line in out.splitlines():
if no... | [
"def",
"show",
"(",
"config_file",
"=",
"False",
")",
":",
"cmd",
"=",
"'sysctl'",
"ret",
"=",
"{",
"}",
"out",
"=",
"__salt__",
"[",
"'cmd.run_stdout'",
"]",
"(",
"cmd",
",",
"output_loglevel",
"=",
"'trace'",
")",
"for",
"line",
"in",
"out",
".",
"... | Return a list of sysctl parameters for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.show | [
"Return",
"a",
"list",
"of",
"sysctl",
"parameters",
"for",
"this",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsd_sysctl.py#L30-L48 | train |
saltstack/salt | salt/modules/openbsd_sysctl.py | assign | def assign(name, value):
'''
Assign a single sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.assign net.inet.ip.forwarding 1
'''
ret = {}
cmd = 'sysctl {0}="{1}"'.format(name, value)
data = __salt__['cmd.run_all'](cmd)
# Certain values c... | python | def assign(name, value):
'''
Assign a single sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.assign net.inet.ip.forwarding 1
'''
ret = {}
cmd = 'sysctl {0}="{1}"'.format(name, value)
data = __salt__['cmd.run_all'](cmd)
# Certain values c... | [
"def",
"assign",
"(",
"name",
",",
"value",
")",
":",
"ret",
"=",
"{",
"}",
"cmd",
"=",
"'sysctl {0}=\"{1}\"'",
".",
"format",
"(",
"name",
",",
"value",
")",
"data",
"=",
"__salt__",
"[",
"'cmd.run_all'",
"]",
"(",
"cmd",
")",
"# Certain values cannot b... | Assign a single sysctl parameter for this minion
CLI Example:
.. code-block:: bash
salt '*' sysctl.assign net.inet.ip.forwarding 1 | [
"Assign",
"a",
"single",
"sysctl",
"parameter",
"for",
"this",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/openbsd_sysctl.py#L66-L89 | train |
saltstack/salt | salt/runners/asam.py | _get_asam_configuration | def _get_asam_configuration(driver_url=''):
'''
Return the configuration read from the master configuration
file or directory
'''
asam_config = __opts__['asam'] if 'asam' in __opts__ else None
if asam_config:
try:
for asam_server, service_config in six.iteritems(asam_config)... | python | def _get_asam_configuration(driver_url=''):
'''
Return the configuration read from the master configuration
file or directory
'''
asam_config = __opts__['asam'] if 'asam' in __opts__ else None
if asam_config:
try:
for asam_server, service_config in six.iteritems(asam_config)... | [
"def",
"_get_asam_configuration",
"(",
"driver_url",
"=",
"''",
")",
":",
"asam_config",
"=",
"__opts__",
"[",
"'asam'",
"]",
"if",
"'asam'",
"in",
"__opts__",
"else",
"None",
"if",
"asam_config",
":",
"try",
":",
"for",
"asam_server",
",",
"service_config",
... | Return the configuration read from the master configuration
file or directory | [
"Return",
"the",
"configuration",
"read",
"from",
"the",
"master",
"configuration",
"file",
"or",
"directory"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/asam.py#L77-L121 | train |
saltstack/salt | salt/runners/asam.py | remove_platform | def remove_platform(name, server_url):
'''
To remove specified ASAM platform from the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.remove_platform my-test-vm prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return Fa... | python | def remove_platform(name, server_url):
'''
To remove specified ASAM platform from the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.remove_platform my-test-vm prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return Fa... | [
"def",
"remove_platform",
"(",
"name",
",",
"server_url",
")",
":",
"config",
"=",
"_get_asam_configuration",
"(",
"server_url",
")",
"if",
"not",
"config",
":",
"return",
"False",
"url",
"=",
"config",
"[",
"'platform_config_url'",
"]",
"data",
"=",
"{",
"'... | To remove specified ASAM platform from the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.remove_platform my-test-vm prov1.domain.com | [
"To",
"remove",
"specified",
"ASAM",
"platform",
"from",
"the",
"Novell",
"Fan",
"-",
"Out",
"Driver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/asam.py#L178-L233 | train |
saltstack/salt | salt/runners/asam.py | list_platforms | def list_platforms(server_url):
'''
To list all ASAM platforms present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platforms prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return False
url = confi... | python | def list_platforms(server_url):
'''
To list all ASAM platforms present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platforms prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return False
url = confi... | [
"def",
"list_platforms",
"(",
"server_url",
")",
":",
"config",
"=",
"_get_asam_configuration",
"(",
"server_url",
")",
"if",
"not",
"config",
":",
"return",
"False",
"url",
"=",
"config",
"[",
"'platform_config_url'",
"]",
"data",
"=",
"{",
"'manual'",
":",
... | To list all ASAM platforms present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platforms prov1.domain.com | [
"To",
"list",
"all",
"ASAM",
"platforms",
"present",
"on",
"the",
"Novell",
"Fan",
"-",
"Out",
"Driver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/asam.py#L236-L274 | train |
saltstack/salt | salt/runners/asam.py | list_platform_sets | def list_platform_sets(server_url):
'''
To list all ASAM platform sets present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platform_sets prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return False
... | python | def list_platform_sets(server_url):
'''
To list all ASAM platform sets present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platform_sets prov1.domain.com
'''
config = _get_asam_configuration(server_url)
if not config:
return False
... | [
"def",
"list_platform_sets",
"(",
"server_url",
")",
":",
"config",
"=",
"_get_asam_configuration",
"(",
"server_url",
")",
"if",
"not",
"config",
":",
"return",
"False",
"url",
"=",
"config",
"[",
"'platformset_config_url'",
"]",
"data",
"=",
"{",
"'manual'",
... | To list all ASAM platform sets present on the Novell Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.list_platform_sets prov1.domain.com | [
"To",
"list",
"all",
"ASAM",
"platform",
"sets",
"present",
"on",
"the",
"Novell",
"Fan",
"-",
"Out",
"Driver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/asam.py#L277-L315 | train |
saltstack/salt | salt/runners/asam.py | add_platform | def add_platform(name, platform_set, server_url):
'''
To add an ASAM platform using the specified ASAM platform set on the Novell
Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.add_platform my-test-vm test-platform-set prov1.domain.com
'''
config = _get_asam_config... | python | def add_platform(name, platform_set, server_url):
'''
To add an ASAM platform using the specified ASAM platform set on the Novell
Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.add_platform my-test-vm test-platform-set prov1.domain.com
'''
config = _get_asam_config... | [
"def",
"add_platform",
"(",
"name",
",",
"platform_set",
",",
"server_url",
")",
":",
"config",
"=",
"_get_asam_configuration",
"(",
"server_url",
")",
"if",
"not",
"config",
":",
"return",
"False",
"platforms",
"=",
"list_platforms",
"(",
"server_url",
")",
"... | To add an ASAM platform using the specified ASAM platform set on the Novell
Fan-Out Driver
CLI Example:
.. code-block:: bash
salt-run asam.add_platform my-test-vm test-platform-set prov1.domain.com | [
"To",
"add",
"an",
"ASAM",
"platform",
"using",
"the",
"specified",
"ASAM",
"platform",
"set",
"on",
"the",
"Novell",
"Fan",
"-",
"Out",
"Driver"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/asam.py#L318-L368 | train |
saltstack/salt | salt/renderers/jinja.py | _split_module_dicts | def _split_module_dicts():
'''
Create a copy of __salt__ dictionary with module.function and module[function]
Takes advantage of Jinja's syntactic sugar lookup:
.. code-block::
{{ salt.cmd.run('uptime') }}
'''
if not isinstance(__salt__, dict):
return __salt__
mod_dict = d... | python | def _split_module_dicts():
'''
Create a copy of __salt__ dictionary with module.function and module[function]
Takes advantage of Jinja's syntactic sugar lookup:
.. code-block::
{{ salt.cmd.run('uptime') }}
'''
if not isinstance(__salt__, dict):
return __salt__
mod_dict = d... | [
"def",
"_split_module_dicts",
"(",
")",
":",
"if",
"not",
"isinstance",
"(",
"__salt__",
",",
"dict",
")",
":",
"return",
"__salt__",
"mod_dict",
"=",
"dict",
"(",
"__salt__",
")",
"for",
"module_func_name",
",",
"mod_fun",
"in",
"six",
".",
"iteritems",
"... | Create a copy of __salt__ dictionary with module.function and module[function]
Takes advantage of Jinja's syntactic sugar lookup:
.. code-block::
{{ salt.cmd.run('uptime') }} | [
"Create",
"a",
"copy",
"of",
"__salt__",
"dictionary",
"with",
"module",
".",
"function",
"and",
"module",
"[",
"function",
"]"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/jinja.py#L23-L42 | train |
saltstack/salt | salt/renderers/jinja.py | render | def render(template_file, saltenv='base', sls='', argline='',
context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string
'''
from_str = argline == '-s'
if not from_str and argl... | python | def render(template_file, saltenv='base', sls='', argline='',
context=None, tmplpath=None, **kws):
'''
Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string
'''
from_str = argline == '-s'
if not from_str and argl... | [
"def",
"render",
"(",
"template_file",
",",
"saltenv",
"=",
"'base'",
",",
"sls",
"=",
"''",
",",
"argline",
"=",
"''",
",",
"context",
"=",
"None",
",",
"tmplpath",
"=",
"None",
",",
"*",
"*",
"kws",
")",
":",
"from_str",
"=",
"argline",
"==",
"'-... | Render the template_file, passing the functions and grains into the
Jinja rendering system.
:rtype: string | [
"Render",
"the",
"template_file",
"passing",
"the",
"functions",
"and",
"grains",
"into",
"the",
"Jinja",
"rendering",
"system",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/renderers/jinja.py#L45-L77 | train |
saltstack/salt | salt/spm/pkgfiles/local.py | init | def init(**kwargs):
'''
Initialize the directories for the files
'''
formula_path = __opts__['formula_path']
pillar_path = __opts__['pillar_path']
reactor_path = __opts__['reactor_path']
for dir_ in (formula_path, pillar_path, reactor_path):
if not os.path.exists(dir_):
o... | python | def init(**kwargs):
'''
Initialize the directories for the files
'''
formula_path = __opts__['formula_path']
pillar_path = __opts__['pillar_path']
reactor_path = __opts__['reactor_path']
for dir_ in (formula_path, pillar_path, reactor_path):
if not os.path.exists(dir_):
o... | [
"def",
"init",
"(",
"*",
"*",
"kwargs",
")",
":",
"formula_path",
"=",
"__opts__",
"[",
"'formula_path'",
"]",
"pillar_path",
"=",
"__opts__",
"[",
"'pillar_path'",
"]",
"reactor_path",
"=",
"__opts__",
"[",
"'reactor_path'",
"]",
"for",
"dir_",
"in",
"(",
... | Initialize the directories for the files | [
"Initialize",
"the",
"directories",
"for",
"the",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgfiles/local.py#L34-L48 | train |
saltstack/salt | salt/spm/pkgfiles/local.py | check_existing | def check_existing(package, pkg_files, formula_def, conn=None):
'''
Check the filesystem for existing files
'''
if conn is None:
conn = init()
node_type = six.text_type(__opts__.get('spm_node_type'))
existing_files = []
for member in pkg_files:
if member.isdir():
... | python | def check_existing(package, pkg_files, formula_def, conn=None):
'''
Check the filesystem for existing files
'''
if conn is None:
conn = init()
node_type = six.text_type(__opts__.get('spm_node_type'))
existing_files = []
for member in pkg_files:
if member.isdir():
... | [
"def",
"check_existing",
"(",
"package",
",",
"pkg_files",
",",
"formula_def",
",",
"conn",
"=",
"None",
")",
":",
"if",
"conn",
"is",
"None",
":",
"conn",
"=",
"init",
"(",
")",
"node_type",
"=",
"six",
".",
"text_type",
"(",
"__opts__",
".",
"get",
... | Check the filesystem for existing files | [
"Check",
"the",
"filesystem",
"for",
"existing",
"files"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgfiles/local.py#L51-L100 | train |
saltstack/salt | salt/spm/pkgfiles/local.py | install_file | def install_file(package, formula_tar, member, formula_def, conn=None):
'''
Install a single file to the file system
'''
if member.name == package:
return False
if conn is None:
conn = init()
node_type = six.text_type(__opts__.get('spm_node_type'))
out_path = conn['formula... | python | def install_file(package, formula_tar, member, formula_def, conn=None):
'''
Install a single file to the file system
'''
if member.name == package:
return False
if conn is None:
conn = init()
node_type = six.text_type(__opts__.get('spm_node_type'))
out_path = conn['formula... | [
"def",
"install_file",
"(",
"package",
",",
"formula_tar",
",",
"member",
",",
"formula_def",
",",
"conn",
"=",
"None",
")",
":",
"if",
"member",
".",
"name",
"==",
"package",
":",
"return",
"False",
"if",
"conn",
"is",
"None",
":",
"conn",
"=",
"init"... | Install a single file to the file system | [
"Install",
"a",
"single",
"file",
"to",
"the",
"file",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgfiles/local.py#L103-L169 | train |
saltstack/salt | salt/spm/pkgfiles/local.py | remove_file | def remove_file(path, conn=None):
'''
Remove a single file from the file system
'''
if conn is None:
conn = init()
log.debug('Removing package file %s', path)
os.remove(path) | python | def remove_file(path, conn=None):
'''
Remove a single file from the file system
'''
if conn is None:
conn = init()
log.debug('Removing package file %s', path)
os.remove(path) | [
"def",
"remove_file",
"(",
"path",
",",
"conn",
"=",
"None",
")",
":",
"if",
"conn",
"is",
"None",
":",
"conn",
"=",
"init",
"(",
")",
"log",
".",
"debug",
"(",
"'Removing package file %s'",
",",
"path",
")",
"os",
".",
"remove",
"(",
"path",
")"
] | Remove a single file from the file system | [
"Remove",
"a",
"single",
"file",
"from",
"the",
"file",
"system"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgfiles/local.py#L172-L180 | train |
saltstack/salt | salt/spm/pkgfiles/local.py | hash_file | def hash_file(path, hashobj, conn=None):
'''
Get the hexdigest hash value of a file
'''
if os.path.isdir(path):
return ''
with salt.utils.files.fopen(path, 'r') as f:
hashobj.update(salt.utils.stringutils.to_bytes(f.read()))
return hashobj.hexdigest() | python | def hash_file(path, hashobj, conn=None):
'''
Get the hexdigest hash value of a file
'''
if os.path.isdir(path):
return ''
with salt.utils.files.fopen(path, 'r') as f:
hashobj.update(salt.utils.stringutils.to_bytes(f.read()))
return hashobj.hexdigest() | [
"def",
"hash_file",
"(",
"path",
",",
"hashobj",
",",
"conn",
"=",
"None",
")",
":",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"path",
")",
":",
"return",
"''",
"with",
"salt",
".",
"utils",
".",
"files",
".",
"fopen",
"(",
"path",
",",
"'r'",
... | Get the hexdigest hash value of a file | [
"Get",
"the",
"hexdigest",
"hash",
"value",
"of",
"a",
"file"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/spm/pkgfiles/local.py#L183-L192 | train |
saltstack/salt | salt/states/win_lgpo.py | set_ | def set_(name,
setting=None,
policy_class=None,
computer_policy=None,
user_policy=None,
cumulative_rights_assignments=True,
adml_language='en-US'):
'''
Ensure the specified policy is set
name
the name of a single policy to configure
setting... | python | def set_(name,
setting=None,
policy_class=None,
computer_policy=None,
user_policy=None,
cumulative_rights_assignments=True,
adml_language='en-US'):
'''
Ensure the specified policy is set
name
the name of a single policy to configure
setting... | [
"def",
"set_",
"(",
"name",
",",
"setting",
"=",
"None",
",",
"policy_class",
"=",
"None",
",",
"computer_policy",
"=",
"None",
",",
"user_policy",
"=",
"None",
",",
"cumulative_rights_assignments",
"=",
"True",
",",
"adml_language",
"=",
"'en-US'",
")",
":"... | Ensure the specified policy is set
name
the name of a single policy to configure
setting
the configuration setting for the single named policy
if this argument is used the computer_policy/user_policy arguments will be ignored
policy_class
the policy class of the single nam... | [
"Ensure",
"the",
"specified",
"policy",
"is",
"set"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/win_lgpo.py#L130-L361 | train |
saltstack/salt | salt/utils/value.py | xor | def xor(*variables):
'''
XOR definition for multiple variables
'''
sum_ = False
for value in variables:
sum_ = sum_ ^ bool(value)
return sum_ | python | def xor(*variables):
'''
XOR definition for multiple variables
'''
sum_ = False
for value in variables:
sum_ = sum_ ^ bool(value)
return sum_ | [
"def",
"xor",
"(",
"*",
"variables",
")",
":",
"sum_",
"=",
"False",
"for",
"value",
"in",
"variables",
":",
"sum_",
"=",
"sum_",
"^",
"bool",
"(",
"value",
")",
"return",
"sum_"
] | XOR definition for multiple variables | [
"XOR",
"definition",
"for",
"multiple",
"variables"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/value.py#L12-L19 | train |
saltstack/salt | salt/modules/win_disk.py | usage | def usage():
'''
Return usage information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.usage
'''
drives = []
ret = {}
drive_bitmask = ctypes.windll.kernel32.GetLogicalDrives()
for letter in UPPERCASE:
if drive_bitmask & 1:
... | python | def usage():
'''
Return usage information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.usage
'''
drives = []
ret = {}
drive_bitmask = ctypes.windll.kernel32.GetLogicalDrives()
for letter in UPPERCASE:
if drive_bitmask & 1:
... | [
"def",
"usage",
"(",
")",
":",
"drives",
"=",
"[",
"]",
"ret",
"=",
"{",
"}",
"drive_bitmask",
"=",
"ctypes",
".",
"windll",
".",
"kernel32",
".",
"GetLogicalDrives",
"(",
")",
"for",
"letter",
"in",
"UPPERCASE",
":",
"if",
"drive_bitmask",
"&",
"1",
... | Return usage information for volumes mounted on this minion
CLI Example:
.. code-block:: bash
salt '*' disk.usage | [
"Return",
"usage",
"information",
"for",
"volumes",
"mounted",
"on",
"this",
"minion"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/win_disk.py#L43-L84 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _convert_datetime_str | def _convert_datetime_str(response):
'''
modify any key-value pair where value is a datetime object to a string.
'''
if response:
return dict([(k, '{0}'.format(v)) if isinstance(v, datetime.date) else (k, v) for k, v in six.iteritems(response)])
return None | python | def _convert_datetime_str(response):
'''
modify any key-value pair where value is a datetime object to a string.
'''
if response:
return dict([(k, '{0}'.format(v)) if isinstance(v, datetime.date) else (k, v) for k, v in six.iteritems(response)])
return None | [
"def",
"_convert_datetime_str",
"(",
"response",
")",
":",
"if",
"response",
":",
"return",
"dict",
"(",
"[",
"(",
"k",
",",
"'{0}'",
".",
"format",
"(",
"v",
")",
")",
"if",
"isinstance",
"(",
"v",
",",
"datetime",
".",
"date",
")",
"else",
"(",
"... | modify any key-value pair where value is a datetime object to a string. | [
"modify",
"any",
"key",
"-",
"value",
"pair",
"where",
"value",
"is",
"a",
"datetime",
"object",
"to",
"a",
"string",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L133-L139 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _multi_call | def _multi_call(function, contentkey, *args, **kwargs):
'''
Retrieve full list of values for the contentkey from a boto3 ApiGateway
client function that may be paged via 'position'
'''
ret = function(*args, **kwargs)
position = ret.get('position')
while position:
more = function(*ar... | python | def _multi_call(function, contentkey, *args, **kwargs):
'''
Retrieve full list of values for the contentkey from a boto3 ApiGateway
client function that may be paged via 'position'
'''
ret = function(*args, **kwargs)
position = ret.get('position')
while position:
more = function(*ar... | [
"def",
"_multi_call",
"(",
"function",
",",
"contentkey",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"ret",
"=",
"function",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"position",
"=",
"ret",
".",
"get",
"(",
"'position'",
")",
"whil... | Retrieve full list of values for the contentkey from a boto3 ApiGateway
client function that may be paged via 'position' | [
"Retrieve",
"full",
"list",
"of",
"values",
"for",
"the",
"contentkey",
"from",
"a",
"boto3",
"ApiGateway",
"client",
"function",
"that",
"may",
"be",
"paged",
"via",
"position"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L156-L168 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _find_apis_by_name | def _find_apis_by_name(name, description=None,
region=None, key=None, keyid=None, profile=None):
'''
get and return list of matching rest api information by the given name and desc.
If rest api name evaluates to False, return all apis w/o filtering the name.
'''
try:
c... | python | def _find_apis_by_name(name, description=None,
region=None, key=None, keyid=None, profile=None):
'''
get and return list of matching rest api information by the given name and desc.
If rest api name evaluates to False, return all apis w/o filtering the name.
'''
try:
c... | [
"def",
"_find_apis_by_name",
"(",
"name",
",",
"description",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"="... | get and return list of matching rest api information by the given name and desc.
If rest api name evaluates to False, return all apis w/o filtering the name. | [
"get",
"and",
"return",
"list",
"of",
"matching",
"rest",
"api",
"information",
"by",
"the",
"given",
"name",
"and",
"desc",
".",
"If",
"rest",
"api",
"name",
"evaluates",
"to",
"False",
"return",
"all",
"apis",
"w",
"/",
"o",
"filtering",
"the",
"name",... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L171-L186 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_apis | def describe_apis(name=None, description=None, region=None, key=None, keyid=None, profile=None):
'''
Returns all rest apis in the defined region. If optional parameter name is included,
returns all rest apis matching the name in the defined region.
CLI Example:
.. code-block:: bash
salt ... | python | def describe_apis(name=None, description=None, region=None, key=None, keyid=None, profile=None):
'''
Returns all rest apis in the defined region. If optional parameter name is included,
returns all rest apis matching the name in the defined region.
CLI Example:
.. code-block:: bash
salt ... | [
"def",
"describe_apis",
"(",
"name",
"=",
"None",
",",
"description",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"name",
":",
"return",
"_find_apis_by_name",... | Returns all rest apis in the defined region. If optional parameter name is included,
returns all rest apis matching the name in the defined region.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_apis
salt myminion boto_apigateway.describe_apis name='api name'
... | [
"Returns",
"all",
"rest",
"apis",
"in",
"the",
"defined",
"region",
".",
"If",
"optional",
"parameter",
"name",
"is",
"included",
"returns",
"all",
"rest",
"apis",
"matching",
"the",
"name",
"in",
"the",
"defined",
"region",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L189-L211 | train |
saltstack/salt | salt/modules/boto_apigateway.py | api_exists | def api_exists(name, description=None, region=None, key=None, keyid=None, profile=None):
'''
Check to see if the given Rest API Name and optionally description exists.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.exists myapi_name
'''
apis = _find_apis_by_name(name... | python | def api_exists(name, description=None, region=None, key=None, keyid=None, profile=None):
'''
Check to see if the given Rest API Name and optionally description exists.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.exists myapi_name
'''
apis = _find_apis_by_name(name... | [
"def",
"api_exists",
"(",
"name",
",",
"description",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"apis",
"=",
"_find_apis_by_name",
"(",
"name",
",",
"description"... | Check to see if the given Rest API Name and optionally description exists.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.exists myapi_name | [
"Check",
"to",
"see",
"if",
"the",
"given",
"Rest",
"API",
"Name",
"and",
"optionally",
"description",
"exists",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L214-L227 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api | def create_api(name, description, cloneFrom=None,
region=None, key=None, keyid=None, profile=None):
'''
Create a new REST API Service with the given name
Returns {created: True} if the rest api was created and returns
{created: False} if the rest api was not created.
CLI Example:
... | python | def create_api(name, description, cloneFrom=None,
region=None, key=None, keyid=None, profile=None):
'''
Create a new REST API Service with the given name
Returns {created: True} if the rest api was created and returns
{created: False} if the rest api was not created.
CLI Example:
... | [
"def",
"create_api",
"(",
"name",
",",
"description",
",",
"cloneFrom",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"... | Create a new REST API Service with the given name
Returns {created: True} if the rest api was created and returns
{created: False} if the rest api was not created.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api myapi_name api_description | [
"Create",
"a",
"new",
"REST",
"API",
"Service",
"with",
"the",
"given",
"name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L230-L254 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api | def delete_api(name, description=None, region=None, key=None, keyid=None, profile=None):
'''
Delete all REST API Service with the given name and an optional API description
Returns {deleted: True, count: deleted_count} if apis were deleted, and
returns {deleted: False} if error or not found.
CLI E... | python | def delete_api(name, description=None, region=None, key=None, keyid=None, profile=None):
'''
Delete all REST API Service with the given name and an optional API description
Returns {deleted: True, count: deleted_count} if apis were deleted, and
returns {deleted: False} if error or not found.
CLI E... | [
"def",
"delete_api",
"(",
"name",
",",
"description",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn_params",
"=",
"dict",
"(",
"region",
"=",
"r... | Delete all REST API Service with the given name and an optional API description
Returns {deleted: True, count: deleted_count} if apis were deleted, and
returns {deleted: False} if error or not found.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api myapi_name
... | [
"Delete",
"all",
"REST",
"API",
"Service",
"with",
"the",
"given",
"name",
"and",
"an",
"optional",
"API",
"description"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L257-L285 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_resources | def describe_api_resources(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, return all resources for this api.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_resources myapi_id
'''
try:
conn = _get_conn(region=r... | python | def describe_api_resources(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, return all resources for this api.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_resources myapi_id
'''
try:
conn = _get_conn(region=r... | [
"def",
"describe_api_resources",
"(",
"restApiId",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
... | Given rest api id, return all resources for this api.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_resources myapi_id | [
"Given",
"rest",
"api",
"id",
"return",
"all",
"resources",
"for",
"this",
"api",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L288-L306 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_resource | def describe_api_resource(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, and an absolute resource path, returns the resource id for
the given path.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe... | python | def describe_api_resource(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, and an absolute resource path, returns the resource id for
the given path.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe... | [
"def",
"describe_api_resource",
"(",
"restApiId",
",",
"path",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"r",
"=",
"describe_api_resources",
"(",
"restApiId",
",",
"region",
"="... | Given rest api id, and an absolute resource path, returns the resource id for
the given path.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_resource myapi_id resource_path | [
"Given",
"rest",
"api",
"id",
"and",
"an",
"absolute",
"resource",
"path",
"returns",
"the",
"resource",
"id",
"for",
"the",
"given",
"path",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L309-L329 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_resources | def create_api_resources(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, and an absolute resource path, create all the resources and
return all resources in the resourcepath, returns False on failure.
CLI Example:
.. code-block:: b... | python | def create_api_resources(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given rest api id, and an absolute resource path, create all the resources and
return all resources in the resourcepath, returns False on failure.
CLI Example:
.. code-block:: b... | [
"def",
"create_api_resources",
"(",
"restApiId",
",",
"path",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"path_parts",
"=",
"path",
".",
"split",
"(",
"'/'",
")",
"created",
... | Given rest api id, and an absolute resource path, create all the resources and
return all resources in the resourcepath, returns False on failure.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_resources myapi_id resource_path | [
"Given",
"rest",
"api",
"id",
"and",
"an",
"absolute",
"resource",
"path",
"create",
"all",
"the",
"resources",
"and",
"return",
"all",
"resources",
"in",
"the",
"resourcepath",
"returns",
"False",
"on",
"failure",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L332-L367 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api_resources | def delete_api_resources(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given restApiId and an absolute resource path, delete the resources starting
from the absolute resource path. If resourcepath is the root resource '/',
the function will return False.... | python | def delete_api_resources(restApiId, path,
region=None, key=None, keyid=None, profile=None):
'''
Given restApiId and an absolute resource path, delete the resources starting
from the absolute resource path. If resourcepath is the root resource '/',
the function will return False.... | [
"def",
"delete_api_resources",
"(",
"restApiId",
",",
"path",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"if",
"path",
"==",
"'/'",
":",
"return",
"{",
"'deleted'",
":",
"Fal... | Given restApiId and an absolute resource path, delete the resources starting
from the absolute resource path. If resourcepath is the root resource '/',
the function will return False. Returns False on failure.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_resource... | [
"Given",
"restApiId",
"and",
"an",
"absolute",
"resource",
"path",
"delete",
"the",
"resources",
"starting",
"from",
"the",
"absolute",
"resource",
"path",
".",
"If",
"resourcepath",
"is",
"the",
"root",
"resource",
"/",
"the",
"function",
"will",
"return",
"F... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L370-L396 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_key | def describe_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
Gets info about the given api key
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_key apigw_api_key
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, p... | python | def describe_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
Gets info about the given api key
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_key apigw_api_key
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, p... | [
"def",
"describe_api_key",
"(",
"apiKey",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"k... | Gets info about the given api key
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_key apigw_api_key | [
"Gets",
"info",
"about",
"the",
"given",
"api",
"key"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L427-L443 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_keys | def describe_api_keys(region=None, key=None, keyid=None, profile=None):
'''
Gets information about the defined API Keys. Return list of apiKeys.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_keys
'''
try:
conn = _get_conn(region=region, key=key... | python | def describe_api_keys(region=None, key=None, keyid=None, profile=None):
'''
Gets information about the defined API Keys. Return list of apiKeys.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_keys
'''
try:
conn = _get_conn(region=region, key=key... | [
"def",
"describe_api_keys",
"(",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key",
",",
"key... | Gets information about the defined API Keys. Return list of apiKeys.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_keys | [
"Gets",
"information",
"about",
"the",
"defined",
"API",
"Keys",
".",
"Return",
"list",
"of",
"apiKeys",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L446-L463 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_key | def create_api_key(name, description, enabled=True, stageKeys=None,
region=None, key=None, keyid=None, profile=None):
'''
Create an API key given name and description.
An optional enabled argument can be provided. If provided, the
valid values are True|False. This argument defaults... | python | def create_api_key(name, description, enabled=True, stageKeys=None,
region=None, key=None, keyid=None, profile=None):
'''
Create an API key given name and description.
An optional enabled argument can be provided. If provided, the
valid values are True|False. This argument defaults... | [
"def",
"create_api_key",
"(",
"name",
",",
"description",
",",
"enabled",
"=",
"True",
",",
"stageKeys",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
... | Create an API key given name and description.
An optional enabled argument can be provided. If provided, the
valid values are True|False. This argument defaults to True.
An optional stageKeys argument can be provided in the form of
list of dictionary with 'restApiId' and 'stageName' as keys.
CL... | [
"Create",
"an",
"API",
"key",
"given",
"name",
"and",
"description",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L466-L501 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api_key | def delete_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
Deletes a given apiKey
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_key apikeystring
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | python | def delete_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
Deletes a given apiKey
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_key apikeystring
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | [
"def",
"delete_api_key",
"(",
"apiKey",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key... | Deletes a given apiKey
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_key apikeystring | [
"Deletes",
"a",
"given",
"apiKey"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L504-L520 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _api_key_patch_replace | def _api_key_patch_replace(conn, apiKey, path, value):
'''
the replace patch operation on an ApiKey resource
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=[{'op': 'replace', 'path': path, 'value': value}])
return response | python | def _api_key_patch_replace(conn, apiKey, path, value):
'''
the replace patch operation on an ApiKey resource
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=[{'op': 'replace', 'path': path, 'value': value}])
return response | [
"def",
"_api_key_patch_replace",
"(",
"conn",
",",
"apiKey",
",",
"path",
",",
"value",
")",
":",
"response",
"=",
"conn",
".",
"update_api_key",
"(",
"apiKey",
"=",
"apiKey",
",",
"patchOperations",
"=",
"[",
"{",
"'op'",
":",
"'replace'",
",",
"'path'",
... | the replace patch operation on an ApiKey resource | [
"the",
"replace",
"patch",
"operation",
"on",
"an",
"ApiKey",
"resource"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L523-L529 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _api_key_patch_add | def _api_key_patch_add(conn, apiKey, pvlist):
'''
the add patch operation for a list of (path, value) tuples on an ApiKey resource list path
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=_api_key_patchops('add', pvlist))
return response | python | def _api_key_patch_add(conn, apiKey, pvlist):
'''
the add patch operation for a list of (path, value) tuples on an ApiKey resource list path
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=_api_key_patchops('add', pvlist))
return response | [
"def",
"_api_key_patch_add",
"(",
"conn",
",",
"apiKey",
",",
"pvlist",
")",
":",
"response",
"=",
"conn",
".",
"update_api_key",
"(",
"apiKey",
"=",
"apiKey",
",",
"patchOperations",
"=",
"_api_key_patchops",
"(",
"'add'",
",",
"pvlist",
")",
")",
"return",... | the add patch operation for a list of (path, value) tuples on an ApiKey resource list path | [
"the",
"add",
"patch",
"operation",
"for",
"a",
"list",
"of",
"(",
"path",
"value",
")",
"tuples",
"on",
"an",
"ApiKey",
"resource",
"list",
"path"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L539-L545 | train |
saltstack/salt | salt/modules/boto_apigateway.py | _api_key_patch_remove | def _api_key_patch_remove(conn, apiKey, pvlist):
'''
the remove patch operation for a list of (path, value) tuples on an ApiKey resource list path
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=_api_key_patchops('remove', pvlist))
return response | python | def _api_key_patch_remove(conn, apiKey, pvlist):
'''
the remove patch operation for a list of (path, value) tuples on an ApiKey resource list path
'''
response = conn.update_api_key(apiKey=apiKey,
patchOperations=_api_key_patchops('remove', pvlist))
return response | [
"def",
"_api_key_patch_remove",
"(",
"conn",
",",
"apiKey",
",",
"pvlist",
")",
":",
"response",
"=",
"conn",
".",
"update_api_key",
"(",
"apiKey",
"=",
"apiKey",
",",
"patchOperations",
"=",
"_api_key_patchops",
"(",
"'remove'",
",",
"pvlist",
")",
")",
"re... | the remove patch operation for a list of (path, value) tuples on an ApiKey resource list path | [
"the",
"remove",
"patch",
"operation",
"for",
"a",
"list",
"of",
"(",
"path",
"value",
")",
"tuples",
"on",
"an",
"ApiKey",
"resource",
"list",
"path"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L548-L554 | train |
saltstack/salt | salt/modules/boto_apigateway.py | update_api_key_description | def update_api_key_description(apiKey, description, region=None, key=None, keyid=None, profile=None):
'''
update the given apiKey with the given description.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_key_description api_key description
'''
try:
... | python | def update_api_key_description(apiKey, description, region=None, key=None, keyid=None, profile=None):
'''
update the given apiKey with the given description.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_key_description api_key description
'''
try:
... | [
"def",
"update_api_key_description",
"(",
"apiKey",
",",
"description",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"re... | update the given apiKey with the given description.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.update_api_key_description api_key description | [
"update",
"the",
"given",
"apiKey",
"with",
"the",
"given",
"description",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L557-L573 | train |
saltstack/salt | salt/modules/boto_apigateway.py | enable_api_key | def enable_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
enable the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.enable_api_key api_key
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | python | def enable_api_key(apiKey, region=None, key=None, keyid=None, profile=None):
'''
enable the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.enable_api_key api_key
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
... | [
"def",
"enable_api_key",
"(",
"apiKey",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"=",
"key... | enable the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.enable_api_key api_key | [
"enable",
"the",
"given",
"apiKey",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L576-L592 | train |
saltstack/salt | salt/modules/boto_apigateway.py | associate_api_key_stagekeys | def associate_api_key_stagekeys(apiKey, stagekeyslist, region=None, key=None, keyid=None, profile=None):
'''
associate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.associate_stagekeys_api_key \\
api_key '["restapi... | python | def associate_api_key_stagekeys(apiKey, stagekeyslist, region=None, key=None, keyid=None, profile=None):
'''
associate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.associate_stagekeys_api_key \\
api_key '["restapi... | [
"def",
"associate_api_key_stagekeys",
"(",
"apiKey",
",",
"stagekeyslist",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
... | associate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.associate_stagekeys_api_key \\
api_key '["restapi id/stage name", ...]' | [
"associate",
"the",
"given",
"stagekeyslist",
"to",
"the",
"given",
"apiKey",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L614-L632 | train |
saltstack/salt | salt/modules/boto_apigateway.py | disassociate_api_key_stagekeys | def disassociate_api_key_stagekeys(apiKey, stagekeyslist, region=None, key=None, keyid=None, profile=None):
'''
disassociate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.disassociate_stagekeys_api_key \\
api_key '... | python | def disassociate_api_key_stagekeys(apiKey, stagekeyslist, region=None, key=None, keyid=None, profile=None):
'''
disassociate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.disassociate_stagekeys_api_key \\
api_key '... | [
"def",
"disassociate_api_key_stagekeys",
"(",
"apiKey",
",",
"stagekeyslist",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",... | disassociate the given stagekeyslist to the given apiKey.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.disassociate_stagekeys_api_key \\
api_key '["restapi id/stage name", ...]' | [
"disassociate",
"the",
"given",
"stagekeyslist",
"to",
"the",
"given",
"apiKey",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L635-L653 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_deployments | def describe_api_deployments(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Gets information about the defined API Deployments. Return list of api deployments.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployments restApiId
'''
tr... | python | def describe_api_deployments(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Gets information about the defined API Deployments. Return list of api deployments.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployments restApiId
'''
tr... | [
"def",
"describe_api_deployments",
"(",
"restApiId",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
... | Gets information about the defined API Deployments. Return list of api deployments.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployments restApiId | [
"Gets",
"information",
"about",
"the",
"defined",
"API",
"Deployments",
".",
"Return",
"list",
"of",
"api",
"deployments",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L656-L681 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_deployment | def describe_api_deployment(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Get API deployment for a given restApiId and deploymentId.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployent restApiId deploymentId
'''
try:... | python | def describe_api_deployment(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Get API deployment for a given restApiId and deploymentId.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployent restApiId deploymentId
'''
try:... | [
"def",
"describe_api_deployment",
"(",
"restApiId",
",",
"deploymentId",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"r... | Get API deployment for a given restApiId and deploymentId.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_deployent restApiId deploymentId | [
"Get",
"API",
"deployment",
"for",
"a",
"given",
"restApiId",
"and",
"deploymentId",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L684-L700 | train |
saltstack/salt | salt/modules/boto_apigateway.py | activate_api_deployment | def activate_api_deployment(restApiId, stageName, deploymentId,
region=None, key=None, keyid=None, profile=None):
'''
Activates previously deployed deployment for a given stage
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.activate_api_deployent r... | python | def activate_api_deployment(restApiId, stageName, deploymentId,
region=None, key=None, keyid=None, profile=None):
'''
Activates previously deployed deployment for a given stage
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.activate_api_deployent r... | [
"def",
"activate_api_deployment",
"(",
"restApiId",
",",
"stageName",
",",
"deploymentId",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
... | Activates previously deployed deployment for a given stage
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.activate_api_deployent restApiId stagename deploymentId | [
"Activates",
"previously",
"deployed",
"deployment",
"for",
"a",
"given",
"stage"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L703-L723 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_deployment | def create_api_deployment(restApiId, stageName, stageDescription='', description='', cacheClusterEnabled=False,
cacheClusterSize='0.5', variables=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates a new API deployment.
CLI Example:
.... | python | def create_api_deployment(restApiId, stageName, stageDescription='', description='', cacheClusterEnabled=False,
cacheClusterSize='0.5', variables=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates a new API deployment.
CLI Example:
.... | [
"def",
"create_api_deployment",
"(",
"restApiId",
",",
"stageName",
",",
"stageDescription",
"=",
"''",
",",
"description",
"=",
"''",
",",
"cacheClusterEnabled",
"=",
"False",
",",
"cacheClusterSize",
"=",
"'0.5'",
",",
"variables",
"=",
"None",
",",
"region",
... | Creates a new API deployment.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_deployent restApiId stagename stageDescription='' \\
description='' cacheClusterEnabled=True|False cacheClusterSize=0.5 variables='{"name": "value"}' | [
"Creates",
"a",
"new",
"API",
"deployment",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L726-L750 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api_deployment | def delete_api_deployment(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Deletes API deployment for a given restApiId and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_deployent restApiId deploymentId
'''
try:
... | python | def delete_api_deployment(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Deletes API deployment for a given restApiId and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_deployent restApiId deploymentId
'''
try:
... | [
"def",
"delete_api_deployment",
"(",
"restApiId",
",",
"deploymentId",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"reg... | Deletes API deployment for a given restApiId and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_deployent restApiId deploymentId | [
"Deletes",
"API",
"deployment",
"for",
"a",
"given",
"restApiId",
"and",
"deploymentID"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L753-L769 | train |
saltstack/salt | salt/modules/boto_apigateway.py | overwrite_api_stage_variables | def overwrite_api_stage_variables(restApiId, stageName, variables, region=None, key=None, keyid=None, profile=None):
'''
Overwrite the stage variables for the given restApiId and stage name with the given variables,
variables must be in the form of a dictionary. Overwrite will always remove all the existin... | python | def overwrite_api_stage_variables(restApiId, stageName, variables, region=None, key=None, keyid=None, profile=None):
'''
Overwrite the stage variables for the given restApiId and stage name with the given variables,
variables must be in the form of a dictionary. Overwrite will always remove all the existin... | [
"def",
"overwrite_api_stage_variables",
"(",
"restApiId",
",",
"stageName",
",",
"variables",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"res",
"=",
"describe_api_stage... | Overwrite the stage variables for the given restApiId and stage name with the given variables,
variables must be in the form of a dictionary. Overwrite will always remove all the existing
stage variables associated with the given restApiId and stage name, follow by the adding of all the
variables specified... | [
"Overwrite",
"the",
"stage",
"variables",
"for",
"the",
"given",
"restApiId",
"and",
"stage",
"name",
"with",
"the",
"given",
"variables",
"variables",
"must",
"be",
"in",
"the",
"form",
"of",
"a",
"dictionary",
".",
"Overwrite",
"will",
"always",
"remove",
... | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L772-L815 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_stage | def describe_api_stage(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Get API stage for a given apiID and stage name
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stage restApiId stageName
'''
try:
conn = _get_conn(r... | python | def describe_api_stage(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Get API stage for a given apiID and stage name
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stage restApiId stageName
'''
try:
conn = _get_conn(r... | [
"def",
"describe_api_stage",
"(",
"restApiId",
",",
"stageName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
... | Get API stage for a given apiID and stage name
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stage restApiId stageName | [
"Get",
"API",
"stage",
"for",
"a",
"given",
"apiID",
"and",
"stage",
"name"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L818-L834 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_stages | def describe_api_stages(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Get all API stages for a given apiID and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stages restApiId deploymentId
'''
try:
con... | python | def describe_api_stages(restApiId, deploymentId, region=None, key=None, keyid=None, profile=None):
'''
Get all API stages for a given apiID and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stages restApiId deploymentId
'''
try:
con... | [
"def",
"describe_api_stages",
"(",
"restApiId",
",",
"deploymentId",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"regio... | Get all API stages for a given apiID and deploymentID
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_stages restApiId deploymentId | [
"Get",
"all",
"API",
"stages",
"for",
"a",
"given",
"apiID",
"and",
"deploymentID"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L837-L853 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_stage | def create_api_stage(restApiId, stageName, deploymentId, description='',
cacheClusterEnabled=False, cacheClusterSize='0.5', variables=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates a new API stage for a given restApiId and deploymentId.
CLI Exa... | python | def create_api_stage(restApiId, stageName, deploymentId, description='',
cacheClusterEnabled=False, cacheClusterSize='0.5', variables=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates a new API stage for a given restApiId and deploymentId.
CLI Exa... | [
"def",
"create_api_stage",
"(",
"restApiId",
",",
"stageName",
",",
"deploymentId",
",",
"description",
"=",
"''",
",",
"cacheClusterEnabled",
"=",
"False",
",",
"cacheClusterSize",
"=",
"'0.5'",
",",
"variables",
"=",
"None",
",",
"region",
"=",
"None",
",",
... | Creates a new API stage for a given restApiId and deploymentId.
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_stage restApiId stagename deploymentId \\
description='' cacheClusterEnabled=True|False cacheClusterSize='0.5' variables='{"name": "value"}' | [
"Creates",
"a",
"new",
"API",
"stage",
"for",
"a",
"given",
"restApiId",
"and",
"deploymentId",
"."
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L856-L879 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api_stage | def delete_api_stage(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Deletes stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_stage restApiId stageName
'''
try:
... | python | def delete_api_stage(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Deletes stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_stage restApiId stageName
'''
try:
... | [
"def",
"delete_api_stage",
"(",
"restApiId",
",",
"stageName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
... | Deletes stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_stage restApiId stageName | [
"Deletes",
"stage",
"identified",
"by",
"stageName",
"from",
"API",
"identified",
"by",
"restApiId"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L882-L898 | train |
saltstack/salt | salt/modules/boto_apigateway.py | flush_api_stage_cache | def flush_api_stage_cache(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Flushes cache for the stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName
... | python | def flush_api_stage_cache(restApiId, stageName, region=None, key=None, keyid=None, profile=None):
'''
Flushes cache for the stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName
... | [
"def",
"flush_api_stage_cache",
"(",
"restApiId",
",",
"stageName",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region... | Flushes cache for the stage identified by stageName from API identified by restApiId
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.flush_api_stage_cache restApiId stageName | [
"Flushes",
"cache",
"for",
"the",
"stage",
"identified",
"by",
"stageName",
"from",
"API",
"identified",
"by",
"restApiId"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L901-L917 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_method | def create_api_method(restApiId, resourcePath, httpMethod, authorizationType,
apiKeyRequired=False, requestParameters=None, requestModels=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates API method for a resource in the given API
CLI Example:
... | python | def create_api_method(restApiId, resourcePath, httpMethod, authorizationType,
apiKeyRequired=False, requestParameters=None, requestModels=None,
region=None, key=None, keyid=None, profile=None):
'''
Creates API method for a resource in the given API
CLI Example:
... | [
"def",
"create_api_method",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"authorizationType",
",",
"apiKeyRequired",
"=",
"False",
",",
"requestParameters",
"=",
"None",
",",
"requestModels",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",... | Creates API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_method restApiId resourcePath, httpMethod, authorizationType, \\
apiKeyRequired=False, requestParameters='{"name", "value"}', requestModels='{"content-type", "valu... | [
"Creates",
"API",
"method",
"for",
"a",
"resource",
"in",
"the",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L920-L949 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_method | def describe_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Get API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod
'''
... | python | def describe_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Get API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod
'''
... | [
"def",
"describe_api_method",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"resource",
"=",
"describe_api_resour... | Get API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_method restApiId resourcePath httpMethod | [
"Get",
"API",
"method",
"for",
"a",
"resource",
"in",
"the",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L952-L972 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api_method | def delete_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Delete API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod
'''
t... | python | def delete_api_method(restApiId, resourcePath, httpMethod, region=None, key=None, keyid=None, profile=None):
'''
Delete API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod
'''
t... | [
"def",
"delete_api_method",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"resource",
"=",
"describe_api_resource... | Delete API method for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_method restApiId resourcePath httpMethod | [
"Delete",
"API",
"method",
"for",
"a",
"resource",
"in",
"the",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L975-L995 | train |
saltstack/salt | salt/modules/boto_apigateway.py | create_api_method_response | def create_api_method_response(restApiId, resourcePath, httpMethod, statusCode, responseParameters=None,
responseModels=None, region=None, key=None, keyid=None, profile=None):
'''
Create API method response for a method on a given resource in the given API
CLI Example:
.... | python | def create_api_method_response(restApiId, resourcePath, httpMethod, statusCode, responseParameters=None,
responseModels=None, region=None, key=None, keyid=None, profile=None):
'''
Create API method response for a method on a given resource in the given API
CLI Example:
.... | [
"def",
"create_api_method_response",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"statusCode",
",",
"responseParameters",
"=",
"None",
",",
"responseModels",
"=",
"None",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"="... | Create API method response for a method on a given resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.create_api_method_response restApiId resourcePath httpMethod \\
statusCode responseParameters='{"name", "True|False"}' responseModels='{"content-... | [
"Create",
"API",
"method",
"response",
"for",
"a",
"method",
"on",
"a",
"given",
"resource",
"in",
"the",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L998-L1025 | train |
saltstack/salt | salt/modules/boto_apigateway.py | delete_api_method_response | def delete_api_method_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Delete API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delet... | python | def delete_api_method_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Delete API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delet... | [
"def",
"delete_api_method_response",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"statusCode",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"resource",... | Delete API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.delete_api_method_response restApiId resourcePath httpMethod statusCode | [
"Delete",
"API",
"method",
"response",
"for",
"a",
"resource",
"in",
"the",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1028-L1050 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_method_response | def describe_api_method_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Get API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.desc... | python | def describe_api_method_response(restApiId, resourcePath, httpMethod, statusCode,
region=None, key=None, keyid=None, profile=None):
'''
Get API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.desc... | [
"def",
"describe_api_method_response",
"(",
"restApiId",
",",
"resourcePath",
",",
"httpMethod",
",",
"statusCode",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"resource... | Get API method response for a resource in the given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_method_response restApiId resourcePath httpMethod statusCode | [
"Get",
"API",
"method",
"response",
"for",
"a",
"resource",
"in",
"the",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1053-L1075 | train |
saltstack/salt | salt/modules/boto_apigateway.py | describe_api_models | def describe_api_models(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Get all models for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_models restApiId
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid,... | python | def describe_api_models(restApiId, region=None, key=None, keyid=None, profile=None):
'''
Get all models for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_models restApiId
'''
try:
conn = _get_conn(region=region, key=key, keyid=keyid,... | [
"def",
"describe_api_models",
"(",
"restApiId",
",",
"region",
"=",
"None",
",",
"key",
"=",
"None",
",",
"keyid",
"=",
"None",
",",
"profile",
"=",
"None",
")",
":",
"try",
":",
"conn",
"=",
"_get_conn",
"(",
"region",
"=",
"region",
",",
"key",
"="... | Get all models for a given API
CLI Example:
.. code-block:: bash
salt myminion boto_apigateway.describe_api_models restApiId | [
"Get",
"all",
"models",
"for",
"a",
"given",
"API"
] | e8541fd6e744ab0df786c0f76102e41631f45d46 | https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_apigateway.py#L1078-L1094 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.