Skip to content

[TSP Migration]--dashboard #34274

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

Merged
merged 33 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8a9c5d3
newly created
welovej Apr 27, 2025
04a00f0
update
welovej Apr 27, 2025
087e307
Delete oldSwagger.json
welovej Apr 27, 2025
b3f813a
update
welovej Apr 28, 2025
3ff30a3
flatten disabled by default
welovej Apr 28, 2025
95a8856
update
welovej Apr 28, 2025
9666764
prettier
welovej May 9, 2025
4437071
Update tspconfig.yaml
welovej May 9, 2025
483f8a6
rename
welovej May 9, 2025
f66e048
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
May 9, 2025
1e1c34e
remove useless comment
welovej May 9, 2025
415f598
update
May 9, 2025
1bf2309
Merge branch 'TspMig-dashboard' of https://github.com/welovej/azure-r…
May 9, 2025
f3ee42f
update
welovej May 9, 2025
c6e6d17
Merge remote-tracking branch 'upstream/main' into TspMig-dashboard
melina5656 May 19, 2025
e646dee
Fix optional body issue
melina5656 May 19, 2025
9f5ff2e
Merge remote-tracking branch 'upstream/main' into TspMig-dashboard
welovej May 21, 2025
e4bb781
update
welovej May 21, 2025
f10381d
remove
welovej May 21, 2025
91e3bcd
recovery
welovej May 21, 2025
cdd532e
Merge branch 'main' into TspMig-dashboard
kazrael2119 May 22, 2025
ee178f6
Merge branch 'main' into TspMig-dashboard
mcgallan May 30, 2025
52b04fe
update
mcgallan May 30, 2025
90832ec
Merge branch 'main' into TspMig-dashboard
v-jiaodi Jun 3, 2025
fa03f5b
update
Jun 5, 2025
e350de8
Delete conditionalClientFlatten
melina5656 Jun 6, 2025
7cd770c
update
mcgallan Jun 6, 2025
c838116
Merge branch 'TspMig-dashboard' of https://github.com/welovej/azure-r…
mcgallan Jun 6, 2025
1295539
update
mcgallan Jun 9, 2025
3684b7d
update
mcgallan Jun 9, 2025
15e36ed
Merge branch 'main' into TspMig-dashboard
pshao25 Jun 10, 2025
8f52a1e
update
mcgallan Jun 10, 2025
507bbfa
fix TSP generation SDK
welovej Jun 10, 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
61 changes: 61 additions & 0 deletions specification/dashboard/Dashboard.Management/IntegrationFabric.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./ManagedGrafana.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.Dashboard;
/**
* The integration fabric resource type.
*/
@parentResource(ManagedGrafana)
model IntegrationFabric
is Azure.ResourceManager.TrackedResource<IntegrationFabricProperties> {
...ResourceNameParameter<
Resource = IntegrationFabric,
KeyName = "integrationFabricName",
SegmentName = "integrationFabrics",
NamePattern = "^[a-zA-Z][a-z0-9A-Z-]{0,18}[a-z0-9A-Z]$"
>;
}

@armResourceOperations
interface IntegrationFabrics {
get is ArmResourceRead<IntegrationFabric>;

create is ArmResourceCreateOrReplaceAsync<IntegrationFabric>;

#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchAsync<
IntegrationFabric,
PatchModel = IntegrationFabricUpdateParameters,
LroHeaders = ArmAsyncOperationHeader<FinalResult = IntegrationFabric> &
Azure.Core.Foundations.RetryAfterHeader
>;

#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
delete is ArmResourceDeleteWithoutOkAsync<
IntegrationFabric,
LroHeaders = ArmAsyncOperationHeader &
Azure.Core.Foundations.RetryAfterHeader
>;

list is ArmResourceListByParent<
IntegrationFabric,
Response = ArmResponse<IntegrationFabricListResponse>
>;
}

@@doc(IntegrationFabric.name,
"The integration fabric name of Azure Managed Grafana."
);
@@doc(IntegrationFabric.properties, "");
@@doc(IntegrationFabrics.create::parameters.resource, "");
@@doc(IntegrationFabrics.update::parameters.properties, "");
80 changes: 80 additions & 0 deletions specification/dashboard/Dashboard.Management/ManagedDashboard.tsp
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";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.Dashboard;
/**
* The managed dashboard resource type.
*/
model ManagedDashboard
is Azure.ResourceManager.TrackedResource<ManagedDashboardProperties> {
...ResourceNameParameter<
Resource = ManagedDashboard,
KeyName = "dashboardName",
SegmentName = "dashboards",
NamePattern = "^[a-zA-Z][a-z0-9A-Z-]{0,28}[a-z0-9A-Z]$"
>;
}

