Skip to content

Commit 682def8

Browse files
authored
[PS] Migrate Orbital module to autorest v4 (Azure#27434)
1 parent f1c23da commit 682def8

File tree

52 files changed

+1630
-297
lines changed

Some content is hidden

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

52 files changed

+1630
-297
lines changed
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Orbital")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.3")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.3")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

Diff for: src/Orbital/Orbital.Autorest/README.md

+19-14
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ module-version: 0.1.0
3737
title: Orbital
3838
subject-prefix: $(service-name)
3939

40-
resourcegroup-append: true
41-
identity-correction-for-post: true
42-
nested-object-to-string: true
43-
44-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
45-
use-extension:
46-
"@autorest/powershell": "3.x"
47-
4840
directive:
4941
- from: swagger-document
5042
where: $.definitions.SpacecraftsProperties.properties.provisioningState
@@ -85,9 +77,17 @@ directive:
8577
],
8678
"description": "The current state of the resource's creation, deletion, or modification."
8779
}
80+
# Following are common directives which are normally required in all the RPs
81+
# 1. Remove the unexpanded parameter set
82+
# 2. For New-* cmdlets, ViaIdentity is not required
83+
# Following two directives are v4 specific
84+
- where:
85+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
86+
remove: true
8887
- where:
89-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
88+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
9089
remove: true
90+
# Remove the set-* cmdlet
9191
- where:
9292
verb: Set
9393
remove: true
@@ -134,11 +134,16 @@ directive:
134134
set:
135135
parameter-name: Name
136136
alias: GroundStationName
137-
# The following are commented out and their generated cmdlets may be renamed and custom logic
138-
# - model-cmdlet:
139-
# - ContactProfileLinkChannel
140-
# - SpacecraftLink
141-
# - ContactProfileLink
137+
# Remove contact update cmdlet, if need please add back
138+
# - where:
139+
# subject: SpacecraftContact
140+
# verb: Update
141+
# remove: true
142+
# SpacecraftLink required properties customized to Mandatory.
143+
- model-cmdlet:
144+
- model-name: ContactProfileLinkChannel
145+
- model-name: ContactProfileLink
146+
# - model-name: SpacecraftLink
142147
- where:
143148
model-name: Spacecraft
144149
set:

Diff for: src/Orbital/Orbital.Autorest/custom/New-AzOrbitalSpacecraftLinkObject.ps1

+11-10
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ Create an in-memory object for SpacecraftLink.
2121
Create an in-memory object for SpacecraftLink.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.SpacecraftLink
24+
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.SpacecraftLink
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.Orbital/new-AzOrbitalSpacecraftLinkObject
26+
https://learn.microsoft.com/powershell/module/Az.Orbital/new-azorbitalspacecraftlinkobject
2727
#>
2828
function New-AzOrbitalSpacecraftLinkObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.SpacecraftLink')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.SpacecraftLink')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -36,21 +37,21 @@ function New-AzOrbitalSpacecraftLinkObject {
3637
[Parameter(Mandatory, HelpMessage="Center Frequency in MHz.")]
3738
[float]
3839
$CenterFrequencyMHz,
39-
[Parameter(Mandatory, HelpMessage="Direction (uplink or downlink).")]
40-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Direction])]
41-
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Direction]
40+
[Parameter(Mandatory, HelpMessage="Direction (Uplink or Downlink).")]
41+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("Uplink", "Downlink")]
42+
[string]
4243
$Direction,
4344
[Parameter(Mandatory, HelpMessage="Link name.")]
4445
[string]
4546
$Name,
46-
[Parameter(Mandatory, HelpMessage="polarization. eg (RHCP, LHCP).")]
47-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Polarization])]
48-
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Polarization]
47+
[Parameter(Mandatory, HelpMessage="Polarization. e.g. (RHCP, LHCP).")]
48+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("RHCP", "LHCP", "linearVertical", "linearHorizontal")]
49+
[string]
4950
$Polarization
5051
)
5152

5253
process {
53-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.SpacecraftLink]::New()
54+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.SpacecraftLink]::New()
5455

