Skip to content
Merged
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
5 changes: 1 addition & 4 deletions src/azure-cli/azure/cli/command_modules/monitor/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,17 +1334,14 @@
examples:
- name: Create a data export rule for a given workspace.
text: az monitor log-analytics workspace data-export create -g MyRG --workspace-name MyWS -n MyDataExport --destination {sa_id_1} --enable -t {table_name}
- name: Create a data export rule for a given workspace with all tables.
text: az monitor log-analytics workspace data-export create -g MyRG --workspace-name MyWS -n MyDataExport --destination {sa_id_1} --enable --all

"""

helps['monitor log-analytics workspace data-export update'] = """
type: command
short-summary: Update a data export rule for a given workspace.
examples:
- name: Update a data export rule for a given workspace.
text: az monitor log-analytics workspace data-export update -g MyRG --workspace-name MyWS -n MyDataExport --destination {namespace_id} --all --enable false
text: az monitor log-analytics workspace data-export update -g MyRG --workspace-name MyWS -n MyDataExport --destination {namespace_id} -t {table_name} --enable false
"""

helps['monitor log-analytics workspace data-export list'] = """
Expand Down
2 changes: 0 additions & 2 deletions src/azure-cli/azure/cli/command_modules/monitor/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,6 @@ def load_arguments(self, _):
with self.argument_context('monitor log-analytics workspace data-export') as c:
c.argument('data_export_name', options_list=['--name', '-n'], help="Name of the data export rule")
c.argument('workspace_name', options_list='--workspace-name')
c.argument('enable_all_tables', options_list=['--all', '--export-all-tables'], arg_type=get_three_state_flag(),
help="All workspace's tables are exported when this is enabled.")
c.argument('table_names', nargs='+', options_list=['--tables', '-t'],
help='An array of tables to export. if --export-all-tables is true, this argument should not be provided.')
c.argument('destination', validator=process_workspace_data_export_destination,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,22 @@ def update_log_analytics_workspace_saved_search(cmd, instance, category=None, di


def create_log_analytics_workspace_data_exports(client, workspace_name, resource_group_name, data_export_name,
destination, data_export_type, enable_all_tables=None, table_names=None,
destination, data_export_type, table_names,
event_hub_name=None, enable=None):
from azure.mgmt.loganalytics.models import DataExport
if enable_all_tables:
table_names = None
data_export = DataExport(all_tables=enable_all_tables,
resource_id=destination,
data_export = DataExport(resource_id=destination,
data_export_type=data_export_type,
table_names=table_names,
event_hub_name=event_hub_name,
enable=enable)
return client.create_or_update(resource_group_name, workspace_name, data_export_name, data_export)


def update_log_analytics_workspace_data_exports(cmd, instance, destination=None, data_export_type=None,
enable_all_tables=None, table_names=None,
def update_log_analytics_workspace_data_exports(cmd, instance, table_names, destination=None, data_export_type=None,
event_hub_name=None, enable=None):
if enable_all_tables:
table_names = ''
with cmd.update_context(instance) as c:
c.set_param('resource_id', destination)
c.set_param('data_export_type', data_export_type)
c.set_param('all_tables', enable_all_tables)
c.set_param('table_names', table_names)
c.set_param('event_hub_name', event_hub_name)
c.set_param('enable', enable)
Expand Down
Loading