Skip to content

Commit 12e290f

Browse files
authored
[PS] migrate StorageCache module to autorest v4 (#27782)
1 parent 8538617 commit 12e290f

File tree

176 files changed

+4187
-22922
lines changed

Some content is hidden

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

176 files changed

+4187
-22922
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 - StorageCache")]
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)]
27+
28+

src/StorageCache/StorageCache.Autorest/README.md

Lines changed: 3 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -27,40 +27,17 @@ For information on how to develop for `Az.StorageCache`, see [how-to.md](how-to.
2727
> see https://aka.ms/autorest
2828
2929
``` yaml
30-
commit: 7a65f22cf67826187f75981e914c7e679039257b
30+
commit: f3a04ddc23771fca8a99b179ea8eaa428c21fa2f
3131
require:
3232
- $(this-folder)/../../readme.azure.noprofile.md
3333
input-file:
34-
- $(repo)/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/storagecache.json
3534
- $(repo)/specification/storagecache/resource-manager/Microsoft.StorageCache/stable/2023-05-01/amlfilesystem.json
3635

3736
module-version: 0.1.0
3837
title: StorageCache
3938
subject-prefix: $(service-name)
4039

41-
identity-correction-for-post: true
42-
resourcegroup-append: true
43-
nested-object-to-string: true
44-
45-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
46-
use-extension:
47-
"@autorest/powershell": "3.x"
48-
4940
directive:
50-
- where:
51-
subject: ^Cach(.*)
52-
set:
53-
subject: $1
54-
- where:
55-
subject: ^Info(.*)
56-
set:
57-
subject: $1
58-
59-
- where:
60-
subject: ^SpaceCachAllocation$
61-
set:
62-
subject: SpaceAllocation
63-
6441
- where:
6542
subject: ^AmlFilesystem$
6643
set:
@@ -82,132 +59,17 @@ directive:
8259
subject: AmlFileSystemSubnet
8360

8461
- where:
85-
subject: ^StorageTarget$
86-
set:
87-
subject: Target
88-
89-
- where:
90-
subject: ^InvalidateStorageTarget$
91-
set:
92-
subject: InvalidateTarget
93-
94-
- where:
95-
subject: ^StorageTargetDefault$
96-
set:
97-
subject: TargetSetting
98-
99-
- where:
100-
subject: ^StorageTargetDns$
101-
set:
102-
subject: TargetDns
103-
104-
- from: swagger-document
105-
where: $.paths["/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/startPrimingJob"].post.responses
106-
transform: >-
107-
return {
108-
"200": {
109-
"description": "The priming job is being created and will complete asynchronously.",
110-
"headers": {
111-
"Location": {
112-
"description": "Location URI to poll for result",
113-
"type": "string"
114-
},
115-
"Azure-AsyncOperation": {
116-
"description": "URI to poll for the operation status",
117-
"type": "string"
118-
}
119-
}
120-
},
121-
"202": {
122-
"description": "The priming job is being created and will complete asynchronously.",
123-
"headers": {
124-
"Location": {
125-
"description": "Location URI to poll for result",
126-
"type": "string"
127-
},
128-
"Azure-AsyncOperation": {
129-
"description": "URI to poll for the operation status",
130-
"type": "string"
131-
}
132-
}
133-
},
134-
"default": {
135-
"description": "Error response describing why the operation failed.",
136-
"schema": {
137-
"$ref": "#/definitions/CloudError"
138-
}
139-
}
140-
}
141-
142-
- from: swagger-document
143-
where: $.paths["/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}/spaceAllocation"].post.responses
144-
transform: >-
145-
return {
146-
"200": {
147-
"description": "OK.",
148-
"headers": {
149-
"Location": {
150-
"description": "Location URI to poll for result",
151-
"type": "string"
152-
},
153-
"Azure-AsyncOperation": {
154-
"description": "URI to poll for the operation status",
155-
"type": "string"
156-
}
157-
}
158-
},
159-
"202": {
160-
"description": "OK.",
161-
"headers": {
162-
"Location": {
163-
"description": "Location URI to poll for result",
164-
"type": "string"
165-
},
166-
"Azure-AsyncOperation": {
167-
"description": "URI to poll for the operation status",
168-
"type": "string"
169-
}
170-
}
171-
},
172-
"default": {
173-
"description": "Error response describing why the operation failed.",
174-
"schema": {
175-
"$ref": "#/definitions/CloudError"
176-
}
177-
}
178-
}
179-
180-
- where:
181-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
62+
variant: ^(Create|Update|Archive|Check)(?!.*?(Expanded|JsonFilePath|JsonString))
18263
remove: true
18364
- where:
18465
subject: ^AmlFileSystemSubnetRequiredSize$
185-
variant: ^Get$|^GetViaIdentity$
186-
remove: true
187-
- where:
188-
subject: ^PrimingJob$
189-
variant: ^Start$|^StartViaIdentity$|^Resume$|^ResumeViaIdentity$|^Stop$|^StopViaIdentity$|^Pause$|^PauseViaIdentity$
190-
remove: true
191-
- where:
192-
variant: ^Archive$|^ArchiveViaIdentity$|^Check$|^CheckViaIdentity$
66+
variant: ^Get(?!.*?Expanded)
19367
remove: true
19468

19569
- where:
19670
verb: Set
19771
remove: true
19872

199-
- where:
200-
verb: Invoke
201-
subject: ^SpaceAllocation$
202-
set:
203-
verb: Update
204-
205-
- where:
206-
parameter-name: EName
207-
set:
208-
parameter-name: Name
209-
alias: CacheName
210-
21173
- where:
21274
subject: AmlFileSystemSubnet
21375
parameter-name: FilesystemSubnet
@@ -223,24 +85,6 @@ directive:
22385
subject: AscOperation
22486
hide: true
22587

226-
# # The following are commented out and their generated cmdlets may be renamed and custom logic
227-
# - model-cmdlet:
228-
# - CacheDirectorySettings
229-
# - NfsAccessPolicy
230-
# - NfsAccessRule
231-
# - NamespaceJunction
232-
# - PrimingJob
233-
# - StorageTargetSpaceAllocation
234-
235-
- where:
236-
model-name: StorageTarget
237-
set:
238-
format-table:
239-
properties:
240-
- Name
241-
- Location
242-
- ResourceGroupName
243-
- State
24488
- where:
24589
model-name: AmlFilesystem
24690
set:

0 commit comments

Comments
 (0)