Skip to content

Commit f6faec3

Browse files
authored
adding sphere RP files (#23725)
* adding sphere RP files * updating custom words list
1 parent 56b585b commit f6faec3

File tree

110 files changed

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

110 files changed

+7807
-0
lines changed

custom-words.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,3 +2799,6 @@ Metadatas
27992799
Gtid
28002800
GTID
28012801
gtid
2802+
Wifi
2803+
Nwfs
2804+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
emit: [
2+
"@azure-tools/cadl-autorest",
3+
"@azure-tools/cadl-python",
4+
"@azure-tools/cadl-csharp",
5+
]
6+
options:
7+
"@azure-tools/cadl-python":
8+
"basic-setup-py": true
9+
"package-version": 3.0.0b6
10+
"package-name": azure-sphere
11+
"@azure-tools/cadl-autorest":
12+
examples-directory: ./examples
13+
output-file: azuresphere.json
14+
azure-resource-provider-folder: ../../../../resource-manager
15+
"@azure-tools/cadl-csharp":
16+
save-inputs: false
17+
clear-output-folder: true
18+
namespace: Azure.Sphere
19+
model-namespace: false
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
import "@cadl-lang/rest";
2+
import "@cadl-lang/versioning";
3+
import "@azure-tools/cadl-autorest";
4+
import "@azure-tools/cadl-azure-core";
5+
import "@azure-tools/cadl-azure-resource-manager";
6+
7+
using Cadl.Http;
8+
using Cadl.Rest;
9+
using Cadl.Versioning;
10+
using Azure.ResourceManager.Foundations;
11+
using Azure.Core;
12+
using Azure.ResourceManager;
13+
14+
namespace Microsoft.AzureSphere;
15+
16+
//Catalogs
17+
@doc("An Azure Sphere catalog")
18+
model Catalog is TrackedResource<CatalogProperties> {
19+
@doc("Name of catalog")
20+
@pattern("^[A-Za-z0-9_-]{1,50}$")
21+
@key("catalogName")
22+
@path
23+
@segment("catalogs")
24+
name: string;
25+
}
26+
27+
@doc("Catalog properties")
28+
model CatalogProperties {
29+
30+
@visibility("read")
31+
@doc("The status of the last operation.")
32+
provisioningState?: ProvisioningState;
33+
}
34+
35+
@doc("Request of the action to list device groups for a catalog.")
36+
model ListDeviceGroupsRequest {
37+
@doc("Device Group name.")
38+
deviceGroupName?: string;
39+
}
40+
@doc("Device insight report.")
41+
model DeviceInsight {
42+
43+
@doc("Device ID")
44+
deviceId: string;
45+
46+
@doc("Event description")
47+
description: string;
48+
49+
@doc("Event start timestamp")
50+
startTimestampUtc: zonedDateTime;
51+
52+
@doc("Event end timestamp")
53+
endTimestampUtc: zonedDateTime;
54+
55+
@doc("Event category")
56+
eventCategory: string;
57+
58+
@doc("Event class")
59+
eventClass: string;
60+
61+
@doc("Event type")
62+
eventType: string;
63+
64+
@doc("Event count")
65+
eventCount: int32;
66+
}
67+
68+
@armResourceOperations
69+
interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, CatalogProperties> {
70+
71+
@autoRoute
72+
@doc("Counts devices in catalog.")
73+
@armResourceAction(Catalog)
74+
@post
75+
op countDevices(
76+
...ResourceInstanceParameters<Catalog>,
77+
): ArmResponse<CountDeviceResponse> | ErrorResponse;
78+
79+
@autoRoute
80+
@doc("Lists device insights for catalog.")
81+
@armResourceAction(Catalog)
82+
@post
83+
op listDeviceInsights(
84+
...ResourceInstanceParameters<Catalog>,
85+
...ListQueryParameters
86+
): ArmResponse<Page<DeviceInsight>> | ErrorResponse;
87+
88+
@autoRoute
89+
@doc("Lists devices for catalog.")
90+
@armResourceAction(Catalog)
91+
@post
92+
op listDevices(
93+
...ResourceInstanceParameters<Catalog>,
94+
...ListQueryParameters
95+
): ArmResponse<ResourceListResult<Device>> | ErrorResponse;
96+
97+
@autoRoute
98+
@doc("Lists deployments for catalog.")
99+
@armResourceAction(Catalog)
100+
@post
101+
op listDeployments(
102+
...ResourceInstanceParameters<Catalog>,
103+
...ListQueryParameters
104+
): ArmResponse<ResourceListResult<Deployment>> | ErrorResponse;
105+
106+
@autoRoute
107+
@armResourceAction(Catalog)
108+
@doc("List the device groups for the catalog.")
109+
@post
110+
op listDeviceGroups(
111+
...ResourceInstanceParameters<Catalog>,
112+
...ListQueryParameters,
113+
@doc("List device groups for catalog.")
114+
@body listDeviceGroupsRequest: ListDeviceGroupsRequest
115+
): ArmResponse<ResourceListResult<DeviceGroup>> | ErrorResponse;
116+
}
117+
118+
119+
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import "@cadl-lang/rest";
2+
import "@cadl-lang/versioning";
3+
import "@azure-tools/cadl-autorest";
4+
import "@azure-tools/cadl-azure-core";
5+
import "@azure-tools/cadl-azure-resource-manager";
6+
7+
using Cadl.Http;
8+
using Cadl.Rest;
9+
using Cadl.Versioning;
10+
using Azure.ResourceManager.Foundations;
11+
using Azure.Core;
12+
using Azure.ResourceManager;
13+
14+
namespace Microsoft.AzureSphere;
15+
16+
//Certificates
17+
@doc("An certificate resource belonging to a catalog resource.")
18+
@parentResource(Catalog)
19+
model Certificate is ProxyResource<CertificateProperties> {
20+
@doc("Serial number of the certificate. Use '.default' to get current active certificate.")
21+
@key("serialNumber")
22+
@path
23+
@segment("certificates")
24+
name: string;
25+
}
26+
27+
@armResourceOperations
28+
interface Certificates extends ProxyResourceOperationsReadList<Certificate, ListQueryParameters> {
29+
30+
@autoRoute
31+
@doc("Retrieves cert chain.")
32+
@armResourceAction(Certificate)
33+
@post
34+
op retrieveCertChain(
35+
...ResourceInstanceParameters<Certificate>,
36+
): ArmResponse<CertificateChainResponse> | ErrorResponse;
37+
38+
@autoRoute
39+
@armResourceAction(Certificate)
40+
@post
41+
@doc("Gets the proof of possession nonce.")
42+
op retrieveProofOfPossessionNonce(
43+
...ResourceInstanceParameters<Certificate>,
44+
@doc("Proof of possession nonce request body ")
45+
@body proofOfPossessionNonceRequest: ProofOfPossessionNonceRequest
46+
): ArmResponse<ProofOfPossessionNonceResponse> | ErrorResponse;
47+
}
48+
49+
@doc("The properties of certificate")
50+
model CertificateProperties {
51+
@doc("The certificate as a UTF-8 encoded base 64 string.")
52+
@visibility("read")
53+
certificate?: string;
54+
55+
@visibility("read")
56+
@doc("The certificate status.")
57+
status?: CertificateStatus;
58+
59+
@visibility("read")
60+
@doc("The certificate subject.")
61+
subject?: string;
62+
63+
@visibility("read")
64+
@doc("The certificate thumbprint.")
65+
thumbprint?: string;
66+
67+
@visibility("read")
68+
@doc("The certificate expiry date.")
69+
expiryUtc?: zonedDateTime;
70+
71+
@visibility("read")
72+
@doc("The certificate not before date.")
73+
notBeforeUtc?: zonedDateTime;
74+
75+
@visibility("read")
76+
@doc("The status of the last operation.")
77+
provisioningState?: ProvisioningState;
78+
}
79+
80+
@doc("The certificate chain response.")
81+
model CertificateChainResponse {
82+
@doc("The certificate chain.")
83+
@visibility("read")
84+
certificateChain?: string;
85+
}
86+
87+
@doc("Request for the proof of possession nonce")
88+
model ProofOfPossessionNonceRequest {
89+
@doc("The proof of possession nonce")
90+
proofOfPossessionNonce: string;
91+
}
92+
93+
@doc("Result of the action to generate a proof of possession nonce")
94+
model ProofOfPossessionNonceResponse extends CertificateProperties {}
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
import "@cadl-lang/openapi";
2+
import "@cadl-lang/rest";
3+
import "@cadl-lang/versioning";
4+
import "@azure-tools/cadl-autorest";
5+
import "@azure-tools/cadl-azure-core";
6+
import "@azure-tools/cadl-azure-resource-manager";
7+
8+
using Cadl.Http;
9+
using Cadl.Rest;
10+
using Cadl.Versioning;
11+
using Azure.ResourceManager.Foundations;
12+
using Azure.Core;
13+
using Azure.ResourceManager;
14+
using OpenAPI;
15+
16+
namespace Microsoft.AzureSphere;
17+
18+
interface Operations extends Azure.ResourceManager.Operations {}
19+
20+
// Common models
21+
@lroStatus
22+
enum ProvisioningState {
23+
...ResourceProvisioningState,
24+
Provisioning,
25+
Updating,
26+
Deleting,
27+
Accepted,
28+
}
29+
30+
@doc("Regional data boundary values.")
31+
enum RegionalDataBoundary {
32+
None,
33+
EU
34+
}
35+
36+
@doc("Allow crash dumps values.")
37+
enum AllowCrashDumpCollection {
38+
Enabled,
39+
Disabled
40+
}
41+
42+
@doc("Certificate status values.")
43+
enum CertificateStatus {
44+
Active,
45+
Inactive,
46+
Expired,
47+
Revoked
48+
}
49+
50+
@doc("Provides the custom '$filter' query parameter for list operations")
51+
model CustomFilterQueryParameter {
52+
@query("$filter")
53+
@doc("Filter the result list using the given expression")
54+
filter?: string;
55+
}
56+
57+
@doc("Provides the custom '$top' query parameter for list operations.")
58+
model CustomTopQueryParameter {
59+
@query("$top")
60+
@doc("The number of result items to return.")
61+
top?: int32;
62+
}
63+
64+
@doc("Provides the custom '$skip' query parameter for list operations.")
65+
model CustomSkipQueryParameter {
66+
@query("$skip")
67+
@doc("The number of result items to skip.")
68+
skip?: int32;
69+
}
70+
71+
@doc("Provides the custom '$maxpagesize' query parameter for list operations.")
72+
model CustomMaxPageSizeQueryParameter {
73+
@query("$maxpagesize")
74+
@doc("The maximum number of result items per page.")
75+
maxpagesize?: int32;
76+
}
77+
78+
@doc("Provides the most common query parameters for list operations.")
79+
model StandardListQueryParametersWithCorrectNames {
80+
...CustomTopQueryParameter;
81+
...CustomSkipQueryParameter;
82+
...CustomMaxPageSizeQueryParameter;
83+
}
84+
85+
@doc("Response to the action call for count devices in a catalog.")
86+
model CountDeviceResponse extends CountElementsResponse {}
87+
88+
@doc("Response of the count for elements.")
89+
model CountElementsResponse {
90+
@doc("Number of children resources in parent resource.")
91+
value: int32;
92+
}
93+
94+
@doc("Parameters for paginated APIs")
95+
model ListQueryParameters {
96+
...CustomFilterQueryParameter;
97+
...StandardListQueryParametersWithCorrectNames;
98+
}
99+
100+
// Templates
101+
interface ProxyResourceOperationsReadList<
102+
TResource extends ArmResource,
103+
TListParameters extends object = {}>
104+
extends Azure.ResourceManager.ResourceRead<TResource>,
105+
ResourceListByParent<TResource, TListParameters & BaseParameters<TResource>> {}
106+
107+
interface ProxyResourceOperationsReadListCreateDelete<
108+
TResource extends ArmResource,
109+
TListParameters extends object = {}>
110+
extends Azure.ResourceManager.ResourceRead<TResource>,
111+
ResourceListByParent<TResource, TListParameters & BaseParameters<TResource>>,
112+
ResourceCreate<TResource>,
113+
Azure.ResourceManager.ResourceDelete<TResource>{}
114+
115+
// Custom update operations
116+
@armResourceOperations
117+
interface CustomUpdateOperations{
118+
@autoRoute
119+
@doc("Update a {name}", TResource)
120+
@extension("x-ms-long-running-operation", true)
121+
@extension(
122+
"x-ms-long-running-operation-options",
123+
{
124+
"final-state-via": "location",
125+
}
126+
)
127+
@armResourceUpdate(TResource)
128+
@patch
129+
op ArmCustomPatchAsyncWithLocation<
130+
TResource extends ArmResource,
131+
TPatchModel extends object = TagsUpdateModel<TResource>,
132+
TBaseParameters = BaseParameters<TResource>
133+
>(
134+
...ResourceInstanceParameters<TResource, TBaseParameters>,
135+
136+
@doc("The resource properties to be updated.")
137+
@body
138+
properties: TPatchModel
139+
): ArmResponse<TResource> | ArmAcceptedResponse<"Resource update request accepted."> | ErrorResponse;
140+
}
141+
142+
alias CustomArmResourcePatchAsync<
143+
TResource extends ArmResource,
144+
TProperties extends object,
145+
TBaseParameters = BaseParameters<TResource>
146+
> = CustomUpdateOperations.ArmCustomPatchAsyncWithLocation<TResource, ResourceUpdateModel<TResource, TProperties>, TBaseParameters>;

0 commit comments

Comments
 (0)