Skip to content

Commit

Permalink
Add client setting for ContainerOrchestratorRuntime (Azure#30789)
Browse files Browse the repository at this point in the history
* Add client setting for ContainerOrchestratorRuntime

* Update the client.tsp for releasing .Net SDK

* add suppression

---------

Co-authored-by: Junda Chen <[email protected]>
  • Loading branch information
2 people authored and digvijaymali94 committed Dec 17, 2024
1 parent ca16536 commit b75394b
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,36 @@ import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
using Azure.ResourceManager.CommonTypes;
using Microsoft.KubernetesRuntime;

@@clientName(Microsoft.KubernetesRuntime,
"ContainerOrchestratorRuntimeMgmt",
"python"
);

@@clientName(AccessMode, "StorageClassAccessMode", "csharp");
@@clientName(AdvertiseMode.ARP, "Arp", "csharp");
@@clientName(AdvertiseMode.BGP, "Bgp", "csharp");
@@clientName(BgpPeer, "ConnectedClusterBgpPeer", "csharp");
@@clientName(BgpPeerProperties, "ConnectedClusterBgpPeerProperties", "csharp");
@@clientName(LoadBalancer, "ConnectedClusterLoadBalancer", "csharp");
@@clientName(LoadBalancerProperties,
"ConnectedClusterLoadBalancerProperties",
"csharp"
);
@@clientName(ServiceResource, "ConnectedClusterService", "csharp");
@@clientName(ServiceProperties, "ConnectedClusterServiceProperties", "csharp");
@@clientName(StorageClassResource, "ConnectedClusterStorageClass", "csharp");
@@clientName(StorageClassProperties,
"ConnectedClusterStorageClassProperties",
"csharp"
);
@@clientName(ProvisioningState,
"ContainerOrchestratorProvisioningState",
"csharp"
);
@@clientName(SCType, "StorageClassType", "csharp");
@@clientName(SCType.RWX, "Rwx", "csharp");
@@clientName(SCType.NFS, "Nfs", "csharp");
@@clientName(SCType.SMB, "Smb", "csharp");
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace Microsoft.KubernetesRuntime;
@doc("Versions of KubernetesRuntime service")
enum Versions {
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
@doc("2023-10-01-preview")
v2023_10_01_preview: "2023-10-01-preview",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "./common.tsp";
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;

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

@doc("Resource provision state")
@visibility("read")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ options:
arm-resource-flattening: true
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/kubernetesruntime.json"
use-read-only-status-schema: true
"@azure-tools/typespec-csharp":
package-dir: "Azure.ResourceManager.ContainerOrchestratorRuntime"
flavor: azure
clear-output-folder: true
use-write-core: true
namespace: "{package-dir}"
"@azure-tools/typespec-python":
package-dir: "azure-mgmt-containerorchestratorruntime"
package-name: "{package-dir}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,11 @@
]
}
},
"Azure.Core.uuid": {
"type": "string",
"format": "uuid",
"description": "Universally Unique Identifier"
},
"BgpPeer": {
"type": "object",
"description": "A BgpPeer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters)",
Expand Down Expand Up @@ -1478,7 +1483,7 @@
"description": "Properties for the service resource",
"properties": {
"rpObjectId": {
"type": "string",
"$ref": "#/definitions/Azure.Core.uuid",
"description": "The object id of the service principal of the RP provisioned in the tenant",
"readOnly": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,11 @@
]
}
},
"Azure.Core.uuid": {
"type": "string",
"format": "uuid",
"description": "Universally Unique Identifier"
},
"BgpPeer": {
"type": "object",
"description": "A BgpPeer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters)",
Expand Down Expand Up @@ -1455,7 +1460,7 @@
"description": "Properties for the service resource",
"properties": {
"rpObjectId": {
"type": "string",
"$ref": "#/definitions/Azure.Core.uuid",
"description": "The object id of the service principal of the RP provisioned in the tenant",
"readOnly": true
},
Expand Down
4 changes: 4 additions & 0 deletions specification/kubernetesruntime/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ suppressions:
- code: ConsistentPatchProperties
from: kubernetesruntime.json
reason: The tooling doens't check properties in derived models of discriminated unions.
- code: GuidUsage
from: kubernetesruntime.json
where: $.definitions["Azure.Core.uuid"].format
reason: The definition is used for AAD object ids, which are UUIDs.

```
### Tag: package-preview-2023-10-01
Expand Down

0 comments on commit b75394b

Please sign in to comment.