Skip to content

Commit

Permalink
Merge pull request Azure#26 from kairu-ms/feature-log-analytics
Browse files Browse the repository at this point in the history
Migrate monitor log analytics commands
  • Loading branch information
kairu-ms authored Sep 26, 2022
2 parents 74234e7 + 96ef650 commit 5d5afbd
Show file tree
Hide file tree
Showing 101 changed files with 24,252 additions and 232 deletions.
2 changes: 1 addition & 1 deletion Commands/monitor/log-analytics/cluster/_delete.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Command] _monitor log-analytics cluster delete_

Deletes a cluster instance.
Delete a cluster instance.

## Versions

Expand Down
2 changes: 1 addition & 1 deletion Commands/monitor/log-analytics/cluster/_update.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Command] _monitor log-analytics cluster update_

Create or update a Log Analytics cluster.
Update a cluster instance.

Update a cluster instance.

Expand Down
4 changes: 2 additions & 2 deletions Commands/monitor/log-analytics/cluster/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Manage Azure log analytics cluster.
: Create a cluster instance.

- [delete](/Commands/monitor/log-analytics/cluster/_delete.md)
: Deletes a cluster instance.
: Delete a cluster instance.

- [list](/Commands/monitor/log-analytics/cluster/_list.md)
: List all cluster instances in a resource group or in current subscription.
Expand All @@ -17,4 +17,4 @@ Manage Azure log analytics cluster.
: Show the properties of a cluster instance.

- [update](/Commands/monitor/log-analytics/cluster/_update.md)
: Create or update a Log Analytics cluster.
: Update a cluster instance.
3 changes: 3 additions & 0 deletions Commands/monitor/log-analytics/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ Manage Azure log analytics.

- [query-pack](/Commands/monitor/log-analytics/query-pack/readme.md)
: Manage Azure log analytics query pack.

- [workspace](/Commands/monitor/log-analytics/workspace/readme.md)
: Manage Azure log analytics workspace
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace create_

Create a workspace instance

## Versions

### [2021-12-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30=/2021-12-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{} 2021-12-01-preview -->

#### examples

- Create a workspace instance
```bash
monitor log-analytics workspace create -g MyResourceGroup -n MyWorkspace
```
23 changes: 23 additions & 0 deletions Commands/monitor/log-analytics/workspace/_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# [Command] _monitor log-analytics workspace delete_

Deletes a workspace resource.

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.

## Versions

### [2021-12-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30=/2021-12-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{} 2021-12-01-preview -->

#### examples

- Soft delete a workspace instance.
```bash
monitor log-analytics workspace delete --resource-group MyResourceGroup --workspace-name MyWorkspace
```

- Completely delete a workspace instance.
```bash
monitor log-analytics workspace delete --force --resource-group MyResourceGroup --workspace-name MyWorkspace
```
19 changes: 19 additions & 0 deletions Commands/monitor/log-analytics/workspace/_get-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# [Command] _monitor log-analytics workspace get-schema_

Get the schema for a given workspace.

Schema represents the internal structure of the workspace, which can be used during the query.\
For more information, visit: https://docs.microsoft.com/en-us/rest/api/loganalytics/workspace-schema/get

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vc2NoZW1h/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/schema 2020-08-01 -->

#### examples

- Get the schema for a given workspace.
```bash
monitor log-analytics workspace get-schema --resource-group MyResourceGroup --workspace-name MyWorkspace
```
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/_get-shared-keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace get-shared-keys_

Get the shared keys for a workspace.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vc2hhcmVka2V5cw==/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/sharedkeys 2020-08-01 -->

#### examples

- Get the shared keys for a workspace.
```bash
monitor log-analytics workspace get-shared-keys --resource-group MyResourceGroup --workspace-name MyWorkspace
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [Command] _monitor log-analytics workspace list-deleted-workspaces_

Get a list of deleted workspaces that can be recovered in a subscription or a resource group.

## Versions

### [2021-12-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL2RlbGV0ZWR3b3Jrc3BhY2Vz/2021-12-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/providers/microsoft.operationalinsights/deletedworkspaces 2021-12-01-preview -->
<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/deletedworkspaces 2021-12-01-preview -->

#### examples

- Get a list of deleted workspaces that can be recovered in a resource group
```bash
monitor log-analytics workspace list-deleted-workspaces --resource-group MyResourceGroup
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace list-management-groups_

Get a list of management groups connected to a workspace.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vbWFuYWdlbWVudGdyb3Vwcw==/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/managementgroups 2020-08-01 -->

#### examples

- Get a list of management groups connected to a workspace.
```bash
monitor log-analytics workspace list-management-groups --resource-group MyResourceGroup --workspace-name MyWorkspace
```
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/_list-usages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace list-usages_

Get a list of usage metrics for a workspace.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vdXNhZ2Vz/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/usages 2020-08-01 -->

#### examples

- Get a list of usage metrics for a workspace.
```bash
monitor log-analytics workspace list-usages --resource-group MyResourceGroup --workspace-name MyWorkspace
```
10 changes: 10 additions & 0 deletions Commands/monitor/log-analytics/workspace/_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# [Command] _monitor log-analytics workspace list_

Get a list of workspaces under a resource group or a subscription.

## Versions

### [2021-12-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXM=/2021-12-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/providers/microsoft.operationalinsights/workspaces 2021-12-01-preview -->
<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces 2021-12-01-preview -->
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace show_

Show a workspace instance.

## Versions

### [2021-12-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30=/2021-12-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{} 2021-12-01-preview -->

#### examples