@armResourceOperations
interface ManagedDashboards {
/**
* Get the properties of a specific dashboard for grafana resource.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Dashboards_Get")
get is ArmResourceRead<ManagedDashboard>;

/**
* Create or update a dashboard for grafana resource. This API is idempotent, so user can either create a new dashboard or update an existing dashboard.
*/
create is ArmResourceCreateOrReplaceAsync<ManagedDashboard>;

/**
* Update a dashboard for Grafana resource.
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchSync<
ManagedDashboard,
PatchModel = ManagedDashboardUpdateParameters
>;

/**
* Delete a dashboard for Grafana resource.
*/
delete is ArmResourceDeleteSync<ManagedDashboard>;

/**
* List all resources of dashboards under the specified resource group.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Dashboards_List")
list is ArmResourceListByParent<
ManagedDashboard,
Response = ArmResponse<ManagedDashboardListResponse>
>;

/**
* List all resources of dashboards under the specified subscription.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Dashboards_ListBySubscription")
listBySubscription is ArmListBySubscription<
ManagedDashboard,
Response = ArmResponse<ManagedDashboardListResponse>
>;
}

@@doc(ManagedDashboard.name, "The name of the Azure Managed Dashboard.");
@@doc(ManagedDashboard.properties,
"Properties specific to the managed dashboard resource."
);
@@doc(ManagedDashboards.create::parameters.resource, "");
@@doc(ManagedDashboards.update::parameters.properties, "");
149 changes: 149 additions & 0 deletions specification/dashboard/Dashboard.Management/ManagedGrafana.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
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.Dashboard;
/**
* The grafana resource type.
*/
#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(ManagedGrafanaProperties)
@TypeSpec.Http.Private.includeInapplicableMetadataInPayload(false)
model ManagedGrafana extends Azure.ResourceManager.Foundations.TrackedResource {
...ResourceNameParameter<
Resource = ManagedGrafana,
KeyName = "workspaceName",
SegmentName = "grafana",
NamePattern = "^[a-zA-Z][a-z0-9A-Z-]{0,28}[a-z0-9A-Z]$"
>;

/**
* The Sku of the grafana resource.
*/
#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"
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@doc("The resource-specific properties for this resource.")
@Azure.ResourceManager.Private.armResourcePropertiesOptionality(true)
properties?: ManagedGrafanaProperties;

...Azure.ResourceManager.ManagedServiceIdentityProperty;
}

@armResourceOperations
interface ManagedGrafanas {
/**
* Get the properties of a specific workspace for Grafana resource.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Grafana_Get")
get is ArmResourceRead<ManagedGrafana>;

/**
* Create or update a workspace for Grafana resource. This API is idempotent, so user can either create a new grafana or update an existing grafana.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Grafana_Create")
create is ArmResourceCreateOrReplaceAsync<ManagedGrafana>;

/**
* Update a workspace for Grafana resource.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
@operationId("Grafana_Update")
update is ArmCustomPatchSync<
ManagedGrafana,
PatchModel = ManagedGrafanaUpdateParameters,
Response = ArmResponse<ManagedGrafana> | (AcceptedResponse & {
@bodyRoot
_: ManagedGrafana;
})
>;

/**
* Delete a workspace for Grafana resource.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@operationId("Grafana_Delete")
delete is ArmResourceDeleteWithoutOkAsync<
ManagedGrafana,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse<ArmAsyncOperationHeader &
Azure.Core.Foundations.RetryAfterHeader> | ArmDeletedNoContentResponse
>;

/**
* List all resources of workspaces for Grafana under the specified resource group.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Grafana_ListByResourceGroup")
listByResourceGroup is ArmResourceListByParent<
ManagedGrafana,
Response = ArmResponse<ManagedGrafanaListResponse>
>;

/**
* List all resources of workspaces for Grafana under the specified subscription.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Grafana_List")
list is ArmListBySubscription<
ManagedGrafana,
Response = ArmResponse<ManagedGrafanaListResponse>
>;

/**
* Retrieve enterprise add-on details information
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Grafana_CheckEnterpriseDetails")
checkEnterpriseDetails is ArmResourceActionSync<
ManagedGrafana,
void,
ArmResponse<EnterpriseDetails>
>;

#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("Grafana_FetchAvailablePlugins")
fetchAvailablePlugins is ArmResourceActionSync<
ManagedGrafana,
void,
ArmResponse<GrafanaAvailablePluginListResponse>
>;

/**
* Refresh and sync managed private endpoints of a grafana resource to latest state.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@action("refreshManagedPrivateEndpoints")
@operationId("ManagedPrivateEndpoints_Refresh")
refresh is ArmResourceActionAsync<
ManagedGrafana,
void,
OkResponse,
LroHeaders = ArmAsyncOperationHeader &
Azure.Core.Foundations.RetryAfterHeader
>;
}

@@doc(ManagedGrafana.name, "The workspace name of Azure Managed Grafana.");
@@doc(ManagedGrafana.properties,
"Properties specific to the grafana resource."
);
@@doc(ManagedGrafanas.create::parameters.resource, "");
@@doc(ManagedGrafanas.update::parameters.properties, "");
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./ManagedGrafana.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;

namespace Microsoft.Dashboard;
/**
* The managed private endpoint resource type.
*/
@parentResource(ManagedGrafana)
model ManagedPrivateEndpointModel
is Azure.ResourceManager.TrackedResource<ManagedPrivateEndpointModelProperties> {
...ResourceNameParameter<
Resource = ManagedPrivateEndpointModel,
KeyName = "managedPrivateEndpointName",
SegmentName = "managedPrivateEndpoints",
NamePattern = ""
>;
}

@armResourceOperations
interface ManagedPrivateEndpointModels {
/**
* Get a specific managed private endpoint of a grafana resource.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("ManagedPrivateEndpoints_Get")
get is ArmResourceRead<ManagedPrivateEndpointModel>;

/**
* Create or update a managed private endpoint for a grafana resource.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@Azure.Core.useFinalStateVia("original-uri")
@operationId("ManagedPrivateEndpoints_Create")
create is ArmResourceCreateOrReplaceAsync<
ManagedPrivateEndpointModel,
Response = ArmResourceUpdatedResponse<ManagedPrivateEndpointModel> | ArmResourceCreatedResponse<
Resource = ManagedPrivateEndpointModel,
LroHeaders = ArmAsyncOperationHeader &
Azure.Core.Foundations.RetryAfterHeader
>
>;

/**
* Update a managed private endpoint for an existing grafana resource.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@patch(#{ implicitOptionality: false })
@operationId("ManagedPrivateEndpoints_Update")
update is ArmCustomPatchAsync<
ManagedPrivateEndpointModel,
PatchModel = ManagedPrivateEndpointUpdateParameters,
Response = ArmResponse<ManagedPrivateEndpointModel> | (ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader<FinalResult = ManagedPrivateEndpointModel> &
Azure.Core.Foundations.RetryAfterHeader> & {
@bodyRoot
_: ManagedPrivateEndpointModel;
})
>;

/**
* Delete a managed private endpoint for a grafana resource.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
#suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@operationId("ManagedPrivateEndpoints_Delete")
delete is ArmResourceDeleteWithoutOkAsync<
ManagedPrivateEndpointModel,
Response = ArmDeletedResponse | ArmDeleteAcceptedLroResponse<ArmAsyncOperationHeader &
Azure.Core.Foundations.RetryAfterHeader> | ArmDeletedNoContentResponse
>;

/**
* List all managed private endpoints of a grafana resource.
*/
#suppress "@azure-tools/typespec-azure-core/no-openapi" "non-standard operations"
@operationId("ManagedPrivateEndpoints_List")
list is ArmResourceListByParent<
ManagedPrivateEndpointModel,
Response = ArmResponse<ManagedPrivateEndpointModelListResponse>
>;
}

@@doc(ManagedPrivateEndpointModel.name,
"The managed private endpoint name of Azure Managed Grafana."
);
@@doc(ManagedPrivateEndpointModel.properties, "Resource properties.");
@@doc(ManagedPrivateEndpointModels.create::parameters.resource,
"The managed private endpoint to be created or updated."
);
@@doc(ManagedPrivateEndpointModels.update::parameters.properties,
"Properties that can be updated to an existing managed private endpoint."
);
Loading
Loading