def METHOD_NAME(self,cert_dir):
    global authorizationField
    cert_url="/api/2.0/services/truststore/v2tmigration/certificate"
    url = "https://" + self.nsxv_ip + cert_url
    response = requests.get(url, auth=(self.nsxv_user, self.nsxv_password), verify=False,
                          headers={'Accept': 'application/json'}, stream=True)
    cert_file="%s/cert.json" % cert_dir
    print('REST JSON %s is in file %s.' % (url, cert_file))
    with open(cert_file, 'w',encoding='utf-8') as newFile:
        json.dump(json.loads(response.text), newFile, indent=4)