Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typespec Migration] servicefabricmanagedclusters #32790

Open
wants to merge 75 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
128878a
initial conversion
iliu816 Feb 19, 2025
75c9617
sorted swaggers
iliu816 Feb 19, 2025
5916f3c
initial generation
iliu816 Feb 19, 2025
1e5e5ce
ManagedCluster supression
iliu816 Feb 20, 2025
8e10d24
managedvmsize, managedclustercodeversionresult, applicationtype
iliu816 Feb 20, 2025
41cd00e
applicationTypeVersions supressions
iliu816 Feb 20, 2025
16f5601
application supression
iliu816 Feb 20, 2025
ccaa7ad
main.tsp: bumping commontype version and adding service operations in…
iliu816 Feb 20, 2025
b47aa6f
nodetype supressions
iliu816 Feb 20, 2025
10282a2
readd @parameterVisibility to ApplicationTypeResource to override pa…
iliu816 Feb 20, 2025
ce8a1f9
serviceresource supression
iliu816 Feb 20, 2025
be8a49e
operationresult, operationstatus supression
iliu816 Feb 21, 2025
52d39b8
first pass cleaning up naming, model links, supressions in models.tsp
iliu816 Feb 21, 2025
d17a1cf
linking client.tsp, changing names of request payload from "propertie…
iliu816 Feb 21, 2025
a3c50c7
removing non-common-type resource models, confirming properties of re…
iliu816 Feb 24, 2025
6eed63f
cleanup remaining linter warnings
iliu816 Feb 24, 2025
4f60214
generated updates to examples
iliu816 Feb 24, 2025
327b498
XMS_EXAMPLE_NOTFOUND_ERROR
iliu816 Feb 25, 2025
b28bfb4
add emitter for sdks
iliu816 Feb 25, 2025
8a5c900
readd example files for old swagger to reduce noise from errors
iliu816 Feb 25, 2025
a612f46
added service-dir default, edits to java and go emitter options
iliu816 Feb 25, 2025
97b0200
RESPONSE_NOT_IN_SPEC, RESPONSE_NOT_IN_EXAMPLE,: removed references to…
iliu816 Feb 25, 2025
dfafe49
remove previous swagger version, readme linter warnings
iliu816 Feb 25, 2025
bdde067
move from common-type v5 to v3 due to armid validation failure
iliu816 Feb 25, 2025
14def47
change eTag to etag
iliu816 Feb 25, 2025
307452c
add url to list operation examples
iliu816 Feb 25, 2025
1d35178
removing requirement on location property for cluster, nodetype, and …
iliu816 Feb 26, 2025
b09971e
better aligning ManagedClusterCodeVersionResult definition with exist…
iliu816 Feb 26, 2025
6bf6dd0
specifying x-ms-parameter-location for operationId parameter
iliu816 Feb 26, 2025
eb4629a
better aligning ManagedVMSize with existing swagger
iliu816 Feb 26, 2025
9b30582
spellcheck omit tsp files, revert managedcluster to trackedresource
iliu816 Feb 26, 2025
8bd4664
prettier check on example files
iliu816 Feb 26, 2025
3062af9
spellcheck omission for tsp files
iliu816 Feb 26, 2025
04c4da5
remove duplicate tags property from managedcluster
iliu816 Feb 26, 2025
dbdaf1b
fix filepath for spellcheck omission for tsp files
iliu816 Feb 26, 2025
a92c54e
lintdiff for readme.md
iliu816 Feb 26, 2025
6ba6162
Lintdiff: SecurityDefinitionsStructure. resource managers not expecte…
iliu816 Feb 27, 2025
18edd7e
LintDiff: DescriptionMustNotBeNodeName
iliu816 Feb 27, 2025
ee9b51a
parent-child relation between ManagedCluster and application models
iliu816 Feb 27, 2025
17fa48c
DescriptionMustNotBeNodeName: SingletonPartitionScheme
iliu816 Feb 27, 2025
09f1970
clean up <*> pattern from docstrings, breaking client generation from…
iliu816 Feb 27, 2025
1b1e4cd
attempt formatting HealthCheckWaitDuration and HealthCheckWaitDuratio…
iliu816 Feb 27, 2025
be93063
remove typespec emitters, brownfield service
iliu816 Feb 27, 2025
062191a
remove duration directives from readme.md
iliu816 Feb 27, 2025
8df62c9
mark durations
iliu816 Feb 27, 2025
274c301
add java and go to sdk in readme.md
iliu816 Feb 28, 2025
f504423
linux is not supported managedcodeversion environment in existing sfm…
iliu816 Feb 28, 2025
11099af
emit final-state-schema for startFaultSimulation and stopFaultSimulat…
iliu816 Feb 28, 2025
4ccfffb
breaking change warnings from go sdk generation
iliu816 Feb 28, 2025
a58f620
breaking change warnings from java sdk generation:
iliu816 Feb 28, 2025
704cb8b
FaultSimulation*Parameters -> FaultSimluation*Content for dotnet SDK …
iliu816 Feb 28, 2025
f9615fa
breaking change warnings from python sdk generation:
iliu816 Mar 1, 2025
22e85ac
breaking change warnings from dotnet sdk generation:
iliu816 Mar 3, 2025
ebdc9df
breaking changes warnings from dotnet sdk generation:
iliu816 Mar 3, 2025
5abdffd
readd non-dotnet emitters to validate sdk generation
iliu816 Mar 4, 2025
aa2f482
Merge branch 'main' into user/iliu/2024-11-01-preview-migrate
mikeharder Mar 4, 2025
bb4890a
breaking changes in go sdk from tspconfig:
iliu816 Mar 5, 2025
ebb839c
tsp formatting fix
iliu816 Mar 5, 2025
cbcd038
breaking changes in go sdk from tspconfig:
iliu816 Mar 5, 2025
a090b99
revert
iliu816 Mar 5, 2025
dbb3ae9
breaking changes in go sdk from tspconfig:
iliu816 Mar 5, 2025
c7fe99c
add back-compat to main.tsp
iliu816 Mar 5, 2025
4ea02dc
typespec validation: emitter configs, formatting
iliu816 Mar 5, 2025
c8f27c3
Merge branch 'main' into user/iliu/2024-11-01-preview-migrate
iliu816 Mar 5, 2025
d2ef26f
typespec version upgrade: fixing warnings
iliu816 Mar 5, 2025
b410d6a
litndiff:
iliu816 Mar 6, 2025
8351ea3
breaking changes in go sdk:
iliu816 Mar 6, 2025
9c92028
double-checking required properties for models, readd capacity as req…
iliu816 Mar 6, 2025
596c316
spellcheck: provisiong -> provisioning
iliu816 Mar 6, 2025
92f1f46
lintdiff: RequiredPropertiesMissingInResourceModel, PatchBodyParamet…
iliu816 Mar 6, 2025
1dbcf71
* remove unused legacy.tsp added by converter tool
iliu816 Mar 7, 2025
4aea569
sorted model types
iliu816 Mar 7, 2025
40d60a1
align PublicIPAddressConfiguration with existing spec
iliu816 Mar 7, 2025
3ecd7b8
dotnet: add backcompat model name for PublicIPAddressConfiguration
iliu816 Mar 7, 2025
6adc0d3
tsp-client compare: minValues, defaults
iliu816 Mar 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;

