Skip to content

Commit 536b95f

Browse files
authored
Quantum v3 to v4 (Azure#27282)
1 parent df616cb commit 536b95f

26 files changed

+466
-111
lines changed
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 - Quantum")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.2")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.2")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/Quantum/Quantum.Autorest/README.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,12 @@ title: Quantum
3737
module-version: 0.1.0
3838
subject-prefix: $(service-name)
3939

40-
identity-correction-for-post: true
41-
resourcegroup-append: 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
- where:
50-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^Check$|^CheckViaIdentity$
42+
variant: ^(Create|Update|Check)(?!.*?(Expanded|JsonFilePath|JsonString))
43+
remove: true
44+
- where:
45+
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
5146
remove: true
5247
- where:
5348
verb: Set

src/Quantum/Quantum.Autorest/custom/New-AzQuantumProviderObject.ps1

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

@@ -40,8 +41,8 @@ function New-AzQuantumProviderObject {
4041
[string]
4142
$InstanceUri,
4243
[Parameter(HelpMessage="Provisioning status field.")]
43-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Quantum.Support.Status])]
44-
[Microsoft.Azure.PowerShell.Cmdlets.Quantum.Support.Status]
44+
[Microsoft.Azure.PowerShell.Cmdlets.Quantum.PSArgumentCompleterAttribute("Succeeded", "Launching", "Updating", "Deleting", "Deleted", "Failed")]
45+
[string]
4546
$ProvisioningState,
4647
[Parameter(HelpMessage="Id to track resource usage for the provider.")]
4748
[string]
@@ -52,7 +53,7 @@ function New-AzQuantumProviderObject {
5253
)
5354

5455
process {
55-
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Api20220110Preview.Provider]::New()
56+
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Provider]::New()
5657

5758
if ($PSBoundParameters.ContainsKey('ApplicationName')) {
5859
$Object.ApplicationName = $ApplicationName
@@ -75,4 +76,3 @@ function New-AzQuantumProviderObject {
7576
return $Object
7677
}
7778
}
78-

src/Quantum/Quantum.Autorest/docs/Az.Quantum.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Quantum
3-
Module Guid: c33ffd08-641a-46a2-8984-f16074447b27
3+
Module Guid: 65936c1e-015a-4add-ade9-753f9194ee60
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.quantum
55
Help Version: 1.0.0.0
66
Locale: en-US
@@ -21,7 +21,7 @@ Returns the Workspace resource associated with the given name.
2121
Create an in-memory object for Provider.
2222

2323
### [New-AzQuantumWorkspace](New-AzQuantumWorkspace.md)
24-
Creates or updates a workspace resource.
24+
create a workspace resource.
2525

2626
### [Remove-AzQuantumWorkspace](Remove-AzQuantumWorkspace.md)
2727
Deletes a Workspace resource.
@@ -30,5 +30,5 @@ Deletes a Workspace resource.
3030
Check the availability of the resource name.
3131

3232
### [Update-AzQuantumWorkspace](Update-AzQuantumWorkspace.md)
33-
Updates an existing workspace's tags.
33+
update an existing workspace's tags.
3434

src/Quantum/Quantum.Autorest/docs/Get-AzQuantumOffering.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
9696
9797
## OUTPUTS
9898
99-
### Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Api20220110Preview.IProviderDescription
99+
### Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IProviderDescription
100100
101101
## NOTES
102102

src/Quantum/Quantum.Autorest/docs/Get-AzQuantumWorkspace.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ Accept wildcard characters: False
9898
9999
### -InputObject
100100
Identity Parameter
101-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
102101
103102
```yaml
104103
Type: Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IQuantumIdentity
@@ -166,7 +165,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
166165
167166
## OUTPUTS
168167
169-
### Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Api20220110Preview.IQuantumWorkspace
168+
### Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IQuantumWorkspace
170169
171170
## NOTES
172171

src/Quantum/Quantum.Autorest/docs/New-AzQuantumProviderObject.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Create an in-memory object for Provider.
1414

1515
```
1616
New-AzQuantumProviderObject [-ApplicationName <String>] [-Id <String>] [-InstanceUri <String>]
17-
[-ProvisioningState <Status>] [-ResourceUsageId <String>] [-Sku <String>] [<CommonParameters>]
17+
[-ProvisioningState <String>] [-ResourceUsageId <String>] [-Sku <String>] [<CommonParameters>]
1818
```
1919

2020
## DESCRIPTION
@@ -86,7 +86,7 @@ Accept wildcard characters: False
8686
Provisioning status field.
8787
8888
```yaml
89-
Type: Microsoft.Azure.PowerShell.Cmdlets.Quantum.Support.Status
89+
Type: System.String
9090
Parameter Sets: (All)
9191
Aliases:
9292

@@ -134,7 +134,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
134134
135135
## OUTPUTS
136136
137-
### Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Api20220110Preview.Provider
137+
### Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Provider
138138
139139
## NOTES
140140

src/Quantum/Quantum.Autorest/docs/New-AzQuantumWorkspace.md

+59-15
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,41 @@ schema: 2.0.0
88
# New-AzQuantumWorkspace
99

1010
## SYNOPSIS
11-
Creates or updates a workspace resource.
11+
create a workspace resource.
1212

1313
## SYNTAX
1414

