Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:dedent: 4
:caption: Restores a backed up secret to the vault
"""
url = "/".join([self.vault_url, "deletedsecrets", name, "recover"])
request = HttpRequest('POST', url)
request.format_parameters({'api-version': self._api_version})
response = self._pipeline.run(request, **kwargs).http_response
if response.status_code != 200:
raise ClientRequestError("Request failed with code {}: '{}'".format(response.status_code, response.text()))
bundle = DESERIALIZE('SecretBundle', response)
return SecretAttributes._from_secret_bundle(bundle)
}
request_body = SERIALIZE.body(secret, 'Secret')
request = HttpRequest('PATCH', url, headers, data=request_body)
request.format_parameters(query_parameters)
response = self._pipeline.run(request, **kwargs).http_response
if response.status_code != 200:
raise ClientRequestError('Request failed status code {}. {}'.format(response.status_code, response.text()))
bundle = DESERIALIZE('SecretBundle', response)
return SecretAttributes._from_secret_bundle(bundle)