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/states/keystone.py
_api_version
def _api_version(profile=None, **connection_args): ''' Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID depending on API version. ''' global _TENANT_ID global _OS_IDENTITY_API_VERSION try: if float(__salt__['keystone.api_version'](profile=profile, **connection_args).stri...
python
def _api_version(profile=None, **connection_args): ''' Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID depending on API version. ''' global _TENANT_ID global _OS_IDENTITY_API_VERSION try: if float(__salt__['keystone.api_version'](profile=profile, **connection_args).stri...
[ "def", "_api_version", "(", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "global", "_TENANT_ID", "global", "_OS_IDENTITY_API_VERSION", "try", ":", "if", "float", "(", "__salt__", "[", "'keystone.api_version'", "]", "(", "profile", "=", "...
Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID depending on API version.
[ "Sets", "global", "variables", "_OS_IDENTITY_API_VERSION", "and", "_TENANT_ID", "depending", "on", "API", "version", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L83-L95
train
saltstack/salt
salt/states/keystone.py
user_present
def user_present(name, password, email, tenant=None, enabled=True, roles=None, profile=None, password_reset=True, project=None, **connection_args): ''' Ensure ...
python
def user_present(name, password, email, tenant=None, enabled=True, roles=None, profile=None, password_reset=True, project=None, **connection_args): ''' Ensure ...
[ "def", "user_present", "(", "name", ",", "password", ",", "email", ",", "tenant", "=", "None", ",", "enabled", "=", "True", ",", "roles", "=", "None", ",", "profile", "=", "None", ",", "password_reset", "=", "True", ",", "project", "=", "None", ",", ...
Ensure that the keystone user is present with the specified properties. name The name of the user to manage password The password to use for this user. .. note:: If the user already exists and a different password was set for the user than the one specified he...
[ "Ensure", "that", "the", "keystone", "user", "is", "present", "with", "the", "specified", "properties", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L98-L298
train
saltstack/salt
salt/states/keystone.py
user_absent
def user_absent(name, profile=None, **connection_args): ''' Ensure that the keystone user is absent. name The name of the user that should not exist ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'User "{0}" is already absent'.format(name...
python
def user_absent(name, profile=None, **connection_args): ''' Ensure that the keystone user is absent. name The name of the user that should not exist ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'User "{0}" is already absent'.format(name...
[ "def", "user_absent", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'User \"{0}\" is ...
Ensure that the keystone user is absent. name The name of the user that should not exist
[ "Ensure", "that", "the", "keystone", "user", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L301-L327
train
saltstack/salt
salt/states/keystone.py
tenant_present
def tenant_present(name, description=None, enabled=True, profile=None, **connection_args): ''' Ensures that the keystone tenant exists name The name of the tenant to manage description The description to use for this tenant enabled Availability state for...
python
def tenant_present(name, description=None, enabled=True, profile=None, **connection_args): ''' Ensures that the keystone tenant exists name The name of the tenant to manage description The description to use for this tenant enabled Availability state for...
[ "def", "tenant_present", "(", "name", ",", "description", "=", "None", ",", "enabled", "=", "True", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",",...
Ensures that the keystone tenant exists name The name of the tenant to manage description The description to use for this tenant enabled Availability state for this tenant
[ "Ensures", "that", "the", "keystone", "tenant", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L330-L399
train
saltstack/salt
salt/states/keystone.py
tenant_absent
def tenant_absent(name, profile=None, **connection_args): ''' Ensure that the keystone tenant is absent. name The name of the tenant that should not exist ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Tenant / project "{0}" is already a...
python
def tenant_absent(name, profile=None, **connection_args): ''' Ensure that the keystone tenant is absent. name The name of the tenant that should not exist ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Tenant / project "{0}" is already a...
[ "def", "tenant_absent", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Tenant / proje...
Ensure that the keystone tenant is absent. name The name of the tenant that should not exist
[ "Ensure", "that", "the", "keystone", "tenant", "is", "absent", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L402-L429
train
saltstack/salt
salt/states/keystone.py
project_present
def project_present(name, description=None, enabled=True, profile=None, **connection_args): ''' Ensures that the keystone project exists Alias for tenant_present from V2 API to fulfill V3 API naming convention. .. versionadded:: 2016.11.0 name The name of the projec...
python
def project_present(name, description=None, enabled=True, profile=None, **connection_args): ''' Ensures that the keystone project exists Alias for tenant_present from V2 API to fulfill V3 API naming convention. .. versionadded:: 2016.11.0 name The name of the projec...
[ "def", "project_present", "(", "name", ",", "description", "=", "None", ",", "enabled", "=", "True", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "return", "tenant_present", "(", "name", ",", "description", "=", "description", "...
Ensures that the keystone project exists Alias for tenant_present from V2 API to fulfill V3 API naming convention. .. versionadded:: 2016.11.0 name The name of the project to manage description The description to use for this project enabled Availability state for thi...
[ "Ensures", "that", "the", "keystone", "project", "exists", "Alias", "for", "tenant_present", "from", "V2", "API", "to", "fulfill", "V3", "API", "naming", "convention", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L432-L460
train
saltstack/salt
salt/states/keystone.py
role_present
def role_present(name, profile=None, **connection_args): '''' Ensures that the keystone role exists name The name of the role that should be present ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Role "{0}" already exists'.format(name)} ...
python
def role_present(name, profile=None, **connection_args): '''' Ensures that the keystone role exists name The name of the role that should be present ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': 'Role "{0}" already exists'.format(name)} ...
[ "def", "role_present", "(", "name", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result'", ":", "True", ",", "'comment'", ":", "'Role \"{0}\" al...
Ensures that the keystone role exists name The name of the role that should be present
[ "Ensures", "that", "the", "keystone", "role", "exists" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L484-L512
train
saltstack/salt
salt/states/keystone.py
service_present
def service_present(name, service_type, description=None, profile=None, **connection_args): ''' Ensure service present in Keystone catalog name The name of the service service_type The type of Openstack Service description (optional) Description of the ...
python
def service_present(name, service_type, description=None, profile=None, **connection_args): ''' Ensure service present in Keystone catalog name The name of the service service_type The type of Openstack Service description (optional) Description of the ...
[ "def", "service_present", "(", "name", ",", "service_type", ",", "description", "=", "None", ",", "profile", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", "'result...
Ensure service present in Keystone catalog name The name of the service service_type The type of Openstack Service description (optional) Description of the service
[ "Ensure", "service", "present", "in", "Keystone", "catalog" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L544-L583
train
saltstack/salt
salt/states/keystone.py
endpoint_present
def endpoint_present(name, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args): ''' Ensure the s...
python
def endpoint_present(name, publicurl=None, internalurl=None, adminurl=None, region=None, profile=None, url=None, interface=None, **connection_args): ''' Ensure the s...
[ "def", "endpoint_present", "(", "name", ",", "publicurl", "=", "None", ",", "internalurl", "=", "None", ",", "adminurl", "=", "None", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "url", "=", "None", ",", "interface", "=", "None", ",", ...
Ensure the specified endpoints exists for service name The Service name publicurl The public url of service endpoint (for V2 API) internalurl The internal url of service endpoint (for V2 API) adminurl The admin url of the service endpoint (for V2 API) region ...
[ "Ensure", "the", "specified", "endpoints", "exists", "for", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L617-L771
train
saltstack/salt
salt/states/keystone.py
endpoint_absent
def endpoint_absent(name, region=None, profile=None, interface=None, **connection_args): ''' Ensure that the endpoint for a service doesn't exist in Keystone catalog name The name of the service whose endpoints should not exist region (optional) The region of the endpoint. Defaults to...
python
def endpoint_absent(name, region=None, profile=None, interface=None, **connection_args): ''' Ensure that the endpoint for a service doesn't exist in Keystone catalog name The name of the service whose endpoints should not exist region (optional) The region of the endpoint. Defaults to...
[ "def", "endpoint_absent", "(", "name", ",", "region", "=", "None", ",", "profile", "=", "None", ",", "interface", "=", "None", ",", "*", "*", "connection_args", ")", ":", "ret", "=", "{", "'name'", ":", "name", ",", "'changes'", ":", "{", "}", ",", ...
Ensure that the endpoint for a service doesn't exist in Keystone catalog name The name of the service whose endpoints should not exist region (optional) The region of the endpoint. Defaults to ``RegionOne``. interface The interface type, which describes the visibility of ...
[ "Ensure", "that", "the", "endpoint", "for", "a", "service", "doesn", "t", "exist", "in", "Keystone", "catalog" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/states/keystone.py#L774-L814
train
saltstack/salt
salt/modules/rh_service.py
_chkconfig_add
def _chkconfig_add(name): ''' Run 'chkconfig --add' for a service whose script is installed in /etc/init.d. The service is initially configured to be disabled at all run-levels. ''' cmd = '/sbin/chkconfig --add {0}'.format(name) if __salt__['cmd.retcode'](cmd, python_shell=False) == 0: ...
python
def _chkconfig_add(name): ''' Run 'chkconfig --add' for a service whose script is installed in /etc/init.d. The service is initially configured to be disabled at all run-levels. ''' cmd = '/sbin/chkconfig --add {0}'.format(name) if __salt__['cmd.retcode'](cmd, python_shell=False) == 0: ...
[ "def", "_chkconfig_add", "(", "name", ")", ":", "cmd", "=", "'/sbin/chkconfig --add {0}'", ".", "format", "(", "name", ")", "if", "__salt__", "[", "'cmd.retcode'", "]", "(", "cmd", ",", "python_shell", "=", "False", ")", "==", "0", ":", "log", ".", "info...
Run 'chkconfig --add' for a service whose script is installed in /etc/init.d. The service is initially configured to be disabled at all run-levels.
[ "Run", "chkconfig", "--", "add", "for", "a", "service", "whose", "script", "is", "installed", "in", "/", "etc", "/", "init", ".", "d", ".", "The", "service", "is", "initially", "configured", "to", "be", "disabled", "at", "all", "run", "-", "levels", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L126-L138
train
saltstack/salt
salt/modules/rh_service.py
_service_is_sysv
def _service_is_sysv(name): ''' Return True if the service is a System V service (includes those managed by chkconfig); otherwise return False. ''' try: # Look for user-execute bit in file mode. return bool(os.stat( os.path.join('/etc/init.d', name)).st_mode & stat.S_IXUS...
python
def _service_is_sysv(name): ''' Return True if the service is a System V service (includes those managed by chkconfig); otherwise return False. ''' try: # Look for user-execute bit in file mode. return bool(os.stat( os.path.join('/etc/init.d', name)).st_mode & stat.S_IXUS...
[ "def", "_service_is_sysv", "(", "name", ")", ":", "try", ":", "# Look for user-execute bit in file mode.", "return", "bool", "(", "os", ".", "stat", "(", "os", ".", "path", ".", "join", "(", "'/etc/init.d'", ",", "name", ")", ")", ".", "st_mode", "&", "sta...
Return True if the service is a System V service (includes those managed by chkconfig); otherwise return False.
[ "Return", "True", "if", "the", "service", "is", "a", "System", "V", "service", "(", "includes", "those", "managed", "by", "chkconfig", ")", ";", "otherwise", "return", "False", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L148-L158
train
saltstack/salt
salt/modules/rh_service.py
_service_is_chkconfig
def _service_is_chkconfig(name): ''' Return True if the service is managed by chkconfig. ''' cmdline = '/sbin/chkconfig --list {0}'.format(name) return __salt__['cmd.retcode'](cmdline, python_shell=False, ignore_retcode=True) == 0
python
def _service_is_chkconfig(name): ''' Return True if the service is managed by chkconfig. ''' cmdline = '/sbin/chkconfig --list {0}'.format(name) return __salt__['cmd.retcode'](cmdline, python_shell=False, ignore_retcode=True) == 0
[ "def", "_service_is_chkconfig", "(", "name", ")", ":", "cmdline", "=", "'/sbin/chkconfig --list {0}'", ".", "format", "(", "name", ")", "return", "__salt__", "[", "'cmd.retcode'", "]", "(", "cmdline", ",", "python_shell", "=", "False", ",", "ignore_retcode", "="...
Return True if the service is managed by chkconfig.
[ "Return", "True", "if", "the", "service", "is", "managed", "by", "chkconfig", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L161-L166
train
saltstack/salt
salt/modules/rh_service.py
_sysv_is_enabled
def _sysv_is_enabled(name, runlevel=None): ''' Return True if the sysv (or chkconfig) service is enabled for the specified runlevel; otherwise return False. If `runlevel` is None, then use the current runlevel. ''' # Try chkconfig first. result = _chkconfig_is_enabled(name, runlevel) if...
python
def _sysv_is_enabled(name, runlevel=None): ''' Return True if the sysv (or chkconfig) service is enabled for the specified runlevel; otherwise return False. If `runlevel` is None, then use the current runlevel. ''' # Try chkconfig first. result = _chkconfig_is_enabled(name, runlevel) if...
[ "def", "_sysv_is_enabled", "(", "name", ",", "runlevel", "=", "None", ")", ":", "# Try chkconfig first.", "result", "=", "_chkconfig_is_enabled", "(", "name", ",", "runlevel", ")", "if", "result", ":", "return", "True", "if", "runlevel", "is", "None", ":", "...
Return True if the sysv (or chkconfig) service is enabled for the specified runlevel; otherwise return False. If `runlevel` is None, then use the current runlevel.
[ "Return", "True", "if", "the", "sysv", "(", "or", "chkconfig", ")", "service", "is", "enabled", "for", "the", "specified", "runlevel", ";", "otherwise", "return", "False", ".", "If", "runlevel", "is", "None", "then", "use", "the", "current", "runlevel", "....
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L169-L183
train
saltstack/salt
salt/modules/rh_service.py
_chkconfig_is_enabled
def _chkconfig_is_enabled(name, runlevel=None): ''' Return ``True`` if the service is enabled according to chkconfig; otherwise return ``False``. If ``runlevel`` is ``None``, then use the current runlevel. ''' cmdline = '/sbin/chkconfig --list {0}'.format(name) result = __salt__['cmd.run_al...
python
def _chkconfig_is_enabled(name, runlevel=None): ''' Return ``True`` if the service is enabled according to chkconfig; otherwise return ``False``. If ``runlevel`` is ``None``, then use the current runlevel. ''' cmdline = '/sbin/chkconfig --list {0}'.format(name) result = __salt__['cmd.run_al...
[ "def", "_chkconfig_is_enabled", "(", "name", ",", "runlevel", "=", "None", ")", ":", "cmdline", "=", "'/sbin/chkconfig --list {0}'", ".", "format", "(", "name", ")", "result", "=", "__salt__", "[", "'cmd.run_all'", "]", "(", "cmdline", ",", "python_shell", "="...
Return ``True`` if the service is enabled according to chkconfig; otherwise return ``False``. If ``runlevel`` is ``None``, then use the current runlevel.
[ "Return", "True", "if", "the", "service", "is", "enabled", "according", "to", "chkconfig", ";", "otherwise", "return", "False", ".", "If", "runlevel", "is", "None", "then", "use", "the", "current", "runlevel", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L186-L204
train
saltstack/salt
salt/modules/rh_service.py
_sysv_enable
def _sysv_enable(name): ''' Enable the named sysv service to start at boot. The service will be enabled using chkconfig with default run-levels if the service is chkconfig compatible. If chkconfig is not available, then this will fail. ''' if not _service_is_chkconfig(name) and not _chkconfig_...
python
def _sysv_enable(name): ''' Enable the named sysv service to start at boot. The service will be enabled using chkconfig with default run-levels if the service is chkconfig compatible. If chkconfig is not available, then this will fail. ''' if not _service_is_chkconfig(name) and not _chkconfig_...
[ "def", "_sysv_enable", "(", "name", ")", ":", "if", "not", "_service_is_chkconfig", "(", "name", ")", "and", "not", "_chkconfig_add", "(", "name", ")", ":", "return", "False", "cmd", "=", "'/sbin/chkconfig {0} on'", ".", "format", "(", "name", ")", "return",...
Enable the named sysv service to start at boot. The service will be enabled using chkconfig with default run-levels if the service is chkconfig compatible. If chkconfig is not available, then this will fail.
[ "Enable", "the", "named", "sysv", "service", "to", "start", "at", "boot", ".", "The", "service", "will", "be", "enabled", "using", "chkconfig", "with", "default", "run", "-", "levels", "if", "the", "service", "is", "chkconfig", "compatible", ".", "If", "ch...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L207-L216
train
saltstack/salt
salt/modules/rh_service.py
_sysv_delete
def _sysv_delete(name): ''' Delete the named sysv service from the system. The service will be deleted using chkconfig. ''' if not _service_is_chkconfig(name): return False cmd = '/sbin/chkconfig --del {0}'.format(name) return not __salt__['cmd.retcode'](cmd)
python
def _sysv_delete(name): ''' Delete the named sysv service from the system. The service will be deleted using chkconfig. ''' if not _service_is_chkconfig(name): return False cmd = '/sbin/chkconfig --del {0}'.format(name) return not __salt__['cmd.retcode'](cmd)
[ "def", "_sysv_delete", "(", "name", ")", ":", "if", "not", "_service_is_chkconfig", "(", "name", ")", ":", "return", "False", "cmd", "=", "'/sbin/chkconfig --del {0}'", ".", "format", "(", "name", ")", "return", "not", "__salt__", "[", "'cmd.retcode'", "]", ...
Delete the named sysv service from the system. The service will be deleted using chkconfig.
[ "Delete", "the", "named", "sysv", "service", "from", "the", "system", ".", "The", "service", "will", "be", "deleted", "using", "chkconfig", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L232-L240
train
saltstack/salt
salt/modules/rh_service.py
_upstart_delete
def _upstart_delete(name): ''' Delete an upstart service. This will only rename the .conf file ''' if HAS_UPSTART: if os.path.exists('/etc/init/{0}.conf'.format(name)): os.rename('/etc/init/{0}.conf'.format(name), '/etc/init/{0}.conf.removed'.format(name)) r...
python
def _upstart_delete(name): ''' Delete an upstart service. This will only rename the .conf file ''' if HAS_UPSTART: if os.path.exists('/etc/init/{0}.conf'.format(name)): os.rename('/etc/init/{0}.conf'.format(name), '/etc/init/{0}.conf.removed'.format(name)) r...
[ "def", "_upstart_delete", "(", "name", ")", ":", "if", "HAS_UPSTART", ":", "if", "os", ".", "path", ".", "exists", "(", "'/etc/init/{0}.conf'", ".", "format", "(", "name", ")", ")", ":", "os", ".", "rename", "(", "'/etc/init/{0}.conf'", ".", "format", "(...
Delete an upstart service. This will only rename the .conf file
[ "Delete", "an", "upstart", "service", ".", "This", "will", "only", "rename", "the", ".", "conf", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L243-L251
train
saltstack/salt
salt/modules/rh_service.py
_sysv_services
def _sysv_services(): ''' Return list of sysv services. ''' _services = [] output = __salt__['cmd.run'](['chkconfig', '--list'], python_shell=False) for line in output.splitlines(): comps = line.split() try: if comps[1].startswith('0:'): _services.appe...
python
def _sysv_services(): ''' Return list of sysv services. ''' _services = [] output = __salt__['cmd.run'](['chkconfig', '--list'], python_shell=False) for line in output.splitlines(): comps = line.split() try: if comps[1].startswith('0:'): _services.appe...
[ "def", "_sysv_services", "(", ")", ":", "_services", "=", "[", "]", "output", "=", "__salt__", "[", "'cmd.run'", "]", "(", "[", "'chkconfig'", ",", "'--list'", "]", ",", "python_shell", "=", "False", ")", "for", "line", "in", "output", ".", "splitlines",...
Return list of sysv services.
[ "Return", "list", "of", "sysv", "services", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L265-L279
train
saltstack/salt
salt/modules/rh_service.py
get_enabled
def get_enabled(limit=''): ''' Return the enabled services. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.get_enabled salt '*' service.get_enabled limit=upstart salt '*' service.get_enabled limit=s...
python
def get_enabled(limit=''): ''' Return the enabled services. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.get_enabled salt '*' service.get_enabled limit=upstart salt '*' service.get_enabled limit=s...
[ "def", "get_enabled", "(", "limit", "=", "''", ")", ":", "limit", "=", "limit", ".", "lower", "(", ")", "if", "limit", "==", "'upstart'", ":", "return", "sorted", "(", "name", "for", "name", "in", "_upstart_services", "(", ")", "if", "_upstart_is_enabled...
Return the enabled services. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.get_enabled salt '*' service.get_enabled limit=upstart salt '*' service.get_enabled limit=sysvinit
[ "Return", "the", "enabled", "services", ".", "Use", "the", "limit", "param", "to", "restrict", "results", "to", "services", "of", "that", "type", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L282-L309
train
saltstack/salt
salt/modules/rh_service.py
get_all
def get_all(limit=''): ''' Return all installed services. Use the ``limit`` param to restrict results to services of that type. CLI Example: .. code-block:: bash salt '*' service.get_all salt '*' service.get_all limit=upstart salt '*' service.get_all limit=sysvinit '''...
python
def get_all(limit=''): ''' Return all installed services. Use the ``limit`` param to restrict results to services of that type. CLI Example: .. code-block:: bash salt '*' service.get_all salt '*' service.get_all limit=upstart salt '*' service.get_all limit=sysvinit '''...
[ "def", "get_all", "(", "limit", "=", "''", ")", ":", "limit", "=", "limit", ".", "lower", "(", ")", "if", "limit", "==", "'upstart'", ":", "return", "sorted", "(", "_upstart_services", "(", ")", ")", "elif", "limit", "==", "'sysvinit'", ":", "return", ...
Return all installed services. Use the ``limit`` param to restrict results to services of that type. CLI Example: .. code-block:: bash salt '*' service.get_all salt '*' service.get_all limit=upstart salt '*' service.get_all limit=sysvinit
[ "Return", "all", "installed", "services", ".", "Use", "the", "limit", "param", "to", "restrict", "results", "to", "services", "of", "that", "type", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L342-L361
train
saltstack/salt
salt/modules/rh_service.py
available
def available(name, limit=''): ''' Return True if the named service is available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.available sshd salt '*' service.available sshd limit=upstart salt '*...
python
def available(name, limit=''): ''' Return True if the named service is available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.available sshd salt '*' service.available sshd limit=upstart salt '*...
[ "def", "available", "(", "name", ",", "limit", "=", "''", ")", ":", "if", "limit", "==", "'upstart'", ":", "return", "_service_is_upstart", "(", "name", ")", "elif", "limit", "==", "'sysvinit'", ":", "return", "_service_is_sysv", "(", "name", ")", "else", ...
Return True if the named service is available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.available sshd salt '*' service.available sshd limit=upstart salt '*' service.available sshd limit=sysvinit
[ "Return", "True", "if", "the", "named", "service", "is", "available", ".", "Use", "the", "limit", "param", "to", "restrict", "results", "to", "services", "of", "that", "type", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L364-L382
train
saltstack/salt
salt/modules/rh_service.py
missing
def missing(name, limit=''): ''' The inverse of service.available. Return True if the named service is not available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.missing sshd salt '*' service.missin...
python
def missing(name, limit=''): ''' The inverse of service.available. Return True if the named service is not available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.missing sshd salt '*' service.missin...
[ "def", "missing", "(", "name", ",", "limit", "=", "''", ")", ":", "if", "limit", "==", "'upstart'", ":", "return", "not", "_service_is_upstart", "(", "name", ")", "elif", "limit", "==", "'sysvinit'", ":", "return", "not", "_service_is_sysv", "(", "name", ...
The inverse of service.available. Return True if the named service is not available. Use the ``limit`` param to restrict results to services of that type. CLI Examples: .. code-block:: bash salt '*' service.missing sshd salt '*' service.missing sshd limit=upstart salt '*' ser...
[ "The", "inverse", "of", "service", ".", "available", ".", "Return", "True", "if", "the", "named", "service", "is", "not", "available", ".", "Use", "the", "limit", "param", "to", "restrict", "results", "to", "services", "of", "that", "type", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L385-L407
train
saltstack/salt
salt/modules/rh_service.py
start
def start(name): ''' Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service name> ''' if _service_is_upstart(name): cmd = 'start {0}'.format(name) else: cmd = '/sbin/service {0} start'.format(name) return not __salt__['cmd...
python
def start(name): ''' Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service name> ''' if _service_is_upstart(name): cmd = 'start {0}'.format(name) else: cmd = '/sbin/service {0} start'.format(name) return not __salt__['cmd...
[ "def", "start", "(", "name", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "cmd", "=", "'start {0}'", ".", "format", "(", "name", ")", "else", ":", "cmd", "=", "'/sbin/service {0} start'", ".", "format", "(", "name", ")", "return", "not",...
Start the specified service CLI Example: .. code-block:: bash salt '*' service.start <service name>
[ "Start", "the", "specified", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L410-L424
train
saltstack/salt
salt/modules/rh_service.py
stop
def stop(name): ''' Stop the specified service CLI Example: .. code-block:: bash salt '*' service.stop <service name> ''' if _service_is_upstart(name): cmd = 'stop {0}'.format(name) else: cmd = '/sbin/service {0} stop'.format(name) return not __salt__['cmd.retc...
python
def stop(name): ''' Stop the specified service CLI Example: .. code-block:: bash salt '*' service.stop <service name> ''' if _service_is_upstart(name): cmd = 'stop {0}'.format(name) else: cmd = '/sbin/service {0} stop'.format(name) return not __salt__['cmd.retc...
[ "def", "stop", "(", "name", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "cmd", "=", "'stop {0}'", ".", "format", "(", "name", ")", "else", ":", "cmd", "=", "'/sbin/service {0} stop'", ".", "format", "(", "name", ")", "return", "not", ...
Stop the specified service CLI Example: .. code-block:: bash salt '*' service.stop <service name>
[ "Stop", "the", "specified", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L427-L441
train
saltstack/salt
salt/modules/rh_service.py
restart
def restart(name): ''' Restart the named service CLI Example: .. code-block:: bash salt '*' service.restart <service name> ''' if _service_is_upstart(name): cmd = 'restart {0}'.format(name) else: cmd = '/sbin/service {0} restart'.format(name) return not __salt_...
python
def restart(name): ''' Restart the named service CLI Example: .. code-block:: bash salt '*' service.restart <service name> ''' if _service_is_upstart(name): cmd = 'restart {0}'.format(name) else: cmd = '/sbin/service {0} restart'.format(name) return not __salt_...
[ "def", "restart", "(", "name", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "cmd", "=", "'restart {0}'", ".", "format", "(", "name", ")", "else", ":", "cmd", "=", "'/sbin/service {0} restart'", ".", "format", "(", "name", ")", "return", ...
Restart the named service CLI Example: .. code-block:: bash salt '*' service.restart <service name>
[ "Restart", "the", "named", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L444-L458
train
saltstack/salt
salt/modules/rh_service.py
reload_
def reload_(name): ''' Reload the named service CLI Example: .. code-block:: bash salt '*' service.reload <service name> ''' if _service_is_upstart(name): cmd = 'reload {0}'.format(name) else: cmd = '/sbin/service {0} reload'.format(name) return not __salt__['c...
python
def reload_(name): ''' Reload the named service CLI Example: .. code-block:: bash salt '*' service.reload <service name> ''' if _service_is_upstart(name): cmd = 'reload {0}'.format(name) else: cmd = '/sbin/service {0} reload'.format(name) return not __salt__['c...
[ "def", "reload_", "(", "name", ")", ":", "if", "_service_is_upstart", "(", "name", ")", ":", "cmd", "=", "'reload {0}'", ".", "format", "(", "name", ")", "else", ":", "cmd", "=", "'/sbin/service {0} reload'", ".", "format", "(", "name", ")", "return", "n...
Reload the named service CLI Example: .. code-block:: bash salt '*' service.reload <service name>
[ "Reload", "the", "named", "service" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/rh_service.py#L461-L475
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
_check_repo_sign_utils_support
def _check_repo_sign_utils_support(name): ''' Check for specified command name in search path ''' if salt.utils.path.which(name): return True else: raise CommandExecutionError( 'utility \'{0}\' needs to be installed or made available in search path'.format(name) )
python
def _check_repo_sign_utils_support(name): ''' Check for specified command name in search path ''' if salt.utils.path.which(name): return True else: raise CommandExecutionError( 'utility \'{0}\' needs to be installed or made available in search path'.format(name) )
[ "def", "_check_repo_sign_utils_support", "(", "name", ")", ":", "if", "salt", ".", "utils", ".", "path", ".", "which", "(", "name", ")", ":", "return", "True", "else", ":", "raise", "CommandExecutionError", "(", "'utility \\'{0}\\' needs to be installed or made avai...
Check for specified command name in search path
[ "Check", "for", "specified", "command", "name", "in", "search", "path" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L73-L82
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
_get_build_env
def _get_build_env(env): ''' Get build environment overrides dictionary to use in build process ''' env_override = '' if env is None: return env_override if not isinstance(env, dict): raise SaltInvocationError( '\'env\' must be a Python dictionary' ) for k...
python
def _get_build_env(env): ''' Get build environment overrides dictionary to use in build process ''' env_override = '' if env is None: return env_override if not isinstance(env, dict): raise SaltInvocationError( '\'env\' must be a Python dictionary' ) for k...
[ "def", "_get_build_env", "(", "env", ")", ":", "env_override", "=", "''", "if", "env", "is", "None", ":", "return", "env_override", "if", "not", "isinstance", "(", "env", ",", "dict", ")", ":", "raise", "SaltInvocationError", "(", "'\\'env\\' must be a Python ...
Get build environment overrides dictionary to use in build process
[ "Get", "build", "environment", "overrides", "dictionary", "to", "use", "in", "build", "process" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L98-L112
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
_get_repo_options_env
def _get_repo_options_env(env): ''' Get repo environment overrides dictionary to use in repo options process env A dictionary of variables to define the repository options Example: .. code-block:: yaml - env: - OPTIONS : 'ask-passphrase' .. war...
python
def _get_repo_options_env(env): ''' Get repo environment overrides dictionary to use in repo options process env A dictionary of variables to define the repository options Example: .. code-block:: yaml - env: - OPTIONS : 'ask-passphrase' .. war...
[ "def", "_get_repo_options_env", "(", "env", ")", ":", "env_options", "=", "''", "if", "env", "is", "None", ":", "return", "env_options", "if", "not", "isinstance", "(", "env", ",", "dict", ")", ":", "raise", "SaltInvocationError", "(", "'\\'env\\' must be a Py...
Get repo environment overrides dictionary to use in repo options process env A dictionary of variables to define the repository options Example: .. code-block:: yaml - env: - OPTIONS : 'ask-passphrase' .. warning:: The above illustrates a ...
[ "Get", "repo", "environment", "overrides", "dictionary", "to", "use", "in", "repo", "options", "process" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L115-L147
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
_get_repo_dists_env
def _get_repo_dists_env(env): ''' Get repo environment overrides dictionary to use in repo distributions process env A dictionary of variables to define the repository distributions Example: .. code-block:: yaml - env: - ORIGIN : 'jessie' ...
python
def _get_repo_dists_env(env): ''' Get repo environment overrides dictionary to use in repo distributions process env A dictionary of variables to define the repository distributions Example: .. code-block:: yaml - env: - ORIGIN : 'jessie' ...
[ "def", "_get_repo_dists_env", "(", "env", ")", ":", "# env key with tuple of control information for handling input env dictionary", "# 0 | M - Mandatory, O - Optional, I - Ignore", "# 1 | 'text string for repo field'", "# 2 | 'default value'", "dflts_dict", "=", "{", "'OPTIONS'", ":", ...
Get repo environment overrides dictionary to use in repo distributions process env A dictionary of variables to define the repository distributions Example: .. code-block:: yaml - env: - ORIGIN : 'jessie' - LABEL : 'salt debian' ...
[ "Get", "repo", "environment", "overrides", "dictionary", "to", "use", "in", "repo", "distributions", "process" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L150-L231
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
_create_pbuilders
def _create_pbuilders(env, runas='root'): ''' Create the .pbuilder family of files in user's home directory env A list or dictionary of environment variables to be set prior to execution. Example: .. code-block:: yaml - env: - DEB_BUILD_OPTIONS: 'noche...
python
def _create_pbuilders(env, runas='root'): ''' Create the .pbuilder family of files in user's home directory env A list or dictionary of environment variables to be set prior to execution. Example: .. code-block:: yaml - env: - DEB_BUILD_OPTIONS: 'noche...
[ "def", "_create_pbuilders", "(", "env", ",", "runas", "=", "'root'", ")", ":", "home", "=", "os", ".", "path", ".", "expanduser", "(", "'~{0}'", ".", "format", "(", "runas", ")", ")", "pbuilderrc", "=", "os", ".", "path", ".", "join", "(", "home", ...
Create the .pbuilder family of files in user's home directory env A list or dictionary of environment variables to be set prior to execution. Example: .. code-block:: yaml - env: - DEB_BUILD_OPTIONS: 'nocheck' .. warning:: The above illus...
[ "Create", "the", ".", "pbuilder", "family", "of", "files", "in", "user", "s", "home", "directory" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L234-L283
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
_get_src
def _get_src(tree_base, source, saltenv='base'): ''' Get the named sources and place them into the tree_base ''' parsed = _urlparse(source) sbase = os.path.basename(source) dest = os.path.join(tree_base, sbase) if parsed.scheme: __salt__['cp.get_url'](source, dest, saltenv=saltenv) ...
python
def _get_src(tree_base, source, saltenv='base'): ''' Get the named sources and place them into the tree_base ''' parsed = _urlparse(source) sbase = os.path.basename(source) dest = os.path.join(tree_base, sbase) if parsed.scheme: __salt__['cp.get_url'](source, dest, saltenv=saltenv) ...
[ "def", "_get_src", "(", "tree_base", ",", "source", ",", "saltenv", "=", "'base'", ")", ":", "parsed", "=", "_urlparse", "(", "source", ")", "sbase", "=", "os", ".", "path", ".", "basename", "(", "source", ")", "dest", "=", "os", ".", "path", ".", ...
Get the named sources and place them into the tree_base
[ "Get", "the", "named", "sources", "and", "place", "them", "into", "the", "tree_base" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L305-L315
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
make_src_pkg
def make_src_pkg(dest_dir, spec, sources, env=None, saltenv='base', runas='root'): ''' Create a platform specific source package from the given platform spec/control file and sources CLI Example: **Debian** .. code-block:: bash salt '*' pkgbuild.make_src_pkg /var/www/html/ ...
python
def make_src_pkg(dest_dir, spec, sources, env=None, saltenv='base', runas='root'): ''' Create a platform specific source package from the given platform spec/control file and sources CLI Example: **Debian** .. code-block:: bash salt '*' pkgbuild.make_src_pkg /var/www/html/ ...
[ "def", "make_src_pkg", "(", "dest_dir", ",", "spec", ",", "sources", ",", "env", "=", "None", ",", "saltenv", "=", "'base'", ",", "runas", "=", "'root'", ")", ":", "_create_pbuilders", "(", "env", ",", "runas", ")", "tree_base", "=", "_mk_tree", "(", "...
Create a platform specific source package from the given platform spec/control file and sources CLI Example: **Debian** .. code-block:: bash salt '*' pkgbuild.make_src_pkg /var/www/html/ https://raw.githubusercontent.com/saltstack/libnacl/master/pkg/deb/python-libnacl.control.tar...
[ "Create", "a", "platform", "specific", "source", "package", "from", "the", "given", "platform", "spec", "/", "control", "file", "and", "sources" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L318-L476
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
build
def build(runas, tgt, dest_dir, spec, sources, deps, env, template, saltenv='base', log_dir='/var/log/salt/pkgbuild'): # pylint: disable=unused-argument ''' Given the package destination directory, the tarball containing ...
python
def build(runas, tgt, dest_dir, spec, sources, deps, env, template, saltenv='base', log_dir='/var/log/salt/pkgbuild'): # pylint: disable=unused-argument ''' Given the package destination directory, the tarball containing ...
[ "def", "build", "(", "runas", ",", "tgt", ",", "dest_dir", ",", "spec", ",", "sources", ",", "deps", ",", "env", ",", "template", ",", "saltenv", "=", "'base'", ",", "log_dir", "=", "'/var/log/salt/pkgbuild'", ")", ":", "# pylint: disable=unused-argument", "...
Given the package destination directory, the tarball containing debian files (e.g. control) and package sources, use pbuilder to safely build the platform package CLI Example: **Debian** .. code-block:: bash salt '*' pkgbuild.make_src_pkg deb-8-x86_64 /var/www/html https://ra...
[ "Given", "the", "package", "destination", "directory", "the", "tarball", "containing", "debian", "files", "(", "e", ".", "g", ".", "control", ")", "and", "package", "sources", "use", "pbuilder", "to", "safely", "build", "the", "platform", "package" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L479-L591
train
saltstack/salt
salt/modules/debuild_pkgbuild.py
make_repo
def make_repo(repodir, keyid=None, env=None, use_passphrase=False, gnupghome='/etc/salt/gpgkeys', runas='root', timeout=15.0): ''' Make a package repository and optionally sign it and packages present Given the repodir (dir...
python
def make_repo(repodir, keyid=None, env=None, use_passphrase=False, gnupghome='/etc/salt/gpgkeys', runas='root', timeout=15.0): ''' Make a package repository and optionally sign it and packages present Given the repodir (dir...
[ "def", "make_repo", "(", "repodir", ",", "keyid", "=", "None", ",", "env", "=", "None", ",", "use_passphrase", "=", "False", ",", "gnupghome", "=", "'/etc/salt/gpgkeys'", ",", "runas", "=", "'root'", ",", "timeout", "=", "15.0", ")", ":", "res", "=", "...
Make a package repository and optionally sign it and packages present Given the repodir (directory to create repository in), create a Debian repository and optionally sign it and packages present. This state is best used with onchanges linked to your package building states. repodir The direct...
[ "Make", "a", "package", "repository", "and", "optionally", "sign", "it", "and", "packages", "present" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/debuild_pkgbuild.py#L594-L945
train
saltstack/salt
salt/runners/vault.py
generate_token
def generate_token(minion_id, signature, impersonated_by_master=False): ''' Generate a Vault token for minion minion_id minion_id The id of the minion that requests a token signature Cryptographic signature which validates that the request is indeed sent by the minion (or the m...
python
def generate_token(minion_id, signature, impersonated_by_master=False): ''' Generate a Vault token for minion minion_id minion_id The id of the minion that requests a token signature Cryptographic signature which validates that the request is indeed sent by the minion (or the m...
[ "def", "generate_token", "(", "minion_id", ",", "signature", ",", "impersonated_by_master", "=", "False", ")", ":", "log", ".", "debug", "(", "'Token generation request for %s (impersonated by master: %s)'", ",", "minion_id", ",", "impersonated_by_master", ")", "_validate...
Generate a Vault token for minion minion_id minion_id The id of the minion that requests a token signature Cryptographic signature which validates that the request is indeed sent by the minion (or the master, see impersonated_by_master). impersonated_by_master If the maste...
[ "Generate", "a", "Vault", "token", "for", "minion", "minion_id" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L28-L96
train
saltstack/salt
salt/runners/vault.py
unseal
def unseal(): ''' Unseal Vault server This function uses the 'keys' from the 'vault' configuration to unseal vault server vault: keys: - n63/TbrQuL3xaIW7ZZpuXj/tIfnK1/MbVxO4vT3wYD2A - S9OwCvMRhErEA4NVVELYBs6w/Me6+urgUr24xGK44Uy3 - F1j4b7JKq850NS6Kboiy5laJ0xY8dWJvB3fcwA+Sr...
python
def unseal(): ''' Unseal Vault server This function uses the 'keys' from the 'vault' configuration to unseal vault server vault: keys: - n63/TbrQuL3xaIW7ZZpuXj/tIfnK1/MbVxO4vT3wYD2A - S9OwCvMRhErEA4NVVELYBs6w/Me6+urgUr24xGK44Uy3 - F1j4b7JKq850NS6Kboiy5laJ0xY8dWJvB3fcwA+Sr...
[ "def", "unseal", "(", ")", ":", "for", "key", "in", "__opts__", "[", "'vault'", "]", "[", "'keys'", "]", ":", "ret", "=", "__utils__", "[", "'vault.make_request'", "]", "(", "'PUT'", ",", "'v1/sys/unseal'", ",", "data", "=", "json", ".", "dumps", "(", ...
Unseal Vault server This function uses the 'keys' from the 'vault' configuration to unseal vault server vault: keys: - n63/TbrQuL3xaIW7ZZpuXj/tIfnK1/MbVxO4vT3wYD2A - S9OwCvMRhErEA4NVVELYBs6w/Me6+urgUr24xGK44Uy3 - F1j4b7JKq850NS6Kboiy5laJ0xY8dWJvB3fcwA+SraYl - 1cYtvjKJNDVa...
[ "Unseal", "Vault", "server" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L99-L126
train
saltstack/salt
salt/runners/vault.py
_validate_signature
def _validate_signature(minion_id, signature, impersonated_by_master): ''' Validate that either minion with id minion_id, or the master, signed the request ''' pki_dir = __opts__['pki_dir'] if impersonated_by_master: public_key = '{0}/master.pub'.format(pki_dir) else: public_...
python
def _validate_signature(minion_id, signature, impersonated_by_master): ''' Validate that either minion with id minion_id, or the master, signed the request ''' pki_dir = __opts__['pki_dir'] if impersonated_by_master: public_key = '{0}/master.pub'.format(pki_dir) else: public_...
[ "def", "_validate_signature", "(", "minion_id", ",", "signature", ",", "impersonated_by_master", ")", ":", "pki_dir", "=", "__opts__", "[", "'pki_dir'", "]", "if", "impersonated_by_master", ":", "public_key", "=", "'{0}/master.pub'", ".", "format", "(", "pki_dir", ...
Validate that either minion with id minion_id, or the master, signed the request
[ "Validate", "that", "either", "minion", "with", "id", "minion_id", "or", "the", "master", "signed", "the", "request" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L146-L163
train
saltstack/salt
salt/runners/vault.py
_get_policies
def _get_policies(minion_id, config): ''' Get the policies that should be applied to a token for minion_id ''' _, grains, _ = salt.utils.minions.get_minion_data(minion_id, __opts__) policy_patterns = config.get( 'policies', ['saltstac...
python
def _get_policies(minion_id, config): ''' Get the policies that should be applied to a token for minion_id ''' _, grains, _ = salt.utils.minions.get_minion_data(minion_id, __opts__) policy_patterns = config.get( 'policies', ['saltstac...
[ "def", "_get_policies", "(", "minion_id", ",", "config", ")", ":", "_", ",", "grains", ",", "_", "=", "salt", ".", "utils", ".", "minions", ".", "get_minion_data", "(", "minion_id", ",", "__opts__", ")", "policy_patterns", "=", "config", ".", "get", "(",...
Get the policies that should be applied to a token for minion_id
[ "Get", "the", "policies", "that", "should", "be", "applied", "to", "a", "token", "for", "minion_id" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L166-L189
train
saltstack/salt
salt/runners/vault.py
_expand_pattern_lists
def _expand_pattern_lists(pattern, **mappings): ''' Expands the pattern for any list-valued mappings, such that for any list of length N in the mappings present in the pattern, N copies of the pattern are returned, each with an element of the list substituted. pattern: A pattern to expand, ...
python
def _expand_pattern_lists(pattern, **mappings): ''' Expands the pattern for any list-valued mappings, such that for any list of length N in the mappings present in the pattern, N copies of the pattern are returned, each with an element of the list substituted. pattern: A pattern to expand, ...
[ "def", "_expand_pattern_lists", "(", "pattern", ",", "*", "*", "mappings", ")", ":", "expanded_patterns", "=", "[", "]", "f", "=", "string", ".", "Formatter", "(", ")", "'''\n This function uses a string.Formatter to get all the formatting tokens from\n the pattern, t...
Expands the pattern for any list-valued mappings, such that for any list of length N in the mappings present in the pattern, N copies of the pattern are returned, each with an element of the list substituted. pattern: A pattern to expand, for example ``by-role/{grains[roles]}`` mappings: ...
[ "Expands", "the", "pattern", "for", "any", "list", "-", "valued", "mappings", "such", "that", "for", "any", "list", "of", "length", "N", "in", "the", "mappings", "present", "in", "the", "pattern", "N", "copies", "of", "the", "pattern", "are", "returned", ...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L192-L239
train
saltstack/salt
salt/runners/vault.py
_selftoken_expired
def _selftoken_expired(): ''' Validate the current token exists and is still valid ''' try: verify = __opts__['vault'].get('verify', None) url = '{0}/v1/auth/token/lookup-self'.format(__opts__['vault']['url']) if 'token' not in __opts__['vault']['auth']: return True ...
python
def _selftoken_expired(): ''' Validate the current token exists and is still valid ''' try: verify = __opts__['vault'].get('verify', None) url = '{0}/v1/auth/token/lookup-self'.format(__opts__['vault']['url']) if 'token' not in __opts__['vault']['auth']: return True ...
[ "def", "_selftoken_expired", "(", ")", ":", "try", ":", "verify", "=", "__opts__", "[", "'vault'", "]", ".", "get", "(", "'verify'", ",", "None", ")", "url", "=", "'{0}/v1/auth/token/lookup-self'", ".", "format", "(", "__opts__", "[", "'vault'", "]", "[", ...
Validate the current token exists and is still valid
[ "Validate", "the", "current", "token", "exists", "and", "is", "still", "valid" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L242-L259
train
saltstack/salt
salt/runners/vault.py
_get_token_create_url
def _get_token_create_url(config): ''' Create Vault url for token creation ''' role_name = config.get('role_name', None) auth_path = '/v1/auth/token/create' base_url = config['url'] return '/'.join(x.strip('/') for x in (base_url, auth_path, role_name) if x)
python
def _get_token_create_url(config): ''' Create Vault url for token creation ''' role_name = config.get('role_name', None) auth_path = '/v1/auth/token/create' base_url = config['url'] return '/'.join(x.strip('/') for x in (base_url, auth_path, role_name) if x)
[ "def", "_get_token_create_url", "(", "config", ")", ":", "role_name", "=", "config", ".", "get", "(", "'role_name'", ",", "None", ")", "auth_path", "=", "'/v1/auth/token/create'", "base_url", "=", "config", "[", "'url'", "]", "return", "'/'", ".", "join", "(...
Create Vault url for token creation
[ "Create", "Vault", "url", "for", "token", "creation" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/runners/vault.py#L262-L269
train
saltstack/salt
salt/modules/boto_lambda.py
_find_function
def _find_function(name, region=None, key=None, keyid=None, profile=None): ''' Given function name, find and return matching Lambda information. ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) for funcs in __utils__['boto3.paged_call'](conn.list_functio...
python
def _find_function(name, region=None, key=None, keyid=None, profile=None): ''' Given function name, find and return matching Lambda information. ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) for funcs in __utils__['boto3.paged_call'](conn.list_functio...
[ "def", "_find_function", "(", "name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid...
Given function name, find and return matching Lambda information.
[ "Given", "function", "name", "find", "and", "return", "matching", "Lambda", "information", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L138-L149
train
saltstack/salt
salt/modules/boto_lambda.py
function_exists
def function_exists(FunctionName, region=None, key=None, keyid=None, profile=None): ''' Given a function name, check to see if the given function name exists. Returns True if the given function exists and returns False if the given function does not exist. CLI Example: .. ...
python
def function_exists(FunctionName, region=None, key=None, keyid=None, profile=None): ''' Given a function name, check to see if the given function name exists. Returns True if the given function exists and returns False if the given function does not exist. CLI Example: .. ...
[ "def", "function_exists", "(", "FunctionName", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "func", "=", "_find_function", "(", "FunctionName", ",", "region", "=", "r...
Given a function name, check to see if the given function name exists. Returns True if the given function exists and returns False if the given function does not exist. CLI Example: .. code-block:: bash salt myminion boto_lambda.function_exists myfunction
[ "Given", "a", "function", "name", "check", "to", "see", "if", "the", "given", "function", "name", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L152-L173
train
saltstack/salt
salt/modules/boto_lambda.py
create_function
def create_function(FunctionName, Runtime, Role, Handler, ZipFile=None, S3Bucket=None, S3Key=None, S3ObjectVersion=None, Description="", Timeout=3, MemorySize=128, Publish=False, WaitForRole=False, RoleRetries=5, region=None, key=None, keyi...
python
def create_function(FunctionName, Runtime, Role, Handler, ZipFile=None, S3Bucket=None, S3Key=None, S3ObjectVersion=None, Description="", Timeout=3, MemorySize=128, Publish=False, WaitForRole=False, RoleRetries=5, region=None, key=None, keyi...
[ "def", "create_function", "(", "FunctionName", ",", "Runtime", ",", "Role", ",", "Handler", ",", "ZipFile", "=", "None", ",", "S3Bucket", "=", "None", ",", "S3Key", "=", "None", ",", "S3ObjectVersion", "=", "None", ",", "Description", "=", "\"\"", ",", "...
.. versionadded:: 2017.7.0 Given a valid config, create a function. Environment The parent object that contains your environment's configuration settings. This is a dictionary of the form: .. code-block:: python { 'Variables': { 'Variab...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L211-L308
train
saltstack/salt
salt/modules/boto_lambda.py
delete_function
def delete_function(FunctionName, Qualifier=None, region=None, key=None, keyid=None, profile=None): ''' Given a function name and optional version qualifier, delete it. Returns {deleted: true} if the function was deleted and returns {deleted: false} if the function was not deleted. CLI Example: ...
python
def delete_function(FunctionName, Qualifier=None, region=None, key=None, keyid=None, profile=None): ''' Given a function name and optional version qualifier, delete it. Returns {deleted: true} if the function was deleted and returns {deleted: false} if the function was not deleted. CLI Example: ...
[ "def", "delete_function", "(", "FunctionName", ",", "Qualifier", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", ...
Given a function name and optional version qualifier, delete it. Returns {deleted: true} if the function was deleted and returns {deleted: false} if the function was not deleted. CLI Example: .. code-block:: bash salt myminion boto_lambda.delete_function myfunction
[ "Given", "a", "function", "name", "and", "optional", "version", "qualifier", "delete", "it", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L311-L335
train
saltstack/salt
salt/modules/boto_lambda.py
describe_function
def describe_function(FunctionName, region=None, key=None, keyid=None, profile=None): ''' Given a function name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_lambda.describe_function myf...
python
def describe_function(FunctionName, region=None, key=None, keyid=None, profile=None): ''' Given a function name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_lambda.describe_function myf...
[ "def", "describe_function", "(", "FunctionName", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "func", "=", "_find_function", "(", "FunctionName", ",", "region", "=", ...
Given a function name describe its properties. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_lambda.describe_function myfunction
[ "Given", "a", "function", "name", "describe", "its", "properties", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L338-L364
train
saltstack/salt
salt/modules/boto_lambda.py
update_function_config
def update_function_config(FunctionName, Role=None, Handler=None, Description=None, Timeout=None, MemorySize=None, region=None, key=None, keyid=None, profile=None, VpcConfig=None, WaitForRole=False, RoleRetries=5, ...
python
def update_function_config(FunctionName, Role=None, Handler=None, Description=None, Timeout=None, MemorySize=None, region=None, key=None, keyid=None, profile=None, VpcConfig=None, WaitForRole=False, RoleRetries=5, ...
[ "def", "update_function_config", "(", "FunctionName", ",", "Role", "=", "None", ",", "Handler", "=", "None", ",", "Description", "=", "None", ",", "Timeout", "=", "None", ",", "MemorySize", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None"...
.. versionadded:: 2017.7.0 Update the named lambda function to the configuration. Environment The parent object that contains your environment's configuration settings. This is a dictionary of the form: .. code-block:: python { 'Variables': { ...
[ "..", "versionadded", "::", "2017", ".", "7", ".", "0" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L367-L445
train
saltstack/salt
salt/modules/boto_lambda.py
update_function_code
def update_function_code(FunctionName, ZipFile=None, S3Bucket=None, S3Key=None, S3ObjectVersion=None, Publish=False, region=None, key=None, keyid=None, profile=None): ''' Upload the given code to the named lambda function. Returns {updated: true} if the fun...
python
def update_function_code(FunctionName, ZipFile=None, S3Bucket=None, S3Key=None, S3ObjectVersion=None, Publish=False, region=None, key=None, keyid=None, profile=None): ''' Upload the given code to the named lambda function. Returns {updated: true} if the fun...
[ "def", "update_function_code", "(", "FunctionName", ",", "ZipFile", "=", "None", ",", "S3Bucket", "=", "None", ",", "S3Key", "=", "None", ",", "S3ObjectVersion", "=", "None", ",", "Publish", "=", "False", ",", "region", "=", "None", ",", "key", "=", "Non...
Upload the given code to the named lambda function. Returns {updated: true} if the function was updated and returns {updated: False} if the function was not updated. CLI Example: .. code-block:: bash salt myminion boto_lamba.update_function_code my_function ZipFile=function.zip
[ "Upload", "the", "given", "code", "to", "the", "named", "lambda", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L448-L495
train
saltstack/salt
salt/modules/boto_lambda.py
add_permission
def add_permission(FunctionName, StatementId, Action, Principal, SourceArn=None, SourceAccount=None, Qualifier=None, region=None, key=None, keyid=None, profile=None): ''' Add a permission to a lambda function. Returns {added: true} if the permission was added and retur...
python
def add_permission(FunctionName, StatementId, Action, Principal, SourceArn=None, SourceAccount=None, Qualifier=None, region=None, key=None, keyid=None, profile=None): ''' Add a permission to a lambda function. Returns {added: true} if the permission was added and retur...
[ "def", "add_permission", "(", "FunctionName", ",", "StatementId", ",", "Action", ",", "Principal", ",", "SourceArn", "=", "None", ",", "SourceAccount", "=", "None", ",", "Qualifier", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", ...
Add a permission to a lambda function. Returns {added: true} if the permission was added and returns {added: False} if the permission was not added. CLI Example: .. code-block:: bash salt myminion boto_lamba.add_permission my_function my_id "lambda:*" \\ s3.amazona...
[ "Add", "a", "permission", "to", "a", "lambda", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L498-L528
train
saltstack/salt
salt/modules/boto_lambda.py
remove_permission
def remove_permission(FunctionName, StatementId, Qualifier=None, region=None, key=None, keyid=None, profile=None): ''' Remove a permission from a lambda function. Returns {removed: true} if the permission was removed and returns {removed: False} if the permission was not removed. ...
python
def remove_permission(FunctionName, StatementId, Qualifier=None, region=None, key=None, keyid=None, profile=None): ''' Remove a permission from a lambda function. Returns {removed: true} if the permission was removed and returns {removed: False} if the permission was not removed. ...
[ "def", "remove_permission", "(", "FunctionName", ",", "StatementId", ",", "Qualifier", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_co...
Remove a permission from a lambda function. Returns {removed: true} if the permission was removed and returns {removed: False} if the permission was not removed. CLI Example: .. code-block:: bash salt myminion boto_lamba.remove_permission my_function my_id
[ "Remove", "a", "permission", "from", "a", "lambda", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L531-L556
train
saltstack/salt
salt/modules/boto_lambda.py
get_permissions
def get_permissions(FunctionName, Qualifier=None, region=None, key=None, keyid=None, profile=None): ''' Get resource permissions for the given lambda function Returns dictionary of permissions, by statement ID CLI Example: .. code-block:: bash salt myminion boto_lamba...
python
def get_permissions(FunctionName, Qualifier=None, region=None, key=None, keyid=None, profile=None): ''' Get resource permissions for the given lambda function Returns dictionary of permissions, by statement ID CLI Example: .. code-block:: bash salt myminion boto_lamba...
[ "def", "get_permissions", "(", "FunctionName", ",", "Qualifier", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", ...
Get resource permissions for the given lambda function Returns dictionary of permissions, by statement ID CLI Example: .. code-block:: bash salt myminion boto_lamba.get_permissions my_function permissions: {...}
[ "Get", "resource", "permissions", "for", "the", "given", "lambda", "function" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L559-L613
train
saltstack/salt
salt/modules/boto_lambda.py
list_functions
def list_functions(region=None, key=None, keyid=None, profile=None): ''' List all Lambda functions visible in the current scope. CLI Example: .. code-block:: bash salt myminion boto_lambda.list_functions ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
python
def list_functions(region=None, key=None, keyid=None, profile=None): ''' List all Lambda functions visible in the current scope. CLI Example: .. code-block:: bash salt myminion boto_lambda.list_functions ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) ...
[ "def", "list_functions", "(", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid", "=", "keyi...
List all Lambda functions visible in the current scope. CLI Example: .. code-block:: bash salt myminion boto_lambda.list_functions
[ "List", "all", "Lambda", "functions", "visible", "in", "the", "current", "scope", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L616-L632
train
saltstack/salt
salt/modules/boto_lambda.py
list_function_versions
def list_function_versions(FunctionName, region=None, key=None, keyid=None, profile=None): ''' List the versions available for the given function. Returns list of function versions CLI Example: .. code-block:: yaml versions: - {...} - {...} ...
python
def list_function_versions(FunctionName, region=None, key=None, keyid=None, profile=None): ''' List the versions available for the given function. Returns list of function versions CLI Example: .. code-block:: yaml versions: - {...} - {...} ...
[ "def", "list_function_versions", "(", "FunctionName", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key",...
List the versions available for the given function. Returns list of function versions CLI Example: .. code-block:: yaml versions: - {...} - {...}
[ "List", "the", "versions", "available", "for", "the", "given", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L635-L661
train
saltstack/salt
salt/modules/boto_lambda.py
create_alias
def create_alias(FunctionName, Name, FunctionVersion, Description="", region=None, key=None, keyid=None, profile=None): ''' Given a valid config, create an alias to a function. Returns {created: true} if the alias was created and returns {created: False} if the alias was not created. ...
python
def create_alias(FunctionName, Name, FunctionVersion, Description="", region=None, key=None, keyid=None, profile=None): ''' Given a valid config, create an alias to a function. Returns {created: true} if the alias was created and returns {created: False} if the alias was not created. ...
[ "def", "create_alias", "(", "FunctionName", ",", "Name", ",", "FunctionVersion", ",", "Description", "=", "\"\"", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "conn",...
Given a valid config, create an alias to a function. Returns {created: true} if the alias was created and returns {created: False} if the alias was not created. CLI Example: .. code-block:: bash salt myminion boto_lamba.create_alias my_function my_alias $LATEST "An alias"
[ "Given", "a", "valid", "config", "create", "an", "alias", "to", "a", "function", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L664-L691
train
saltstack/salt
salt/modules/boto_lambda.py
_find_alias
def _find_alias(FunctionName, Name, FunctionVersion=None, region=None, key=None, keyid=None, profile=None): ''' Given function name and alias name, find and return matching alias information. ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) args = { ...
python
def _find_alias(FunctionName, Name, FunctionVersion=None, region=None, key=None, keyid=None, profile=None): ''' Given function name and alias name, find and return matching alias information. ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) args = { ...
[ "def", "_find_alias", "(", "FunctionName", ",", "Name", ",", "FunctionVersion", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region",...
Given function name and alias name, find and return matching alias information.
[ "Given", "function", "name", "and", "alias", "name", "find", "and", "return", "matching", "alias", "information", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L717-L734
train
saltstack/salt
salt/modules/boto_lambda.py
alias_exists
def alias_exists(FunctionName, Name, region=None, key=None, keyid=None, profile=None): ''' Given a function name and alias name, check to see if the given alias exists. Returns True if the given alias exists and returns False if the given alias does not exist. CLI Example: .....
python
def alias_exists(FunctionName, Name, region=None, key=None, keyid=None, profile=None): ''' Given a function name and alias name, check to see if the given alias exists. Returns True if the given alias exists and returns False if the given alias does not exist. CLI Example: .....
[ "def", "alias_exists", "(", "FunctionName", ",", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "alias", "=", "_find_alias", "(", "FunctionName", ",", "Name", ...
Given a function name and alias name, check to see if the given alias exists. Returns True if the given alias exists and returns False if the given alias does not exist. CLI Example: .. code-block:: bash salt myminion boto_lambda.alias_exists myfunction myalias
[ "Given", "a", "function", "name", "and", "alias", "name", "check", "to", "see", "if", "the", "given", "alias", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L737-L758
train
saltstack/salt
salt/modules/boto_lambda.py
describe_alias
def describe_alias(FunctionName, Name, region=None, key=None, keyid=None, profile=None): ''' Given a function name and alias name describe the properties of the alias. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_...
python
def describe_alias(FunctionName, Name, region=None, key=None, keyid=None, profile=None): ''' Given a function name and alias name describe the properties of the alias. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_...
[ "def", "describe_alias", "(", "FunctionName", ",", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try", ":", "alias", "=", "_find_alias", "(", "FunctionName", ",", "Name",...
Given a function name and alias name describe the properties of the alias. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_lambda.describe_alias myalias
[ "Given", "a", "function", "name", "and", "alias", "name", "describe", "the", "properties", "of", "the", "alias", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L761-L785
train
saltstack/salt
salt/modules/boto_lambda.py
update_alias
def update_alias(FunctionName, Name, FunctionVersion=None, Description=None, region=None, key=None, keyid=None, profile=None): ''' Update the named alias to the configuration. Returns {updated: true} if the alias was updated and returns {updated: False} if the alias was not updated. ...
python
def update_alias(FunctionName, Name, FunctionVersion=None, Description=None, region=None, key=None, keyid=None, profile=None): ''' Update the named alias to the configuration. Returns {updated: true} if the alias was updated and returns {updated: False} if the alias was not updated. ...
[ "def", "update_alias", "(", "FunctionName", ",", "Name", ",", "FunctionVersion", "=", "None", ",", "Description", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "try",...
Update the named alias to the configuration. Returns {updated: true} if the alias was updated and returns {updated: False} if the alias was not updated. CLI Example: .. code-block:: bash salt myminion boto_lamba.update_alias my_lambda my_alias $LATEST
[ "Update", "the", "named", "alias", "to", "the", "configuration", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L788-L819
train
saltstack/salt
salt/modules/boto_lambda.py
create_event_source_mapping
def create_event_source_mapping(EventSourceArn, FunctionName, StartingPosition, Enabled=True, BatchSize=100, region=None, key=None, keyid=None, profile=None): ''' Identifies a stream as an event source for a Lambda function. It can be either an...
python
def create_event_source_mapping(EventSourceArn, FunctionName, StartingPosition, Enabled=True, BatchSize=100, region=None, key=None, keyid=None, profile=None): ''' Identifies a stream as an event source for a Lambda function. It can be either an...
[ "def", "create_event_source_mapping", "(", "EventSourceArn", ",", "FunctionName", ",", "StartingPosition", ",", "Enabled", "=", "True", ",", "BatchSize", "=", "100", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profil...
Identifies a stream as an event source for a Lambda function. It can be either an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda invokes the specified function when records are posted to the stream. Returns {created: true} if the event source mapping was created and returns {created: Fa...
[ "Identifies", "a", "stream", "as", "an", "event", "source", "for", "a", "Lambda", "function", ".", "It", "can", "be", "either", "an", "Amazon", "Kinesis", "stream", "or", "an", "Amazon", "DynamoDB", "stream", ".", "AWS", "Lambda", "invokes", "the", "specif...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L822-L855
train
saltstack/salt
salt/modules/boto_lambda.py
get_event_source_mapping_ids
def get_event_source_mapping_ids(EventSourceArn, FunctionName, region=None, key=None, keyid=None, profile=None): ''' Given an event source and function name, return a list of mapping IDs CLI Example: .. code-block:: bash salt myminion boto_lambda.get_event_sou...
python
def get_event_source_mapping_ids(EventSourceArn, FunctionName, region=None, key=None, keyid=None, profile=None): ''' Given an event source and function name, return a list of mapping IDs CLI Example: .. code-block:: bash salt myminion boto_lambda.get_event_sou...
[ "def", "get_event_source_mapping_ids", "(", "EventSourceArn", ",", "FunctionName", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region"...
Given an event source and function name, return a list of mapping IDs CLI Example: .. code-block:: bash salt myminion boto_lambda.get_event_source_mapping_ids arn:::: myfunction
[ "Given", "an", "event", "source", "and", "function", "name", "return", "a", "list", "of", "mapping", "IDs" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L858-L881
train
saltstack/salt
salt/modules/boto_lambda.py
delete_event_source_mapping
def delete_event_source_mapping(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None): ''' Given an event source mapping ID or an event source ARN and FunctionName, delete the event source mapping Returns {deleted: true} if t...
python
def delete_event_source_mapping(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None): ''' Given an event source mapping ID or an event source ARN and FunctionName, delete the event source mapping Returns {deleted: true} if t...
[ "def", "delete_event_source_mapping", "(", "UUID", "=", "None", ",", "EventSourceArn", "=", "None", ",", "FunctionName", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", ...
Given an event source mapping ID or an event source ARN and FunctionName, delete the event source mapping Returns {deleted: true} if the mapping was deleted and returns {deleted: false} if the mapping was not deleted. CLI Example: .. code-block:: bash salt myminion boto_lambda.delete_eve...
[ "Given", "an", "event", "source", "mapping", "ID", "or", "an", "event", "source", "ARN", "and", "FunctionName", "delete", "the", "event", "source", "mapping" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L900-L924
train
saltstack/salt
salt/modules/boto_lambda.py
event_source_mapping_exists
def event_source_mapping_exists(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None): ''' Given an event source mapping ID or an event source ARN and FunctionName, check whether the mapping exists....
python
def event_source_mapping_exists(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None): ''' Given an event source mapping ID or an event source ARN and FunctionName, check whether the mapping exists....
[ "def", "event_source_mapping_exists", "(", "UUID", "=", "None", ",", "EventSourceArn", "=", "None", ",", "FunctionName", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", ...
Given an event source mapping ID or an event source ARN and FunctionName, check whether the mapping exists. Returns True if the given alias exists and returns False if the given alias does not exist. CLI Example: .. code-block:: bash salt myminion boto_lambda.alias_exists myfunction myal...
[ "Given", "an", "event", "source", "mapping", "ID", "or", "an", "event", "source", "ARN", "and", "FunctionName", "check", "whether", "the", "mapping", "exists", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L927-L952
train
saltstack/salt
salt/modules/boto_lambda.py
describe_event_source_mapping
def describe_event_source_mapping(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None): ''' Given an event source mapping ID or an event source ARN and FunctionName, obtain the current settings...
python
def describe_event_source_mapping(UUID=None, EventSourceArn=None, FunctionName=None, region=None, key=None, keyid=None, profile=None): ''' Given an event source mapping ID or an event source ARN and FunctionName, obtain the current settings...
[ "def", "describe_event_source_mapping", "(", "UUID", "=", "None", ",", "EventSourceArn", "=", "None", ",", "FunctionName", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":",...
Given an event source mapping ID or an event source ARN and FunctionName, obtain the current settings of that mapping. Returns a dictionary of interesting properties. CLI Example: .. code-block:: bash salt myminion boto_lambda.describe_event_source_mapping uuid
[ "Given", "an", "event", "source", "mapping", "ID", "or", "an", "event", "source", "ARN", "and", "FunctionName", "obtain", "the", "current", "settings", "of", "that", "mapping", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L955-L989
train
saltstack/salt
salt/modules/boto_lambda.py
update_event_source_mapping
def update_event_source_mapping(UUID, FunctionName=None, Enabled=None, BatchSize=None, region=None, key=None, keyid=None, profile=None): ''' Update the event source mapping identified by the UUID. Returns {updated: true} if the alias was updat...
python
def update_event_source_mapping(UUID, FunctionName=None, Enabled=None, BatchSize=None, region=None, key=None, keyid=None, profile=None): ''' Update the event source mapping identified by the UUID. Returns {updated: true} if the alias was updat...
[ "def", "update_event_source_mapping", "(", "UUID", ",", "FunctionName", "=", "None", ",", "Enabled", "=", "None", ",", "BatchSize", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ...
Update the event source mapping identified by the UUID. Returns {updated: true} if the alias was updated and returns {updated: False} if the alias was not updated. CLI Example: .. code-block:: bash salt myminion boto_lamba.update_event_source_mapping uuid FunctionName=new_function
[ "Update", "the", "event", "source", "mapping", "identified", "by", "the", "UUID", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto_lambda.py#L992-L1028
train
saltstack/salt
salt/fileserver/s3fs.py
update
def update(): ''' Update the cache file for the bucket. ''' metadata = _init() if S3_SYNC_ON_UPDATE: # sync the buckets to the local cache log.info('Syncing local cache from S3...') for saltenv, env_meta in six.iteritems(metadata): for bucket_files in _find_file...
python
def update(): ''' Update the cache file for the bucket. ''' metadata = _init() if S3_SYNC_ON_UPDATE: # sync the buckets to the local cache log.info('Syncing local cache from S3...') for saltenv, env_meta in six.iteritems(metadata): for bucket_files in _find_file...
[ "def", "update", "(", ")", ":", "metadata", "=", "_init", "(", ")", "if", "S3_SYNC_ON_UPDATE", ":", "# sync the buckets to the local cache", "log", ".", "info", "(", "'Syncing local cache from S3...'", ")", "for", "saltenv", ",", "env_meta", "in", "six", ".", "i...
Update the cache file for the bucket.
[ "Update", "the", "cache", "file", "for", "the", "bucket", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L121-L141
train
saltstack/salt
salt/fileserver/s3fs.py
find_file
def find_file(path, saltenv='base', **kwargs): ''' Look through the buckets cache file for a match. If the field is found, it is retrieved from S3 only if its cached version is missing, or if the MD5 does not match. ''' if 'env' in kwargs: # "env" is not supported; Use "saltenv". ...
python
def find_file(path, saltenv='base', **kwargs): ''' Look through the buckets cache file for a match. If the field is found, it is retrieved from S3 only if its cached version is missing, or if the MD5 does not match. ''' if 'env' in kwargs: # "env" is not supported; Use "saltenv". ...
[ "def", "find_file", "(", "path", ",", "saltenv", "=", "'base'", ",", "*", "*", "kwargs", ")", ":", "if", "'env'", "in", "kwargs", ":", "# \"env\" is not supported; Use \"saltenv\".", "kwargs", ".", "pop", "(", "'env'", ")", "fnd", "=", "{", "'bucket'", ":"...
Look through the buckets cache file for a match. If the field is found, it is retrieved from S3 only if its cached version is missing, or if the MD5 does not match.
[ "Look", "through", "the", "buckets", "cache", "file", "for", "a", "match", ".", "If", "the", "field", "is", "found", "it", "is", "retrieved", "from", "S3", "only", "if", "its", "cached", "version", "is", "missing", "or", "if", "the", "MD5", "does", "no...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L144-L185
train
saltstack/salt
salt/fileserver/s3fs.py
file_hash
def file_hash(load, fnd): ''' Return an MD5 file hash ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = {} if 'saltenv' not in load: return ret if 'path' not in fnd or 'bucket' not in fnd or not fnd['path']: return ret ...
python
def file_hash(load, fnd): ''' Return an MD5 file hash ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = {} if 'saltenv' not in load: return ret if 'path' not in fnd or 'bucket' not in fnd or not fnd['path']: return ret ...
[ "def", "file_hash", "(", "load", ",", "fnd", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "ret", "=", "{", "}", "if", "'saltenv'", "not", "in", "load", ":", "return", "...
Return an MD5 file hash
[ "Return", "an", "MD5", "file", "hash" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L188-L213
train
saltstack/salt
salt/fileserver/s3fs.py
serve_file
def serve_file(load, fnd): ''' Return a chunk from a file based on the data received ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = {'data': '', 'dest': ''} if 'path' not in load or 'loc' not in load or 'saltenv' not in load: ...
python
def serve_file(load, fnd): ''' Return a chunk from a file based on the data received ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = {'data': '', 'dest': ''} if 'path' not in load or 'loc' not in load or 'saltenv' not in load: ...
[ "def", "serve_file", "(", "load", ",", "fnd", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "ret", "=", "{", "'data'", ":", "''", ",", "'dest'", ":", "''", "}", "if", ...
Return a chunk from a file based on the data received
[ "Return", "a", "chunk", "from", "a", "file", "based", "on", "the", "data", "received" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L216-L252
train
saltstack/salt
salt/fileserver/s3fs.py
file_list
def file_list(load): ''' Return a list of all files on the file server in a specified environment ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = [] if 'saltenv' not in load: return ret saltenv = load['saltenv'] metadata = _...
python
def file_list(load): ''' Return a list of all files on the file server in a specified environment ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = [] if 'saltenv' not in load: return ret saltenv = load['saltenv'] metadata = _...
[ "def", "file_list", "(", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "ret", "=", "[", "]", "if", "'saltenv'", "not", "in", "load", ":", "return", "ret", "saltenv...
Return a list of all files on the file server in a specified environment
[ "Return", "a", "list", "of", "all", "files", "on", "the", "file", "server", "in", "a", "specified", "environment" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L255-L278
train
saltstack/salt
salt/fileserver/s3fs.py
dir_list
def dir_list(load): ''' Return a list of all directories on the master ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = [] if 'saltenv' not in load: return ret saltenv = load['saltenv'] metadata = _init() if not metadata...
python
def dir_list(load): ''' Return a list of all directories on the master ''' if 'env' in load: # "env" is not supported; Use "saltenv". load.pop('env') ret = [] if 'saltenv' not in load: return ret saltenv = load['saltenv'] metadata = _init() if not metadata...
[ "def", "dir_list", "(", "load", ")", ":", "if", "'env'", "in", "load", ":", "# \"env\" is not supported; Use \"saltenv\".", "load", ".", "pop", "(", "'env'", ")", "ret", "=", "[", "]", "if", "'saltenv'", "not", "in", "load", ":", "return", "ret", "saltenv"...
Return a list of all directories on the master
[ "Return", "a", "list", "of", "all", "directories", "on", "the", "master" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L291-L318
train
saltstack/salt
salt/fileserver/s3fs.py
_get_s3_key
def _get_s3_key(): ''' Get AWS keys from pillar or config ''' key = __opts__['s3.key'] if 's3.key' in __opts__ else None keyid = __opts__['s3.keyid'] if 's3.keyid' in __opts__ else None service_url = __opts__['s3.service_url'] \ if 's3.service_url' in __opts__ \ else None ve...
python
def _get_s3_key(): ''' Get AWS keys from pillar or config ''' key = __opts__['s3.key'] if 's3.key' in __opts__ else None keyid = __opts__['s3.keyid'] if 's3.keyid' in __opts__ else None service_url = __opts__['s3.service_url'] \ if 's3.service_url' in __opts__ \ else None ve...
[ "def", "_get_s3_key", "(", ")", ":", "key", "=", "__opts__", "[", "'s3.key'", "]", "if", "'s3.key'", "in", "__opts__", "else", "None", "keyid", "=", "__opts__", "[", "'s3.keyid'", "]", "if", "'s3.keyid'", "in", "__opts__", "else", "None", "service_url", "=...
Get AWS keys from pillar or config
[ "Get", "AWS", "keys", "from", "pillar", "or", "config" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L321-L345
train
saltstack/salt
salt/fileserver/s3fs.py
_init
def _init(): ''' Connect to S3 and download the metadata for each file in all buckets specified and cache the data to disk. ''' cache_file = _get_buckets_cache_filename() exp = time.time() - S3_CACHE_EXPIRE # check mtime of the buckets files cache metadata = None try: if os....
python
def _init(): ''' Connect to S3 and download the metadata for each file in all buckets specified and cache the data to disk. ''' cache_file = _get_buckets_cache_filename() exp = time.time() - S3_CACHE_EXPIRE # check mtime of the buckets files cache metadata = None try: if os....
[ "def", "_init", "(", ")", ":", "cache_file", "=", "_get_buckets_cache_filename", "(", ")", "exp", "=", "time", ".", "time", "(", ")", "-", "S3_CACHE_EXPIRE", "# check mtime of the buckets files cache", "metadata", "=", "None", "try", ":", "if", "os", ".", "pat...
Connect to S3 and download the metadata for each file in all buckets specified and cache the data to disk.
[ "Connect", "to", "S3", "and", "download", "the", "metadata", "for", "each", "file", "in", "all", "buckets", "specified", "and", "cache", "the", "data", "to", "disk", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L348-L368
train
saltstack/salt
salt/fileserver/s3fs.py
_get_cached_file_name
def _get_cached_file_name(bucket_name, saltenv, path): ''' Return the cached file name for a bucket path file ''' file_path = os.path.join(_get_cache_dir(), saltenv, bucket_name, path) # make sure bucket and saltenv directories exist if not os.path.exists(os.path.dirname(file_path)): o...
python
def _get_cached_file_name(bucket_name, saltenv, path): ''' Return the cached file name for a bucket path file ''' file_path = os.path.join(_get_cache_dir(), saltenv, bucket_name, path) # make sure bucket and saltenv directories exist if not os.path.exists(os.path.dirname(file_path)): o...
[ "def", "_get_cached_file_name", "(", "bucket_name", ",", "saltenv", ",", "path", ")", ":", "file_path", "=", "os", ".", "path", ".", "join", "(", "_get_cache_dir", "(", ")", ",", "saltenv", ",", "bucket_name", ",", "path", ")", "# make sure bucket and saltenv ...
Return the cached file name for a bucket path file
[ "Return", "the", "cached", "file", "name", "for", "a", "bucket", "path", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L380-L391
train
saltstack/salt
salt/fileserver/s3fs.py
_get_buckets_cache_filename
def _get_buckets_cache_filename(): ''' Return the filename of the cache for bucket contents. Create the path if it does not exist. ''' cache_dir = _get_cache_dir() if not os.path.exists(cache_dir): os.makedirs(cache_dir) return os.path.join(cache_dir, 'buckets_files.cache')
python
def _get_buckets_cache_filename(): ''' Return the filename of the cache for bucket contents. Create the path if it does not exist. ''' cache_dir = _get_cache_dir() if not os.path.exists(cache_dir): os.makedirs(cache_dir) return os.path.join(cache_dir, 'buckets_files.cache')
[ "def", "_get_buckets_cache_filename", "(", ")", ":", "cache_dir", "=", "_get_cache_dir", "(", ")", "if", "not", "os", ".", "path", ".", "exists", "(", "cache_dir", ")", ":", "os", ".", "makedirs", "(", "cache_dir", ")", "return", "os", ".", "path", ".", ...
Return the filename of the cache for bucket contents. Create the path if it does not exist.
[ "Return", "the", "filename", "of", "the", "cache", "for", "bucket", "contents", ".", "Create", "the", "path", "if", "it", "does", "not", "exist", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L394-L404
train
saltstack/salt
salt/fileserver/s3fs.py
_refresh_buckets_cache_file
def _refresh_buckets_cache_file(cache_file): ''' Retrieve the content of all buckets and cache the metadata to the buckets cache file ''' log.debug('Refreshing buckets cache file') key, keyid, service_url, verify_ssl, kms_keyid, location, path_style, https_enable = _get_s3_key() metadata =...
python
def _refresh_buckets_cache_file(cache_file): ''' Retrieve the content of all buckets and cache the metadata to the buckets cache file ''' log.debug('Refreshing buckets cache file') key, keyid, service_url, verify_ssl, kms_keyid, location, path_style, https_enable = _get_s3_key() metadata =...
[ "def", "_refresh_buckets_cache_file", "(", "cache_file", ")", ":", "log", ".", "debug", "(", "'Refreshing buckets cache file'", ")", "key", ",", "keyid", ",", "service_url", ",", "verify_ssl", ",", "kms_keyid", ",", "location", ",", "path_style", ",", "https_enabl...
Retrieve the content of all buckets and cache the metadata to the buckets cache file
[ "Retrieve", "the", "content", "of", "all", "buckets", "and", "cache", "the", "metadata", "to", "the", "buckets", "cache", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L407-L553
train
saltstack/salt
salt/fileserver/s3fs.py
_read_buckets_cache_file
def _read_buckets_cache_file(cache_file): ''' Return the contents of the buckets cache file ''' log.debug('Reading buckets cache file') with salt.utils.files.fopen(cache_file, 'rb') as fp_: try: data = pickle.load(fp_) except (pickle.UnpicklingError, AttributeError, EOF...
python
def _read_buckets_cache_file(cache_file): ''' Return the contents of the buckets cache file ''' log.debug('Reading buckets cache file') with salt.utils.files.fopen(cache_file, 'rb') as fp_: try: data = pickle.load(fp_) except (pickle.UnpicklingError, AttributeError, EOF...
[ "def", "_read_buckets_cache_file", "(", "cache_file", ")", ":", "log", ".", "debug", "(", "'Reading buckets cache file'", ")", "with", "salt", ".", "utils", ".", "files", ".", "fopen", "(", "cache_file", ",", "'rb'", ")", "as", "fp_", ":", "try", ":", "dat...
Return the contents of the buckets cache file
[ "Return", "the", "contents", "of", "the", "buckets", "cache", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L556-L570
train
saltstack/salt
salt/fileserver/s3fs.py
_find_files
def _find_files(metadata): ''' Looks for all the files in the S3 bucket cache metadata ''' ret = [] found = {} for bucket_dict in metadata: for bucket_name, data in six.iteritems(bucket_dict): filepaths = [k['Key'] for k in data] filepaths = [k for k in filepath...
python
def _find_files(metadata): ''' Looks for all the files in the S3 bucket cache metadata ''' ret = [] found = {} for bucket_dict in metadata: for bucket_name, data in six.iteritems(bucket_dict): filepaths = [k['Key'] for k in data] filepaths = [k for k in filepath...
[ "def", "_find_files", "(", "metadata", ")", ":", "ret", "=", "[", "]", "found", "=", "{", "}", "for", "bucket_dict", "in", "metadata", ":", "for", "bucket_name", ",", "data", "in", "six", ".", "iteritems", "(", "bucket_dict", ")", ":", "filepaths", "="...
Looks for all the files in the S3 bucket cache metadata
[ "Looks", "for", "all", "the", "files", "in", "the", "S3", "bucket", "cache", "metadata" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L573-L593
train
saltstack/salt
salt/fileserver/s3fs.py
_find_dirs
def _find_dirs(metadata): ''' Looks for all the directories in the S3 bucket cache metadata. Supports trailing '/' keys (as created by S3 console) as well as directories discovered in the path of file keys. ''' ret = [] found = {} for bucket_dict in metadata: for bucket_name, ...
python
def _find_dirs(metadata): ''' Looks for all the directories in the S3 bucket cache metadata. Supports trailing '/' keys (as created by S3 console) as well as directories discovered in the path of file keys. ''' ret = [] found = {} for bucket_dict in metadata: for bucket_name, ...
[ "def", "_find_dirs", "(", "metadata", ")", ":", "ret", "=", "[", "]", "found", "=", "{", "}", "for", "bucket_dict", "in", "metadata", ":", "for", "bucket_name", ",", "data", "in", "six", ".", "iteritems", "(", "bucket_dict", ")", ":", "dirpaths", "=", ...
Looks for all the directories in the S3 bucket cache metadata. Supports trailing '/' keys (as created by S3 console) as well as directories discovered in the path of file keys.
[ "Looks", "for", "all", "the", "directories", "in", "the", "S3", "bucket", "cache", "metadata", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L596-L625
train
saltstack/salt
salt/fileserver/s3fs.py
_find_file_meta
def _find_file_meta(metadata, bucket_name, saltenv, path): ''' Looks for a file's metadata in the S3 bucket cache file ''' env_meta = metadata[saltenv] if saltenv in metadata else {} bucket_meta = {} for bucket in env_meta: if bucket_name in bucket: bucket_meta = bucket[bucke...
python
def _find_file_meta(metadata, bucket_name, saltenv, path): ''' Looks for a file's metadata in the S3 bucket cache file ''' env_meta = metadata[saltenv] if saltenv in metadata else {} bucket_meta = {} for bucket in env_meta: if bucket_name in bucket: bucket_meta = bucket[bucke...
[ "def", "_find_file_meta", "(", "metadata", ",", "bucket_name", ",", "saltenv", ",", "path", ")", ":", "env_meta", "=", "metadata", "[", "saltenv", "]", "if", "saltenv", "in", "metadata", "else", "{", "}", "bucket_meta", "=", "{", "}", "for", "bucket", "i...
Looks for a file's metadata in the S3 bucket cache file
[ "Looks", "for", "a", "file", "s", "metadata", "in", "the", "S3", "bucket", "cache", "file" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L628-L646
train
saltstack/salt
salt/fileserver/s3fs.py
_get_file_from_s3
def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path): ''' Checks the local cache for the file, if it's old or missing go grab the file from S3 and update the cache ''' key, keyid, service_url, verify_ssl, kms_keyid, location, path_style, https_enable = _get_s3_key() # c...
python
def _get_file_from_s3(metadata, saltenv, bucket_name, path, cached_file_path): ''' Checks the local cache for the file, if it's old or missing go grab the file from S3 and update the cache ''' key, keyid, service_url, verify_ssl, kms_keyid, location, path_style, https_enable = _get_s3_key() # c...
[ "def", "_get_file_from_s3", "(", "metadata", ",", "saltenv", ",", "bucket_name", ",", "path", ",", "cached_file_path", ")", ":", "key", ",", "keyid", ",", "service_url", ",", "verify_ssl", ",", "kms_keyid", ",", "location", ",", "path_style", ",", "https_enabl...
Checks the local cache for the file, if it's old or missing go grab the file from S3 and update the cache
[ "Checks", "the", "local", "cache", "for", "the", "file", "if", "it", "s", "old", "or", "missing", "go", "grab", "the", "file", "from", "S3", "and", "update", "the", "cache" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L657-L736
train
saltstack/salt
salt/fileserver/s3fs.py
_trim_env_off_path
def _trim_env_off_path(paths, saltenv, trim_slash=False): ''' Return a list of file paths with the saltenv directory removed ''' env_len = None if _is_env_per_bucket() else len(saltenv) + 1 slash_len = -1 if trim_slash else None return [d[env_len:slash_len] for d in paths]
python
def _trim_env_off_path(paths, saltenv, trim_slash=False): ''' Return a list of file paths with the saltenv directory removed ''' env_len = None if _is_env_per_bucket() else len(saltenv) + 1 slash_len = -1 if trim_slash else None return [d[env_len:slash_len] for d in paths]
[ "def", "_trim_env_off_path", "(", "paths", ",", "saltenv", ",", "trim_slash", "=", "False", ")", ":", "env_len", "=", "None", "if", "_is_env_per_bucket", "(", ")", "else", "len", "(", "saltenv", ")", "+", "1", "slash_len", "=", "-", "1", "if", "trim_slas...
Return a list of file paths with the saltenv directory removed
[ "Return", "a", "list", "of", "file", "paths", "with", "the", "saltenv", "directory", "removed" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L739-L746
train
saltstack/salt
salt/fileserver/s3fs.py
_is_env_per_bucket
def _is_env_per_bucket(): ''' Return the configuration mode, either buckets per environment or a list of buckets that have environment dirs in their root ''' buckets = _get_buckets() if isinstance(buckets, dict): return True elif isinstance(buckets, list): return False e...
python
def _is_env_per_bucket(): ''' Return the configuration mode, either buckets per environment or a list of buckets that have environment dirs in their root ''' buckets = _get_buckets() if isinstance(buckets, dict): return True elif isinstance(buckets, list): return False e...
[ "def", "_is_env_per_bucket", "(", ")", ":", "buckets", "=", "_get_buckets", "(", ")", "if", "isinstance", "(", "buckets", ",", "dict", ")", ":", "return", "True", "elif", "isinstance", "(", "buckets", ",", "list", ")", ":", "return", "False", "else", ":"...
Return the configuration mode, either buckets per environment or a list of buckets that have environment dirs in their root
[ "Return", "the", "configuration", "mode", "either", "buckets", "per", "environment", "or", "a", "list", "of", "buckets", "that", "have", "environment", "dirs", "in", "their", "root" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/fileserver/s3fs.py#L749-L761
train
saltstack/salt
salt/modules/boto3_route53.py
find_hosted_zone
def find_hosted_zone(Id=None, Name=None, PrivateZone=None, region=None, key=None, keyid=None, profile=None): ''' Find a hosted zone with the given characteristics. Id The unique Zone Identifier for the Hosted Zone. Exclusive with Name. Name The domain name associa...
python
def find_hosted_zone(Id=None, Name=None, PrivateZone=None, region=None, key=None, keyid=None, profile=None): ''' Find a hosted zone with the given characteristics. Id The unique Zone Identifier for the Hosted Zone. Exclusive with Name. Name The domain name associa...
[ "def", "find_hosted_zone", "(", "Id", "=", "None", ",", "Name", "=", "None", ",", "PrivateZone", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "if", "not", "_exac...
Find a hosted zone with the given characteristics. Id The unique Zone Identifier for the Hosted Zone. Exclusive with Name. Name The domain name associated with the Hosted Zone. Exclusive with Id. Note this has the potential to match more then one hosted zone (e.g. a public and a priv...
[ "Find", "a", "hosted", "zone", "with", "the", "given", "characteristics", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L132-L184
train
saltstack/salt
salt/modules/boto3_route53.py
get_hosted_zone
def get_hosted_zone(Id, region=None, key=None, keyid=None, profile=None): ''' Return detailed info about the given zone. Id The unique Zone Identifier for the Hosted Zone. region Region to connect to. key Secret key to be used. keyid Access key to be used. ...
python
def get_hosted_zone(Id, region=None, key=None, keyid=None, profile=None): ''' Return detailed info about the given zone. Id The unique Zone Identifier for the Hosted Zone. region Region to connect to. key Secret key to be used. keyid Access key to be used. ...
[ "def", "get_hosted_zone", "(", "Id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "keyid"...
Return detailed info about the given zone. Id The unique Zone Identifier for the Hosted Zone. region Region to connect to. key Secret key to be used. keyid Access key to be used. profile Dict, or pillar key pointing to a dict, containing AWS region/key/ke...
[ "Return", "detailed", "info", "about", "the", "given", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L187-L215
train
saltstack/salt
salt/modules/boto3_route53.py
get_hosted_zones_by_domain
def get_hosted_zones_by_domain(Name, region=None, key=None, keyid=None, profile=None): ''' Find any zones with the given domain name and return detailed info about them. Note that this can return multiple Route53 zones, since a domain name can be used in both public and private zones. Name ...
python
def get_hosted_zones_by_domain(Name, region=None, key=None, keyid=None, profile=None): ''' Find any zones with the given domain name and return detailed info about them. Note that this can return multiple Route53 zones, since a domain name can be used in both public and private zones. Name ...
[ "def", "get_hosted_zones_by_domain", "(", "Name", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", "...
Find any zones with the given domain name and return detailed info about them. Note that this can return multiple Route53 zones, since a domain name can be used in both public and private zones. Name The domain name associated with the Hosted Zone(s). region Region to connect to. ...
[ "Find", "any", "zones", "with", "the", "given", "domain", "name", "and", "return", "detailed", "info", "about", "them", ".", "Note", "that", "this", "can", "return", "multiple", "Route53", "zones", "since", "a", "domain", "name", "can", "be", "used", "in",...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L218-L252
train
saltstack/salt
salt/modules/boto3_route53.py
list_hosted_zones
def list_hosted_zones(DelegationSetId=None, region=None, key=None, keyid=None, profile=None): ''' Return detailed info about all zones in the bound account. DelegationSetId If you're using reusable delegation sets and you want to list all of the hosted zones that are associated with a reusa...
python
def list_hosted_zones(DelegationSetId=None, region=None, key=None, keyid=None, profile=None): ''' Return detailed info about all zones in the bound account. DelegationSetId If you're using reusable delegation sets and you want to list all of the hosted zones that are associated with a reusa...
[ "def", "list_hosted_zones", "(", "DelegationSetId", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", ...
Return detailed info about all zones in the bound account. DelegationSetId If you're using reusable delegation sets and you want to list all of the hosted zones that are associated with a reusable delegation set, specify the ID of that delegation set. region Region to connect to. ...
[ "Return", "detailed", "info", "about", "all", "zones", "in", "the", "bound", "account", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L255-L284
train
saltstack/salt
salt/modules/boto3_route53.py
create_hosted_zone
def create_hosted_zone(Name, VPCId=None, VPCName=None, VPCRegion=None, CallerReference=None, Comment='', PrivateZone=False, DelegationSetId=None, region=None, key=None, keyid=None, profile=None): ''' Create a new Route53 Hosted Zone. Returns a Python data structure ...
python
def create_hosted_zone(Name, VPCId=None, VPCName=None, VPCRegion=None, CallerReference=None, Comment='', PrivateZone=False, DelegationSetId=None, region=None, key=None, keyid=None, profile=None): ''' Create a new Route53 Hosted Zone. Returns a Python data structure ...
[ "def", "create_hosted_zone", "(", "Name", ",", "VPCId", "=", "None", ",", "VPCName", "=", "None", ",", "VPCRegion", "=", "None", ",", "CallerReference", "=", "None", ",", "Comment", "=", "''", ",", "PrivateZone", "=", "False", ",", "DelegationSetId", "=", ...
Create a new Route53 Hosted Zone. Returns a Python data structure with information about the newly created Hosted Zone. Name The name of the domain. This should be a fully-specified domain, and should terminate with a period. This is the name you have registered with your DNS registrar. It is a...
[ "Create", "a", "new", "Route53", "Hosted", "Zone", ".", "Returns", "a", "Python", "data", "structure", "with", "information", "about", "the", "newly", "created", "Hosted", "Zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L287-L412
train
saltstack/salt
salt/modules/boto3_route53.py
update_hosted_zone_comment
def update_hosted_zone_comment(Id=None, Name=None, Comment=None, PrivateZone=None, region=None, key=None, keyid=None, profile=None): ''' Update the comment on an existing Route 53 hosted zone. Id The unique Zone Identifier for the Hosted Zone. Name The do...
python
def update_hosted_zone_comment(Id=None, Name=None, Comment=None, PrivateZone=None, region=None, key=None, keyid=None, profile=None): ''' Update the comment on an existing Route 53 hosted zone. Id The unique Zone Identifier for the Hosted Zone. Name The do...
[ "def", "update_hosted_zone_comment", "(", "Id", "=", "None", ",", "Name", "=", "None", ",", "Comment", "=", "None", ",", "PrivateZone", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", ...
Update the comment on an existing Route 53 hosted zone. Id The unique Zone Identifier for the Hosted Zone. Name The domain name associated with the Hosted Zone(s). Comment Any comments you want to include about the hosted zone. PrivateZone Boolean - Set to True if cha...
[ "Update", "the", "comment", "on", "an", "existing", "Route", "53", "hosted", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L415-L462
train
saltstack/salt
salt/modules/boto3_route53.py
associate_vpc_with_hosted_zone
def associate_vpc_with_hosted_zone(HostedZoneId=None, Name=None, VPCId=None, VPCName=None, VPCRegion=None, Comment=None, region=None, key=None, keyid=None, profile=None): ''' Associates an Amazon VPC with a private hosted zone. To perfor...
python
def associate_vpc_with_hosted_zone(HostedZoneId=None, Name=None, VPCId=None, VPCName=None, VPCRegion=None, Comment=None, region=None, key=None, keyid=None, profile=None): ''' Associates an Amazon VPC with a private hosted zone. To perfor...
[ "def", "associate_vpc_with_hosted_zone", "(", "HostedZoneId", "=", "None", ",", "Name", "=", "None", ",", "VPCId", "=", "None", ",", "VPCName", "=", "None", ",", "VPCRegion", "=", "None", ",", "Comment", "=", "None", ",", "region", "=", "None", ",", "key...
Associates an Amazon VPC with a private hosted zone. To perform the association, the VPC and the private hosted zone must already exist. You can't convert a public hosted zone into a private hosted zone. If you want to associate a VPC from one AWS account with a zone from a another, the AWS account owning...
[ "Associates", "an", "Amazon", "VPC", "with", "a", "private", "hosted", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L465-L567
train
saltstack/salt
salt/modules/boto3_route53.py
delete_hosted_zone
def delete_hosted_zone(Id, region=None, key=None, keyid=None, profile=None): ''' Delete a Route53 hosted zone. CLI Example:: salt myminion boto3_route53.delete_hosted_zone Z1234567890 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) try: r = conn.delet...
python
def delete_hosted_zone(Id, region=None, key=None, keyid=None, profile=None): ''' Delete a Route53 hosted zone. CLI Example:: salt myminion boto3_route53.delete_hosted_zone Z1234567890 ''' conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile) try: r = conn.delet...
[ "def", "delete_hosted_zone", "(", "Id", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "conn", "=", "_get_conn", "(", "region", "=", "region", ",", "key", "=", "key", ",", "key...
Delete a Route53 hosted zone. CLI Example:: salt myminion boto3_route53.delete_hosted_zone Z1234567890
[ "Delete", "a", "Route53", "hosted", "zone", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L686-L700
train
saltstack/salt
salt/modules/boto3_route53.py
delete_hosted_zone_by_domain
def delete_hosted_zone_by_domain(Name, PrivateZone=None, region=None, key=None, keyid=None, profile=None): ''' Delete a Route53 hosted zone by domain name, and PrivateZone status if provided. CLI Example:: salt myminion boto3_route53.delete_hosted_zone_by_domain ex...
python
def delete_hosted_zone_by_domain(Name, PrivateZone=None, region=None, key=None, keyid=None, profile=None): ''' Delete a Route53 hosted zone by domain name, and PrivateZone status if provided. CLI Example:: salt myminion boto3_route53.delete_hosted_zone_by_domain ex...
[ "def", "delete_hosted_zone_by_domain", "(", "Name", ",", "PrivateZone", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "profile", "=", "None", ")", ":", "args", "=", "{", "'Name'", ":", "Name", ",", ...
Delete a Route53 hosted zone by domain name, and PrivateZone status if provided. CLI Example:: salt myminion boto3_route53.delete_hosted_zone_by_domain example.org.
[ "Delete", "a", "Route53", "hosted", "zone", "by", "domain", "name", "and", "PrivateZone", "status", "if", "provided", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L703-L721
train
saltstack/salt
salt/modules/boto3_route53.py
aws_encode
def aws_encode(x): ''' An implementation of the encoding required to suport AWS's domain name rules defined here__: .. __: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html While AWS's documentation specifies individual ASCII characters which need to be encoded, we...
python
def aws_encode(x): ''' An implementation of the encoding required to suport AWS's domain name rules defined here__: .. __: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html While AWS's documentation specifies individual ASCII characters which need to be encoded, we...
[ "def", "aws_encode", "(", "x", ")", ":", "ret", "=", "None", "try", ":", "x", ".", "encode", "(", "'ascii'", ")", "ret", "=", "re", ".", "sub", "(", "r'\\\\x([a-f0-8]{2})'", ",", "_hexReplace", ",", "x", ".", "encode", "(", "'unicode_escape'", ")", "...
An implementation of the encoding required to suport AWS's domain name rules defined here__: .. __: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html While AWS's documentation specifies individual ASCII characters which need to be encoded, we instead just try to force the ...
[ "An", "implementation", "of", "the", "encoding", "required", "to", "suport", "AWS", "s", "domain", "name", "rules", "defined", "here__", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L724-L754
train
saltstack/salt
salt/modules/boto3_route53.py
_aws_encode_changebatch
def _aws_encode_changebatch(o): ''' helper method to process a change batch & encode the bits which need encoding. ''' change_idx = 0 while change_idx < len(o['Changes']): o['Changes'][change_idx]['ResourceRecordSet']['Name'] = aws_encode(o['Changes'][change_idx]['ResourceRecordSet']['Name']...
python
def _aws_encode_changebatch(o): ''' helper method to process a change batch & encode the bits which need encoding. ''' change_idx = 0 while change_idx < len(o['Changes']): o['Changes'][change_idx]['ResourceRecordSet']['Name'] = aws_encode(o['Changes'][change_idx]['ResourceRecordSet']['Name']...
[ "def", "_aws_encode_changebatch", "(", "o", ")", ":", "change_idx", "=", "0", "while", "change_idx", "<", "len", "(", "o", "[", "'Changes'", "]", ")", ":", "o", "[", "'Changes'", "]", "[", "change_idx", "]", "[", "'ResourceRecordSet'", "]", "[", "'Name'"...
helper method to process a change batch & encode the bits which need encoding.
[ "helper", "method", "to", "process", "a", "change", "batch", "&", "encode", "the", "bits", "which", "need", "encoding", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L757-L772
train
saltstack/salt
salt/modules/boto3_route53.py
get_resource_records
def get_resource_records(HostedZoneId=None, Name=None, StartRecordName=None, StartRecordType=None, PrivateZone=None, region=None, key=None, keyid=None, profile=None): ''' Get all resource records from a given zone matching the provided StartRecordName (if given)...
python
def get_resource_records(HostedZoneId=None, Name=None, StartRecordName=None, StartRecordType=None, PrivateZone=None, region=None, key=None, keyid=None, profile=None): ''' Get all resource records from a given zone matching the provided StartRecordName (if given)...
[ "def", "get_resource_records", "(", "HostedZoneId", "=", "None", ",", "Name", "=", "None", ",", "StartRecordName", "=", "None", ",", "StartRecordType", "=", "None", ",", "PrivateZone", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", ...
Get all resource records from a given zone matching the provided StartRecordName (if given) or all records in the zone (if not), optionally filtered by a specific StartRecordType. This will return any and all RRs matching, regardless of their special AWS flavors (weighted, geolocation, alias, etc.) so your...
[ "Get", "all", "resource", "records", "from", "a", "given", "zone", "matching", "the", "provided", "StartRecordName", "(", "if", "given", ")", "or", "all", "records", "in", "the", "zone", "(", "if", "not", ")", "optionally", "filtered", "by", "a", "specific...
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L814-L901
train
saltstack/salt
salt/modules/boto3_route53.py
change_resource_record_sets
def change_resource_record_sets(HostedZoneId=None, Name=None, PrivateZone=None, ChangeBatch=None, region=None, key=None, keyid=None, profile=None): ''' See the `AWS Route53 API docs`__ as well as the `Boto3 documentation`__ for all the details... ...
python
def change_resource_record_sets(HostedZoneId=None, Name=None, PrivateZone=None, ChangeBatch=None, region=None, key=None, keyid=None, profile=None): ''' See the `AWS Route53 API docs`__ as well as the `Boto3 documentation`__ for all the details... ...
[ "def", "change_resource_record_sets", "(", "HostedZoneId", "=", "None", ",", "Name", "=", "None", ",", "PrivateZone", "=", "None", ",", "ChangeBatch", "=", "None", ",", "region", "=", "None", ",", "key", "=", "None", ",", "keyid", "=", "None", ",", "prof...
See the `AWS Route53 API docs`__ as well as the `Boto3 documentation`__ for all the details... .. __: https://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html .. __: http://boto3.readthedocs.io/en/latest/reference/services/route53.html#Route53.Client.change_resource_record_sets...
[ "See", "the", "AWS", "Route53", "API", "docs", "__", "as", "well", "as", "the", "Boto3", "documentation", "__", "for", "all", "the", "details", "..." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/modules/boto3_route53.py#L904-L1002
train
saltstack/salt
salt/utils/sanitizers.py
mask_args_value
def mask_args_value(data, mask): ''' Mask a line in the data, which matches "mask". This can be used for cases where values in your roster file may contain sensitive data such as IP addresses, passwords, user names, etc. Note that this works only when ``data`` is a single string (i.e. when the ...
python
def mask_args_value(data, mask): ''' Mask a line in the data, which matches "mask". This can be used for cases where values in your roster file may contain sensitive data such as IP addresses, passwords, user names, etc. Note that this works only when ``data`` is a single string (i.e. when the ...
[ "def", "mask_args_value", "(", "data", ",", "mask", ")", ":", "if", "not", "mask", ":", "return", "data", "out", "=", "[", "]", "for", "line", "in", "data", ".", "split", "(", "os", ".", "linesep", ")", ":", "if", "fnmatch", ".", "fnmatch", "(", ...
Mask a line in the data, which matches "mask". This can be used for cases where values in your roster file may contain sensitive data such as IP addresses, passwords, user names, etc. Note that this works only when ``data`` is a single string (i.e. when the data in the roster is formatted as ``key: va...
[ "Mask", "a", "line", "in", "the", "data", "which", "matches", "mask", "." ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/sanitizers.py#L69-L95
train
saltstack/salt
salt/utils/sanitizers.py
InputSanitizer.trim
def trim(value): ''' Raise an exception if value is empty. Otherwise strip it down. :param value: :return: ''' value = (value or '').strip() if not value: raise CommandExecutionError("Empty value during sanitation") return six.text_type(value)
python
def trim(value): ''' Raise an exception if value is empty. Otherwise strip it down. :param value: :return: ''' value = (value or '').strip() if not value: raise CommandExecutionError("Empty value during sanitation") return six.text_type(value)
[ "def", "trim", "(", "value", ")", ":", "value", "=", "(", "value", "or", "''", ")", ".", "strip", "(", ")", "if", "not", "value", ":", "raise", "CommandExecutionError", "(", "\"Empty value during sanitation\"", ")", "return", "six", ".", "text_type", "(", ...
Raise an exception if value is empty. Otherwise strip it down. :param value: :return:
[ "Raise", "an", "exception", "if", "value", "is", "empty", ".", "Otherwise", "strip", "it", "down", ".", ":", "param", "value", ":", ":", "return", ":" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/sanitizers.py#L31-L41
train
saltstack/salt
salt/utils/sanitizers.py
InputSanitizer.filename
def filename(value): ''' Remove everything that would affect paths in the filename :param value: :return: ''' return re.sub('[^a-zA-Z0-9.-_ ]', '', os.path.basename(InputSanitizer.trim(value)))
python
def filename(value): ''' Remove everything that would affect paths in the filename :param value: :return: ''' return re.sub('[^a-zA-Z0-9.-_ ]', '', os.path.basename(InputSanitizer.trim(value)))
[ "def", "filename", "(", "value", ")", ":", "return", "re", ".", "sub", "(", "'[^a-zA-Z0-9.-_ ]'", ",", "''", ",", "os", ".", "path", ".", "basename", "(", "InputSanitizer", ".", "trim", "(", "value", ")", ")", ")" ]
Remove everything that would affect paths in the filename :param value: :return:
[ "Remove", "everything", "that", "would", "affect", "paths", "in", "the", "filename" ]
e8541fd6e744ab0df786c0f76102e41631f45d46
https://github.com/saltstack/salt/blob/e8541fd6e744ab0df786c0f76102e41631f45d46/salt/utils/sanitizers.py#L44-L51
train