Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:language: python
:dedent: 4
:caption: Gets the deleted secret
"""
url = "/".join([self.vault_url, "deletedsecrets", name])
request = HttpRequest('GET', 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('DeletedSecretBundle', response)
return DeletedSecret._from_deleted_secret_bundle(bundle)
:language: python
:dedent: 4
:caption: Deletes a secret
"""
url = '/'.join([self._vault_url, 'secrets', name])
request = HttpRequest('DELETE', 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('DeletedSecretBundle', response)
return DeletedSecret._from_deleted_secret_bundle(bundle)