Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def get_long_running_output(response):


def _delete_initial(
self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, workspace_name, force=None, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.delete.metadata['url']
path_format_arguments = {
Expand All @@ -296,6 +296,8 @@ def _delete_initial(
# Construct parameters
query_parameters = {}
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1)
if force is not None:
query_parameters['force'] = self._serialize.query("force", force, 'bool')

# Construct headers
header_parameters = {}
Expand All @@ -320,14 +322,21 @@ def _delete_initial(
return client_raw_response

def delete(
self, resource_group_name, workspace_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes a workspace instance.
self, resource_group_name, workspace_name, force=None, custom_headers=None, raw=False, polling=True, **operation_config):
"""Deletes a workspace resource. To recover the workspace, create it again
with the same name, in the same subscription, resource group and
location. The name is kept for 14 days and cannot be used for another
workspace. To remove the workspace completely and release the name, use
the force flag.

:param resource_group_name: The name of the resource group. The name
is case insensitive.
:type resource_group_name: str
:param workspace_name: The name of the workspace.
:type workspace_name: str
:param force: Deletes the workspace without the recovery option. A
workspace that was deleted with this flag cannot be recovered.
:type force: bool
:param dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
Expand All @@ -342,6 +351,7 @@ def delete(
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
workspace_name=workspace_name,
force=force,
custom_headers=custom_headers,
raw=True,
**operation_config
Expand Down
4 changes: 3 additions & 1 deletion sdk/loganalytics/azure-mgmt-loganalytics/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
pass

# Version extraction inspired from 'requests'
with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd:
with open(os.path.join(package_folder_path, 'version.py')
if os.path.exists(os.path.join(package_folder_path, 'version.py'))
else os.path.join(package_folder_path, '_version.py'), 'r') as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)

Expand Down