Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
202 changes: 202 additions & 0 deletions specification/datadog/Datadog.Management/DatadogMonitorResource.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
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
is Azure.ResourceManager.TrackedResource<MonitorProperties, true> {
...ResourceNameParameter<
Resource = DatadogMonitorResource,
KeyName = "monitorName",
SegmentName = "monitors",
NamePattern = "^[a-zA-Z0-9_][a-zA-Z0-9_-]+$"
>;
#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 DatadogMonitorResources {
/**
* Get the properties of a specific monitor resource.
*/
@summary("Get the properties of a specific monitor resource.")
get is ArmResourceRead<DatadogMonitorResource>;

/**
* Create a monitor resource.
*/
@summary("Create a monitor resource.")
create is Azure.ResourceManager.Legacy.CreateOrUpdateAsync<
DatadogMonitorResource,
OptionalRequestBody = true
>;

/**
* Update a monitor resource.
*/
@summary("Update a monitor resource.")
@patch(#{ implicitOptionality: false })
update is Azure.ResourceManager.Legacy.CreateOrReplaceAsync<
DatadogMonitorResource,
Request = 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"
@summary("Delete a monitor resource.")
delete is ArmResourceDeleteWithoutOkAsync<
DatadogMonitorResource,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
>;

/**
* List all monitors under the specified resource group.
*/
@summary("List all monitors under the specified resource group.")
listByResourceGroup is ArmResourceListByParent<
DatadogMonitorResource,
Response = ArmResponse<DatadogMonitorResourceListResponse>
>;

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

/**
* List the api keys for a given monitor resource.
*/
@list
@summary("List the api keys for a given monitor resource.")
listApiKeys is ArmResourceActionSync<
DatadogMonitorResource,
void,
ArmResponse<DatadogApiKeyListResponse>
>;

/**
* Get the default api key.
*/
@summary("Get the default api key.")
getDefaultKey is ArmResourceActionSync<
DatadogMonitorResource,
void,
ArmResponse<DatadogApiKey>
>;

/**
* Set the default api key.
*/
@summary("Set the default api key.")
setDefaultKey is ArmResourceActionSync<
DatadogMonitorResource,
DatadogApiKey,
OkResponse,
OptionalRequestBody = true
>;

/**
* List the hosts for a given monitor resource.
*/
@list
@summary("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.
*/
@list
@summary("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.
*/
@list
@summary("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.
*/
@summary("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.
*/
@summary("Get marketplace and organization info mapped to the given monitor.")
@action("getBillingInfo")
billingInfoGet is ArmResourceActionSync<
DatadogMonitorResource,
void,
ArmResponse<BillingInfoResponse>
>;

/**
* Reinstate integration with your Datadog organization by choosing one of the available subscription plans.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@summary("Reinstate integration with your Datadog organization by choosing one of the available subscription plans.")
resubscribe is ArmResourceActionAsync<
DatadogMonitorResource,
ResubscribeProperties,
DatadogMonitorResource,
OptionalRequestBody = true
>;
}

@@maxLength(DatadogMonitorResource.name, 32);
@@minLength(DatadogMonitorResource.name, 2);
@@doc(DatadogMonitorResource.name, "Monitor resource name");
@@doc(DatadogMonitorResource.properties,
"Properties specific to the monitor resource."
);
@@doc(DatadogMonitorResources.create::parameters.resource, "");
@@doc(DatadogMonitorResources.update::parameters.resource, "");
@@doc(DatadogMonitorResources.setDefaultKey::parameters.body, "");
@@doc(DatadogMonitorResources.resubscribe::parameters.body,
"Resubscribe Properties"
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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 = ""
>;
}

#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.
*/
@summary("Gets the datadog single sign-on resource for the given Monitor.")
get is ArmResourceRead<DatadogSingleSignOnResource>;

/**
* Configures single-sign-on for this resource.
*/
@summary("Configures single-sign-on for this resource.")
create is Azure.ResourceManager.Legacy.CreateOrUpdateAsync<
DatadogSingleSignOnResource,
OptionalRequestBody = true
>;

/**
* List the single sign-on configurations for a given monitor resource.
*/
@summary("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.create::parameters.resource, "");
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
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 MonitoredSubscriptions {
/**
* List the subscriptions currently being monitored by the Datadog monitor resource.
*/
@summary("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"
@summary("Add the subscriptions that should be monitored by the Datadog monitor resource.")
createorUpdate is Azure.ResourceManager.Legacy.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
*/
@summary("Updates the subscriptions that are being monitored by the Datadog monitor resource")
@patch(#{ implicitOptionality: false })
update is Azure.ResourceManager.Legacy.CreateOrReplaceAsync<
MonitoredSubscriptionProperties,
Request = MonitoredSubscriptionProperties,
Response = ArmResponse<MonitoredSubscriptionProperties> | ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = MonitoredSubscriptionProperties> &
Azure.Core.Foundations.RetryAfterHeader>,
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"
@summary("Updates the subscriptions that are being monitored by the Datadog monitor resource")
delete is ArmResourceDeleteWithoutOkAsync<
MonitoredSubscriptionProperties,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse
>;

/**
* List the subscriptions currently being monitored by the Datadog monitor resource.
*/
@summary("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.resource, "");
Loading
Loading