當前位置: 首頁>>代碼示例>>Python>>正文


Python RdsDefault.del_policy_to_bool方法代碼示例

本文整理匯總了Python中scli.constants.RdsDefault.del_policy_to_bool方法的典型用法代碼示例。如果您正苦於以下問題:Python RdsDefault.del_policy_to_bool方法的具體用法?Python RdsDefault.del_policy_to_bool怎麽用?Python RdsDefault.del_policy_to_bool使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在scli.constants.RdsDefault的用法示例。


在下文中一共展示了RdsDefault.del_policy_to_bool方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: execute

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import del_policy_to_bool [as 別名]
 def execute(self, parameter_pool):
     
     command = parameter_pool.get_value(ParameterName.Command)
     
     if parameter_pool.has(ParameterName.ApplicationName)\
         and parameter_pool.has(ParameterName.EnvironmentName):
         
         app_name = parameter_pool.get_value(ParameterName.ApplicationName)
         env_name = parameter_pool.get_value(ParameterName.EnvironmentName)
         policy = rds_utils.is_rds_delete_to_snapshot(parameter_pool, app_name, env_name)
         local_rds_switch = parameter_pool.get_value(ParameterName.RdsEnabled)
         if policy is not None and not RdsDefault.del_policy_to_bool(policy):
             if command == CommandType.UPDATE:
                 if local_rds_switch:
                     pass
                 else:
                     prompt.result(AskConfirmationOpMessage.CommandWarning[command])
             else:
                 prompt.result(AskConfirmationOpMessage.CommandWarning[command])
     
     if (parameter_pool.has(ParameterName.Force) \
             and parameter_pool.get_value(ParameterName.Force) == ServiceDefault.ENABLED) \
         or TerminalBase.ask_confirmation(AskConfirmationOpMessage.CommandConfirmation[command]):
         ret_result = OperationResult(self, None, None, None)
         return ret_result
     else:
         log.info('User cancelled command.')
         raise EBSCliException()
開發者ID:basilbeltran,項目名稱:bashitol,代碼行數:30,代碼來源:pseudo_operations.py

示例2: is_rds_delete_to_snapshot

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import del_policy_to_bool [as 別名]
def is_rds_delete_to_snapshot(parameter_pool, app_name, env_name):
    policy_option = OptionSepcification(RdsDefault.Namespace, 
                                          RdsDefault.OptionNames[ParameterName.RdsDeletionPolicy])
    policy_setting = api_wrapper.retrieve_configuration_settings(parameter_pool, app_name,
                                                                 env_name = env_name, 
                                                                 options = [policy_option])

    if len(policy_setting) != 1:
        return None # Option name not found. No RDS instance
    return RdsDefault.del_policy_to_bool(policy_setting[0].value) 
開發者ID:basilbeltran,項目名稱:bashitol,代碼行數:12,代碼來源:rds_utils.py

示例3: is_rds_delete_to_snapshot

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import del_policy_to_bool [as 別名]
def is_rds_delete_to_snapshot(parameter_pool, app_name, env_name):
    policy_options = {RdsDefault.Namespace: {RdsDefault.OptionNames[ParameterName.RdsDeletionPolicy]}}
    try:
        policy_setting = api_wrapper.retrieve_configuration_settings(parameter_pool, app_name,
                                                                     env_name = env_name, 
                                                                     options = policy_options)
    except InvalidParameterValueException:
        return None  # Environment not exist. No RDS instance        

    if len(policy_setting) < 1:
        return None # Option name not found. No RDS instance
   
    return RdsDefault.del_policy_to_bool(policy_setting[RdsDefault.Namespace]\
                                         [RdsDefault.OptionNames[ParameterName.RdsDeletionPolicy]]) 
開發者ID:cpdean,項目名稱:cpd.dotfiles,代碼行數:16,代碼來源:rds_utils.py

示例4: ask_delete_to_snapshot

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import del_policy_to_bool [as 別名]
    def ask_delete_to_snapshot(cls, parameter_pool):
        if parameter_pool.has(PName.RdsDeletionPolicy):
            original_value = parameter_pool.get_value(PName.RdsDeletionPolicy)
            display_value = RdsDefault.del_policy_to_bool(original_value)
            display_value = misc.bool_to_yesno(display_value)
        else:
            display_value = None
                    
        value = cls.ask_parameter(parameter_pool, PName.RdsDeletionPolicy, display_value)

        if value is None:
            return
        elif not isinstance(value, bool):
            value = RdsDefault.bool_to_del_policy(misc.string_to_boolean(value))
            
        parameter_pool.put(Parameter(PName.RdsDeletionPolicy, 
                                     value, 
                                     PSource.Terminal), 
                           True)        
開發者ID:basilbeltran,項目名稱:bashitol,代碼行數:21,代碼來源:rds_terminal.py

示例5: _probe_rds_change

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import del_policy_to_bool [as 別名]
    def _probe_rds_change(self, parameter_pool, command):
        
        if parameter_pool.has(ParameterName.ApplicationName)\
            and parameter_pool.has(ParameterName.EnvironmentName):

            app_name = parameter_pool.get_value(ParameterName.ApplicationName)
            env_name = parameter_pool.get_value(ParameterName.EnvironmentName)
            
            policy = rds_utils.is_rds_delete_to_snapshot(parameter_pool, app_name, env_name)
            local_rds_switch = parameter_pool.get_value(ParameterName.RdsEnabled)

            if policy is not None and not RdsDefault.del_policy_to_bool(policy):
                if command == CommandType.UPDATE:
                    if local_rds_switch:
                        pass
                    else:
                        prompt.result(AskConfirmationOpMessage.CommandWarning[command])
                else:
                    prompt.result(AskConfirmationOpMessage.CommandWarning[command])
開發者ID:eduardog,項目名稱:aws-toolbox,代碼行數:21,代碼來源:pseudo_operations.py


注:本文中的scli.constants.RdsDefault.del_policy_to_bool方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。