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


Python RdsDefault.get_snippet_url方法代碼示例

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


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

示例1: generate_endpoint

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import get_snippet_url [as 別名]
def generate_endpoint(parameter_pool, region, source, force = False):
    parameter_pool.put(Parameter(ParameterName.RdsEndpoint, 
                                 RdsEndpoint[region], 
                                 source))     
    parameter_pool.put(Parameter(ParameterName.RdsSnippetUrl, 
                                 RdsDefault.get_snippet_url(region), 
                                 source))      
開發者ID:cpdean,項目名稱:cpd.dotfiles,代碼行數:9,代碼來源:rds_utils.py

示例2: execute

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import get_snippet_url [as 別名]
    def execute(self, parameter_pool):
        location = EbLocalDir.Path + os.path.sep + EbConfigFile.Name
        
        try:
            config_file.load_eb_config_file(location, parameter_pool, False)
            if config_file.check_access_permission(location) is False:
                message = ConfigFileErrorMessage.PermissionError.format(EbConfigFile.Name)
                log.info(message)
                prompt.error(message)
           
            #Post processing
            if not parameter_pool.has(ParameterName.RdsSnippetUrl)\
                and parameter_pool.has(ParameterName.Region):
                region = parameter_pool.get_value(ParameterName.Region)
                parameter_pool.put(Parameter(ParameterName.RdsSnippetUrl,
                                             RdsDefault.get_snippet_url(region),
                                             ParameterSource.ConfigFile))
            
        except EBConfigFileNotExistError:
            log.error('Configuration file "{0}" not exist.'.format(EbConfigFile.Name))
            prompt.error(ConfigFileMessage.CannotFind.format\
                        (EbConfigFile.Name, CommandType.INIT.lower()))
            raise EBSCliException()
            
        except BaseException as ex:
            log.error('Encountered error when load configuration file "{0}", becuase "{1}".'.\
                      format(EbConfigFile.Name, ex))
            prompt.error(ConfigFileMessage.CorrectionSuggestion.
                         format(location,CommandType.INIT.lower()))
            raise

        ret_result = OperationResult(self, None, None, None)
        return ret_result
開發者ID:JoaoVasques,項目名稱:aws-devtool,代碼行數:35,代碼來源:file_operations.py

示例3: _add_rds_extension

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import get_snippet_url [as 別名]
def _add_rds_extension(parameter_pool, option_settings, option_to_remove):
    region = parameter_pool.get_value(ParameterName.Region)
    
    #Generate snippet    
    env_name = parameter_pool.get_value(ParameterName.EnvironmentName)
    if has_rds_instance(parameter_pool, env_name):
        spec = None
    else:
        spec = TemplateSpecification()
        snippet = TemplateSnippet()
        snippet.snippet_name = RdsDefault.SnippetName
        snippet.source_url = RdsDefault.get_snippet_url(region)
        snippet.order = RdsDefault.SnippetAddOrder
        spec.template_snippets = [snippet]
    
    #Add/update option settings
    #TODO: change option_settings to o(1) structure while retain order for output
    for pname in RdsDefault.OptionMinSet:
        if parameter_pool.has(pname) and parameter_pool.get_value(pname) is not None:
            _update_option_setting(option_settings, 
                                   RdsDefault.Namespace, 
                                   RdsDefault.OptionNames[pname], 
                                   parameter_pool.get_value(pname))
    
    _trim_rds_options(option_settings, option_to_remove)
                    
    return spec
開發者ID:basilbeltran,項目名稱:bashitol,代碼行數:29,代碼來源:rds_utils.py

示例4: _remove_rds_extension

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import get_snippet_url [as 別名]
def _remove_rds_extension(parameter_pool, template_spec, option_settings, option_to_remove):
    region = parameter_pool.get_value(ParameterName.Region, False)
    
    #Generate snippet
    snippet = TemplateSnippet()
    snippet.snippet_name = RdsDefault.SnippetName
    snippet.source_url = RdsDefault.get_snippet_url(region)
    snippet.order = RdsDefault.SnippetRemoveOrder
    template_spec.template_snippets.append(snippet)
    
    #Remove option settings
    _remove_all_rds_options(option_settings, option_to_remove)
開發者ID:cpdean,項目名稱:cpd.dotfiles,代碼行數:14,代碼來源:rds_utils.py

示例5: ask_region

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import get_snippet_url [as 別名]
    def ask_region(cls, parameter_pool):
        original_value = parameter_pool.get_value(ParameterName.Region) \
            if parameter_pool.has(ParameterName.Region) else None
        
        original_source = parameter_pool.get_source(ParameterName.Region) \
            if parameter_pool.has(ParameterName.Region) else None
        
        if original_value is not None and \
            ParameterSource.is_ahead(original_source, ParameterSource.Terminal):
            print(TerminalPromptSettingParameterMessage[ParameterName.Region].\
                      format(ServiceRegionName[original_value]))            
            region_value = original_value
        else:
            append_message = u'' if original_value is None \
                else TerminalMessage.CurrentValue.format(ServiceRegionName[original_value])        
            print TerminalPromptAskingMessage[ParameterName.Region].format(append_message)
            
            region_name_list = list()
            for region in AvailableServiceRegion:
                region_name_list.append(ServiceRegionName[region])
            region_index = cls.single_choice(region_name_list, 
                                              TerminalMessage.AvailableRegion, 
                                              None,
                                              original_value is not None)
            
            region_value = AvailableServiceRegion[region_index] \
                if region_index is not None else original_value
            region = Parameter(ParameterName.Region, 
                               misc.to_unicode(region_value), 
                               ParameterSource.Terminal)
            parameter_pool.put(region, True)

        # Set service endpoint if not specified as CLI arguments
        cls._set_parameter_value(parameter_pool, 
                                 ParameterName.ServiceEndpoint, 
                                 misc.to_unicode(ServiceEndpoint[region_value]), 
                                 ParameterSource.Terminal)

            
        # Set RDS endpont and snippet if not specified as CLI arguments
        cls._set_parameter_value(parameter_pool, 
                                 ParameterName.RdsEndpoint, 
                                 RdsEndpoint[region_value], 
                                 ParameterSource.Terminal)
        cls._set_parameter_value(parameter_pool, 
                                 ParameterName.RdsSnippetUrl, 
                                 RdsDefault.get_snippet_url(region_value), 
                                 ParameterSource.Terminal)
開發者ID:basilbeltran,項目名稱:bashitol,代碼行數:50,代碼來源:service_terminal.py

示例6: _remove_rds_extension

# 需要導入模塊: from scli.constants import RdsDefault [as 別名]
# 或者: from scli.constants.RdsDefault import get_snippet_url [as 別名]
def _remove_rds_extension(parameter_pool, template_spec, option_settings, option_to_remove):
    region = parameter_pool.get_value(ParameterName.Region)
    
    #Generate snippet
    snippet = TemplateSnippet()
    snippet.snippet_name = RdsDefault.SnippetName
    snippet.source_url = RdsDefault.get_snippet_url(region)
    snippet.order = RdsDefault.SnippetRemoveOrder
    template_spec.template_snippets.append(snippet)
    
    #Remove option settings
    for pname in RdsDefault.OptionNames:
        _remove_option_setting(option_settings, 
                               option_to_remove,
                               RdsDefault.Namespace, 
                               RdsDefault.OptionNames[pname])
開發者ID:JoaoVasques,項目名稱:aws-devtool,代碼行數:18,代碼來源:rds_utils.py


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