From 8587bdd47710cede6a6dcd229798c4f7a51dd2cf Mon Sep 17 00:00:00 2001 From: Ivy Liu Date: Mon, 28 Apr 2025 23:19:26 -0700 Subject: [PATCH 1/6] shimmed typespec changes for sdk generation --- .../ApplicationResource.tsp | 42 +++++++-------- .../ManagedCluster.tsp | 30 +++++++---- .../ManagedClusterCodeVersionResult.tsp | 3 ++ .../NodeType.tsp | 9 ++-- .../ServiceResource.tsp | 24 ++++----- .../back-compat.tsp | 54 +++++++++++++++---- 6 files changed, 107 insertions(+), 55 deletions(-) diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ApplicationResource.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ApplicationResource.tsp index 38857566bd2d..ebc7ad817608 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ApplicationResource.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ApplicationResource.tsp @@ -130,6 +130,12 @@ interface Applications { * The application resource properties. */ model ApplicationResourceProperties { + /** + * List of user assigned identities for the application, each mapped to a friendly name. + */ + @OpenAPI.extension("x-ms-identifiers", #[]) + managedIdentities?: ApplicationUserAssignedIdentity[]; + /** * The current deployment or provisioning state, which only appears in the response */ @@ -154,12 +160,6 @@ model ApplicationResourceProperties { * Describes the policy for a monitored application upgrade. */ upgradePolicy?: ApplicationUpgradePolicy; - - /** - * List of user assigned identities for the application, each mapped to a friendly name. - */ - @OpenAPI.extension("x-ms-identifiers", #[]) - managedIdentities?: ApplicationUserAssignedIdentity[]; } /** @@ -278,37 +278,37 @@ model RollingUpgradeMonitoringPolicy { /** * The amount of time to wait after completing an upgrade domain before applying health policies. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - healthCheckWaitDuration: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + healthCheckWaitDuration: duration; /** * The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - healthCheckStableDuration: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + healthCheckStableDuration: duration; /** * The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - healthCheckRetryTimeout: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + healthCheckRetryTimeout: duration; /** * The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - upgradeTimeout: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + upgradeTimeout: duration; /** * The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - upgradeDomainTimeout: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + upgradeDomainTimeout: duration; } /** diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedCluster.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedCluster.tsp index 2ef68c9ff063..d6ad9e9c0fbc 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedCluster.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedCluster.tsp @@ -1,12 +1,15 @@ import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-client-generator-core"; import "@typespec/openapi"; import "@typespec/rest"; import "@typespec/versioning"; import "./models.tsp"; +using Azure.Core; using TypeSpec.Rest; using Azure.ResourceManager; +using Azure.ClientGenerator.Core; using TypeSpec.Http; using TypeSpec.OpenAPI; using TypeSpec.Versioning; @@ -215,6 +218,7 @@ model ManagedClusterProperties { * A service generated unique identifier for the cluster resource. */ @visibility(Lifecycle.Read) + @deserializeEmptyStringAsNull clusterId?: string; /** @@ -227,7 +231,8 @@ model ManagedClusterProperties { * List of thumbprints of the cluster certificates. */ @visibility(Lifecycle.Read) - clusterCertificateThumbprints?: string[]; + // TODO: Waiting for alternate type to support nonscalar values + clusterCertificateThumbprints?: unknown[]; /** * The port used for client connections to the cluster. @@ -644,6 +649,7 @@ model Subnet { /** * Subnet name. */ + @deserializeEmptyStringAsNull name: string; /** @@ -664,6 +670,7 @@ model Subnet { /** * Full resource id for the network security group. */ + @deserializeEmptyStringAsNull networkSecurityGroupId?: string; } @@ -679,7 +686,8 @@ model ServiceEndpoint { /** * A list of locations. */ - locations?: string[]; + // TODO: Waiting for alternate type to support nonscalar values + locations?: azureLocation[]; } /** @@ -793,16 +801,16 @@ model ClusterMonitoringPolicy { /** * The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - healthCheckWaitDuration: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + healthCheckWaitDuration: duration; /** * The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - healthCheckStableDuration: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + healthCheckStableDuration: duration; /** * The amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. @@ -1188,7 +1196,8 @@ model ClientCertificate { /** * Certificate thumbprint. */ - thumbprint?: string; + // TODO: Waiting for alternate type to support nonscalar values + thumbprint?: unknown; /** * Certificate common name. @@ -1198,7 +1207,8 @@ model ClientCertificate { /** * Issuer thumbprint for the certificate. Only used together with CommonName. */ - issuerThumbprint?: string; + // TODO: Waiting for alternate type to support nonscalar values + issuerThumbprint?: unknown; } /** diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedClusterCodeVersionResult.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedClusterCodeVersionResult.tsp index 7548a6851385..39fe4a2ffe87 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedClusterCodeVersionResult.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedClusterCodeVersionResult.tsp @@ -1,11 +1,14 @@ import "@azure-tools/typespec-azure-core"; import "@azure-tools/typespec-azure-resource-manager"; +import "@azure-tools/typespec-client-generator-core"; import "@typespec/openapi"; import "@typespec/rest"; import "./models.tsp"; using TypeSpec.Rest; +using Azure.Core; using Azure.ResourceManager; +using Azure.ClientGenerator.Core; using TypeSpec.Http; namespace Microsoft.ServiceFabric; diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/NodeType.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/NodeType.tsp index 32c396b7b35d..056c16361dab 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/NodeType.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/NodeType.tsp @@ -905,13 +905,15 @@ model VMSSExtensionProperties { * Json formatted public settings for the extension. */ #suppress "@azure-tools/typespec-azure-resource-manager/no-empty-model" "Day 0 property" - settings?: {}; + // TODO: alternate type to support non-scalars + settings?: unknown; /** * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ #suppress "@azure-tools/typespec-azure-resource-manager/no-empty-model" "Day 0 property" - protectedSettings?: {}; + // TODO: alternate type to support non-scalar + protectedSettings?: unknown; /** * If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. @@ -948,7 +950,8 @@ model VmManagedIdentity { /** * The list of user identities associated with the virtual machine scale set under the node type. Each entry will be an ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - userAssignedIdentities?: string[]; + // TODO: Used to be string, waiting for alternatetype to support non-scalars + userAssignedIdentities?: Azure.Core.armResourceIdentifier[]; } /** diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ServiceResource.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ServiceResource.tsp index bc1d09766a5c..2c3bcb8c6357 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ServiceResource.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ServiceResource.tsp @@ -196,30 +196,30 @@ model StatefulServiceProperties extends ServiceResourceProperties { /** * The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format "hh:mm:ss". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - replicaRestartWaitDuration?: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + replicaRestartWaitDuration?: duration; /** * The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - quorumLossWaitDuration?: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + quorumLossWaitDuration?: duration; /** * The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format "hh:mm:ss". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - standByReplicaKeepDuration?: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + standByReplicaKeepDuration?: duration; /** * The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format "hh:mm:ss". */ - #suppress "@azure-tools/typespec-azure-core/no-openapi" "Day 0 property" - @OpenAPI.extension("x-ms-format", "duration-constant") - servicePlacementTimeLimit?: string; + #suppress "@azure-tools/typespec-azure-core/known-encoding" "Backwards compatibility with non-standard duration encoding in c#" + @encode("duration-constant") + servicePlacementTimeLimit?: duration; /** * The kind of service (Stateless or Stateful). diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp index 3e2a8e885d2f..cc709bdca76a 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp @@ -73,11 +73,11 @@ using Microsoft.ServiceFabric; "IsRdpAccessAllowed", "csharp" ); -@@clientName(ManagedClusterProperties.clusterCertificateThumbprints, - "-|any", - "csharp" -); -@@clientName(ManagedClusterProperties.clusterId, "-|uuid", "csharp"); +// TODO: Waiting on alternateType to support non-scalers, list of binary data +// @@clientName(ManagedClusterProperties.clusterCertificateThumbprints, +// "-|any", +// "csharp" +// ); @@clientName(ManagedClusterProperties.enableAutoOSUpgrade, "IsAutoOSUpgradeEnabled", "csharp" @@ -134,7 +134,6 @@ using Microsoft.ServiceFabric; "csharp" ); @@clientName(ServiceEndpoint, "ManagedClusterServiceEndpoint", "csharp"); -@@clientName(ServiceEndpoint.locations, "-|azure-location", "csharp"); @@clientName(NodeType, "ServiceFabricManagedNodeType", "csharp"); @@clientName(NodeTypeProperties.dataDiskSizeGB, "DataDiskSizeInGB", "csharp"); @@clientName(NodeTypeProperties.enableAcceleratedNetworking, @@ -170,7 +169,8 @@ using Microsoft.ServiceFabric; @@clientName(VaultCertificate, "NodeTypeVaultCertificate", "csharp"); @@clientName(DiskType, "ServiceFabricManagedDataDiskType", "csharp"); @@clientName(FrontendConfiguration, "NodeTypeFrontendConfiguration", "csharp"); -@@clientName(VmManagedIdentity.userAssignedIdentities, "-|arm-id", "csharp"); +// TODO: Waiting on alternateType to support non-scalers, list of arm ids +//@@clientName(VmManagedIdentity.userAssignedIdentities, "-|arm-id", "csharp"); @@clientName(NodeTypeActionParameters, "NodeTypeActionContent", "csharp"); @@clientName(NodeTypeActionParameters.force, "IsForced", "csharp"); @@clientName(ServiceResource, "ServiceFabricManagedService", "csharp"); @@ -205,7 +205,6 @@ using Microsoft.ServiceFabric; @@clientName(Partition, "ManagedServicePartitionScheme", "csharp"); @@clientName(NsgProtocol, "ServiceFabricManagedNsgProtocol", "csharp"); @@clientName(NsgProtocol.ah, "AH", "csharp"); -@@clientName(NodeTypeAvailableSku.resourceType, "-|resource-type", "csharp"); @@clientName(PartitionInstanceCountScaleMechanism, "PartitionInstanceCountScalingMechanism", "csharp" @@ -242,7 +241,6 @@ using Microsoft.ServiceFabric; "csharp" ); @@clientName(EvictionPolicyType, "SpotNodeVmEvictionPolicyType", "csharp"); -@@clientName(ResourceAzStatus.resourceType, "-|resource-type", "csharp"); @@clientName(SecurityType, "ServiceFabricManagedClusterSecurityType", "csharp"); @@clientName(UpdateType, "ServiceFabricManagedClusterUpdateType", "csharp"); @@clientName(ClusterHealthPolicy, "ManagedClusterHealthPolicy", "csharp"); @@ -283,8 +281,44 @@ using Microsoft.ServiceFabric; "LastWindowEndOn", "csharp" ); +@@clientName(VMSSExtensionProperties.type, + "vmssExtensionPropertiesType", + "csharp" +); +@@clientName(DiskType.Standard_LRS, "StandardLrs", "csharp"); +@@clientName(DiskType.StandardSSD_LRS, "StandardSsdLrs", "csharp"); +@@clientName(DiskType.Premium_LRS, "PremiumLrs", "csharp"); +@@clientName(DiskType.StandardSSD_ZRS, "PremiumV2Lrs", "csharp"); +@@clientName(DiskType.StandardSSD_ZRS, "StandardSsdZrs", "csharp"); +@@clientName(DiskType.StandardSSD_ZRS, "PremiumZrs", "csharp"); + +@@alternateType(ManagedClusterVersion.list::parameters.location, + azureLocation, + "csharp" +); +@@alternateType(ManagedClusterVersion.get::parameters.location, + azureLocation, + "csharp" +); +@@alternateType(ManagedClusterVersion.getByEnvironment::parameters.location, + azureLocation, + "csharp" +); +@@alternateType(ManagedClusterVersion.listByEnvironment::parameters.location, + azureLocation, + "csharp" +); +@@alternateType(ManagedUnsupportedVMSizes.get::parameters.location, + azureLocation, + "csharp" +); +@@alternateType(ManagedUnsupportedVMSizes.list::parameters.location, + azureLocation, + "csharp" +); @@alternateType(ManagedClusterProperties.clusterId, uuid, "csharp"); +@@alternateType(ManagedCluster.etag, eTag, "csharp"); @@alternateType(ManagedClusterProperties.ipv4Address, ipV4Address, "csharp"); @@alternateType(ManagedClusterProperties.ipv6Address, ipV6Address, "csharp"); @@alternateType(Subnet.networkSecurityGroupId, armResourceIdentifier, "csharp"); @@ -304,3 +338,5 @@ using Microsoft.ServiceFabric; ); @@alternateType(AzureActiveDirectory.tenantId, uuid, "csharp"); @@alternateType(VaultCertificate.certificateUrl, url, "csharp"); +// TODO: waiting on alternateType to support non-scalers +// @@alternateType(ServiceEndpoint.locations, azureLocation[], "csharp"); From d19359a0417148379a1debcb55874649e5446721 Mon Sep 17 00:00:00 2001 From: Ivy Liu Date: Thu, 15 May 2025 10:31:11 -0700 Subject: [PATCH 2/6] adopting alternateType for non-scalar, suppress-abstract-base-class --- .../ManagedCluster.tsp | 12 ++-- .../NodeType.tsp | 9 +-- .../back-compat.tsp | 22 ++++--- .../tspconfig.yaml | 2 + .../servicefabricmanagedclusters.json | 60 +++++++++---------- .../servicefabricmanagedclusters.json | 60 +++++++++---------- 6 files changed, 82 insertions(+), 83 deletions(-) diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedCluster.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedCluster.tsp index 8978b1323b7b..8c952dfa0b27 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedCluster.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/ManagedCluster.tsp @@ -231,8 +231,7 @@ model ManagedClusterProperties { * List of thumbprints of the cluster certificates. */ @visibility(Lifecycle.Read) - // TODO: Waiting for alternate type to support nonscalar values - clusterCertificateThumbprints?: unknown[]; + clusterCertificateThumbprints?: string[]; /** * The port used for client connections to the cluster. @@ -686,8 +685,7 @@ model ServiceEndpoint { /** * A list of locations. */ - // TODO: Waiting for alternate type to support nonscalar values - locations?: azureLocation[]; + locations?: string[]; } /** @@ -1196,8 +1194,7 @@ model ClientCertificate { /** * Certificate thumbprint. */ - // TODO: Waiting for alternate type to support nonscalar values - thumbprint?: unknown; + thumbprint?: string; /** * Certificate common name. @@ -1207,8 +1204,7 @@ model ClientCertificate { /** * Issuer thumbprint for the certificate. Only used together with CommonName. */ - // TODO: Waiting for alternate type to support nonscalar values - issuerThumbprint?: unknown; + issuerThumbprint?: string; } /** diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/NodeType.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/NodeType.tsp index 5905067dc695..5cf5636626ba 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/NodeType.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/NodeType.tsp @@ -905,15 +905,13 @@ model VMSSExtensionProperties { * Json formatted public settings for the extension. */ #suppress "@azure-tools/typespec-azure-resource-manager/no-empty-model" "Day 0 property" - // TODO: alternate type to support non-scalars - settings?: unknown; + settings?: {}; /** * The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. */ #suppress "@azure-tools/typespec-azure-resource-manager/no-empty-model" "Day 0 property" - // TODO: alternate type to support non-scalar - protectedSettings?: unknown; + protectedSettings?: {}; /** * If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. @@ -949,8 +947,7 @@ model VmManagedIdentity { /** * The list of user identities associated with the virtual machine scale set under the node type. Each entry will be an ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. */ - // TODO: Used to be string, waiting for alternatetype to support non-scalars - userAssignedIdentities?: Azure.Core.armResourceIdentifier[]; + userAssignedIdentities?: string[]; } /** diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp index cc709bdca76a..b1fa96a959d3 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp @@ -73,11 +73,6 @@ using Microsoft.ServiceFabric; "IsRdpAccessAllowed", "csharp" ); -// TODO: Waiting on alternateType to support non-scalers, list of binary data -// @@clientName(ManagedClusterProperties.clusterCertificateThumbprints, -// "-|any", -// "csharp" -// ); @@clientName(ManagedClusterProperties.enableAutoOSUpgrade, "IsAutoOSUpgradeEnabled", "csharp" @@ -169,8 +164,6 @@ using Microsoft.ServiceFabric; @@clientName(VaultCertificate, "NodeTypeVaultCertificate", "csharp"); @@clientName(DiskType, "ServiceFabricManagedDataDiskType", "csharp"); @@clientName(FrontendConfiguration, "NodeTypeFrontendConfiguration", "csharp"); -// TODO: Waiting on alternateType to support non-scalers, list of arm ids -//@@clientName(VmManagedIdentity.userAssignedIdentities, "-|arm-id", "csharp"); @@clientName(NodeTypeActionParameters, "NodeTypeActionContent", "csharp"); @@clientName(NodeTypeActionParameters.force, "IsForced", "csharp"); @@clientName(ServiceResource, "ServiceFabricManagedService", "csharp"); @@ -338,5 +331,16 @@ using Microsoft.ServiceFabric; ); @@alternateType(AzureActiveDirectory.tenantId, uuid, "csharp"); @@alternateType(VaultCertificate.certificateUrl, url, "csharp"); -// TODO: waiting on alternateType to support non-scalers -// @@alternateType(ServiceEndpoint.locations, azureLocation[], "csharp"); +@@alternateType(ServiceEndpoint.locations, azureLocation[], "csharp"); +@@alternateType(ManagedClusterProperties.clusterCertificateThumbprints, + unknown, + "csharp" +); +@@alternateType(ClientCertificate.thumbprint, unknown, "csharp"); +@@alternateType(ClientCertificate.issuerThumbprint, unknown, "csharp"); +@@alternateType(VMSSExtensionProperties.settings, unknown, "csharp"); +@@alternateType(VMSSExtensionProperties.protectedSettings, unknown, "csharp"); +@@alternateType(VmManagedIdentity.userAssignedIdentities, + armResourceIdentifier[], + "csharp" +); diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/tspconfig.yaml b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/tspconfig.yaml index 223215169ede..c30fdc0bb5a0 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/tspconfig.yaml +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/tspconfig.yaml @@ -18,6 +18,8 @@ options: model-namespace: false namespace: "{package-dir}" flavor: azure + suppress-abstract-base-class: + - "ManagedServiceProperties" "@azure-tools/typespec-python": package-dir: "azure-mgmt-servicefabricmanagedclusters" package-name: "azure-mgmt-servicefabricmanagedclusters" diff --git a/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/servicefabricmanagedclusters.json b/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/servicefabricmanagedclusters.json index 2c2db1643da0..1a3082276f96 100644 --- a/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/servicefabricmanagedclusters.json +++ b/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/servicefabricmanagedclusters.json @@ -4068,6 +4068,14 @@ "type": "object", "description": "The application resource properties.", "properties": { + "managedIdentities": { + "type": "array", + "description": "List of user assigned identities for the application, each mapped to a friendly name.", + "items": { + "$ref": "#/definitions/ApplicationUserAssignedIdentity" + }, + "x-ms-identifiers": [] + }, "provisioningState": { "type": "string", "description": "The current deployment or provisioning state, which only appears in the response", @@ -4087,14 +4095,6 @@ "upgradePolicy": { "$ref": "#/definitions/ApplicationUpgradePolicy", "description": "Describes the policy for a monitored application upgrade." - }, - "managedIdentities": { - "type": "array", - "description": "List of user assigned identities for the application, each mapped to a friendly name.", - "items": { - "$ref": "#/definitions/ApplicationUserAssignedIdentity" - }, - "x-ms-identifiers": [] } } }, @@ -4550,13 +4550,13 @@ "properties": { "healthCheckWaitDuration": { "type": "string", - "description": "The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format.", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format." }, "healthCheckStableDuration": { "type": "string", - "description": "The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format.", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format." }, "healthCheckRetryTimeout": { "type": "string", @@ -7090,28 +7090,28 @@ }, "healthCheckWaitDuration": { "type": "string", - "description": "The amount of time to wait after completing an upgrade domain before applying health policies. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time to wait after completing an upgrade domain before applying health policies. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." }, "healthCheckStableDuration": { "type": "string", - "description": "The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." }, "healthCheckRetryTimeout": { "type": "string", - "description": "The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." }, "upgradeTimeout": { "type": "string", - "description": "The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." }, "upgradeDomainTimeout": { "type": "string", - "description": "The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." } }, "required": [ @@ -7942,23 +7942,23 @@ }, "replicaRestartWaitDuration": { "type": "string", - "description": "The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format \"hh:mm:ss\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format \"hh:mm:ss\"." }, "quorumLossWaitDuration": { "type": "string", - "description": "The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format \"hh:mm:ss\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format \"hh:mm:ss\"." }, "standByReplicaKeepDuration": { "type": "string", - "description": "The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format \"hh:mm:ss\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format \"hh:mm:ss\"." }, "servicePlacementTimeLimit": { "type": "string", - "description": "The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format \"hh:mm:ss\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format \"hh:mm:ss\"." } }, "allOf": [ diff --git a/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2025-03-01-preview/servicefabricmanagedclusters.json b/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2025-03-01-preview/servicefabricmanagedclusters.json index 94902021c96d..96f4c051ead9 100644 --- a/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2025-03-01-preview/servicefabricmanagedclusters.json +++ b/specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2025-03-01-preview/servicefabricmanagedclusters.json @@ -4068,6 +4068,14 @@ "type": "object", "description": "The application resource properties.", "properties": { + "managedIdentities": { + "type": "array", + "description": "List of user assigned identities for the application, each mapped to a friendly name.", + "items": { + "$ref": "#/definitions/ApplicationUserAssignedIdentity" + }, + "x-ms-identifiers": [] + }, "provisioningState": { "type": "string", "description": "The current deployment or provisioning state, which only appears in the response", @@ -4087,14 +4095,6 @@ "upgradePolicy": { "$ref": "#/definitions/ApplicationUpgradePolicy", "description": "Describes the policy for a monitored application upgrade." - }, - "managedIdentities": { - "type": "array", - "description": "List of user assigned identities for the application, each mapped to a friendly name.", - "items": { - "$ref": "#/definitions/ApplicationUserAssignedIdentity" - }, - "x-ms-identifiers": [] } } }, @@ -4550,13 +4550,13 @@ "properties": { "healthCheckWaitDuration": { "type": "string", - "description": "The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format.", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format." }, "healthCheckStableDuration": { "type": "string", - "description": "The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format.", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format." }, "healthCheckRetryTimeout": { "type": "string", @@ -7099,28 +7099,28 @@ }, "healthCheckWaitDuration": { "type": "string", - "description": "The amount of time to wait after completing an upgrade domain before applying health policies. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time to wait after completing an upgrade domain before applying health policies. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." }, "healthCheckStableDuration": { "type": "string", - "description": "The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." }, "healthCheckRetryTimeout": { "type": "string", - "description": "The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." }, "upgradeTimeout": { "type": "string", - "description": "The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." }, "upgradeDomainTimeout": { "type": "string", - "description": "The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format \"hh:mm:ss.fff\"." } }, "required": [ @@ -7951,23 +7951,23 @@ }, "replicaRestartWaitDuration": { "type": "string", - "description": "The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format \"hh:mm:ss\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format \"hh:mm:ss\"." }, "quorumLossWaitDuration": { "type": "string", - "description": "The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format \"hh:mm:ss\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format \"hh:mm:ss\"." }, "standByReplicaKeepDuration": { "type": "string", - "description": "The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format \"hh:mm:ss\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format \"hh:mm:ss\"." }, "servicePlacementTimeLimit": { "type": "string", - "description": "The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format \"hh:mm:ss\".", - "x-ms-format": "duration-constant" + "format": "duration-constant", + "description": "The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format \"hh:mm:ss\"." } }, "allOf": [ From 7a680961e8d82f100ef8ec6f0b01082d18a5fc5f Mon Sep 17 00:00:00 2001 From: Ivy Liu Date: Thu, 15 May 2025 10:44:43 -0700 Subject: [PATCH 3/6] fix unknown to unknown[] --- .../ServiceFabricManagedClusters.Management/back-compat.tsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp index b1fa96a959d3..5bff359bb9d7 100644 --- a/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp +++ b/specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp @@ -333,7 +333,7 @@ using Microsoft.ServiceFabric; @@alternateType(VaultCertificate.certificateUrl, url, "csharp"); @@alternateType(ServiceEndpoint.locations, azureLocation[], "csharp"); @@alternateType(ManagedClusterProperties.clusterCertificateThumbprints, - unknown, + unknown[], "csharp" ); @@alternateType(ClientCertificate.thumbprint, unknown, "csharp"); From 2661bc8621c1757f8a5f7a7a5f1c7d68520ee6fd Mon Sep 17 00:00:00 2001 From: Ivy Liu Date: Fri, 16 May 2025 10:31:05 -0700 Subject: [PATCH 4/6] lintdiff suppressions for duration-constant --- .../resource-manager/readme.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/specification/servicefabricmanagedclusters/resource-manager/readme.md b/specification/servicefabricmanagedclusters/resource-manager/readme.md index 4eab1df1c193..2561d9eac592 100644 --- a/specification/servicefabricmanagedclusters/resource-manager/readme.md +++ b/specification/servicefabricmanagedclusters/resource-manager/readme.md @@ -413,6 +413,22 @@ suppressions: - $.definitions.ManagedClusterCodeVersionResult - $.definitions.LongRunningOperationResult - $.definitions.NodeTypeListSkuResult + + + - code: ValidFormats + reason: duration-constant is an expected format to the .NET SDK generator + where: + - $.definitions.ClusterMonitoringPolicy.properties.healthCheckWaitDuration + - $.definitions.ClusterMonitoringPolicy.properties.healthCheckStableDuration + - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckWaitDuration + - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckStableDuration + - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckRetryTimeout + - $.definitions.RollingUpgradeMonitoringPolicy.properties.upgradeTimeout + - $.definitions.RollingUpgradeMonitoringPolicy.properties.upgradeDomainTimeout + - $.definitions.StatefulServiceProperties.properties.replicaRestartWaitDuration + - $.definitions.StatefulServiceProperties.properties.quorumLossWaitDuration + - $.definitions.StatefulServiceProperties.properties.standByReplicaKeepDuration + - $.definitions.StatefulServiceProperties.properties.servicePlacementTimeLimit ``` --- From 395775cc9c8bb96cedc24cbbbcc2fea961c4e070 Mon Sep 17 00:00:00 2001 From: Ivy Liu Date: Fri, 16 May 2025 10:40:30 -0700 Subject: [PATCH 5/6] spacing fix? --- .../servicefabricmanagedclusters/resource-manager/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/servicefabricmanagedclusters/resource-manager/readme.md b/specification/servicefabricmanagedclusters/resource-manager/readme.md index 2561d9eac592..5c9dde15910b 100644 --- a/specification/servicefabricmanagedclusters/resource-manager/readme.md +++ b/specification/servicefabricmanagedclusters/resource-manager/readme.md @@ -414,7 +414,6 @@ suppressions: - $.definitions.LongRunningOperationResult - $.definitions.NodeTypeListSkuResult - - code: ValidFormats reason: duration-constant is an expected format to the .NET SDK generator where: From 360bc80b0826bdfd91ba96439baaa9046cd464c0 Mon Sep 17 00:00:00 2001 From: Ivy Liu Date: Fri, 16 May 2025 10:49:24 -0700 Subject: [PATCH 6/6] add .format to suppression locations --- .../resource-manager/readme.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/specification/servicefabricmanagedclusters/resource-manager/readme.md b/specification/servicefabricmanagedclusters/resource-manager/readme.md index 5c9dde15910b..3e758695c840 100644 --- a/specification/servicefabricmanagedclusters/resource-manager/readme.md +++ b/specification/servicefabricmanagedclusters/resource-manager/readme.md @@ -417,17 +417,17 @@ suppressions: - code: ValidFormats reason: duration-constant is an expected format to the .NET SDK generator where: - - $.definitions.ClusterMonitoringPolicy.properties.healthCheckWaitDuration - - $.definitions.ClusterMonitoringPolicy.properties.healthCheckStableDuration - - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckWaitDuration - - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckStableDuration - - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckRetryTimeout - - $.definitions.RollingUpgradeMonitoringPolicy.properties.upgradeTimeout - - $.definitions.RollingUpgradeMonitoringPolicy.properties.upgradeDomainTimeout - - $.definitions.StatefulServiceProperties.properties.replicaRestartWaitDuration - - $.definitions.StatefulServiceProperties.properties.quorumLossWaitDuration - - $.definitions.StatefulServiceProperties.properties.standByReplicaKeepDuration - - $.definitions.StatefulServiceProperties.properties.servicePlacementTimeLimit + - $.definitions.ClusterMonitoringPolicy.properties.healthCheckWaitDuration.format + - $.definitions.ClusterMonitoringPolicy.properties.healthCheckStableDuration.format + - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckWaitDuration.format + - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckStableDuration.format + - $.definitions.RollingUpgradeMonitoringPolicy.properties.healthCheckRetryTimeout.format + - $.definitions.RollingUpgradeMonitoringPolicy.properties.upgradeTimeout.format + - $.definitions.RollingUpgradeMonitoringPolicy.properties.upgradeDomainTimeout.format + - $.definitions.StatefulServiceProperties.properties.replicaRestartWaitDuration.format + - $.definitions.StatefulServiceProperties.properties.quorumLossWaitDuration.format + - $.definitions.StatefulServiceProperties.properties.standByReplicaKeepDuration.format + - $.definitions.StatefulServiceProperties.properties.servicePlacementTimeLimit.format ``` ---