namespace Microsoft.ServiceFabric;
/**
* The application resource.
*/
@parentResource(ManagedCluster)
model ApplicationResource
is Azure.ResourceManager.ProxyResource<ApplicationResourceProperties> {
...ResourceNameParameter<
Resource = ApplicationResource,
KeyName = "applicationName",
SegmentName = "applications",
NamePattern = ""
>;
...Azure.ResourceManager.Foundations.ArmTagsProperty;

/**
* Describes the managed identities for an Azure resource.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "Backwards compatibility with existing spec"
identity?: ManagedIdentity;

/**
* The geo-location where the resource lives
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "Day 0 Property"
@visibility(Lifecycle.Create, Lifecycle.Read)
location?: string;
}

@armResourceOperations
interface Applications {
/**
* Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource.
*/
get is ArmResourceRead<ApplicationResource>;

/**
* Create or update a Service Fabric managed application resource with the specified name.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "Day 0 Property"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "Day 0 Property"
createOrUpdate is ArmResourceCreateOrUpdateAsync<
ApplicationResource,
Response = ArmResourceUpdatedResponse<ApplicationResource> | (ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = ApplicationResource>> & {
@bodyRoot
_: ApplicationResource;
})
>;

/**
* Updates the tags of an application resource of a given managed cluster.
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchSync<
ApplicationResource,
PatchModel = ApplicationUpdateParameters
>;

/**
* Delete a Service Fabric managed application resource with the specified name.
*/
delete is ArmResourceDeleteWithoutOkAsync<
ApplicationResource,
Response = ArmDeleteAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders> | ArmDeletedNoContentResponse
>;

/**
* Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource.
*/
list is ArmResourceListByParent<
ApplicationResource,
Response = ArmResponse<ApplicationResourceList>
>;

/**
* Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade.
*/
@action("fetchUpgradeStatus")
readUpgrade is ArmResourceActionAsync<
ApplicationResource,
void,
never,
LroHeaders = ArmCombinedLroHeaders
>;

/**
* Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused.
*/
resumeUpgrade is ArmResourceActionAsync<
ApplicationResource,
RuntimeResumeApplicationUpgradeParameters,
never,
LroHeaders = ArmCombinedLroHeaders
>;

/**
* Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version.
*/
startRollback is ArmResourceActionAsync<
ApplicationResource,
void,
never,
LroHeaders = ArmCombinedLroHeaders
>;
}

