Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
50cab8f
newly converted
welovej Apr 28, 2025
69812e6
update
welovej Apr 28, 2025
23d3875
Update models.tsp
welovej Apr 28, 2025
5386953
update
welovej Apr 28, 2025
3fb2691
Update tspconfig.yaml
welovej May 9, 2025
bbe71f7
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
May 9, 2025
4e30424
update
May 9, 2025
e9ddc49
update
welovej May 9, 2025
2a21db9
update
welovej May 9, 2025
f4105f7
update
May 14, 2025
e82088f
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
May 14, 2025
bb7b192
Fix optional body issues
melina5656 May 23, 2025
d480385
Merge remote-tracking branch 'upstream/main' into TspMig-datadog
melina5656 Jun 6, 2025
ecbeb46
Delete conditionalClientFlatten and run prettier check
melina5656 Jun 6, 2025
a7cbf79
Merge remote-tracking branch 'upstream/main' into TspMig-datadog
welovej Jun 23, 2025
846483b
FIXME
welovej Jun 24, 2025
f3333a7
Merge remote-tracking branch 'upstream/main' into pr/34281
mcgallan Jul 3, 2025
04b7287
update
mcgallan Jul 3, 2025
fa7b056
update
mcgallan Jul 3, 2025
5fbf01c
update
mcgallan Jul 3, 2025
8ab2204
Merge branch 'main' into TspMig-datadog
v-jiaodi Jul 8, 2025
1f0a9d0
Merge branch 'main' into TspMig-datadog
v-jiaodi Jul 14, 2025
9ee2977
Remove Bodyboot Decorator
melina5656 Jul 15, 2025
d26919a
resolve breaking
v-jiaodi Jul 16, 2025
c21e550
Update ArmLroLocationHeader type in monitor resource
welovej Jul 18, 2025
40921b4
fix for subscriptionId to be optional
welovej Jul 22, 2025
3dbc32a
Update tspconfig.yaml
welovej Jul 23, 2025
0d3f8aa
remove private things
welovej Jul 30, 2025
5e357c5
Update main.tsp
welovej Jul 30, 2025
2756877
Update tspconfig.yaml
welovej Aug 1, 2025
d5c8748
fix for as description and migration language scop decorator to clien…
welovej Aug 5, 2025
ac9cc3e
Update client.tsp
welovej Aug 5, 2025
80be29c
fix for typespec migration validation
welovej Aug 5, 2025
5f8f3dc
Revert "fix for typespec migration validation"
welovej Aug 5, 2025
e1d953d
update
welovej Aug 5, 2025
bf65c02
fix: for @pagedItems
welovej Aug 22, 2025
397b66d
Update DatadogMonitorResource.tsp
welovej Aug 25, 2025
c37407d
compability for java
weidongxu-microsoft Aug 26, 2025
13ea7d0
Update main.tsp
welovej Oct 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions specification/datadog/Datadog.Management/DatadogMonitorResource.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
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"
model DatadogMonitorResource
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use the canonical name for the resource type (Monitor) and customize for client code/openapi by augmentation decorator.

is Azure.ResourceManager.TrackedResource<MonitorProperties, true> {
...ResourceNameParameter<
Resource = DatadogMonitorResource,
KeyName = "monitorName",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove since this is the default value.

SegmentName = "monitors",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove since this is the default value.

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-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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the default segment for a Monitor resource, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is expected to have this segment part in a legacy operation

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a tracked resource, which means that not specifying a request body wouldn't be valid, right?

>;

/**
* Update a monitor resource.
*/
@patch(#{ implicitOptionality: false })
update is DatadogMonitorResourcesOps.CustomPatchAsync<
DatadogMonitorResource,
PatchModel = DatadogMonitorResourceUpdateParameters,
Response = ArmResponse<DatadogMonitorResource> | ArmResourceCreatedResponse<
DatadogMonitorResource,
LroHeaders = ArmLroLocationHeader<FinalResult = DatadogMonitorResource> &
Azure.Core.Foundations.RetryAfterHeader
>,
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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a standard list response I assume.

>;

/**
* List all monitors under the specified subscription.
*/
list is ArmListBySubscription<
DatadogMonitorResource,
Response = ArmResponse<DatadogMonitorResourceListResponse>
>;

/**
* List the api keys for a given monitor resource.
*/
@list
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,
DatadogApiKey,
OkResponse,
OptionalRequestBody = true
>;

/**
* List the hosts for a given monitor resource.
*/
@list
listHosts is ArmResourceActionSync<
DatadogMonitorResource,
void,
ArmResponse<DatadogHostListResponse>
>;

/**
* List all Azure resources associated to the same Datadog organization as the target resource.
*/
@list
listLinkedResources is ArmResourceActionSync<
DatadogMonitorResource,
void,
ArmResponse<LinkedResourceListResponse>
>;

/**
* List the resources currently being monitored by the Datadog monitor resource.
*/
@list
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, "");
@@doc(DatadogMonitorResources.setDefaultKey::parameters.body, "");
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, "");
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, "");
Loading
Loading