Skip to content
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

Review request v3 for Microsoft.Portal to onboard to TypeSpec #29796

Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
428deb5
Initial iteration: Exact copy of 2020-09-01-preview
Jul 11, 2024
c0a799d
Iteration#2: Adding the typespec
Jul 11, 2024
748284e
Reoved 2022-12-01preview api
Jul 19, 2024
ea3f09d
Modified example files
Jul 19, 2024
eb2e78f
Removed old files
Jul 19, 2024
c139bef
Added tsp output
Jul 19, 2024
6a8a5ca
Reverted readme
Jul 19, 2024
0a9d2db
Merge branch 'main' into add-api-version-microsoft-portal-2022-12-01-…
sayeedalam-microsoft Jul 19, 2024
b5df381
Added new tsp project
Jul 20, 2024
b303dd2
Separated tenant config
Jul 20, 2024
d11c468
Renamed configuration model name
Jul 22, 2024
d7ed6d7
Made changes to swagger
Jul 22, 2024
9bd2080
Fixed operation id
Jul 22, 2024
ea96599
Renamed configuration properties
Jul 22, 2024
9d80374
Renamed resource in body
Jul 22, 2024
7b65ff8
Moved ConfigurationName union
Jul 22, 2024
36fb5e0
Added back 404
Jul 22, 2024
f0a8770
Merge branch 'main' into add-api-version-microsoft-portal-2022-12-01-…
sayeedalam-microsoft Jul 23, 2024
0e83bb4
Revert "Added back 404"
Jul 24, 2024
7c74c8a
Merge branch 'add-api-version-microsoft-portal-2022-12-01-preview-v2'…
Jul 24, 2024
2ab8012
Tenant Config set to singleton
Jul 24, 2024
327796c
Revert "Tenant Config set to singleton"
Jul 25, 2024
0be7c40
Reapply "Added back 404"
Jul 25, 2024
862eafe
Reverted 404 and singleton
Jul 25, 2024
a734912
Moving to v3
Jul 25, 2024
b53d5ba
Removed pattern from DashboardName
Jul 25, 2024
575e290
DashboardPartMetaData type to string
Jul 25, 2024
01f9f32
Added additional properties
Jul 25, 2024
653e108
Revert "Added additional properties"
Jul 25, 2024
73c7a17
Merge branch 'main' into add-api-version-microsoft-portal-2022-12-01-…
sayeedalam-microsoft Jul 25, 2024
5e441b9
Revert "DashboardPartMetaData type to string"
Jul 26, 2024
a7e8350
Revert "Moving to v3"
Jul 26, 2024
43e5c42
Revert "Reverted 404 and singleton"
Jul 26, 2024
1812015
Merge branch 'add-api-version-microsoft-portal-2022-12-01-preview-v2'…
Jul 26, 2024
c6a7638
Reapply "Reverted 404 and singleton"
Jul 26, 2024
47dad30
Revert "Added back 404"
Jul 26, 2024
98d5ef3
Modified examples
Jul 29, 2024
fa8452a
Merge branch 'main' into add-api-version-microsoft-portal-2022-12-01-…
sayeedalam-microsoft Jul 29, 2024
5c0b185
Fixed examples
Jul 29, 2024
3d1636c
prettier
Jul 29, 2024
9cfc322
Removed the default segment name
Jul 31, 2024
c514159
Removed unncessary sections
Aug 1, 2024
6ddbd38
Added common lib among
Aug 1, 2024
683cab7
New line added
Aug 1, 2024
7ace620
Revert "New line added"
Aug 1, 2024
ff808ac
Revert "Added common lib among"
Aug 1, 2024
71c64e1
Removed operation from Tenant config
Aug 1, 2024
00c6b73
Removed unnecessary operation list
Aug 1, 2024
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
78 changes: 78 additions & 0 deletions specification/portal/Dashboard.Management/Dashboard.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@azure-tools/typespec-client-generator-core";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";

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

namespace Microsoft.Portal;
/**
* The shared dashboard resource definition.
*/
@doc("The shared dashboard resource definition.")
model Dashboard
is Azure.ResourceManager.TrackedResource<DashboardPropertiesWithProvisioningState> {
...ResourceNameParameter<
Resource = Dashboard,
KeyName = "dashboardName",
sayeedalam-microsoft marked this conversation as resolved.
Show resolved Hide resolved
SegmentName = "dashboards"
sayeedalam-microsoft marked this conversation as resolved.
Show resolved Hide resolved
>;
}

@armResourceOperations
interface Dashboards {
/**
* Gets the Dashboard.
*/
get is ArmResourceRead<Dashboard>;

/**
* Creates or updates a Dashboard.
*/
createOrUpdate is ArmResourceCreateOrReplaceSync<Dashboard>;

/**
* Updates an existing Dashboard.
*/
@parameterVisibility
update is ArmCustomPatchSync<Dashboard, PatchableDashboard>;

/**
* Deletes the Dashboard.
*/
delete is ArmResourceDeleteSync<Dashboard>;
sayeedalam-microsoft marked this conversation as resolved.
Show resolved Hide resolved

/**
* Gets all the Dashboards within a resource group.
*/
listByResourceGroup is ArmResourceListByParent<Dashboard>;

/**
* Gets all the dashboards within a subscription.
*/
listBySubscription is ArmListBySubscription<Dashboard>;
}