- Show a workspace instance.
```bash
monitor log-analytics workspace show --resource-group MyResourceGroup --workspace-name MyWorkspace
```
21 changes: 21 additions & 0 deletions Commands/monitor/log-analytics/workspace/_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# [Command] _monitor log-analytics workspace update_

Update a workspace instance.

## Versions

### [2021-12-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30=/2021-12-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{} 2021-12-01-preview -->

#### examples

- Update a workspace instance.
```bash
monitor log-analytics workspace update --resource-group myresourcegroup --retention-time 30 --workspace-name myworkspace
```

- Update the defaultDataCollectionRuleResourceId of the workspace
```bash
monitor log-analytics workspace update --resource-group myresourcegroup --workspace-name myworkspace --data-collection-rule "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}".
```
19 changes: 19 additions & 0 deletions Commands/monitor/log-analytics/workspace/data-export/_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# [Command] _monitor log-analytics workspace data-export create_

Create a data export rule for a given workspace.

For more information, see\
https://docs.microsoft.com/azure/azure-monitor/platform/logs-data-export

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vZGF0YWV4cG9ydHMve30=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/dataexports/{} 2020-08-01 -->

#### examples

- Create a data export rule for a given workspace.
```bash
monitor log-analytics workspace data-export create -g MyRG --workspace-name MyWS -n MyDataExport --destination <storage account id> --enable -t <table name>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _monitor log-analytics workspace data-export delete_

Delete a data export rule for a given workspace.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vZGF0YWV4cG9ydHMve30=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/dataexports/{} 2020-08-01 -->
9 changes: 9 additions & 0 deletions Commands/monitor/log-analytics/workspace/data-export/_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _monitor log-analytics workspace data-export list_

List all data export ruleses for a given workspace.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vZGF0YWV4cG9ydHM=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/dataexports 2020-08-01 -->
9 changes: 9 additions & 0 deletions Commands/monitor/log-analytics/workspace/data-export/_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _monitor log-analytics workspace data-export show_

Show a data export rule for a given workspace.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vZGF0YWV4cG9ydHMve30=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/dataexports/{} 2020-08-01 -->
19 changes: 19 additions & 0 deletions Commands/monitor/log-analytics/workspace/data-export/_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# [Command] _monitor log-analytics workspace data-export update_

Update a data export rule for a given workspace.

For more information, see\
https://docs.microsoft.com/azure/azure-monitor/platform/logs-data-export

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vZGF0YWV4cG9ydHMve30=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/dataexports/{} 2020-08-01 -->

#### examples

- Update a data export rule for a given workspace.
```bash
monitor log-analytics workspace data-export update -g MyRG --workspace-name MyWS -n MyDataExport --destination <event hub namespace id> -t <table name> --enable false
```
20 changes: 20 additions & 0 deletions Commands/monitor/log-analytics/workspace/data-export/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# [Group] _monitor log-analytics workspace data-export_

Manage data export ruls for log analytics workspace.

## Commands

- [create](/Commands/monitor/log-analytics/workspace/data-export/_create.md)
: Create a data export rule for a given workspace.

- [delete](/Commands/monitor/log-analytics/workspace/data-export/_delete.md)
: Delete a data export rule for a given workspace.

- [list](/Commands/monitor/log-analytics/workspace/data-export/_list.md)
: List all data export ruleses for a given workspace.

- [show](/Commands/monitor/log-analytics/workspace/data-export/_show.md)
: Show a data export rule for a given workspace.

- [update](/Commands/monitor/log-analytics/workspace/data-export/_update.md)
: Update a data export rule for a given workspace.
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/linked-service/_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace linked-service create_

Create a linked service.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vbGlua2Vkc2VydmljZXMve30=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/linkedservices/{} 2020-08-01 -->

#### examples

- Create a linked service.
```bash
monitor log-analytics workspace linked-service create -g MyResourceGroup -n cluster --workspace-name MyWorkspace --write-access-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/clusters/MyCluster
```
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/linked-service/_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace linked-service delete_

Delete a linked service.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vbGlua2Vkc2VydmljZXMve30=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/linkedservices/{} 2020-08-01 -->

#### examples

- Delete a linked service.
```bash
monitor log-analytics workspace linked-service delete -g MyResourceGroup -n cluster --workspace-name MyWorkspace
```
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/linked-service/_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace linked-service list_

Get all the linked services in a workspace.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vbGlua2Vkc2VydmljZXM=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/linkedservices 2020-08-01 -->

#### examples

- Get all the linked services in a workspace.
```bash
monitor log-analytics workspace linked-service list -g MyResourceGroup --workspace-name MyWorkspace
```
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/linked-service/_show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace linked-service show_

Show the properties of a linked service.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vbGlua2Vkc2VydmljZXMve30=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/linkedservices/{} 2020-08-01 -->

#### examples

- Show the properties of a linked service.
```bash
monitor log-analytics workspace linked-service show -g MyResourceGroup -n cluster --workspace-name MyWorkspace
```
16 changes: 16 additions & 0 deletions Commands/monitor/log-analytics/workspace/linked-service/_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# [Command] _monitor log-analytics workspace linked-service update_

Update a linked service.

## Versions

### [2020-08-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5vcGVyYXRpb25hbGluc2lnaHRzL3dvcmtzcGFjZXMve30vbGlua2Vkc2VydmljZXMve30=/2020-08-01.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.operationalinsights/workspaces/{}/linkedservices/{} 2020-08-01 -->

#### examples

- Update a linked service.
```bash
monitor log-analytics workspace linked-service update -g MyResourceGroup -n cluster --workspace-name MyWorkspace --write-access-resource-id /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.OperationalInsights/clusters/MyCluster
```
Loading

0 comments on commit 5d5afbd

Please sign in to comment.