Skip to content

Commit 2490235

Browse files
iliu816kazrael2119v-jiaodi
authored
[servicefabric] Typespec migration (#39844)
Typespec conversion for servicefabric with lintdiff suppression and sdk validation suppression for .net --------- Co-authored-by: ZiWei Chen <98569699+kazrael2119@users.noreply.github.com> Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com> Co-authored-by: Jiao Di (MSFT) <v-jiaodi@microsoft.com>
1 parent 1fce3d8 commit 2490235

File tree

206 files changed

+14652
-6688
lines changed

Some content is hidden

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

206 files changed

+14652
-6688
lines changed

specification/servicefabric/resource-manager/Microsoft.ServiceFabric/ServiceFabric/ApplicationResource.tsp

Lines changed: 414 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import "@azure-tools/typespec-azure-core";
2+
import "@azure-tools/typespec-azure-resource-manager";
3+
import "@typespec/openapi";
4+
import "@typespec/rest";
5+
import "./models.tsp";
6+
import "./Cluster.tsp";
7+
8+
using TypeSpec.Rest;
9+
using Azure.ResourceManager;
10+
using TypeSpec.Http;
11+
using TypeSpec.OpenAPI;
12+
13+
namespace Microsoft.ServiceFabric;
14+
/**
15+
* The application type name resource
16+
*/
17+
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "servicefabric is brownfield service with legacy patterns for resources"
18+
@parentResource(Cluster)
19+
model ApplicationTypeResource
20+
is Azure.ResourceManager.Legacy.TrackedResourceWithOptionalLocation<ApplicationTypeResourceProperties> {
21+
...ResourceNameParameter<
22+
Resource = ApplicationTypeResource,
23+
KeyName = "applicationTypeName",
24+
SegmentName = "applicationTypes",
25+
NamePattern = ""
26+
>;
27+
...Azure.ResourceManager.Legacy.EntityTagProperty;
28+
}
29+
30+
@armResourceOperations
31+
interface ApplicationTypeResources {
32+
/**
33+
* Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric cluster resource.
34+
*/
35+
get is ArmResourceRead<ApplicationTypeResource>;
36+
37+
/**
38+
* Create or update a Service Fabric application type name resource with the specified name.
39+
*/
40+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "servicefabric is brownfield service existing api without 201 response code"
41+
createOrUpdate is ArmResourceCreateOrReplaceSync<
42+
ApplicationTypeResource,
43+
Response = ArmResourceUpdatedResponse<ApplicationTypeResource>
44+
>;
45+
46+
/**
47+
* Delete a Service Fabric application type name resource with the specified name.
48+
*/
49+
delete is ArmResourceDeleteWithoutOkAsync<ApplicationTypeResource>;
50+
51+
/**
52+
* Gets all application type name resources created or in the process of being created in the Service Fabric cluster resource.
53+
*/
54+
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
55+
@operationId("ApplicationTypes_List")
56+
list is ArmResourceListByParent<
57+
ApplicationTypeResource,
58+
Response = ArmResponse<ApplicationTypeResourceList>
59+
>;
60+
}
61+
62+
@@doc(ApplicationTypeResource.name,
63+
"The name of the application type name resource."
64+
);
65+
@@doc(ApplicationTypeResource.properties,
66+
"The application type name properties"
67+
);
68+
@@doc(ApplicationTypeResources.createOrUpdate::parameters.resource,
69+
"The application type name resource."
70+
);
71+
72+
/**
73+
* The application type name properties
74+
*/
75+
model ApplicationTypeResourceProperties {
76+
/**
77+
* The current deployment or provisioning state, which only appears in the response.
78+
*/
79+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "servicefabric is a brownfield service with existing provisioning state property as string and not enum"
80+
@visibility(Lifecycle.Read)
81+
provisioningState?: string;
82+
}
83+
84+
/**
85+
* The list of application type names.
86+
*/
87+
model ApplicationTypeResourceList is Azure.Core.Page<ApplicationTypeResource>;
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import "@azure-tools/typespec-azure-core";
2+
import "@azure-tools/typespec-azure-resource-manager";
3+
import "@typespec/openapi";
4+
import "@typespec/rest";
5+
import "./models.tsp";
6+
import "./ApplicationTypeResource.tsp";
7+
8+
using TypeSpec.Rest;
9+
using Azure.ResourceManager;
10+
using TypeSpec.Http;
11+
using TypeSpec.OpenAPI;
12+
13+
namespace Microsoft.ServiceFabric;
14+
/**
15+
* An application type version resource for the specified application type name resource.
16+
*/
17+
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "servicefabric is brownfield service with legacy patterns for resources"
18+
@parentResource(ApplicationTypeResource)
19+
model ApplicationTypeVersionResource
20+
is Azure.ResourceManager.Legacy.TrackedResourceWithOptionalLocation<ApplicationTypeVersionResourceProperties> {
21+
...ResourceNameParameter<
22+
Resource = ApplicationTypeVersionResource,
23+
KeyName = "version",
24+
SegmentName = "versions",
25+
NamePattern = ""
26+
>;
27+
...Azure.ResourceManager.Legacy.EntityTagProperty;
28+
}
29+
30+
@armResourceOperations
31+
interface ApplicationTypeVersionResources {
32+
/**
33+
* Get a Service Fabric application type version resource created or in the process of being created in the Service Fabric application type name resource.
34+
*/
35+
get is ArmResourceRead<ApplicationTypeVersionResource>;
36+
37+
/**
38+
* Create or update a Service Fabric application type version resource with the specified name.
39+
*/
40+
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "servicefabric is brownfield service with existing non-standard 202 response body"
41+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "servicefabric is brownfield service with existing non-standard response codes"
42+
createOrUpdate is ArmResourceCreateOrReplaceAsync<
43+
ApplicationTypeVersionResource,
44+
Response = ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = ApplicationTypeVersionResource>> & {
45+
@bodyRoot
46+
_: ApplicationTypeVersionResource;
47+
}
48+
>;
49+
50+
/**
51+
* Delete a Service Fabric application type version resource with the specified name.
52+
*/
53+
delete is ArmResourceDeleteWithoutOkAsync<ApplicationTypeVersionResource>;
54+
55+
/**
56+
* Gets all application type version resources created or in the process of being created in the Service Fabric application type name resource.
57+
*/
58+
list is ArmResourceListByParent<
59+
ApplicationTypeVersionResource,
60+
Response = ArmResponse<ApplicationTypeVersionResourceList>
61+
>;
62+
}
63+
64+
@@doc(ApplicationTypeVersionResource.name, "The application type version.");
65+
@@doc(ApplicationTypeVersionResource.properties,
66+
"The properties of the application type version resource."
67+
);
68+
@@doc(ApplicationTypeVersionResources.createOrUpdate::parameters.resource,
69+
"The application type version resource."
70+
);
71+
72+
/**
73+
* The properties of the application type version resource.
74+
*/
75+
model ApplicationTypeVersionResourceProperties {
76+
/**
77+
* The current deployment or provisioning state, which only appears in the response
78+
*/
79+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "servicefabric is a brownfield service with existing provisioning state property as string and not enum"
80+
@visibility(Lifecycle.Read)
81+
provisioningState?: string;
82+
83+
/**
84+
* The URL to the application package
85+
*/
86+
appPackageUrl: string;
87+
88+
/**
89+
* List of application type parameters that can be overridden when creating or updating the application.
90+
*/
91+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "servicefabric is a brownfield resource with existing APIs that use Record types"
92+
@visibility(Lifecycle.Read)
93+
defaultParameterList?: Record<string>;
94+
}
95+
96+
/**
97+
* The list of application type version resources for the specified application type name resource.
98+
*/
99+
model ApplicationTypeVersionResourceList
100+
is Azure.Core.Page<ApplicationTypeVersionResource>;

0 commit comments

Comments
 (0)