Skip to content

Commit 8c0a6a0

Browse files
ArthurMa1978Junda Chen
authored andcommitted
Add client setting for ContainerOrchestratorRuntime (#30789)
* Add client setting for ContainerOrchestratorRuntime * Update the client.tsp for releasing .Net SDK * add suppression --------- Co-authored-by: Junda Chen <[email protected]>
1 parent 7d4f001 commit 8c0a6a0

File tree

7 files changed

+53
-3
lines changed

7 files changed

+53
-3
lines changed

specification/kubernetesruntime/KubernetesRuntime.Management/client.tsp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,36 @@ import "./main.tsp";
22
import "@azure-tools/typespec-client-generator-core";
33

44
using Azure.ClientGenerator.Core;
5+
using Azure.ResourceManager.CommonTypes;
6+
using Microsoft.KubernetesRuntime;
57

68
@@clientName(Microsoft.KubernetesRuntime,
79
"ContainerOrchestratorRuntimeMgmt",
810
"python"
911
);
12+
13+
@@clientName(AccessMode, "StorageClassAccessMode", "csharp");
14+
@@clientName(AdvertiseMode.ARP, "Arp", "csharp");
15+
@@clientName(AdvertiseMode.BGP, "Bgp", "csharp");
16+
@@clientName(BgpPeer, "ConnectedClusterBgpPeer", "csharp");
17+
@@clientName(BgpPeerProperties, "ConnectedClusterBgpPeerProperties", "csharp");
18+
@@clientName(LoadBalancer, "ConnectedClusterLoadBalancer", "csharp");
19+
@@clientName(LoadBalancerProperties,
20+
"ConnectedClusterLoadBalancerProperties",
21+
"csharp"
22+
);
23+
@@clientName(ServiceResource, "ConnectedClusterService", "csharp");
24+
@@clientName(ServiceProperties, "ConnectedClusterServiceProperties", "csharp");
25+
@@clientName(StorageClassResource, "ConnectedClusterStorageClass", "csharp");
26+
@@clientName(StorageClassProperties,
27+
"ConnectedClusterStorageClassProperties",
28+
"csharp"
29+
);
30+
@@clientName(ProvisioningState,
31+
"ContainerOrchestratorProvisioningState",
32+
"csharp"
33+
);
34+
@@clientName(SCType, "StorageClassType", "csharp");
35+
@@clientName(SCType.RWX, "Rwx", "csharp");
36+
@@clientName(SCType.NFS, "Nfs", "csharp");
37+
@@clientName(SCType.SMB, "Smb", "csharp");

specification/kubernetesruntime/KubernetesRuntime.Management/common.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace Microsoft.KubernetesRuntime;
2020
@doc("Versions of KubernetesRuntime service")
2121
enum Versions {
2222
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
23+
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
2324
@doc("2023-10-01-preview")
2425
v2023_10_01_preview: "2023-10-01-preview",
2526

specification/kubernetesruntime/KubernetesRuntime.Management/service.tsp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import "./common.tsp";
33
using TypeSpec.Http;
44
using TypeSpec.Rest;
55
using TypeSpec.Versioning;
6+
using Azure.Core;
67
using Azure.ResourceManager;
78

89
namespace Microsoft.KubernetesRuntime;
@@ -11,7 +12,7 @@ namespace Microsoft.KubernetesRuntime;
1112
model ServiceProperties {
1213
@doc("The object id of the service principal of the RP provisioned in the tenant")
1314
@visibility("read")
14-
rpObjectId?: string;
15+
rpObjectId?: uuid;
1516

1617
@doc("Resource provision state")
1718
@visibility("read")

specification/kubernetesruntime/KubernetesRuntime.Management/tspconfig.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ options:
1414
arm-resource-flattening: true
1515
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/kubernetesruntime.json"
1616
use-read-only-status-schema: true
17+
"@azure-tools/typespec-csharp":
18+
package-dir: "Azure.ResourceManager.ContainerOrchestratorRuntime"
19+
flavor: azure
20+
clear-output-folder: true
21+
use-write-core: true
22+
namespace: "{package-dir}"
1723
"@azure-tools/typespec-python":
1824
package-dir: "azure-mgmt-containerorchestratorruntime"
1925
package-name: "{package-dir}"

specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/preview/2023-10-01-preview/kubernetesruntime.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,11 @@
10221022
]
10231023
}
10241024
},
1025+
"Azure.Core.uuid": {
1026+
"type": "string",
1027+
"format": "uuid",
1028+
"description": "Universally Unique Identifier"
1029+
},
10251030
"BgpPeer": {
10261031
"type": "object",
10271032
"description": "A BgpPeer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters)",
@@ -1478,7 +1483,7 @@
14781483
"description": "Properties for the service resource",
14791484
"properties": {
14801485
"rpObjectId": {
1481-
"type": "string",
1486+
"$ref": "#/definitions/Azure.Core.uuid",
14821487
"description": "The object id of the service principal of the RP provisioned in the tenant",
14831488
"readOnly": true
14841489
},

specification/kubernetesruntime/resource-manager/Microsoft.KubernetesRuntime/stable/2024-03-01/kubernetesruntime.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,11 @@
992992
]
993993
}
994994
},
995+
"Azure.Core.uuid": {
996+
"type": "string",
997+
"format": "uuid",
998+
"description": "Universally Unique Identifier"
999+
},
9951000
"BgpPeer": {
9961001
"type": "object",
9971002
"description": "A BgpPeer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters)",
@@ -1455,7 +1460,7 @@
14551460
"description": "Properties for the service resource",
14561461
"properties": {
14571462
"rpObjectId": {
1458-
"type": "string",
1463+
"$ref": "#/definitions/Azure.Core.uuid",
14591464
"description": "The object id of the service principal of the RP provisioned in the tenant",
14601465
"readOnly": true
14611466
},

specification/kubernetesruntime/resource-manager/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ suppressions:
3333
- code: ConsistentPatchProperties
3434
from: kubernetesruntime.json
3535
reason: The tooling doens't check properties in derived models of discriminated unions.
36+
- code: GuidUsage
37+
from: kubernetesruntime.json
38+
where: $.definitions["Azure.Core.uuid"].format
39+
reason: The definition is used for AAD object ids, which are UUIDs.
3640

3741
```
3842
### Tag: package-preview-2023-10-01

0 commit comments

Comments
 (0)