Skip to content

Commit a0bdf73

Browse files
authored
[Sphere] Feature generated by auto rest (#24568)
* feature Sphere stable 20240401 * sphere directive redesign * test * Update Sphere test cases * Update message in readme * Fix count parameter set for analyze test coverage
1 parent d4c38c3 commit a0bdf73

File tree

125 files changed

+91245
-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.

125 files changed

+91245
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

src/Sphere/Sphere.Autorest/.gitignore

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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@{
2+
GUID = '4855dcb5-d1a4-45e3-b4b2-49d37925ed0b'
3+
RootModule = './Az.Sphere.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: Sphere cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Sphere.private.dll'
13+
FormatsToProcess = './Az.Sphere.format.ps1xml'
14+
FunctionsToExport = 'Get-AzSphereCatalog', 'Get-AzSphereCatalogDevice', 'Get-AzSphereCatalogDeviceGroup', 'Get-AzSphereCatalogDeviceInsight', 'Get-AzSphereCertificate', 'Get-AzSphereCertificateCertChain', 'Get-AzSphereCertificateProof', 'Get-AzSphereDeployment', 'Get-AzSphereDevice', 'Get-AzSphereDeviceGroup', 'Get-AzSphereImage', 'Get-AzSphereProduct', 'Invoke-AzSphereCountCatalogDevice', 'Invoke-AzSphereCountDeviceGroupDevice', 'Invoke-AzSphereCountProductDevice', 'New-AzSphereCatalog', 'New-AzSphereDeployment', 'New-AzSphereDevice', 'New-AzSphereDeviceCapabilityImage', 'New-AzSphereDeviceGroup', 'New-AzSphereImage', 'New-AzSphereProduct', 'New-AzSphereProductDefaultDeviceGroup', 'Remove-AzSphereCatalog', 'Remove-AzSphereDeviceGroup', 'Remove-AzSphereProduct', 'Update-AzSphereCatalog', 'Update-AzSphereDevice', 'Update-AzSphereDeviceGroup', 'Update-AzSphereProduct'
15+
PrivateData = @{
16+
PSData = @{
17+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Sphere'
18+
LicenseUri = 'https://aka.ms/azps-license'
19+
ProjectUri = 'https://github.com/Azure/azure-powershell'
20+
ReleaseNotes = ''
21+
}
22+
}
23+
}

src/Sphere/Sphere.Autorest/README.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
<!-- region Generated -->
2+
# Az.Sphere
3+
This directory contains the PowerShell module for the Sphere service.
4+
5+
---
6+
## Info
7+
- Modifiable: yes
8+
- Generated: all
9+
- Committed: yes
10+
- Packaged: yes
11+
12+
---
13+
## Detail
14+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
15+
16+
## Module Requirements
17+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
18+
19+
## Authentication
20+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
21+
22+
## Development
23+
For information on how to develop for `Az.Sphere`, see [how-to.md](how-to.md).
24+
<!-- endregion -->
25+
26+
### AutoRest Configuration
27+
> see https://aka.ms/autorest
28+
29+
```yaml
30+
# pin the swagger version by using the commit id instead of branch name
31+
commit: ebce1c690af6060f0e5a72d875edf752d41d5769
32+
tag: package-2024-04-01
33+
require:
34+
# readme.azure.noprofile.md is the common configuration file
35+
- $(this-folder)/../../readme.azure.noprofile.md
36+
- $(repo)/specification/sphere/resource-manager/readme.md
37+
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
38+
# - (this-folder)/relative-path-to-your-local-readme.md
39+
40+
try-require:
41+
- $(repo)/specification/sphere/resource-manager/readme.powershell.md
42+
43+
# For new RP, the version is 0.1.0
44+
module-version: 0.1.0
45+
# Normally, title is the service name
46+
title: Sphere
47+
subject-prefix: $(service-name)
48+
49+
directive:
50+
# Following are common directives which are normally required in all the RPs
51+
# 1. Remove the unexpanded parameter set
52+
# 2. For New-* cmdlets, ViaIdentity is not required
53+
- where:
54+
variant: ^(Create|Update)(?!.*?Expanded|ViaJsonString|ViaJsonFilePath)
55+
remove: true
56+
- where:
57+
variant: ^CreateViaIdentity.*$
58+
remove: true
59+
# Remove unavailable feature
60+
- where:
61+
verb: Remove
62+
subject: ^Device$|Image|Deployment
63+
remove: true
64+
- where:
65+
verb: Update
66+
subject: Image|Deployment
67+
remove: true
68+
- where:
69+
verb: Get
70+
subject: CatalogDeployment
71+
remove: true
72+
# error 'The server responded with an unrecognized response', error message missing in default error response for post path
73+
- where:
74+
verb: Invoke
75+
subject: UploadCatalogImage
76+
remove: true
77+
- where:
78+
verb: Invoke
79+
subject: ClaimDeviceGroupDevice
80+
remove: true
81+
- where:
82+
verb: Invoke
83+
variant: ^Count(.*)
84+
set:
85+
variant: CountDevice$1
86+
# Remove unexpanded include json parameter set
87+
- where:
88+
variant: ^List(?!.*?Expanded)
89+
subject: CatalogDeviceGroup
90+
remove: true
91+
- where:
92+
variant: ^(Retrieve)(?!.*?Expanded)
93+
subject: CertificateProof
94+
remove: true
95+
- where:
96+
variant: ^Claim(?!.*?Expanded)
97+
subject: ClaimDeviceGroupDevice
98+
hide: true
99+
# New-AzSphereDeviceCapabilityImage remove unexpanded parameter set
100+
- where:
101+
variant: ^(Generate)(?!.*?(Expanded|JsonString|JsonFilePath))
102+
subject: DeviceCapabilityImage
103+
remove: true
104+
- where:
105+
variant: GenerateViaIdentityExpanded
106+
subject: DeviceCapabilityImage
107+
remove: true
108+
# Remove the set-* cmdlet
109+
- where:
110+
verb: Set
111+
hide: true
112+
```
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"resourceType": "catalogs/certificates",
3+
"apiVersion": "2024-04-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.sphere"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzSphereCertificateCertChain",
10+
"description": "Retrieves cert chain.",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}/retrieveCertChain",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecertificatecertchain"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-CatalogName <String>",
20+
"-ResourceGroupName <String>",
21+
"-SerialNumber <String>",
22+
"[-SubscriptionId <String[]>]"
23+
]
24+
}
25+
]
26+
},
27+
"examples": [
28+
{
29+
"description": "Retrieves cert chain.",
30+
"parameters": [
31+
{
32+
"name": "-CatalogName",
33+
"value": "[Path.catalogName]"
34+
},
35+
{
36+
"name": "-ResourceGroupName",
37+
"value": "[Path.resourceGroupName]"
38+
},
39+
{
40+
"name": "-SerialNumber",
41+
"value": "[Path.serialNumber]"
42+
},
43+
{
44+
"name": "-SubscriptionId",
45+
"value": "[Path.subscriptionId]"
46+
}
47+
]
48+
}
49+
]
50+
},
51+
{
52+
"name": "Get-AzSphereCertificate",
53+
"description": "Get a Certificate",
54+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/certificates/{serialNumber}",
55+
"help": {
56+
"learnMore": {
57+
"url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspherecertificate"
58+
},
59+
"parameterSets": [
60+
{
61+
"parameters": [
62+
"-CatalogName <String>",
63+
"-ResourceGroupName <String>",
64+
"-SerialNumber <String>",
65+
"[-SubscriptionId <String[]>]"
66+
]
67+
}
68+
]
69+
},
70+
"examples": [
71+
{
72+
"description": "Get a Certificate",
73+
"parameters": [
74+
{
75+
"name": "-CatalogName",
76+
"value": "[Path.catalogName]"
77+
},
78+
{
79+
"name": "-ResourceGroupName",
80+
"value": "[Path.resourceGroupName]"
81+
},
82+
{
83+
"name": "-SerialNumber",
84+
"value": "[Path.serialNumber]"
85+
},
86+
{
87+
"name": "-SubscriptionId",
88+
"value": "[Path.subscriptionId]"
89+
}
90+
]
91+
}
92+
]
93+
}
94+
]
95+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"resourceType": "catalogs/images",
3+
"apiVersion": "2024-04-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.sphere"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzSphereImage",
10+
"description": "Get a Image",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/images/{imageName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azsphereimage"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-CatalogName <String>",
20+
"-Name <String>",
21+
"-ResourceGroupName <String>",
22+
"[-SubscriptionId <String[]>]"
23+
]
24+
}
25+
]
26+
},
27+
"examples": [
28+
{
29+
"description": "Get a Image",
30+
"parameters": [
31+
{
32+
"name": "-CatalogName",
33+
"value": "[Path.catalogName]"
34+
},
35+
{
36+
"name": "-Name",
37+
"value": "[Path.imageName]"
38+
},
39+
{
40+
"name": "-ResourceGroupName",
41+
"value": "[Path.resourceGroupName]"
42+
},
43+
{
44+
"name": "-SubscriptionId",
45+
"value": "[Path.subscriptionId]"
46+
}
47+
]
48+
}
49+
]
50+
}
51+
]
52+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"resourceType": "catalogs/products/deviceGroups/deployments",
3+
"apiVersion": "2024-04-01",
4+
"learnMore": {
5+
"url": "https://learn.microsoft.com/powershell/module/az.sphere"
6+
},
7+
"commands": [
8+
{
9+
"name": "Get-AzSphereDeployment",
10+
"description": "Get a Deployment.\n'.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
11+
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureSphere/catalogs/{catalogName}/products/{productName}/deviceGroups/{deviceGroupName}/deployments/{deploymentName}",
12+
"help": {
13+
"learnMore": {
14+
"url": "https://learn.microsoft.com/powershell/module/az.sphere/get-azspheredeployment"
15+
},
16+
"parameterSets": [
17+
{
18+
"parameters": [
19+
"-CatalogName <String>",
20+
"-DeviceGroupName <String>",
21+
"-Name <String>",
22+
"-ProductName <String>",
23+
"-ResourceGroupName <String>",
24+
"[-SubscriptionId <String[]>]"
25+
]
26+
}
27+
]
28+
},
29+
"examples": [
30+
{
31+
"description": "Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name.",
32+
"parameters": [
33+
{
34+
"name": "-CatalogName",
35+
"value": "[Path.catalogName]"
36+
},
37+
{
38+
"name": "-DeviceGroupName",
39+
"value": "[Path.deviceGroupName]"
40+
},
41+
{
42+
"name": "-Name",
43+
"value": "[Path.deploymentName]"
44+
},
45+
{
46+
"name": "-ProductName",
47+
"value": "[Path.productName]"
48+
},
49+
{
50+
"name": "-ResourceGroupName",
51+
"value": "[Path.resourceGroupName]"
52+
},
53+
{
54+
"name": "-SubscriptionId",
55+
"value": "[Path.subscriptionId]"
56+
}
57+
]
58+
}
59+
]
60+
}
61+
]
62+
}

0 commit comments

Comments
 (0)