@@maxLength(Dashboard.name, 64);
@@minLength(Dashboard.name, 3);
@@doc(Dashboard.name, "The name of the dashboard.");
@@doc(Dashboards.createOrUpdate::parameters.resource,
"The parameters required to create or update a dashboard."
);
@@doc(Dashboards.update::parameters.properties,
"The updatable fields of a Dashboard."
);
@@encodedName(Dashboards.createOrUpdate::parameters.resource,
"application/json",
"dashboard"
);
@@encodedName(Dashboards.update::parameters.properties,
"application/json",
"dashboard"
);
8 changes: 8 additions & 0 deletions specification/portal/Dashboard.Management/client.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
using Microsoft.Portal;

#suppress "deprecated" "@flattenProperty decorator is not recommended to use."
@@flattenProperty(PatchableDashboard.properties);
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
{
"parameters": {
"dashboardName": "testDashboard",
"resourceGroupName": "testRG",
"api-version": "2020-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"dashboard": {
"location": "eastus",
"properties": {
"lenses": [
{
"order": 1,
"parts": [
{
"position": {
"x": 1,
"y": 2,
"colSpan": 3,
"rowSpan": 4,
"colSpan": 3
"x": 1,
"y": 2
}
},
{
"position": {
"x": 5,
"y": 5,
"colSpan": 6,
"rowSpan": 6,
"colSpan": 6
"x": 5,
"y": 5
}
}
]
Expand All @@ -35,42 +33,48 @@
],
"metadata": {
"metadata": {
"X": 4,
"Y": 3,
"ColSpan": 2,
"RowSpan": 1,
"ColSpan": 2
"X": 4,
"Y": 3
}
}
},
"location": "eastus",
"tags": {
"aKey": "aValue",
"anotherKey": "anotherValue"
}
}
},
"dashboardName": "testDashboard",
"resourceGroupName": "testRG",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"201": {
"200": {
"body": {
"name": "testDashboard",
"type": "Microsoft.Portal/dashboards",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard",
"location": "eastus",
"properties": {
"lenses": [
{
"order": 1,
"parts": [
{
"position": {
"x": 1,
"y": 2,
"colSpan": 3,
"rowSpan": 4,
"colSpan": 3
"x": 1,
"y": 2
}
},
{
"position": {
"x": 5,
"y": 5,
"colSpan": 6,
"rowSpan": 6,
"colSpan": 6
"x": 5,
"y": 5
}
}
]
Expand All @@ -82,44 +86,44 @@
],
"metadata": {
"metadata": {
"X": 4,
"Y": 3,
"ColSpan": 2,
"RowSpan": 1,
"ColSpan": 2
"X": 4,
"Y": 3
}
}
},
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard",
"name": "testDashboard",
"type": "Microsoft.Portal/dashboards",
"location": "eastus",
"tags": {
"aKey": "aValue",
"anotherKey": "anotherValue"
}
}
},
"200": {
"201": {
"body": {
"name": "testDashboard",
"type": "Microsoft.Portal/dashboards",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard",
"location": "eastus",
"properties": {
"lenses": [
{
"order": 1,
"parts": [
{
"position": {
"x": 1,
"y": 2,
"colSpan": 3,
"rowSpan": 4,
"colSpan": 3
"x": 1,
"y": 2
}
},
{
"position": {
"x": 5,
"y": 5,
"colSpan": 6,
"rowSpan": 6,
"colSpan": 6
"x": 5,
"y": 5
}
}
]
Expand All @@ -131,22 +135,20 @@
],
"metadata": {
"metadata": {
"X": 4,
"Y": 3,
"ColSpan": 2,
"RowSpan": 1,
"ColSpan": 2
"X": 4,
"Y": 3
}
}
},
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard",
"name": "testDashboard",
"type": "Microsoft.Portal/dashboards",
"location": "eastus",
"tags": {
"aKey": "aValue",
"anotherKey": "anotherValue"
}
}
}
}
},
"operationId": "Dashboards_CreateOrUpdate",
"title": "Create or update a Dashboard"
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"parameters": {
"api-version": "2020-09-01-preview",
"dashboardName": "testDashboard",
"resourceGroupName": "testRG",
"api-version": "2020-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {},
"204": {}
}
},
"operationId": "Dashboards_Delete",
"title": "Delete a Dashboard"
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
{
"parameters": {
"api-version": "2020-09-01-preview",
"dashboardName": "testDashboard",
"resourceGroupName": "testRG",
"api-version": "2020-09-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
"body": {
"name": "testDashboard",
"type": "Microsoft.Portal/dashboards",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard",
"location": "eastus",
"properties": {
"lenses": [
{
"order": 1,
"parts": [
{
"position": {
"x": 1,
"y": 2,
"colSpan": 3,
"rowSpan": 4,
"colSpan": 3
"x": 1,
"y": 2
}
},
{
"position": {
"x": 5,
"y": 5,
"colSpan": 6,
"rowSpan": 6,
"colSpan": 6
"x": 5,
"y": 5
}
}
]
Expand All @@ -38,23 +42,20 @@
],
"metadata": {
"metadata": {
"X": 4,
"Y": 3,
"ColSpan": 2,
"RowSpan": 1,
"ColSpan": 2
"X": 4,
"Y": 3
}
}
},
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Portal/dashboards/testDashboard",
"name": "testDashboard",
"type": "Microsoft.Portal/dashboards",
"location": "eastus",
"tags": {
"aKey": "aValue",
"anotherKey": "anotherValue"
}
}
},
"404": {}
}
}
},
"operationId": "Dashboards_Get",
"title": "Get a Dashboard"
}
Loading