5556
if ($PSBoundParameters.ContainsKey('BandwidthMHz')) {
5657
$Object.BandwidthMHz = $BandwidthMHz

Diff for: src/Orbital/Orbital.Autorest/custom/New-AzOrbitalContactProfileLinkChannelObject.ps1 renamed to src/Orbital/Orbital.Autorest/custom/autogen-model-cmdlets/New-AzOrbitalContactProfileLinkChannelObject.ps1

+12-11
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ Create an in-memory object for ContactProfileLinkChannel.
2121
Create an in-memory object for ContactProfileLinkChannel.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLinkChannel
24+
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLinkChannel
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.Orbital/new-AzOrbitalContactProfileLinkChannelObject
26+
https://learn.microsoft.com/powershell/module/Az.Orbital/new-azorbitalcontactprofilelinkchannelobject
2727
#>
2828
function New-AzOrbitalContactProfileLinkChannelObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLinkChannel')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLinkChannel')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

@@ -36,16 +37,16 @@ function New-AzOrbitalContactProfileLinkChannelObject {
3637
[Parameter(Mandatory, HelpMessage="Center Frequency in MHz.")]
3738
[float]
3839
$CenterFrequencyMHz,
39-
[Parameter(HelpMessage="Configuration for decoding.")]
40+
[Parameter(HelpMessage="Currently unused.")]
4041
[string]
4142
$DecodingConfiguration,
42-
[Parameter(HelpMessage="Configuration for demodulation.")]
43+
[Parameter(HelpMessage="Copy of the modem configuration file such as Kratos QRadio or Kratos QuantumRx. Only valid for downlink directions. If provided, the modem connects to the customer endpoint and sends demodulated data instead of a VITA.49 stream.")]
4344
[string]
4445
$DemodulationConfiguration,
45-
[Parameter(HelpMessage="Configuration for encoding.")]
46+
[Parameter(HelpMessage="Currently unused.")]
4647
[string]
4748
$EncodingConfiguration,
48-
[Parameter(Mandatory, HelpMessage="IP Address.")]
49+
[Parameter(Mandatory, HelpMessage="IP Address (IPv4).")]
4950
[string]
5051
$EndPointIPAddress,
5152
[Parameter(Mandatory, HelpMessage="Name of an end point.")]
@@ -55,10 +56,10 @@ function New-AzOrbitalContactProfileLinkChannelObject {
5556
[string]
5657
$EndPointPort,
5758
[Parameter(Mandatory, HelpMessage="Protocol either UDP or TCP.")]
58-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Protocol])]
59-
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Protocol]
59+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("TCP", "UDP")]
60+
[string]
6061
$EndPointProtocol,
61-
[Parameter(HelpMessage="Configuration for modulation.")]
62+
[Parameter(HelpMessage="Copy of the modem configuration file such as Kratos QRadio. Only valid for uplink directions. If provided, the modem connects to the customer endpoint and accepts commands from the customer instead of a VITA.49 stream.")]
6263
[string]
6364
$ModulationConfiguration,
6465
[Parameter(Mandatory, HelpMessage="Channel name.")]
@@ -67,7 +68,7 @@ function New-AzOrbitalContactProfileLinkChannelObject {
6768
)
6869

6970
process {
70-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLinkChannel]::New()
71+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLinkChannel]::New()
7172

7273
if ($PSBoundParameters.ContainsKey('BandwidthMHz')) {
7374
$Object.BandwidthMHz = $BandwidthMHz

Diff for: src/Orbital/Orbital.Autorest/custom/New-AzOrbitalContactProfileLinkObject.ps1 renamed to src/Orbital/Orbital.Autorest/custom/autogen-model-cmdlets/New-AzOrbitalContactProfileLinkObject.ps1

+14-13
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,40 @@ Create an in-memory object for ContactProfileLink.
2121
Create an in-memory object for ContactProfileLink.
2222
2323
.Outputs
24-
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLink
24+
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLink
2525
.Link
26-
https://learn.microsoft.com/powershell/module/az.Orbital/new-AzOrbitalContactProfileLinkObject
26+
https://learn.microsoft.com/powershell/module/Az.Orbital/new-azorbitalcontactprofilelinkobject
2727
#>
2828
function New-AzOrbitalContactProfileLinkObject {
29-
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLink')]
29+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.ModelCmdletAttribute()]
30+
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLink')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(
3233

3334
[Parameter(Mandatory, HelpMessage="Contact Profile Link Channel.")]
34-
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.IContactProfileLinkChannel[]]
35+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.IContactProfileLinkChannel[]]
3536
$Channel,
36-
[Parameter(Mandatory, HelpMessage="Direction (uplink or downlink).")]
37-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Direction])]
38-
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Direction]
37+
[Parameter(Mandatory, HelpMessage="Direction (Uplink or Downlink).")]
38+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("Uplink", "Downlink")]
39+
[string]
3940
$Direction,
40-
[Parameter(HelpMessage="Effective Isotropic Radiated Power (EIRP) in dBW.")]
41+
[Parameter(HelpMessage="Effective Isotropic Radiated Power (EIRP) in dBW. It is the required EIRP by the customer. Not used yet.")]
4142
[float]
4243
$EirpdBw,
43-
[Parameter(HelpMessage="Gain To Noise Temperature in db/K.")]
44+
[Parameter(HelpMessage="Gain to noise temperature in db/K. It is the required G/T by the customer. Not used yet.")]
4445
[float]
4546
$GainOverTemperature,
4647
[Parameter(Mandatory, HelpMessage="Link name.")]
4748
[string]
4849
$Name,
49-
[Parameter(Mandatory, HelpMessage="polarization. eg (RHCP, LHCP).")]
50-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Polarization])]
51-
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Polarization]
50+
[Parameter(Mandatory, HelpMessage="Polarization. e.g. (RHCP, LHCP).")]
51+
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("RHCP", "LHCP", "linearVertical", "linearHorizontal")]
52+
[string]
5253
$Polarization
5354
)
5455

