-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[TSP Migration]--datadog #34281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
welovej
wants to merge
21
commits into
Azure:main
Choose a base branch
from
welovej:TspMig-datadog
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[TSP Migration]--datadog #34281
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
50cab8f
newly converted
welovej 69812e6
update
welovej 23d3875
Update models.tsp
welovej 5386953
update
welovej 3fb2691
Update tspconfig.yaml
welovej bbe71f7
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
4e30424
update
e9ddc49
update
welovej 2a21db9
update
welovej f4105f7
update
e82088f
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
bb7b192
Fix optional body issues
melina5656 d480385
Merge remote-tracking branch 'upstream/main' into TspMig-datadog
melina5656 ecbeb46
Delete conditionalClientFlatten and run prettier check
melina5656 a7cbf79
Merge remote-tracking branch 'upstream/main' into TspMig-datadog
welovej 846483b
FIXME
welovej f3333a7
Merge remote-tracking branch 'upstream/main' into pr/34281
mcgallan 04b7287
update
mcgallan fa7b056
update
mcgallan 5fbf01c
update
mcgallan 8ab2204
Merge branch 'main' into TspMig-datadog
v-jiaodi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
193 changes: 193 additions & 0 deletions
193
specification/datadog/Datadog.Management/DatadogMonitorResource.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@typespec/openapi"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
using TypeSpec.OpenAPI; | ||
namespace Microsoft.Datadog; | ||
|
||
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@Azure.ResourceManager.Private.armResourceInternal(IdentityProperties) | ||
@TypeSpec.Http.Private.includeInapplicableMetadataInPayload(false) | ||
model DatadogMonitorResource | ||
extends Azure.ResourceManager.Foundations.TrackedResource { | ||
...ResourceNameParameter< | ||
Resource = DatadogMonitorResource, | ||
KeyName = "monitorName", | ||
SegmentName = "monitors", | ||
NamePattern = "" | ||
>; | ||
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
sku?: ResourceSku; | ||
|
||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@Azure.ResourceManager.Private.armResourcePropertiesOptionality(true) | ||
properties?: MonitorProperties; | ||
|
||
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
identity?: IdentityProperties; | ||
} | ||
|
||
@armResourceOperations | ||
interface DatadogMonitorResourcesOps | ||
extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
{ | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
...Azure.ResourceManager.Legacy.Provider, | ||
|
||
/** | ||
* Monitor resource name | ||
*/ | ||
@path | ||
@segment("monitors") | ||
monitorName: string, | ||
}, | ||
{}, | ||
ErrorResponse | ||
> {} | ||
|
||
@armResourceOperations | ||
interface DatadogMonitorResources { | ||
/** | ||
* Get the properties of a specific monitor resource. | ||
*/ | ||
get is ArmResourceRead<DatadogMonitorResource>; | ||
|
||
/** | ||
* Create a monitor resource. | ||
*/ | ||
create is DatadogMonitorResourcesOps.CreateOrUpdateAsync< | ||
DatadogMonitorResource, | ||
OptionalRequestBody = true | ||
>; | ||
|
||
/** | ||
* Update a monitor resource. | ||
*/ | ||
@patch(#{ implicitOptionality: false }) | ||
update is DatadogMonitorResourcesOps.CustomPatchAsync< | ||
DatadogMonitorResource, | ||
PatchModel = DatadogMonitorResourceUpdateParameters, | ||
Response = ArmResponse<DatadogMonitorResource> | (ArmResourceCreatedResponse<DatadogMonitorResource> & | ||
ArmLroLocationHeader), | ||
OptionalRequestBody = true | ||
>; | ||
|
||
/** | ||
* Delete a monitor resource. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
delete is ArmResourceDeleteWithoutOkAsync< | ||
DatadogMonitorResource, | ||
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse | ||
>; | ||
|
||
/** | ||
* List all monitors under the specified resource group. | ||
*/ | ||
listByResourceGroup is ArmResourceListByParent< | ||
DatadogMonitorResource, | ||
Response = ArmResponse<DatadogMonitorResourceListResponse> | ||
>; | ||
|
||
/** | ||
* List all monitors under the specified subscription. | ||
*/ | ||
list is ArmListBySubscription< | ||
DatadogMonitorResource, | ||
Response = ArmResponse<DatadogMonitorResourceListResponse> | ||
>; | ||
|
||
/** | ||
* List the api keys for a given monitor resource. | ||
*/ | ||
listApiKeys is ArmResourceActionSync< | ||
DatadogMonitorResource, | ||
void, | ||
ArmResponse<DatadogApiKeyListResponse> | ||
>; | ||
|
||
/** | ||
* Get the default api key. | ||
*/ | ||
getDefaultKey is ArmResourceActionSync< | ||
DatadogMonitorResource, | ||
void, | ||
ArmResponse<DatadogApiKey> | ||
>; | ||
|
||
/** | ||
* Set the default api key. | ||
*/ | ||
setDefaultKey is ArmResourceActionSync< | ||
DatadogMonitorResource, | ||
{ | ||
@bodyRoot | ||
body?: DatadogApiKey; | ||
}, | ||
OkResponse | ||
>; | ||
|
||
/** | ||
* List the hosts for a given monitor resource. | ||
*/ | ||
listHosts is ArmResourceActionSync< | ||
DatadogMonitorResource, | ||
void, | ||
ArmResponse<DatadogHostListResponse> | ||
>; | ||
|
||
/** | ||
* List all Azure resources associated to the same Datadog organization as the target resource. | ||
*/ | ||
listLinkedResources is ArmResourceActionSync< | ||
DatadogMonitorResource, | ||
void, | ||
ArmResponse<LinkedResourceListResponse> | ||
>; | ||
|
||
/** | ||
* List the resources currently being monitored by the Datadog monitor resource. | ||
*/ | ||
listMonitoredResources is ArmResourceActionSync< | ||
DatadogMonitorResource, | ||
void, | ||
ArmResponse<MonitoredResourceListResponse> | ||
>; | ||
|
||
/** | ||
* Refresh the set password link and return a latest one. | ||
*/ | ||
refreshSetPasswordLink is ArmResourceActionSync< | ||
DatadogMonitorResource, | ||
void, | ||
ArmResponse<DatadogSetPasswordLink> | ||
>; | ||
|
||
/** | ||
* Get marketplace and organization info mapped to the given monitor. | ||
*/ | ||
@action("getBillingInfo") | ||
billingInfoGet is ArmResourceActionSync< | ||
DatadogMonitorResource, | ||
void, | ||
ArmResponse<BillingInfoResponse> | ||
>; | ||
} | ||
|
||
@@doc(DatadogMonitorResource.name, "Monitor resource name"); | ||
@@doc(DatadogMonitorResource.properties, | ||
"Properties specific to the monitor resource." | ||
); | ||
@@doc(DatadogMonitorResources.create::parameters.resource, ""); | ||
@@doc(DatadogMonitorResources.update::parameters.properties, ""); |
80 changes: 80 additions & 0 deletions
80
specification/datadog/Datadog.Management/DatadogSingleSignOnResource.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@typespec/openapi"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
import "./DatadogMonitorResource.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
using TypeSpec.OpenAPI; | ||
|
||
namespace Microsoft.Datadog; | ||
|
||
@parentResource(DatadogMonitorResource) | ||
model DatadogSingleSignOnResource | ||
is Azure.ResourceManager.ProxyResource<DatadogSingleSignOnProperties> { | ||
...ResourceNameParameter< | ||
Resource = DatadogSingleSignOnResource, | ||
KeyName = "configurationName", | ||
SegmentName = "singleSignOnConfigurations", | ||
NamePattern = "" | ||
>; | ||
} | ||
|
||
@armResourceOperations | ||
interface DatadogSingleSignOnResourcesOps | ||
extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
{ | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
...Azure.ResourceManager.Legacy.Provider, | ||
|
||
/** | ||
* Monitor resource name | ||
*/ | ||
@path | ||
@segment("monitors") | ||
monitorName: string, | ||
}, | ||
{ | ||
/** | ||
* Configuration name | ||
*/ | ||
@path | ||
@segment("singleSignOnConfigurations") | ||
configurationName: string, | ||
}, | ||
ErrorResponse | ||
> {} | ||
|
||
#suppress "@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
@armResourceOperations | ||
interface DatadogSingleSignOnResources { | ||
/** | ||
* Gets the datadog single sign-on resource for the given Monitor. | ||
*/ | ||
get is ArmResourceRead<DatadogSingleSignOnResource>; | ||
|
||
/** | ||
* Configures single-sign-on for this resource. | ||
*/ | ||
createOrUpdate is DatadogSingleSignOnResourcesOps.CreateOrUpdateAsync< | ||
DatadogSingleSignOnResource, | ||
OptionalRequestBody = true | ||
>; | ||
|
||
/** | ||
* List the single sign-on configurations for a given monitor resource. | ||
*/ | ||
list is ArmResourceListByParent< | ||
DatadogSingleSignOnResource, | ||
Response = ArmResponse<DatadogSingleSignOnResourceListResponse> | ||
>; | ||
} | ||
|
||
@@doc(DatadogSingleSignOnResource.name, "Configuration name"); | ||
@@doc(DatadogSingleSignOnResource.properties, ""); | ||
@@doc(DatadogSingleSignOnResources.createOrUpdate::parameters.resource, ""); |
111 changes: 111 additions & 0 deletions
111
specification/datadog/Datadog.Management/MonitoredSubscriptionProperties.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@typespec/openapi"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
import "./DatadogMonitorResource.tsp"; | ||
|
||
using TypeSpec.Rest; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
using TypeSpec.OpenAPI; | ||
|
||
namespace Microsoft.Datadog; | ||
/** | ||
* The request to update subscriptions needed to be monitored by the Datadog monitor resource. | ||
*/ | ||
@parentResource(DatadogMonitorResource) | ||
model MonitoredSubscriptionProperties | ||
is Azure.ResourceManager.ProxyResource<SubscriptionList> { | ||
...ResourceNameParameter< | ||
Resource = MonitoredSubscriptionProperties, | ||
KeyName = "configurationName", | ||
SegmentName = "monitoredSubscriptions", | ||
NamePattern = "" | ||
>; | ||
} | ||
|
||
@armResourceOperations | ||
interface MonitoredSubscriptionsOps | ||
extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
{ | ||
...ApiVersionParameter, | ||
...SubscriptionIdParameter, | ||
...ResourceGroupParameter, | ||
...Azure.ResourceManager.Legacy.Provider, | ||
|
||
/** | ||
* Monitor resource name | ||
*/ | ||
@path | ||
@segment("monitors") | ||
monitorName: string, | ||
}, | ||
{ | ||
/** | ||
* The configuration name. Only 'default' value is supported. | ||
*/ | ||
@path | ||
@segment("monitoredSubscriptions") | ||
configurationName: string, | ||
}, | ||
ErrorResponse | ||
> {} | ||
|
||
@armResourceOperations | ||
interface MonitoredSubscriptions { | ||
/** | ||
* List the subscriptions currently being monitored by the Datadog monitor resource. | ||
*/ | ||
get is ArmResourceRead<MonitoredSubscriptionProperties>; | ||
|
||
/** | ||
* Add the subscriptions that should be monitored by the Datadog monitor resource. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
createorUpdate is MonitoredSubscriptionsOps.CreateOrUpdateAsync< | ||
MonitoredSubscriptionProperties, | ||
Response = ArmResourceUpdatedResponse<MonitoredSubscriptionProperties> | ArmResourceCreatedResponse< | ||
MonitoredSubscriptionProperties, | ||
ArmLroLocationHeader<FinalResult = MonitoredSubscriptionProperties> & | ||
Azure.Core.Foundations.RetryAfterHeader | ||
> | ArmAcceptedLroResponse, | ||
OptionalRequestBody = true | ||
>; | ||
|
||
/** | ||
* Updates the subscriptions that are being monitored by the Datadog monitor resource | ||
*/ | ||
@patch(#{ implicitOptionality: false }) | ||
update is MonitoredSubscriptionsOps.CustomPatchAsync< | ||
MonitoredSubscriptionProperties, | ||
PatchModel = MonitoredSubscriptionProperties, | ||
OptionalRequestBody = true | ||
>; | ||
|
||
/** | ||
* Updates the subscriptions that are being monitored by the Datadog monitor resource | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
delete is ArmResourceDeleteWithoutOkAsync< | ||
MonitoredSubscriptionProperties, | ||
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse | ||
>; | ||
|
||
/** | ||
* List the subscriptions currently being monitored by the Datadog monitor resource. | ||
*/ | ||
list is ArmResourceListByParent< | ||
MonitoredSubscriptionProperties, | ||
Response = ArmResponse<MonitoredSubscriptionPropertiesList> | ||
>; | ||
} | ||
|
||
@@doc(MonitoredSubscriptionProperties.name, | ||
"The configuration name. Only 'default' value is supported." | ||
); | ||
@@doc(MonitoredSubscriptionProperties.properties, | ||
"The request to update subscriptions needed to be monitored by the Datadog monitor resource." | ||
); | ||
@@doc(MonitoredSubscriptions.createorUpdate::parameters.resource, ""); | ||
@@doc(MonitoredSubscriptions.update::parameters.properties, ""); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing final result.