Пример #1
0
    def __init__(self, api_key):
        super(_LinodeLexiconClient, self).__init__()

        config = dns_common_lexicon.build_lexicon_config('linode', {}, {
            'auth_token': api_key,
        })

        self.provider = linode.Provider(config)
Пример #2
0
    def __init__(self, api_key: str, api_version: int) -> None:
        super().__init__()

        self.api_version = api_version

        if api_version == 3:
            config = dns_common_lexicon.build_lexicon_config('linode', {}, {
                'auth_token': api_key,
            })

            self.provider = linode.Provider(config)
        elif api_version == 4:
            config = dns_common_lexicon.build_lexicon_config('linode4', {}, {
                'auth_token': api_key,
            })

            self.provider = linode4.Provider(config)
        else:
            raise errors.PluginError('Invalid api version specified: {0}. (Supported: 3, 4)'
                                     .format(api_version))
Пример #3
0
 def __init__(self, api_key):
     super(_LinodeLexiconClient, self).__init__()
     self.provider = linode.Provider({
         'provider_name': 'linode',
         'auth_token': api_key
     })