Skip to content

Commit cfc0509

Browse files
authored
Merge pull request #16903 from dabenhamMic/feature/OperationalInsights
[OperationalInsights] onboarding autorest - Create hybrid repo
2 parents 9175c28 + fce8a5e commit cfc0509

File tree

59 files changed

+8320
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+8320
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@{
2+
GUID = 'c4733603-3414-41cb-b2f6-2e53c59925f4'
3+
RootModule = './Az.OperationalInsights.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: OperationalInsights cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.OperationalInsights.private.dll'
13+
FormatsToProcess = './Az.OperationalInsights.format.ps1xml'
14+
FunctionsToExport = 'Get-AzOperationalInsightsDeletedWorkspace', 'Get-AzOperationalInsightsTable', 'Get-AzOperationalInsightsWorkspace', 'Move-AzOperationalInsightsTable', 'New-AzOperationalInsightsTable', 'New-AzOperationalInsightsTableColumnObject', 'New-AzOperationalInsightsWorkspace', 'Remove-AzOperationalInsightsTable', 'Remove-AzOperationalInsightsWorkspace', 'Update-AzOperationalInsightsTable', 'Update-AzOperationalInsightsWorkspace', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
17+
PSData = @{
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'OperationalInsights'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
24+
}
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<!-- region Generated -->
2+
# Az.OperationalInsights
3+
This directory contains the PowerShell module for the OperationalInsights service.
4+
5+
---
6+
## Status
7+
[![Az.OperationalInsights](https://img.shields.io/powershellgallery/v/Az.OperationalInsights.svg?style=flat-square&label=Az.OperationalInsights "Az.OperationalInsights")](https://www.powershellgallery.com/packages/Az.OperationalInsights/)
8+
9+
## Info
10+
- Modifiable: yes
11+
- Generated: all
12+
- Committed: yes
13+
- Packaged: yes
14+
15+
---
16+
## Detail
17+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
18+
19+
## Module Requirements
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
21+
22+
## Authentication
23+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
24+
25+
## Development
26+
For information on how to develop for `Az.OperationalInsights`, see [how-to.md](how-to.md).
27+
<!-- endregion -->
28+
29+
### AutoRest Configuration
30+
> see https://aka.ms/autorest
31+
32+
``` yaml
33+
branch: 11126e93093e14fa30fd2bf314cc3992a6b1c4f1
34+
require:
35+
- $(this-folder)/../../readme.azure.noprofile.md
36+
input-file:
37+
- $(repo)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Operations.json
38+
- $(repo)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Tables.json
39+
- $(repo)/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/Workspaces.json
40+
41+
title: OperationalInsights
42+
module-version: 0.1.0
43+
subject-prefix: $(service-name)
44+
45+
identity-correction-for-post: true
46+
resourcegroup-append: true
47+
nested-object-to-string: true
48+
49+
directive:
50+
# Autorest only support enum for type string.
51+
- from: swagger-document
52+
where: $.definitions.WorkspaceSku.properties.capacityReservationLevel
53+
transform: >-
54+
return {
55+
"type": "integer",
56+
"format": "int32",
57+
"description": "The capacity reservation level in GB for this workspace, when CapacityReservation sku is selected.",
58+
"enum": [
59+
100,
60+
200,
61+
300,
62+
400,
63+
500,
64+
1000,
65+
2000,
66+
5000
67+
]
68+
}
69+
# Following is two common directive which are normally required in all the RPs
70+
# 1. Remove the unexpanded parameter set
71+
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
72+
- where:
73+
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
74+
remove: true
75+
# Remove the set-* cmdlet
76+
- where:
77+
verb: Set
78+
remove: true
79+
80+
- where:
81+
verb: New|Update
82+
subject: Workspace
83+
parameter-name: SkuName
84+
set:
85+
parameter-name: Sku
86+
87+
- where:
88+
verb: New|Update
89+
subject: Table
90+
parameter-name: RestoredLogsStartRestoreTime
91+
hide: true
92+
93+
- where:
94+
verb: New|Update
95+
subject: Table
96+
parameter-name: RestoredLogsEndRestoreTime
97+
hide: true
98+
99+
- where:
100+
verb: New|Update
101+
subject: Table
102+
parameter-name: SearchResultsLimit
103+
hide: true
104+
105+
- where:
106+
verb: New|Update
107+
subject: Table
108+
parameter-name: SearchResultsDescription
109+
hide: true
110+
111+
- where:
112+
verb: New|Update
113+
subject: Table
114+
parameter-name: SearchResultsStartSearchTime
115+
hide: true
116+
117+
- where:
118+
verb: New|Update
119+
subject: Table
120+
parameter-name: SearchResultsEndSearchTime
121+
hide: true
122+
123+
- where:
124+
verb: New|Update
125+
subject: Table
126+
parameter-name: SearchResultsQuery
127+
hide: true
128+
129+
- where:
130+
verb: New|Update
131+
subject: Workspace
132+
parameter-name: SkuCapacityReservationLevel
133+
set:
134+
parameter-name: SkuCapacity
135+
136+
- where:
137+
verb: New|Update
138+
subject: Workspace
139+
parameter-name: WorkspaceCappingDailyQuotaGb
140+
set:
141+
parameter-name: DailyQuotaGb
142+
143+
- where:
144+
verb: Remove
145+
subject: Workspace
146+
parameter-name: Force
147+
set:
148+
parameter-name: ForceDelete
149+
# For memory object that generate cmdlet.
150+
#- model-cmdlet:
151+
# - Column # Successfull generated after hide it for custom.
152+
```
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
16+
17+
<#
18+
.Synopsis
19+
Create an in-memory object for Column.
20+
.Description
21+
Create an in-memory object for Column.
22+
23+
.Outputs
24+
Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.Models.Api20211201Preview.Column
25+
.Link
26+
https://docs.microsoft.com/powershell/module/az.OperationalInsights/new-AzOperationalInsightsTableColumnObject
27+
#>
28+
function New-AzOperationalInsightsTableColumnObject {
29+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.Models.Api20211201Preview.Column')]
30+
[CmdletBinding(PositionalBinding=$false)]
31+
Param(
32+
33+
[Parameter(HelpMessage="Column data type logical hint.")]
34+
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.Support.ColumnDataTypeHintEnum])]
35+
[Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.Support.ColumnDataTypeHintEnum]
36+
$DataTypeHint,
37+
[Parameter(HelpMessage="Column description.")]
38+
[string]
39+
$Description,
40+
[Parameter(HelpMessage="Column display name.")]
41+
[string]
42+
$DisplayName,
43+
[Parameter(HelpMessage="Column name.")]
44+
[string]
45+
$Name,
46+
[Parameter(HelpMessage="Column data type.")]
47+
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.Support.ColumnTypeEnum])]
48+
[Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.Support.ColumnTypeEnum]
49+
$Type
50+
)
51+
52+
process {
53+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.Models.Api20211201Preview.Column]::New()
54+
55+
if ($PSBoundParameters.ContainsKey('DataTypeHint')) {
56+
$Object.DataTypeHint = $DataTypeHint
57+
}
58+
if ($PSBoundParameters.ContainsKey('Description')) {
59+
$Object.Description = $Description
60+
}
61+
if ($PSBoundParameters.ContainsKey('DisplayName')) {
62+
$Object.DisplayName = $DisplayName
63+
}
64+
if ($PSBoundParameters.ContainsKey('Name')) {
65+
$Object.Name = $Name
66+
}
67+
if ($PSBoundParameters.ContainsKey('Type')) {
68+
$Object.Type = $Type
69+
}
70+
return $Object
71+
}
72+
}
73+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Custom
2+
This directory contains custom implementation for non-generated cmdlets for the `Az.OperationalInsights` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.OperationalInsights.custom.psm1`. This file should not be modified.
3+
4+
## Info
5+
- Modifiable: yes
6+
- Generated: partial
7+
- Committed: yes
8+
- Packaged: yes
9+
10+
## Details
11+
For `Az.OperationalInsights` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
12+
13+
For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.OperationalInsights.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
14+
15+
For script cmdlets, these are loaded via the `Az.OperationalInsights.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
16+
17+
## Purpose
18+
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder.
19+
20+
## Usage
21+
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
22+
- Break
23+
- DefaultProfile
24+
- HttpPipelineAppend
25+
- HttpPipelinePrepend
26+
- Proxy
27+
- ProxyCredential
28+
- ProxyUseDefaultCredentials
29+
30+
These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.OperationalInsights`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
31+
32+
### Attributes
33+
For processing the cmdlets, we've created some additional attributes:
34+
- `Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.DescriptionAttribute`
35+
- Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
36+
- `Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.DoNotExportAttribute`
37+
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.OperationalInsights`.
38+
- `Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.InternalExportAttribute`
39+
- Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.OperationalInsights`. For more information, see [README.md](../internal/README.md) in the `../internal` folder.
40+
- `Microsoft.Azure.PowerShell.Cmdlets.OperationalInsights.ProfileAttribute`
41+
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
Module Name: Az.OperationalInsights
3+
Module Guid: c4733603-3414-41cb-b2f6-2e53c59925f4
4+
Download Help Link: https://docs.microsoft.com/powershell/module/az.operationalinsights
5+
Help Version: 1.0.0.0
6+
Locale: en-US
7+
---
8+
9+
# Az.OperationalInsights Module
10+
## Description
11+
Microsoft Azure PowerShell: OperationalInsights cmdlets
12+
13+
## Az.OperationalInsights Cmdlets
14+
### [Get-AzOperationalInsightsDeletedWorkspace](Get-AzOperationalInsightsDeletedWorkspace.md)
15+
Gets recently deleted workspaces in a subscription, available for recovery.
16+
17+
### [Get-AzOperationalInsightsTable](Get-AzOperationalInsightsTable.md)
18+
Gets a Log Analytics workspace table.
19+
20+
### [Get-AzOperationalInsightsWorkspace](Get-AzOperationalInsightsWorkspace.md)
21+
Gets a workspace instance.
22+
23+
### [Move-AzOperationalInsightsTable](Move-AzOperationalInsightsTable.md)
24+
Migrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of Data Collection Rule-based Custom Logs.
25+
26+
### [New-AzOperationalInsightsTable](New-AzOperationalInsightsTable.md)
27+
Update or Create a Log Analytics workspace table.
28+
29+
### [New-AzOperationalInsightsTableColumnObject](New-AzOperationalInsightsTableColumnObject.md)
30+
Create an in-memory object for Column.
31+
32+
### [New-AzOperationalInsightsWorkspace](New-AzOperationalInsightsWorkspace.md)
33+
Create or update a workspace.
34+
35+
### [Remove-AzOperationalInsightsTable](Remove-AzOperationalInsightsTable.md)
36+
Delete a Log Analytics workspace table.
37+
38+
### [Remove-AzOperationalInsightsWorkspace](Remove-AzOperationalInsightsWorkspace.md)
39+
Deletes a workspace resource.
40+
To recover the workspace, create it again with the same name, in the same subscription, resource group and location.
41+
The name is kept for 14 days and cannot be used for another workspace.
42+
To remove the workspace completely and release the name, use the force flag.
43+
44+
### [Update-AzOperationalInsightsTable](Update-AzOperationalInsightsTable.md)
45+
Update a Log Analytics workspace table.
46+
47+
### [Update-AzOperationalInsightsWorkspace](Update-AzOperationalInsightsWorkspace.md)
48+
Updates a workspace.
49+

0 commit comments

Comments
 (0)