15+
### CreateExpanded (Default)
1516
```
1617
New-AzQuantumWorkspace -Name <String> -ResourceGroupName <String> -Location <String>
17-
[-SubscriptionId <String>] [-IdentityType <ResourceIdentityType>] [-Provider <IProvider[]>]
18+
[-SubscriptionId <String>] [-EnableSystemAssignedIdentity] [-Provider <IProvider[]>]
1819
[-StorageAccount <String>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm]
1920
[-WhatIf] [<CommonParameters>]
2021
```
2122

23+
### CreateViaJsonFilePath
24+
```
25+
New-AzQuantumWorkspace -Name <String> -ResourceGroupName <String> -JsonFilePath <String>
26+
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf]
27+
[<CommonParameters>]
28+
```
29+
30+
### CreateViaJsonString
31+
```
32+
New-AzQuantumWorkspace -Name <String> -ResourceGroupName <String> -JsonString <String>
33+
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf]
34+
[<CommonParameters>]
35+
```
36+
2237
## DESCRIPTION
23-
Creates or updates a workspace resource.
38+
create a workspace resource.
2439

2540
## EXAMPLES
2641

2742
### Example 1: Creates or updates a workspace resource.
2843
```powershell
2944
$object = New-AzQuantumProviderObject -Id "ionq" -Sku "pay-as-you-go-cred"
30-
New-AzQuantumWorkspace -Name azps-qw -ResourceGroupName azps_test_group_quantum -Location eastus -IdentityType 'SystemAssigned' -Provider $object -StorageAccount "/subscriptions/{subId}/resourceGroups/azps_test_group_quantum/providers/Microsoft.Storage/storageAccounts/azpssa"
45+
New-AzQuantumWorkspace -Name azps-qw -ResourceGroupName azps_test_group_quantum -Location eastus -EnableSystemAssignedIdentity -Provider $object -StorageAccount "/subscriptions/{subId}/resourceGroups/azps_test_group_quantum/providers/Microsoft.Storage/storageAccounts/azpssa"
3146
```
3247

3348
```output
@@ -71,12 +86,12 @@ Accept pipeline input: False
7186
Accept wildcard characters: False
7287
```
7388
74-
### -IdentityType
75-
The identity type.
89+
### -EnableSystemAssignedIdentity
90+
Determines whether to enable a system-assigned identity for the resource.
7691
7792
```yaml
78-
Type: Microsoft.Azure.PowerShell.Cmdlets.Quantum.Support.ResourceIdentityType
79-
Parameter Sets: (All)
93+
Type: System.Management.Automation.SwitchParameter
94+
Parameter Sets: CreateExpanded
8095
Aliases:
8196

8297
Required: False
@@ -86,12 +101,42 @@ Accept pipeline input: False
86101
Accept wildcard characters: False
87102
```
88103
104+
### -JsonFilePath
105+
Path of Json file supplied to the Create operation
106+
107+
```yaml
108+
Type: System.String
109+
Parameter Sets: CreateViaJsonFilePath
110+
Aliases:
111+
112+
Required: True
113+
Position: Named
114+
Default value: None
115+
Accept pipeline input: False
116+
Accept wildcard characters: False
117+
```
118+
119+
### -JsonString
120+
Json string supplied to the Create operation
121+
122+
```yaml
123+
Type: System.String
124+
Parameter Sets: CreateViaJsonString
125+
Aliases:
126+
127+
Required: True
128+
Position: Named
129+
Default value: None
130+
Accept pipeline input: False
131+
Accept wildcard characters: False
132+
```
133+
89134
### -Location
90135
The geo-location where the resource lives
91136
92137
```yaml
93138
Type: System.String
94-
Parameter Sets: (All)
139+
Parameter Sets: CreateExpanded
95140
Aliases:
96141

97142
Required: True
@@ -133,11 +178,10 @@ Accept wildcard characters: False
133178
134179
### -Provider
135180
List of Providers selected for this Workspace
136-
To construct, see NOTES section for PROVIDER properties and create a hash table.
137181
138182
```yaml
139-
Type: Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Api20220110Preview.IProvider[]
140-
Parameter Sets: (All)
183+
Type: Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IProvider[]
184+
Parameter Sets: CreateExpanded
141185
Aliases:
142186

143187
Required: False
@@ -167,7 +211,7 @@ ARM Resource Id of the storage account associated with this workspace.
167211
168212
```yaml
169213
Type: System.String
170-
Parameter Sets: (All)
214+
Parameter Sets: CreateExpanded
171215
Aliases:
172216

173217
Required: False
@@ -197,7 +241,7 @@ Resource tags.
197241
198242
```yaml
199243
Type: System.Collections.Hashtable
200-
Parameter Sets: (All)
244+
Parameter Sets: CreateExpanded
201245
Aliases:
202246

203247
Required: False
@@ -245,7 +289,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
245289
246290
## OUTPUTS
247291
248-
### Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.Api20220110Preview.IQuantumWorkspace
292+
### Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IQuantumWorkspace
249293
250294
## NOTES
251295

src/Quantum/Quantum.Autorest/docs/Remove-AzQuantumWorkspace.md

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ Accept wildcard characters: False
7878
7979
### -InputObject
8080
Identity Parameter
81-
To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
8281
8382
```yaml
8483
Type: Microsoft.Azure.PowerShell.Cmdlets.Quantum.Models.IQuantumIdentity

0 commit comments

Comments
 (0)