python аутентификация atlasapi - PullRequest
0 голосов
/ 05 мая 2020

Я пытаюсь пройти аутентификацию в Атласе с помощью atlasapi . Я использую свою учетную запись Google и получаю сообщение об ошибке ErrAtlasUnauthorized: Authentication is required с помощью метода ниже. Поддерживается ли google auth или я что-то делаю не так?

from atlasapi.atlas import Atlas
auth = Atlas("foo@google.com","<password>","<groupId>")
clusters = auth.Clusters.get_all_clusters
print (clusters())

полная трассировка:

ErrAtlasUnauthorized                      Traceback (most recent call last)
<ipython-input-61-d69a101fdf69> in <module>
      1 clusters = auth.Clusters.get_all_clusters
----> 2 print (clusters())

C:\...\atlasapi\atlas.py in get_all_clusters(self, pageNum, itemsPerPage, iterable)
    129 
    130             uri = Settings.api_resources["Clusters"]["Get All Clusters"] % (self.atlas.group, pageNum, itemsPerPage)
--> 131             return self.atlas.network.get(Settings.BASE_URL + uri)
    132 
    133         def get_single_cluster(self, cluster: str) -> dict:

C:\...\atlasapi\network.py in get(self, uri)
    144             logger.debug("Auth information = {} {}".format(self.user, self.password))
    145 
--> 146             return self.answer(r.status_code, r.json())
    147 
    148         except Exception:

C:\...\atlasapi\network.py in answer(self, c, details)
     68             raise ErrAtlasBadRequest(c, details)
     69         elif c == Settings.UNAUTHORIZED:
---> 70             raise ErrAtlasUnauthorized(c, details)
     71         elif c == Settings.FORBIDDEN:
     72             raise ErrAtlasForbidden(c, details)

ErrAtlasUnauthorized: Authentication is required

1 Ответ

0 голосов
/ 06 мая 2020

Ключи доступа к API - это ваш Пользователь / Пароль.

...