Пример #1
0
    def permission_auth(access_id,
                        access_key,
                        region,
                        project_id,
                        offset=1,
                        limit=1):
        """
        请求一台机器做权限测试
        :param access_id:
        :param access_key:
        :param region:
        :param project_id:
        :param offset:
        :param limit:
        :return:
        """

        client = Client({
            "region": region,
            "project_id": project_id,
            "public_key": access_id,
            "private_key": access_key
        })
        response = client.umem().describe_uredis_group({
            "Offset": offset,
            "Limit": limit
        })
        return response
Пример #2
0
 def get_region_uredis(self, offset=0, limit=50):
     try:
         client = Client({
             "region": self.region,
             "project_id": self.project_id,
             "public_key": self.access_id,
             "private_key": self.access_key
         })
         response = client.umem().describe_uredis_group({
             "Offset": offset,
             "Limit": limit
         })
         return response
     except exc.UCloudException as uerr:
         ins_log.read_log('error',
                          'request ucloud api error:{0}'.format(uerr))
         return False
     except Exception as err:
         ins_log.read_log('error', err)
         return False