Skip to content

Commit 1e84d78

Browse files
mgmt, chaos, remove operationId and keep back-compatible (Azure#35901)
1 parent a29efdd commit 1e84d78

File tree

7 files changed

+38
-63
lines changed

7 files changed

+38
-63
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import "@azure-tools/typespec-client-generator-core";
2+
import "./privateEndpointConnection.tsp";
3+
import "./experimentExecution.tsp";
4+
import "./privateAccess.tsp";
5+
6+
using Azure.ClientGenerator.Core;
7+
using Microsoft.Chaos;
8+
9+
// PrivateEndpointConnections interface operations with PrivateAccesses_ prefix
10+
@@clientLocation(PrivateEndpointConnections.getAPrivateEndpointConnection,
11+
PrivateAccesses,
12+
"!csharp"
13+
);
14+
@@clientLocation(PrivateEndpointConnections.deleteAPrivateEndpointConnection,
15+
PrivateAccesses,
16+
"!csharp"
17+
);
18+
@@clientLocation(PrivateEndpointConnections.listPrivateEndpointConnections,
19+
PrivateAccesses,
20+
"!csharp"
21+
);
22+
23+
// ExperimentExecutions interface operations with Experiments_ prefix
24+
@@clientLocation(ExperimentExecutions.getExecution, Experiments, "!csharp");
25+
@@clientLocation(ExperimentExecutions.listAllExecutions,
26+
Experiments,
27+
"!csharp"
28+
);
29+
@@clientLocation(ExperimentExecutions.getExecutionDetails,
30+
Experiments,
31+
"!csharp"
32+
);
33+
34+
@@clientName(Operations.list, "ListAll", "autorest");
35+
@@clientName(ExperimentExecutions.getExecutionDetails, "ExecutionDetails");
36+
@@clientName(PrivateAccesses.privateLinkResources, "GetPrivateLinkResources");
Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,9 @@
11
import "./main.tsp";
22
import "@azure-tools/typespec-client-generator-core";
33

4-
using TypeSpec.Versioning;
54
using Azure.ClientGenerator.Core;
6-
using Azure.ResourceManager;
75
using Microsoft.Chaos;
86

9-
@client(
10-
{
11-
name: "ChaosManagementClient",
12-
service: Microsoft.Chaos,
13-
},
14-
"java,go,javascript"
15-
)
16-
@useDependency(Microsoft.Chaos.Versions.v2025_01_01)
17-
namespace Customization;
18-
19-
@operationGroup("java,go,javascript")
20-
@armResourceOperations
21-
interface Experiments {
22-
get is Microsoft.Chaos.Experiments.get;
23-
createOrUpdate is Microsoft.Chaos.Experiments.createOrUpdate;
24-
update is Microsoft.Chaos.Experiments.update;
25-
delete is Microsoft.Chaos.Experiments.delete;
26-
list is Microsoft.Chaos.Experiments.list;
27-
listAll is Microsoft.Chaos.Experiments.listAll;
28-
cancel is Microsoft.Chaos.Experiments.cancel;
29-
start is Microsoft.Chaos.Experiments.start;
30-
31-
getExecution is Microsoft.Chaos.ExperimentExecutions.getExecution;
32-
listAllExecutions is Microsoft.Chaos.ExperimentExecutions.listAllExecutions;
33-
executionDetails is Microsoft.Chaos.ExperimentExecutions.getExecutionDetails;
34-
}
35-
36-
@operationGroup("java,go,javascript")
37-
@armResourceOperations
38-
interface Capabilities extends Microsoft.Chaos.Capabilities {}
39-
40-
@operationGroup("java,go,javascript")
41-
@armResourceOperations
42-
interface CapabilityTypes extends Microsoft.Chaos.CapabilityTypes {}
43-
44-
@operationGroup("java,go,javascript")
45-
@armResourceOperations
46-
interface Operations extends Microsoft.Chaos.Operations {}
47-
48-
@operationGroup("java,go,javascript")
49-
@armResourceOperations
50-
interface OperationStatuses extends Microsoft.Chaos.OperationStatuses {}
51-
52-
@operationGroup("java,go,javascript")
53-
@armResourceOperations
54-
interface Targets extends Microsoft.Chaos.Targets {}
55-
56-
@operationGroup("java,go,javascript")
57-
@armResourceOperations
58-
interface TargetTypes extends Microsoft.Chaos.TargetTypes {}
59-
607
// csharp
618
@@clientName(ExperimentExecution, "ChaosExperimentExecution", "csharp");
629
@@clientName(Experiment, "ChaosExperiment", "csharp");
@@ -116,4 +63,4 @@ interface TargetTypes extends Microsoft.Chaos.TargetTypes {}
11663
#suppress "deprecated" "property flatten for SDK backward compatibility"
11764
@@flattenProperty(ExperimentExecutionDetails.properties);
11865

119-
@@clientName(Microsoft.Chaos.Operations.list, "listAll", "javascript");
66+
@@clientName(Microsoft.Chaos.Operations.list, "listAll", "javascript,python");

specification/chaos/Chaos.Management/common.models.tsp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ namespace Microsoft.Chaos;
1313

1414
interface Operations extends Azure.ResourceManager.Operations {}
1515
#suppress "@azure-tools/typespec-azure-core/no-openapi" "Required to avoid breaking SDK change"
16-
@@operationId(Operations.list, "Operations_ListAll");
17-
1816
alias ParentResourceParameters = {
1917
/**
2018
* The parent resource provider namespace.

specification/chaos/Chaos.Management/experimentExecution.tsp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@ interface ExperimentExecutions {
1818
* Get an execution of an Experiment resource.
1919
*/
2020
#suppress "@azure-tools/typespec-azure-core/no-openapi" "Required to not break existing SDKs"
21-
@operationId("Experiments_GetExecution")
2221
getExecution is ArmResourceRead<ExperimentExecution>;
2322

2423
/**
2524
* Get a list of executions of an Experiment resource.
2625
*/
2726
#suppress "@azure-tools/typespec-azure-core/no-openapi" "Required to not break existing SDKs"
28-
@operationId("Experiments_ListAllExecutions")
2927
listAllExecutions is ArmResourceListByParent<
3028
ExperimentExecution,
3129
Response = ExperimentExecutionListResult
@@ -35,7 +33,6 @@ interface ExperimentExecutions {
3533
* Execution details of an experiment resource.
3634
*/
3735
#suppress "@azure-tools/typespec-azure-core/no-openapi" "Required to not break existing SDKs"
38-
@operationId("Experiments_ExecutionDetails")
3936
getExecutionDetails is ArmResourceActionSync<
4037
ExperimentExecution,
4138
void,

specification/chaos/Chaos.Management/main.tsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import "./privateEndpointConnection.tsp";
1717
import "./target.tsp";
1818
import "./targetType.tsp";
1919
import "./operationStatus.tsp";
20+
import "./back-compatible.tsp";
2021

2122
using TypeSpec.Rest;
2223
using TypeSpec.Http;

specification/chaos/Chaos.Management/privateAccess.tsp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ interface PrivateAccesses {
7070
* Gets the private link resources possible under private access resource
7171
*/
7272
#suppress "@azure-tools/typespec-azure-core/no-openapi" "Required to not break existing SDKs"
73-
@operationId("PrivateAccesses_GetPrivateLinkResources")
7473
@get
7574
privateLinkResources is ArmResourceActionSync<
7675
PrivateAccess,

specification/chaos/Chaos.Management/privateEndpointConnection.tsp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,19 @@ interface PrivateEndpointConnections {
1919
*/
2020
#suppress "@azure-tools/typespec-azure-core/casing-style" "Linting error - is actually camel-case."
2121
#suppress "@azure-tools/typespec-azure-core/no-openapi" "Required to not break existing SDKs"
22-
@operationId("PrivateAccesses_GetAPrivateEndpointConnection")
2322
getAPrivateEndpointConnection is ArmResourceRead<PrivateEndpointConnection>;
2423

2524
/**
2625
* Deletes a private endpoint connection under a private access resource.
2726
*/
2827
#suppress "@azure-tools/typespec-azure-core/casing-style" "Linting error - is actually camel-case."
2928
#suppress "@azure-tools/typespec-azure-core/no-openapi" "Required to not break existing SDKs"
30-
@operationId("PrivateAccesses_DeleteAPrivateEndpointConnection")
3129
deleteAPrivateEndpointConnection is ArmResourceDeleteWithoutOkAsync<PrivateEndpointConnection>;
3230

3331
/**
3432
* List information about private endpoint connections under a private access resource
3533
*/
3634
#suppress "@azure-tools/typespec-azure-core/no-openapi" "Required to not break existing SDKs"
37-
@operationId("PrivateAccesses_ListPrivateEndpointConnections")
3835
listPrivateEndpointConnections is ArmResourceListByParent<
3936
PrivateEndpointConnection,
4037
Response = PrivateEndpointConnectionListResult

0 commit comments

Comments
 (0)