@@doc(ApplicationResource.name, "The name of the application resource.");
@@doc(ApplicationResource.properties, "The application resource properties.");
@@doc(Applications.createOrUpdate::parameters.resource,
"The application resource."
);
@@doc(Applications.update::parameters.properties,
"The application resource updated tags."
);
@@doc(Applications.resumeUpgrade::parameters.body,
"The parameters for resuming an application upgrade."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.ServiceFabric;
/**
* The application type name resource
*/
@parentResource(ManagedCluster)
model ApplicationTypeResource
is Azure.ResourceManager.ProxyResource<ApplicationTypeResourceProperties> {
...ResourceNameParameter<
Resource = ApplicationTypeResource,
KeyName = "applicationTypeName",
SegmentName = "applicationTypes",
NamePattern = ""
>;
...Azure.ResourceManager.Foundations.ArmTagsProperty;

/**
* The geo-location where the resource lives
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "Day 0 Property"
@visibility(Lifecycle.Create, Lifecycle.Read)
location?: string;
}

@armResourceOperations
interface ApplicationTypes {
/**
* Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource.
*/
get is ArmResourceRead<ApplicationTypeResource>;

/**
* Create or update a Service Fabric managed application type name resource with the specified name.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "Day 0 Property"
createOrUpdate is ArmResourceCreateOrReplaceSync<
ApplicationTypeResource,
Response = ArmResourceUpdatedResponse<ApplicationTypeResource>
>;

/**
* Updates the tags of an application type resource of a given managed cluster.
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchSync<
ApplicationTypeResource,
PatchModel = ApplicationTypeUpdateParameters
>;

/**
* Delete a Service Fabric managed application type name resource with the specified name.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "Day 0 Property"
delete is ArmResourceDeleteWithoutOkAsync<
ApplicationTypeResource,
Response = ArmDeleteAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders> | ArmDeletedNoContentResponse
>;

/**
* Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource.
*/
list is ArmResourceListByParent<
ApplicationTypeResource,
Response = ArmResponse<ApplicationTypeResourceList>
>;
}

@@doc(ApplicationTypeResource.name,
"The name of the application type name resource."
);
@@doc(ApplicationTypeResource.properties,
"The application type name properties"
);
@@doc(ApplicationTypes.createOrUpdate::parameters.resource,
"The application type name resource."
);
@@doc(ApplicationTypes.update::parameters.properties,
"The application type resource updated tags."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./ApplicationTypeResource.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;

namespace Microsoft.ServiceFabric;
/**
* An application type version resource for the specified application type name resource.
*/
@parentResource(ApplicationTypeResource)
model ApplicationTypeVersionResource
is Azure.ResourceManager.ProxyResource<ApplicationTypeVersionResourceProperties> {
...ResourceNameParameter<
Resource = ApplicationTypeVersionResource,
KeyName = "version",
SegmentName = "versions",
NamePattern = ""
>;
...Azure.ResourceManager.Foundations.ArmTagsProperty;

/**
* The geo-location where the resource lives
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "Day 0 Property"
@visibility(Lifecycle.Create, Lifecycle.Read)
location?: string;
}

@armResourceOperations
interface ApplicationTypeVersions {
/**
* Get a Service Fabric managed application type version resource created or in the process of being created in the Service Fabric managed application type name resource.
*/
get is ArmResourceRead<ApplicationTypeVersionResource>;

/**
* Create or update a Service Fabric managed application type version resource with the specified name.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "Day 0 Property"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "Day 0 Property"
createOrUpdate is ArmResourceCreateOrUpdateAsync<
ApplicationTypeVersionResource,
Response = ArmResourceUpdatedResponse<ApplicationTypeVersionResource> | (ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = ApplicationTypeVersionResource>> & {
@bodyRoot
_: ApplicationTypeVersionResource;
})
>;

/**
* Updates the tags of an application type version resource of a given managed cluster.
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchSync<
ApplicationTypeVersionResource,
PatchModel = ApplicationTypeVersionUpdateParameters
>;

/**
* Delete a Service Fabric managed application type version resource with the specified name.
*/
delete is ArmResourceDeleteWithoutOkAsync<
ApplicationTypeVersionResource,
Response = ArmDeleteAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders> | ArmDeletedNoContentResponse
>;

/**
* Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource.
*/
listByApplicationTypes is ArmResourceListByParent<
ApplicationTypeVersionResource,
Response = ArmResponse<ApplicationTypeVersionResourceList>
>;
}

@@doc(ApplicationTypeVersionResource.name, "The application type version.");
@@doc(ApplicationTypeVersionResource.properties,
"The properties of the application type version resource."
);
@@doc(ApplicationTypeVersions.createOrUpdate::parameters.resource,
"The application type version resource."
);
@@doc(ApplicationTypeVersions.update::parameters.properties,
"The application type version resource updated tags."
);
Loading
Loading