Skip to content

Commit be34b3d

Browse files
atastrophicAli Gilaniyijinglu-microsoft
authored
Microsoft.DeviceRegistry 2025-11-01-Preview (#37634)
* added new api version * Added Credentials, Policies and Policies on Device * Updated validityperiod * Fixed Examples * fixed errors & ran linting * fixed examples * prettier * added other sdks * updated description --------- Co-authored-by: Ali Gilani <[email protected]> Co-authored-by: Yijing Lu <[email protected]>
1 parent ef8f970 commit be34b3d

File tree

166 files changed

+26191
-13
lines changed

Some content is hidden

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

166 files changed

+26191
-13
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Create New API Version for Azure Resource Provider
2+
3+
This prompt helps create a new API version for an Azure Resource Provider service that uses TypeSpec.
4+
5+
## Context Variables
6+
- `{SERVICE_NAME}`: The name of the service (e.g., deviceregistry, storage, compute)
7+
- `{NEW_API_VERSION}`: The new API version to create (e.g., 2025-12-01, 2026-01-01-preview)
8+
- `{PREVIOUS_API_VERSION}`: The most recent existing API version to copy from
9+
- `{PROVIDER_NAMESPACE}`: The Microsoft provider namespace (e.g., Microsoft.DeviceRegistry)
10+
11+
## Instructions
12+
13+
This repository represents Azure Resource Provider services API schema in the form of TypeSpec which is then used to generate JSON.
14+
15+
Our service is located under `specification/{SERVICE_NAME}` with multiple folders:
16+
- The `{SERVICE_NAME}.Management` folder hosts the TypeSpec files and JSON examples
17+
- The `resource-manager` folder hosts the generated JSON files as well as copied over examples
18+
19+
When creating a new API version, follow these steps:
20+
21+
### 1. Add New Version to TypeSpec
22+
- Add the new version `{NEW_API_VERSION}` to the `Versions` enum in `specification/{SERVICE_NAME}/{SERVICE_NAME}.Management/main.tsp`
23+
- Include appropriate documentation and ARM common types version
24+
25+
### 2. Copy and Update Examples
26+
- Copy examples from the `{PREVIOUS_API_VERSION}` folder to a new `{NEW_API_VERSION}` folder under `specification/{SERVICE_NAME}/{SERVICE_NAME}.Management/examples/`
27+
- Replace all references of `{PREVIOUS_API_VERSION}` with `{NEW_API_VERSION}` in all example files
28+
29+
### 3. Compile TypeSpec
30+
- Run `tsp compile .` at the TypeSpec path (`specification/{SERVICE_NAME}/{SERVICE_NAME}.Management/`)
31+
- This generates new JSON files for the new API version under `specification/{SERVICE_NAME}/resource-manager/`
32+
33+
### 4. Verify No Existing Files Modified
34+
- Ensure that no existing files for older API versions are modified during compilation
35+
- Only new files for `{NEW_API_VERSION}` should be created
36+
37+
### 5. Update Resource Manager readme.md
38+
- Add new version configuration to `specification/{SERVICE_NAME}/resource-manager/readme.md`
39+
- Create a new tag section (e.g., `package-{VERSION_SHORT}`)
40+
- Copy existing suppressions from the previous version if applicable
41+
- Update the global settings tag to point to the new version
42+
43+
### 6. Run Validation
44+
- Run `npx tsv` on folder with main.tsp file
45+
- Run `npx prettier --write {SERVICE_NAME} folder`
46+
- Fix any errors.
47+
48+
## Example Usage
49+
50+
To create version `2025-12-01` for DeviceRegistry service:
51+
- SERVICE_NAME: `deviceregistry`
52+
- NEW_API_VERSION: `2025-12-01`
53+
- PREVIOUS_API_VERSION: `2025-10-01`
54+
- PROVIDER_NAMESPACE: `Microsoft.DeviceRegistry`
55+
56+
## Validation Checklist
57+
- [ ] New version added to TypeSpec Versions enum
58+
- [ ] Examples copied and API version references updated
59+
- [ ] TypeSpec compiles successfully
60+
- [ ] No existing files modified
61+
- [ ] readme.md updated with new tag configuration
62+
- [ ] Global settings updated to new version
63+
- [ ] TSV validation passes on all JSON files
64+
65+
## Notes
66+
- Use semantic versioning patterns (YYYY-MM-DD for stable, YYYY-MM-DD-preview for preview)
67+
- Ensure ARM common types version is appropriate for the API version
68+
- Maintain consistency with existing patterns in the service specification
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"title": "CreateOrReplace_AssetEndpointProfile",
3+
"operationId": "AssetEndpointProfiles_CreateOrReplace",
4+
"description": "Create an Asset Endpoint Profile",
5+
"parameters": {
6+
"api-version": "2025-11-01-preview",
7+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
8+
"resourceGroupName": "myResourceGroup",
9+
"assetEndpointProfileName": "my-assetendpointprofile",
10+
"resource": {
11+
"location": "West Europe",
12+
"extendedLocation": {
13+
"type": "CustomLocation",
14+
"name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"
15+
},
16+
"tags": {
17+
"site": "building-1"
18+
},
19+
"properties": {
20+
"targetAddress": "https://www.example.com/myTargetAddress",
21+
"endpointProfileType": "myEndpointProfileType",
22+
"authentication": {
23+
"method": "Anonymous"
24+
}
25+
}
26+
}
27+
},
28+
"responses": {
29+
"200": {
30+
"body": {
31+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile",
32+
"name": "my-assetendpointprofile",
33+
"type": "Microsoft.DeviceRegistry/assetEndpointProfiles",
34+
"location": "West Europe",
35+
"extendedLocation": {
36+
"type": "CustomLocation",
37+
"name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"
38+
},
39+
"tags": {
40+
"site": "building-1"
41+
},
42+
"systemData": {
43+
"createdBy": "2ta23112-4596-44ff-b773-19405922bfc1",
44+
"createdByType": "Application",
45+
"createdAt": "2022-11-16T00:36:43.2516899Z",
46+
"lastModifiedBy": "2ta23112-4596-44ff-b773-19405922bfc1",
47+
"lastModifiedByType": "Application",
48+
"lastModifiedAt": "2022-11-16T01:37:16.0922793Z"
49+
},
50+
"properties": {
51+
"uuid": "0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d",
52+
"targetAddress": "https://www.example.com/myTargetAddress",
53+
"endpointProfileType": "myEndpointProfileType",
54+
"authentication": {
55+
"method": "Anonymous"
56+
},
57+
"provisioningState": "Succeeded"
58+
}
59+
}
60+
},
61+
"201": {
62+
"body": {
63+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile",
64+
"name": "my-assetendpointprofile",
65+
"type": "Microsoft.DeviceRegistry/assetEndpointProfiles",
66+
"location": "West Europe",
67+
"extendedLocation": {
68+
"type": "CustomLocation",
69+
"name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"
70+
},
71+
"tags": {
72+
"site": "building-1"
73+
},
74+
"systemData": {
75+
"createdBy": "2ta23112-4596-44ff-b773-19405922bfc1",
76+
"createdByType": "Application",
77+
"createdAt": "2022-11-16T00:36:43.2516899Z",
78+
"lastModifiedBy": "2ta23112-4596-44ff-b773-19405922bfc1",
79+
"lastModifiedByType": "Application",
80+
"lastModifiedAt": "2022-11-16T01:37:16.0922793Z"
81+
},
82+
"properties": {
83+
"uuid": "0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d",
84+
"targetAddress": "https://www.example.com/myTargetAddress",
85+
"endpointProfileType": "myEndpointProfileType",
86+
"authentication": {
87+
"method": "Anonymous"
88+
},
89+
"provisioningState": "Accepted"
90+
}
91+
}
92+
}
93+
}
94+
}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"title": "CreateOrReplace_AssetEndpointProfile_With_DiscoveredAepRef",
3+
"operationId": "AssetEndpointProfiles_CreateOrReplace",
4+
"description": "Create an Asset Endpoint Profile With Discovered Asset Endpoint Profile Reference",
5+
"parameters": {
6+
"api-version": "2025-11-01-preview",
7+
"subscriptionId": "00000000-0000-0000-0000-000000000000",
8+
"resourceGroupName": "myResourceGroup",
9+
"assetEndpointProfileName": "my-assetendpointprofile",
10+
"resource": {
11+
"location": "West Europe",
12+
"extendedLocation": {
13+
"type": "CustomLocation",
14+
"name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"
15+
},
16+
"tags": {
17+
"site": "building-1"
18+
},
19+
"properties": {
20+
"targetAddress": "https://www.example.com/myTargetAddress",
21+
"endpointProfileType": "myEndpointProfileType",
22+
"discoveredAssetEndpointProfileRef": "discoveredAssetEndpointProfile1",
23+
"authentication": {
24+
"method": "Anonymous"
25+
}
26+
}
27+
}
28+
},
29+
"responses": {
30+
"200": {
31+
"body": {
32+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile",
33+
"name": "my-assetendpointprofile",
34+
"type": "Microsoft.DeviceRegistry/assetEndpointProfiles",
35+
"location": "West Europe",
36+
"extendedLocation": {
37+
"type": "CustomLocation",
38+
"name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"
39+
},
40+
"tags": {
41+
"site": "building-1"
42+
},
43+
"systemData": {
44+
"createdBy": "2ta23112-4596-44ff-b773-19405922bfc1",
45+
"createdByType": "Application",
46+
"createdAt": "2022-11-16T00:36:43.2516899Z",
47+
"lastModifiedBy": "2ta23112-4596-44ff-b773-19405922bfc1",
48+
"lastModifiedByType": "Application",
49+
"lastModifiedAt": "2022-11-16T01:37:16.0922793Z"
50+
},
51+
"properties": {
52+
"uuid": "0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d",
53+
"targetAddress": "https://www.example.com/myTargetAddress",
54+
"endpointProfileType": "myEndpointProfileType",
55+
"discoveredAssetEndpointProfileRef": "discoveredAssetEndpointProfile1",
56+
"authentication": {
57+
"method": "Anonymous"
58+
},
59+
"provisioningState": "Succeeded"
60+
}
61+
}
62+
},
63+
"201": {
64+
"body": {
65+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile",
66+
"name": "my-assetendpointprofile",
67+
"type": "Microsoft.DeviceRegistry/assetEndpointProfiles",
68+
"location": "West Europe",
69+
"extendedLocation": {
70+
"type": "CustomLocation",
71+
"name": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"
72+
},
73+
"tags": {
74+
"site": "building-1"
75+
},
76+
"systemData": {
77+
"createdBy": "2ta23112-4596-44ff-b773-19405922bfc1",
78+
"createdByType": "Application",
79+
"createdAt": "2022-11-16T00:36:43.2516899Z",
80+
"lastModifiedBy": "2ta23112-4596-44ff-b773-19405922bfc1",
81+
"lastModifiedByType": "Application",
82+
"lastModifiedAt": "2022-11-16T01:37:16.0922793Z"
83+
},
84+
"properties": {
85+
"uuid": "0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d",
86+
"targetAddress": "https://www.example.com/myTargetAddress",
87+
"endpointProfileType": "myEndpointProfileType",
88+
"discoveredAssetEndpointProfileRef": "discoveredAssetEndpointProfile1",
89+
"authentication": {
90+
"method": "Anonymous"
91+
},
92+
"provisioningState": "Accepted"
93+
}
94+
}
95+
}
96+
}
97+
}

0 commit comments

Comments
 (0)