5556
process {
56-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLink]::New()
57+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLink]::New()
5758

5859
if ($PSBoundParameters.ContainsKey('Channel')) {
5960
$Object.Channel = $Channel

Diff for: src/Orbital/Orbital.Autorest/docs/Az.Orbital.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Orbital
3-
Module Guid: 4fb1d4af-9f8d-4a19-9f17-d8186bf02cfb
3+
Module Guid: da3f3c81-b8f0-4648-9b05-4afd458a4b16
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.orbital
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -28,7 +28,7 @@ Gets the specified spacecraft in a specified resource group.
2828
Gets the specified contact in a specified resource group.
2929

3030
### [New-AzOrbitalContactProfile](New-AzOrbitalContactProfile.md)
31-
Creates or updates a contact profile.
31+
create a contact profile.
3232

3333
### [New-AzOrbitalContactProfileLinkChannelObject](New-AzOrbitalContactProfileLinkChannelObject.md)
3434
Create an in-memory object for ContactProfileLinkChannel.
@@ -37,10 +37,10 @@ Create an in-memory object for ContactProfileLinkChannel.
3737
Create an in-memory object for ContactProfileLink.
3838

3939
### [New-AzOrbitalSpacecraft](New-AzOrbitalSpacecraft.md)
40-
Creates or updates a spacecraft resource.
40+
create a spacecraft resource.
4141

4242
### [New-AzOrbitalSpacecraftContact](New-AzOrbitalSpacecraftContact.md)
43-
Creates a contact.
43+
create a contact.
4444

4545
### [New-AzOrbitalSpacecraftLinkObject](New-AzOrbitalSpacecraftLinkObject.md)
4646
Create an in-memory object for SpacecraftLink.
@@ -55,8 +55,11 @@ Deletes a specified spacecraft resource.
5555
Deletes a specified contact.
5656

5757
### [Update-AzOrbitalContactProfile](Update-AzOrbitalContactProfile.md)
58-
Updates the specified contact profile tags.
58+
update the specified contact profile tags.
5959

6060
### [Update-AzOrbitalSpacecraft](Update-AzOrbitalSpacecraft.md)
61-
Updates the specified spacecraft tags.
61+
update the specified spacecraft tags.
62+
63+
### [Update-AzOrbitalSpacecraftContact](Update-AzOrbitalSpacecraftContact.md)
64+
update a contact.
6265

Diff for: src/Orbital/Orbital.Autorest/docs/Get-AzOrbitalAvailableGroundStation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Returns list of available ground stations.
1313
## SYNTAX
1414

1515
```
16-
Get-AzOrbitalAvailableGroundStation -Capability <CapabilityParameter> [-SubscriptionId <String[]>]
16+
Get-AzOrbitalAvailableGroundStation -Capability <String> [-SubscriptionId <String[]>]
1717
[-DefaultProfile <PSObject>] [<CommonParameters>]
1818
```
1919

@@ -48,7 +48,7 @@ Gets the specified available ground station.
4848
Ground Station Capability.
4949

5050
```yaml
51-
Type: Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.CapabilityParameter
51+
Type: System.String
5252
Parameter Sets: (All)
5353
Aliases:
5454

@@ -97,7 +97,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
9797
9898
## OUTPUTS
9999
100-
### Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.IAvailableGroundStation
100+
### Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.IAvailableGroundStation
101101
102102
## NOTES
103103

0 commit comments

Comments
 (0)