Skip to content

Commit 42abee2

Browse files
welovejXiaofeiCaov-jiaodimelina5656Pan Shao
authored
[TSP Migration]--elastic (#34324)
* newly converted * compiled * update * formatted * prettier * suppress some warnings * Update models.tsp * update * examples update * optional body fix and other diff fix * justification * remove previous api version example files * recovery of previous api version files * Fix addtional model Azure.ResourceManager.ArmResponse<ElasticMonitorResource> * Update java config * update * update * prettier * Remove Bodyboot Decorator * resolve breaking * update * fix go breaking * fix as description System.ArgumentException: 'An item with the same key has already been added. Key: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' * update * update * fix OkResponse issue for SDK generation * update * Java SDK migration: Fix createAndAssociateIpFilters operation name for backward compatibility * Update tspconfig.yaml * update client settings * Update main.tsp * Update models.tsp * update * Update tspconfig.yaml --------- Co-authored-by: Xiaofei Cao <[email protected]> Co-authored-by: Jiao Di (MSFT) <[email protected]> Co-authored-by: melina5656 <[email protected]> Co-authored-by: Pan Shao <[email protected]> Co-authored-by: tadelesh <[email protected]> Co-authored-by: Arthur Ma <[email protected]> Co-authored-by: Weidong Xu <[email protected]> Co-authored-by: Arthur Ma <[email protected]> Co-authored-by: Pan Shao <[email protected]>
1 parent 77ccf2d commit 42abee2

File tree

97 files changed

+7442
-2550
lines changed

Some content is hidden

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

97 files changed

+7442
-2550
lines changed

specification/elastic/Elastic.Management/ElasticMonitorResource.tsp

Lines changed: 467 additions & 0 deletions
Large diffs are not rendered by default.
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 "./ElasticMonitorResource.tsp";
7+
8+
using TypeSpec.Rest;
9+
using Azure.ResourceManager;
10+
using TypeSpec.Http;
11+
using TypeSpec.OpenAPI;
12+
13+
namespace Microsoft.Elastic;
14+
/**
15+
* The request to update subscriptions needed to be monitored by the Elastic monitor resource.
16+
*/
17+
@parentResource(ElasticMonitorResource)
18+
model MonitoredSubscriptionProperties
19+
is Azure.ResourceManager.ProxyResource<SubscriptionList> {
20+
...ResourceNameParameter<
21+
Resource = MonitoredSubscriptionProperties,
22+
KeyName = "configurationName",
23+
SegmentName = "monitoredSubscriptions",
24+
NamePattern = "^.*$"
25+
>;
26+
}
27+
28+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
29+
interface MonitoredCreateOrUpdateResourceOps
30+
extends Azure.ResourceManager.Legacy.LegacyOperations<
31+
{
32+
...ApiVersionParameter,
33+
...SubscriptionIdParameter,
34+
...ResourceGroupParameter,
35+
...Azure.ResourceManager.Legacy.Provider,
36+
},
37+
{
38+
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
39+
@path
40+
@segment("monitors")
41+
@pattern("^.*$")
42+
monitorName: string,
43+
44+
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
45+
@path
46+
@segment("monitoredSubscriptions")
47+
@pattern("^.*$")
48+
configurationName: string,
49+
}
50+
> {}
51+
52+
@armResourceOperations
53+
interface MonitoredSubscriptions {
54+
/**
55+
* Get detailed information about all subscriptions currently being monitored by the Elastic monitor resource.
56+
*/
57+
get is ArmResourceRead<MonitoredSubscriptionProperties>;
58+
59+
/**
60+
* Add subscriptions to be monitored by the Elastic monitor resource, enabling observability and monitoring.
61+
*/
62+
createorUpdate is MonitoredCreateOrUpdateResourceOps.CreateOrUpdateAsync<
63+
MonitoredSubscriptionProperties,
64+
LroHeaders = ArmLroLocationHeader<FinalResult = MonitoredSubscriptionProperties> &
65+
Azure.Core.Foundations.RetryAfterHeader,
66+
OptionalRequestBody = true
67+
>;
68+
69+
/**
70+
* Update subscriptions to be monitored by the Elastic monitor resource, ensuring optimal observability and performance.
71+
*/
72+
@patch(#{ implicitOptionality: false })
73+
update is MonitoredCreateOrUpdateResourceOps.CustomPatchAsync<
74+
MonitoredSubscriptionProperties,
75+
PatchModel = MonitoredSubscriptionProperties,
76+
OptionalRequestBody = true
77+
>;
78+
79+
/**
80+
* Delete subscriptions being monitored by the Elastic monitor resource, removing their observability and monitoring capabilities.
81+
*/
82+
delete is ArmResourceDeleteWithoutOkAsync<MonitoredSubscriptionProperties>;
83+
84+
/**
85+
* List all subscriptions currently being monitored by the Elastic monitor resource, helping you manage observability.
86+
*/
87+
list is ArmResourceListByParent<
88+
MonitoredSubscriptionProperties,
89+
Response = ArmResponse<MonitoredSubscriptionPropertiesList>
90+
>;
91+
}
92+
93+
@@doc(MonitoredSubscriptionProperties.name,
94+
"The configuration name. Only 'default' value is supported."
95+
);
96+
@@doc(MonitoredSubscriptionProperties.properties,
97+
"The request to update subscriptions needed to be monitored by the Elastic monitor resource."
98+
);
99+
@@doc(MonitoredSubscriptions.createorUpdate::parameters.resource, "");
100+
@@doc(MonitoredSubscriptions.update::parameters.properties, "");
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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 "./ElasticMonitorResource.tsp";
7+
8+
using TypeSpec.Rest;
9+
using Azure.ResourceManager;
10+
using TypeSpec.Http;
11+
using TypeSpec.OpenAPI;
12+
13+
namespace Microsoft.Elastic;
14+
/**
15+
* Capture logs and metrics of Azure resources based on ARM tags.
16+
*/
17+
@parentResource(ElasticMonitorResource)
18+
model MonitoringTagRules
19+
is Azure.ResourceManager.ProxyResource<MonitoringTagRulesProperties> {
20+
...ResourceNameParameter<
21+
Resource = MonitoringTagRules,
22+
KeyName = "ruleSetName",
23+
SegmentName = "tagRules",
24+
NamePattern = "^.*$"
25+
>;
26+
}
27+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
28+
interface TagRulesCreateOrUpdateResourceOps
29+
extends Azure.ResourceManager.Legacy.LegacyOperations<
30+
{
31+
...ApiVersionParameter,
32+
...SubscriptionIdParameter,
33+
...ResourceGroupParameter,
34+
...Azure.ResourceManager.Legacy.Provider,
35+
},
36+
{
37+
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
38+
@path
39+
@segment("monitors")
40+
@pattern("^.*$")
41+
monitorName: string,
42+
43+
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
44+
@path
45+
@segment("tagRules")
46+
@pattern("^.*$")
47+
ruleSetName: string,
48+
},
49+
ErrorType = ResourceProviderDefaultErrorResponse
50+
> {}
51+
52+
@armResourceOperations
53+
interface TagRules {
54+
/**
55+
* Get detailed information about a tag rule set for a given Elastic monitor resource.
56+
*/
57+
get is ArmResourceRead<
58+
MonitoringTagRules,
59+
Error = ResourceProviderDefaultErrorResponse
60+
>;
61+
62+
/**
63+
* Create or update a tag rule set for a given Elastic monitor resource, enabling fine-grained control over observability based on resource tags.
64+
*/
65+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
66+
createOrUpdate is TagRulesCreateOrUpdateResourceOps.CreateOrUpdateAsync<
67+
MonitoringTagRules,
68+
Response = ArmResourceUpdatedResponse<MonitoringTagRules>,
69+
OptionalRequestBody = true
70+
>;
71+
72+
/**
73+
* Delete a tag rule set for a given Elastic monitor resource, removing fine-grained control over observability based on resource tags.
74+
*/
75+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
76+
delete is ArmResourceDeleteWithoutOkAsync<
77+
MonitoringTagRules,
78+
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse,
79+
Error = ResourceProviderDefaultErrorResponse
80+
>;
81+
82+
/**
83+
* List all tag rules for a given Elastic monitor resource, helping you manage fine-grained control over observability based on resource tags.
84+
*/
85+
list is ArmResourceListByParent<
86+
MonitoringTagRules,
87+
Response = ArmResponse<MonitoringTagRulesListResponse>,
88+
Error = ResourceProviderDefaultErrorResponse
89+
>;
90+
}
91+
92+
@@doc(MonitoringTagRules.name, "Tag Rule Set resource name");
93+
@@doc(MonitoringTagRules.properties, "Properties of the monitoring tag rules.");
94+
@@doc(TagRules.createOrUpdate::parameters.resource,
95+
"request body of MonitoringTagRules"
96+
);
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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 "./ElasticMonitorResource.tsp";
7+
8+
using TypeSpec.Rest;
9+
using Azure.ResourceManager;
10+
using TypeSpec.Http;
11+
using TypeSpec.OpenAPI;
12+
13+
namespace Microsoft.Elastic;
14+
/**
15+
* Capture properties of Open AI resource Integration.
16+
*/
17+
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
18+
@parentResource(ElasticMonitorResource)
19+
model OpenAIIntegrationRPModel
20+
is Azure.ResourceManager.ProxyResource<OpenAIIntegrationProperties> {
21+
...ResourceNameParameter<
22+
Resource = OpenAIIntegrationRPModel,
23+
KeyName = "integrationName",
24+
SegmentName = "openAIIntegrations",
25+
NamePattern = "^[a-z][a-z0-9]*$"
26+
>;
27+
}
28+
29+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
30+
interface OpenAiCreateOrUpdateResourceOps
31+
extends Azure.ResourceManager.Legacy.LegacyOperations<
32+
{
33+
...ApiVersionParameter,
34+
...SubscriptionIdParameter,
35+
...ResourceGroupParameter,
36+
...Azure.ResourceManager.Legacy.Provider,
37+
},
38+
{
39+
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
40+
@path
41+
@segment("monitors")
42+
@pattern("^.*$")
43+
monitorName: string,
44+
45+
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
46+
@path
47+
@segment("openAIIntegrations")
48+
@pattern("^[a-z][a-z0-9]*$")
49+
integrationName: string,
50+
},
51+
ErrorType = ResourceProviderDefaultErrorResponse
52+
> {}
53+
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
54+
@armResourceOperations
55+
interface OpenAIIntegrationRPModels {
56+
/**
57+
* Get detailed information about OpenAI integration rules for a given Elastic monitor resource.
58+
*/
59+
get is ArmResourceRead<
60+
OpenAIIntegrationRPModel,
61+
Error = ResourceProviderDefaultErrorResponse
62+
>;
63+
64+
/**
65+
* Create or update an OpenAI integration rule for a given Elastic monitor resource, enabling advanced AI-driven observability and monitoring.
66+
*/
67+
createOrUpdate is OpenAiCreateOrUpdateResourceOps.CreateOrUpdateAsync<
68+
OpenAIIntegrationRPModel,
69+
Response = ArmResourceUpdatedResponse<OpenAIIntegrationRPModel> | ArmResourceCreatedResponse<
70+
OpenAIIntegrationRPModel,
71+
LroHeaders = {}
72+
>,
73+
OptionalRequestBody = true
74+
>;
75+
76+
/**
77+
* Delete an OpenAI integration rule for a given Elastic monitor resource, removing AI-driven observability and monitoring capabilities.
78+
*/
79+
delete is ArmResourceDeleteSync<
80+
OpenAIIntegrationRPModel,
81+
Error = ResourceProviderDefaultErrorResponse
82+
>;
83+
84+
/**
85+
* List all OpenAI integration rules for a given Elastic monitor resource, helping you manage AI-driven observability and monitoring.
86+
*/
87+
list is ArmResourceListByParent<
88+
OpenAIIntegrationRPModel,
89+
Response = ArmResponse<OpenAIIntegrationRPModelListResponse>,
90+
Error = ResourceProviderDefaultErrorResponse
91+
>;
92+
93+
/**
94+
* Get the status of OpenAI integration for a given Elastic monitor resource, ensuring optimal observability and performance.
95+
*/
96+
getStatus is ArmResourceActionSync<
97+
OpenAIIntegrationRPModel,
98+
void,
99+
ArmResponse<OpenAIIntegrationStatusResponse>,
100+
Error = ResourceProviderDefaultErrorResponse
101+
>;
102+
}
103+
104+
@@doc(OpenAIIntegrationRPModel.name, "OpenAI Integration name");
105+
@@doc(OpenAIIntegrationRPModel.properties, "Open AI Integration details.");
106+
@@doc(OpenAIIntegrationRPModels.createOrUpdate::parameters.resource, "");

0 commit comments

Comments
 (0)