示例#1
0
    def __init__(self, api_key, api_secret, access_token):
        Api.__init__(self, api_key, api_secret)

        self.oauth_token = oauth.Token(
            access_token['oauth_token'], access_token['oauth_token_secret']
        )
        self.client = oauth.Client(self.consumer, self.oauth_token)
示例#2
0
 def __init__(self, protocol="http", hostname="", port="", authenticationMethode="basic"):
     Api.__init__(self)
     self._protocol = protocol.lower()
     self._hostname = hostname
     self._port = port
     self._rootUrl = self._protocol + "://" + self._hostname + ":" + self._port
     self.setAuthenticationMethode(authenticationMethode)
     # Loading configuration file with all the api
     with open("module_utils/ranger_api.json") as jsonFile:
         self._config = json.load(jsonFile)
     self._api = self._config["api"]
示例#3
0
 def __init__(self,
              protocol="http",
              hostname="",
              port="",
              authenticationMethode="basic"):
     Api.__init__(self)
     self._protocol = protocol.lower()
     self._hostname = hostname
     self._port = port
     self._rootUrl = self._protocol + "://" + self._hostname + ":" + self._port
     self.setAuthenticationMethode(authenticationMethode)
     # Loading configuration file with all the api
     with open("ambari_api.json") as jsonFile:
         self._config = json.load(jsonFile)
     self._clusterNameMask = self._config["clusterNameMask"]
     self._serviceNameMask = self._config["serviceNameMask"]
     self._requestIdMask = self._config["requestIdMask"]
     self._sleepingTimeInSeconds = self._config["sleepingTimeInSeconds"]
     self._api = self._config["api"]
示例#4
0
    def __init__(self, api_key, api_secret):
        self.request_token_endpoint = '/uas/oauth/requestToken'
        self.access_token_endpoint = '/uas/oauth/accessToken'
        # self.authorize_endpoint = '/uas/oauth/authorize'

        Api.__init__(self, api_key, api_secret)