zoukankan      html  css  js  c++  java
  • Saltstack module etcd 详解

    etcd.set

    New in version 2014.7.0
    
    Set a key in etcd by direct path. Optionally, create a directory
    or set a TTL on the key.  Returns None on failure.
    
    CLI Example:
    
        salt myminion etcd.set /path/to/key value
        salt myminion etcd.set /path/to/key value profile=my_etcd_config
        salt myminion etcd.set /path/to/key value host=127.0.0.1 port=2379
        salt myminion etcd.set /path/to/dir '' directory=True
        salt myminion etcd.set /path/to/key value ttl=5
    

    etcd.rm

    New in version 2014.7.0
    
    Delete a key from etcd.  Returns True if the key was deleted, False if it was
    not and None if there was a failure.
    
    CLI Example:
    
    
        salt myminion etcd.rm /path/to/key
        salt myminion etcd.rm /path/to/key profile=my_etcd_config
        salt myminion etcd.rm /path/to/key host=127.0.0.1 port=2379
        salt myminion etcd.rm /path/to/dir recurse=True profile=my_etcd_config
    

    etcd.update

    New in version 2016.3.0
    
    Sets a dictionary of values in one call.  Useful for large updates
    in syndic environments.  The dictionary can contain a mix of formats
    such as:
    
        {
          '/some/example/key': 'bar',
          '/another/example/key': 'baz'
        }
    
    Or it may be a straight dictionary, which will be flattened to look
    like the above format:
    
        {
            'some': {
                'example': {
                    'key': 'bar'
                }
            },
            'another': {
                'example': {
                    'key': 'baz'
                }
            }
        }
    
    You can even mix the two formats and it will be flattened to the first
    format.  Leading and trailing '/' will be removed.
    
    Empty directories can be created by setting the value of the key to an
    empty dictionary.
    
    The 'path' parameter will optionally set the root of the path to use.
    
    CLI Example:
    
        salt myminion etcd.update "{'/path/to/key': 'baz', '/another/key': 'bar'}"
        salt myminion etcd.update "{'/path/to/key': 'baz', '/another/key': 'bar'}" profile=my_etcd_config
        salt myminion etcd.update "{'/path/to/key': 'baz', '/another/key': 'bar'}" host=127.0.0.1 port=2379
        salt myminion etcd.update "{'/path/to/key': 'baz', '/another/key': 'bar'}" path='/some/root'
    

    etcd.tree

    New in version 2014.7.0
    
    Recurse through etcd and return all values.  Returns None on failure.
    
    CLI Example:
    
    
        salt myminion etcd.tree
        salt myminion etcd.tree profile=my_etcd_config
        salt myminion etcd.tree host=127.0.0.1 port=2379
        salt myminion etcd.tree /path/to/keys profile=my_etcd_config
    

    etcd.watch

    New in version 2016.3.0
    
    Makes a best effort to watch for a key or tree change in etcd.
    Returns a dict containing the new key value ( or None if the key was
    deleted ), the modifiedIndex of the key, whether the key changed or
    not, the path to the key that changed and whether it is a directory or not.
    
    If something catastrophic happens, returns {}
    
    CLI Example:
    
        salt myminion etcd.watch /path/to/key
        salt myminion etcd.watch /path/to/key timeout=10
        salt myminion etcd.watch /patch/to/key profile=my_etcd_config index=10
        salt myminion etcd.watch /patch/to/key host=127.0.0.1 port=2379
    

    etcd.ls

    New in version 2014.7.0
    
    Return all keys and dirs inside a specific path. Returns an empty dict on
    failure.
    
    CLI Example:
    
    
        salt myminion etcd.ls /path/to/dir/
        salt myminion etcd.ls /path/to/dir/ profile=my_etcd_config
        salt myminion etcd.ls /path/to/dir/ host=127.0.0.1 port=2379
    

    etcd.get

    New in version 2014.7.0
    
    Get a value from etcd, by direct path.  Returns None on failure.
    
    CLI Examples:
    
        salt myminion etcd.get /path/to/key
        salt myminion etcd.get /path/to/key profile=my_etcd_config
        salt myminion etcd.get /path/to/key recurse=True profile=my_etcd_config
        salt myminion etcd.get /path/to/key host=127.0.0.1 port=2379
  • 相关阅读:
    JDK1.8HashMap底层实现原理
    关于map转json,空key丢失的问题
    spring一些注解的使用及相关注解差异
    搭建基础项目遇到的一些小坑
    解析ftp上word文档的文字并输入
    R语言中回归模型预测的不同类型置信区间应用比较分析
    R语言中的广义线性模型(GLM)和广义相加模型(GAM):多元(平滑)回归分析保险资金投资组合信用风险敞口
    R语言对巨灾风险下的再保险合同定价研究案例:广义线性模型和帕累托分布Pareto distributions分析
    R语言中GLM(广义线性模型),非线性和异方差可视化分析
    如何用R语言绘制生成正态分布图表
  • 原文地址:https://www.cnblogs.com/randomlee/p/Saltstack_module_etcd.html
Copyright © 2011-2022 走看看