Skip to content

Commit 69685d6

Browse files
authored
tsp - Add four brown field test cases (#1521)
* tsp - Add four brown field test cases * tsp - fixed a typo
1 parent b24da40 commit 69685d6

File tree

2,453 files changed

+597099
-0
lines changed

Some content is hidden

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

2,453 files changed

+597099
-0
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: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import "@typespec/rest";
2+
import "@typespec/http";
3+
import "@azure-tools/typespec-azure-core";
4+
import "@azure-tools/typespec-azure-resource-manager";
5+
import "./common.models.tsp";
6+
7+
using TypeSpec.Rest;
8+
using TypeSpec.Http;
9+
using Azure.ResourceManager;
10+
using Azure.ResourceManager.Foundations;
11+
using TypeSpec.OpenAPI;
12+
using TypeSpec.Versioning;
13+
14+
namespace Microsoft.Chaos;
15+
16+
/**
17+
* Model that represents a Capability resource.
18+
*/
19+
@parentResource(Target)
20+
model Capability is Azure.ResourceManager.ProxyResource<CapabilityProperties> {
21+
...ResourceNameParameter<
22+
Resource = Capability,
23+
KeyName = "capabilityName",
24+
SegmentName = "capabilities",
25+
NamePattern = "^[a-zA-Z0-9\\-\\.]+-\\d\\.\\d$"
26+
>;
27+
}
28+
29+
alias CapabilityParentResourceParameters = BaseParameters<Capability> &
30+
ParentResourceParameters;
31+
32+
/**
33+
* Model that represents the Capability properties model.
34+
*/
35+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "Unused property, avoids breaking changes in SDK."
36+
model CapabilityProperties {
37+
/**
38+
* String of the Publisher that this Capability extends.
39+
*/
40+
@visibility(Lifecycle.Read)
41+
publisher?: string;
42+
43+
/**
44+
* String of the Target Type that this Capability extends.
45+
*/
46+
@visibility(Lifecycle.Read)
47+
targetType?: string;
48+
49+
/**
50+
* Localized string of the description.
51+
*/
52+
@visibility(Lifecycle.Read)
53+
description?: string;
54+
55+
/**
56+
* URL to retrieve JSON schema of the Capability parameters.
57+
*/
58+
@visibility(Lifecycle.Read)
59+
@maxLength(2048)
60+
parametersSchema?: string;
61+
62+
/**
63+
* String of the URN for this Capability Type.
64+
*/
65+
@visibility(Lifecycle.Read)
66+
@maxLength(2048)
67+
urn?: string;
68+
69+
/**
70+
* Resource provisioning state. Not currently in use because resource is created synchronously.
71+
*/
72+
@removed(Microsoft.Chaos.Versions.v2025_01_01)
73+
@visibility(Lifecycle.Read)
74+
provisioningState?: ProvisioningState;
75+
}
76+
77+
/**
78+
* Model that represents a list of Capability resources and a link for pagination.
79+
*/
80+
model CapabilityListResult is Azure.Core.Page<Capability>;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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 "./capability.models.tsp";
6+
import "./target.tsp";
7+
8+
using TypeSpec.Rest;
9+
using Azure.ResourceManager;
10+
using Azure.ResourceManager.Foundations;
11+
using TypeSpec.Http;
12+
using TypeSpec.OpenAPI;
13+
14+
namespace Microsoft.Chaos;
15+
16+
@armResourceOperations
17+
interface Capabilities {
18+
/**
19+
* Get a Capability resource that extends a Target resource.
20+
*/
21+
get is ArmResourceRead<Capability, CapabilityParentResourceParameters>;
22+
23+
/**
24+
* Create or update a Capability resource that extends a Target resource.
25+
*/
26+
createOrUpdate is ArmResourceCreateOrReplaceSync<
27+
Capability,
28+
CapabilityParentResourceParameters
29+
>;
30+
31+
/**
32+
* Delete a Capability that extends a Target resource.
33+
*/
34+
delete is ArmResourceDeleteSync<
35+
Capability,
36+
CapabilityParentResourceParameters
37+
>;
38+
39+
/**
40+
* Get a list of Capability resources that extend a Target resource.
41+
*/
42+
list is ArmResourceListByParent<
43+
Capability,
44+
{
45+
...CapabilityParentResourceParameters;
46+
47+
/**
48+
* String that sets the continuation token.
49+
*/
50+
@query("continuationToken")
51+
continuationToken?: string;
52+
},
53+
Response = CapabilityListResult
54+
>;
55+
}
56+
57+
@@doc(Capability.name, "String that represents a Capability resource name.");
58+
@@doc(Capability.properties, "The properties of a capability resource.");
59+
@@doc(Capabilities.createOrUpdate::parameters.resource,
60+
"Capability resource to be created or updated."
61+
);
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import "@typespec/rest";
2+
import "@typespec/http";
3+
import "@azure-tools/typespec-azure-core";
4+
import "@azure-tools/typespec-azure-resource-manager";
5+
6+
using TypeSpec.Rest;
7+
using TypeSpec.Http;
8+
using Azure.ResourceManager;
9+
using Azure.ResourceManager.Foundations;
10+
using TypeSpec.OpenAPI;
11+
using TypeSpec.Versioning;
12+
13+
namespace Microsoft.Chaos;
14+
15+
/**
16+
* Model that represents a Capability Type resource.
17+
*/
18+
@parentResource(TargetType)
19+
model CapabilityType
20+
is Azure.ResourceManager.ProxyResource<CapabilityTypeProperties> {
21+
...ResourceNameParameter<
22+
Resource = CapabilityType,
23+
KeyName = "capabilityTypeName",
24+
SegmentName = "capabilityTypes",
25+
NamePattern = "^[a-zA-Z0-9\\-\\.]+-\\d\\.\\d$"
26+
>;
27+
}
28+
29+
/**
30+
* Model that represents the Capability Type properties model.
31+
*/
32+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "Read-only metadata resource."
33+
model CapabilityTypeProperties {
34+
/**
35+
* String of the Publisher that this Capability Type extends.
36+
*/
37+
@visibility(Lifecycle.Read)
38+
publisher?: string;
39+
40+
/**
41+
* String of the Target Type that this Capability Type extends.
42+
*/
43+
@visibility(Lifecycle.Read)
44+
targetType?: string;
45+
46+
/**
47+
* Localized string of the display name.
48+
*/
49+
@visibility(Lifecycle.Read)
50+
displayName?: string;
51+
52+
/**
53+
* Localized string of the description.
54+
*/
55+
@visibility(Lifecycle.Read)
56+
description?: string;
57+
58+
/**
59+
* URL to retrieve JSON schema of the Capability Type parameters.
60+
*/
61+
@visibility(Lifecycle.Read)
62+
@maxLength(2048)
63+
parametersSchema?: string;
64+
65+
/**
66+
* String of the URN for this Capability Type.
67+
*/
68+
@visibility(Lifecycle.Read)
69+
@maxLength(2048)
70+
urn?: string;
71+
72+
/**
73+
* String of the kind of this Capability Type.
74+
*/
75+
@visibility(Lifecycle.Read)
76+
kind?: string;
77+
78+
/**
79+
* Control plane actions necessary to execute capability type.
80+
*/
81+
@visibility(Lifecycle.Read)
82+
azureRbacActions?: string[];
83+
84+
/**
85+
* Data plane actions necessary to execute capability type.
86+
*/
87+
@visibility(Lifecycle.Read)
88+
azureRbacDataActions?: string[];
89+
90+
/**
91+
* Required Azure Role Definition Ids to execute capability type.
92+
*/
93+
@visibility(Lifecycle.Read)
94+
@added(Microsoft.Chaos.Versions.v2025_01_01)
95+
requiredAzureRoleDefinitionIds?: string[];
96+
97+
/**
98+
* Runtime properties of this Capability Type.
99+
*/
100+
@visibility(Lifecycle.Read)
101+
runtimeProperties?: CapabilityTypePropertiesRuntimeProperties;
102+
}
103+
104+
/**
105+
* Runtime properties of this Capability Type.
106+
*/
107+
model CapabilityTypePropertiesRuntimeProperties {
108+
/**
109+
* String of the kind of the resource's action type (continuous or discrete).
110+
*/
111+
@visibility(Lifecycle.Read)
112+
kind?: string;
113+
}
114+
115+
/**
116+
* Model that represents a list of Capability Type resources and a link for pagination.
117+
*/
118+
model CapabilityTypeListResult is Azure.Core.Page<CapabilityType>;
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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 "./capabilityType.models.tsp";
6+
7+
using TypeSpec.Rest;
8+
using Azure.ResourceManager;
9+
using TypeSpec.Http;
10+
using TypeSpec.OpenAPI;
11+
12+
namespace Microsoft.Chaos;
13+
14+
@armResourceOperations
15+
interface CapabilityTypes {
16+
/**
17+
* Get a Capability Type resource for given Target Type and location.
18+
*/
19+
get is ArmResourceRead<CapabilityType>;
20+
21+
/**
22+
* Get a list of Capability Type resources for given Target Type and location.
23+
*/
24+
list is ArmResourceListByParent<
25+
CapabilityType,
26+
Parameters = {
27+
/**
28+
* String that sets the continuation token.
29+
*/
30+
@query("continuationToken")
31+
continuationToken?: string;
32+
},
33+
Response = CapabilityTypeListResult
34+
>;
35+
}
36+
37+
@@doc(CapabilityType.name,
38+
"String that represents a Capability Type resource name."
39+
);
40+
@@doc(CapabilityType.properties,
41+
"The properties of the capability type resource."
42+
);

0 commit comments

Comments
 (0)