Skip to content

Commit be33ae9

Browse files
iliu816anushkasingh16
authored andcommitted
[servicefabricmanagedclusters] 2025-10-01-preview (Azure#37886)
2025-10-01-preview for servicefabricmanagedclusters
1 parent 35e1d59 commit be33ae9

File tree

236 files changed

+21224
-134
lines changed

Some content is hidden

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

236 files changed

+21224
-134
lines changed

specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/ServiceFabricManagedClusters/ApplicationResource.tsp

Lines changed: 156 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import "@azure-tools/typespec-azure-core";
22
import "@azure-tools/typespec-azure-resource-manager";
33
import "@typespec/openapi";
44
import "@typespec/rest";
5+
import "@typespec/versioning";
56
import "./models.tsp";
67

78
using TypeSpec.Rest;
89
using Azure.ResourceManager;
910
using TypeSpec.Http;
11+
using TypeSpec.Versioning;
1012

1113
namespace Microsoft.ServiceFabric;
1214
/**
@@ -58,12 +60,17 @@ interface Applications {
5860
>;
5961

6062
/**
61-
* Updates the tags of an application resource of a given managed cluster.
63+
* Updates an application resource of a given managed cluster.
6264
*/
65+
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "Day 0 Property"
6366
@patch(#{ implicitOptionality: false })
64-
update is ArmCustomPatchSync<
67+
update is ArmCustomPatchAsync<
6568
ApplicationResource,
66-
PatchModel = ApplicationUpdateParameters
69+
PatchModel = ApplicationUpdateParameters,
70+
Response = ArmResourceUpdatedResponse<ApplicationResource> | (ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = ApplicationResource>> & {
71+
@bodyRoot
72+
_: ApplicationResource;
73+
})
6774
>;
6875

6976
/**
@@ -122,6 +129,28 @@ interface Applications {
122129
never,
123130
LroHeaders = ArmCombinedLroHeaders
124131
>;
132+
133+
/**
134+
* Get the status of the deployed application health. It will query the cluster to find the health of the deployed application.
135+
*/
136+
@added(Versions.v2025_10_01_preview)
137+
fetchHealth is ArmResourceActionAsync<
138+
ApplicationResource,
139+
ApplicationFetchHealthRequest,
140+
never,
141+
LroHeaders = ArmCombinedLroHeaders
142+
>;
143+
144+
/**
145+
* Restart a code package instance of a service replica or instance. This is a potentially destabilizing operation that should be used with immense care.
146+
*/
147+
@added(Versions.v2025_10_01_preview)
148+
restartDeployedCodePackage is ArmResourceActionAsync<
149+
ApplicationResource,
150+
RestartDeployedCodePackageRequest,
151+
never,
152+
LroHeaders = ArmCombinedLroHeaders
153+
>;
125154
}
126155

127156
@@doc(ApplicationResource.name, "The name of the application resource.");
@@ -138,6 +167,12 @@ interface Applications {
138167
@@doc(Applications.updateUpgrade::parameters.body,
139168
"The parameters for updating an application upgrade."
140169
);
170+
@@doc(Applications.fetchHealth::parameters.body,
171+
"The parameters for fetching the health of a deployed application."
172+
);
173+
@@doc(Applications.restartDeployedCodePackage::parameters.body,
174+
"The parameters for restarting a deployed code package."
175+
);
141176

142177
/**
143178
* The application resource properties.
@@ -312,6 +347,18 @@ model ApplicationUserAssignedIdentity {
312347
principalId: string;
313348
}
314349

350+
/**
351+
* Properties for application update request.
352+
*/
353+
@added(Versions.v2025_10_01_preview)
354+
model ApplicationUpdateParametersProperties {
355+
/**
356+
* List of application parameters with overridden values from their default values specified in the application manifest.
357+
*/
358+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "Patch operation expects same format as create or update, used to pass string to string dictionary"
359+
parameters?: Record<string>;
360+
}
361+
315362
/**
316363
* Application update request.
317364
*/
@@ -322,6 +369,12 @@ model ApplicationUpdateParameters {
322369
*/
323370
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "Day 0 property, used to pass string to string dictionary"
324371
tags?: Record<string>;
372+
373+
/**
374+
* Application update parameters properties.
375+
*/
376+
@added(Versions.v2025_10_01_preview)
377+
properties?: ApplicationUpdateParametersProperties;
325378
}
326379

327380
/**
@@ -618,3 +671,103 @@ model RuntimeUpdateApplicationUpgradeParameters {
618671
*/
619672
updateDescription?: RuntimeRollingUpgradeUpdateMonitoringPolicy;
620673
}
674+
675+
/**
676+
* Enum for filtering health events.
677+
*/
678+
@added(Versions.v2025_10_01_preview)
679+
union HealthFilter {
680+
string,
681+
682+
/**
683+
* Default value. Matches any health state.
684+
*/
685+
Default: "Default",
686+
687+
/**
688+
* Filter that doesn't match any health state. Used to return no results on a given collection of health entities.
689+
*/
690+
None: "None",
691+
692+
/**
693+
* Filter for health state Ok.
694+
*/
695+
Ok: "Ok",
696+
697+
/**
698+
* Filter for health state Warning.
699+
*/
700+
Warning: "Warning",
701+
702+
/**
703+
* Filter for health state Error.
704+
*/
705+
Error: "Error",
706+
707+
/**
708+
* Filter that matches input with any health state.
709+
*/
710+
All: "All",
711+
}
712+
713+
/**
714+
* Parameters for fetching the health of an application.
715+
*/
716+
@added(Versions.v2025_10_01_preview)
717+
model ApplicationFetchHealthRequest {
718+
/**
719+
* Allows filtering of the health events returned in the response based on health state.
720+
*/
721+
eventsHealthStateFilter?: HealthFilter;
722+
723+
/**
724+
* Allows filtering of the deployed applications health state objects returned in the result of application health query based on their health state.
725+
*/
726+
deployedApplicationsHealthStateFilter?: HealthFilter;
727+
728+
/**
729+
* Allows filtering of the services health state objects returned in the result of services health query based on their health state.
730+
*/
731+
servicesHealthStateFilter?: HealthFilter;
732+
733+
/**
734+
* Indicates whether the health statistics should be returned as part of the query result. False by default. The statistics show the number of children entities in health state Ok, Warning, and Error.
735+
*/
736+
excludeHealthStatistics?: boolean = false;
737+
738+
/**
739+
* Request timeout for the health query in seconds. The default value is 60 seconds.
740+
*/
741+
timeout?: int64 = 60;
742+
}
743+
744+
/**
745+
* Parameters for restarting a deployed code package.
746+
*/
747+
@added(Versions.v2025_10_01_preview)
748+
model RestartDeployedCodePackageRequest {
749+
/**
750+
* The name of the node where the code package needs to be restarted. Use '*' to restart on all nodes where the code package is running.
751+
*/
752+
nodeName: string;
753+
754+
/**
755+
* The name of the service manifest as specified in the code package.
756+
*/
757+
serviceManifestName: string;
758+
759+
/**
760+
* The name of the code package as specified in the service manifest.
761+
*/
762+
codePackageName: string;
763+
764+
/**
765+
* The instance ID for currently running entry point. For a code package setup entry point (if specified) runs first and after it finishes main entry point is started. Each time entry point executable is run, its instance ID will change. If 0 is passed in as the code package instance ID, the API will restart the code package with whatever instance ID it is currently running. If an instance ID other than 0 is passed in, the API will restart the code package only if the current Instance ID matches the passed in instance ID. Note, passing in the exact instance ID (not 0) in the API is safer, because if ensures at most one restart of the code package.
766+
*/
767+
codePackageInstanceId: string;
768+
769+
/**
770+
* The activation id of a deployed service package. If ServicePackageActivationMode specified at the time of creating the service is 'SharedProcess' (or if it is not specified, in which case it defaults to 'SharedProcess'), then value of ServicePackageActivationId is always an empty string.
771+
*/
772+
servicePackageActivationId?: string;
773+
}

specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/ServiceFabricManagedClusters/ManagedCluster.tsp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ interface ManagedClusters {
6464
/**
6565
* Update the tags of of a Service Fabric managed cluster resource with the specified name.
6666
*/
67+
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "Day 0 Property"
6768
@patch(#{ implicitOptionality: false })
68-
update is ArmCustomPatchSync<
69+
update is ArmCustomPatchAsync<
6970
ManagedCluster,
70-
PatchModel = ManagedClusterUpdateParameters
71+
PatchModel = ManagedClusterUpdateParameters,
72+
Response = ArmResourceUpdatedResponse<ManagedCluster> | (ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = ManagedCluster>> & {
73+
@bodyRoot
74+
_: ManagedCluster;
75+
})
7176
>;
7277

7378
/**

specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/ServiceFabricManagedClusters/NodeType.tsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ interface NodeTypes {
5454
>;
5555

5656
/**
57-
* Update the configuration of a node type of a given managed cluster, only updating tags.
57+
* Update the configuration of a node type of a given managed cluster, only updating tags or capacity.
5858
*/
5959
@patch(#{ implicitOptionality: false })
6060
update is ArmCustomPatchAsync<

specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/ServiceFabricManagedClusters/ServiceResource.tsp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ interface Services {
7878
ServiceResource,
7979
Response = ArmResponse<ServiceResourceList>
8080
>;
81+
82+
@added(Versions.v2025_10_01_preview)
83+
restartReplica is ArmResourceActionAsync<
84+
ServiceResource,
85+
RestartReplicaRequest,
86+
never,
87+
LroHeaders = ArmCombinedLroHeaders
88+
>;
8189
}
8290

8391
@@doc(ServiceResource.name,
@@ -88,6 +96,9 @@ interface Services {
8896
@@doc(Services.update::parameters.properties,
8997
"The service resource updated tags."
9098
);
99+
@@doc(Services.restartReplica::parameters.body,
100+
"The parameters for restarting replicas."
101+
);
91102

92103
/**
93104
* The service resource properties.
@@ -806,3 +817,47 @@ union MoveCost {
806817
*/
807818
High: "High",
808819
}
820+
821+
/**
822+
* Request to restart a replica.
823+
*/
824+
@added(Versions.v2025_10_01_preview)
825+
model RestartReplicaRequest {
826+
/**
827+
* The ID of the partition.
828+
*/
829+
partitionId: string;
830+
831+
/**
832+
* The IDs of the replicas to be restarted.
833+
*/
834+
replicaIds: int64[];
835+
836+
/**
837+
* The kind of restart to perform.
838+
*/
839+
restartKind: RestartKind;
840+
841+
/**
842+
* If true, the restart operation will be forced. Use this option with care, as it may cause data loss.
843+
*/
844+
forceRestart?: boolean;
845+
846+
/**
847+
* The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds.
848+
*/
849+
timeout?: int64;
850+
}
851+
852+
/**
853+
* The kind of restart to perform.
854+
*/
855+
@added(Versions.v2025_10_01_preview)
856+
union RestartKind {
857+
string,
858+
859+
/**
860+
* Restart all listed replicas at the same time.
861+
*/
862+
Simultaneous: "Simultaneous",
863+
}

specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/ServiceFabricManagedClusters/client.tsp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,17 @@ using Microsoft.ServiceFabric;
4545
@@clientName(Applications.update::parameters.properties, "parameters");
4646
@@clientName(Applications.resumeUpgrade::parameters.body, "parameters");
4747
@@clientName(Applications.updateUpgrade::parameters.body, "parameters");
48+
@@clientName(Applications.fetchHealth::parameters.body, "parameters");
49+
@@clientName(Applications.restartDeployedCodePackage::parameters.body,
50+
"parameters"
51+
);
4852
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "@Azure.ClientGenerator.Core.Legacy.flattenProperty decorator for backwards compatibility with existing spec"
4953
@@Azure.ClientGenerator.Core.Legacy.flattenProperty(ApplicationResource.properties
5054
);
5155

5256
@@clientName(Services.createOrUpdate::parameters.resource, "parameters");
5357
@@clientName(Services.update::parameters.properties, "parameters");
58+
@@clientName(Services.restartReplica::parameters.body, "parameters");
5459

5560
@@clientName(ManagedClusters.createOrUpdate::parameters.resource, "parameters");
5661
@@clientName(ManagedClusters.update::parameters.properties, "parameters");

specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/ServiceFabricManagedClusters/examples/2024-11-01-preview/ApplicationDeleteOperation_example.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"responses": {
1010
"202": {
1111
"headers": {
12-
"Location": "http://10.91.140.224/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/operationResults/76053752-a423-4a80-b283-1dad1ba5f314?api-version=2024-11-01-preview",
13-
"Retry-After": "10"
12+
"Azure-AsyncOperation": "http://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/managedClusterOperationStatus/1ca6e48d-70ca-4e43-b652-3b0522f64d67?api-version=2024-11-01-preview",
13+
"Location": "http://10.91.140.224/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ServiceFabric/locations/eastus/operationResults/9c2ce367-47ea-43de-b69e-c5a423da4557?api-version=2024-11-01-preview"
1414
}
1515
},
1616
"204": {}

0 commit comments

Comments
 (0)