(self, config_dir)
| 24 | self.session.headers.update({'Authorization': 'Bearer ' + token}) |
| 25 | |
| 26 | def __get_auth_token(self, config_dir): |
| 27 | creds_path = os.path.join(config_dir, 'credentials.json') |
| 28 | try: |
| 29 | with open(creds_path) as f: |
| 30 | data = f.read() |
| 31 | except FileNotFoundError: |
| 32 | return None |
| 33 | creds = json.loads(data) |
| 34 | if self.base_url in creds['services']: |
| 35 | return creds['services'][self.base_url]['access'] |
| 36 | return None |
| 37 | |
| 38 | def create_pool(self, name, layout={'order': 'desc', 'keys': [['ts']]}, |
| 39 | thresh=0): |