Skip to content

Update sharing APIs to match server #2067

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
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-24 14:19:09.982374",
"spec_repo_commit": "b34a35ef"
"regenerated": "2025-02-25 17:19:34.286623",
"spec_repo_commit": "7b09d7dd"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-24 14:19:09.997906",
"spec_repo_commit": "b34a35ef"
"regenerated": "2025-02-25 17:19:34.302231",
"spec_repo_commit": "7b09d7dd"
}
}
}
131 changes: 128 additions & 3 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1451,11 +1451,13 @@ components:
enum:
- open
- invite
- embed
nullable: true
type: string
x-enum-varnames:
- OPEN
- INVITE
- EMBED
DashboardSummary:
description: Dashboard summary response.
properties:
Expand Down Expand Up @@ -13047,7 +13049,7 @@ components:
properties:
author:
$ref: '#/components/schemas/SharedDashboardAuthor'
created_at:
created:
description: Date the dashboard was shared.
format: date-time
readOnly: true
Expand All @@ -13058,13 +13060,44 @@ components:
type: string
dashboard_type:
$ref: '#/components/schemas/DashboardType'
embeddable_domains:
description: The `SharedDashboard` `embeddable_domains`.
example:
- https://domain.atlassian.net/
- http://myserver.com/
items:
description: The allowlisted referrers for an EMBED shared dashboard.
type: string
type: array
expiration:
description: The time when an OPEN shared dashboard becomes publicly unavailable.
format: date-time
nullable: true
type: string
global_time:
$ref: '#/components/schemas/DashboardGlobalTime'
global_time_selectable_enabled:
description: Whether to allow viewers to select a different global time
setting for the shared dashboard.
nullable: true
type: boolean
invitees:
description: The `SharedDashboard` `invitees`.
example:
- access_expiration: '2030-01-01T12:00:00.00Z'
email: test@datadoghq.com
- access_expiration: null
email: test2@datadoghq.com
items:
$ref: '#/components/schemas/SharedDashboardInviteesItems'
type: array
last_accessed:
description: The last time the shared dashboard was accessed. Null if never
accessed.
format: date-time
nullable: true
readOnly: true
type: string
public_url:
description: URL of the shared dashboard.
readOnly: true
Expand All @@ -13084,6 +13117,7 @@ components:
nullable: true
type: array
share_list:
deprecated: true
description: List of email addresses that can receive an invitation to access
to the shared dashboard.
example:
Expand All @@ -13097,10 +13131,17 @@ components:
type: array
share_type:
$ref: '#/components/schemas/DashboardShareType'
status:
$ref: '#/components/schemas/SharedDashboardStatus'
title:
description: Title of the shared dashboard.
type: string
token:
description: A unique token assigned to the shared dashboard.
readOnly: true
type: string
viewing_preferences:
$ref: '#/components/schemas/ViewingPreferences'
required:
- dashboard_id
- dashboard_type
Expand All @@ -13120,6 +13161,27 @@ components:
type: string
readOnly: true
type: object
SharedDashboardInviteesItems:
description: The allowlisted invitees for an INVITE-only shared dashboard.
properties:
access_expiration:
description: Time of the invitee expiration. Null means the invite will
not expire.
format: date-time
nullable: true
type: string
created_at:
description: Time that the invitee was created.
format: date-time
readOnly: true
type: string
email:
description: Email of the invitee.
example: test@datadoghq.com
type: string
required:
- email
type: object
SharedDashboardInvites:
description: Invitations data and metadata that exists for a shared dashboard
returned by the API.
Expand Down Expand Up @@ -13236,6 +13298,17 @@ components:
format: int64
type: integer
type: object
SharedDashboardStatus:
description: Active means the dashboard is publicly available. Paused means
the dashboard is not publicly available.
enum:
- active
- paused
example: active
type: string
x-enum-varnames:
- ACTIVE
- PAUSED
SharedDashboardUpdateRequest:
description: Update a shared dashboard's settings.
example:
Expand All @@ -13246,13 +13319,37 @@ components:
- test2@datadoghq.com
share_type: invite
properties:
embeddable_domains:
description: The `SharedDashboard` `embeddable_domains`.
example:
- https://domain.atlassian.net/
- http://myserver.com/
items:
description: The allowlisted referrers for an EMBED shared dashboard.
type: string
type: array
expiration:
description: The time when an OPEN shared dashboard becomes publicly unavailable.
format: date-time
nullable: true
type: string
global_time:
$ref: '#/components/schemas/SharedDashboardUpdateRequestGlobalTime'
global_time_selectable_enabled:
description: Whether to allow viewers to select a different global time
setting for the shared dashboard.
nullable: true
type: boolean
invitees:
description: The `SharedDashboard` `invitees`.
example:
- access_expiration: '2030-01-01T12:00:00.00Z'
email: test@datadoghq.com
- access_expiration: null
email: test2@datadoghq.com
items:
$ref: '#/components/schemas/SharedDashboardInviteesItems'
type: array
selectable_template_vars:
description: List of objects representing template variables on the shared
dashboard which can have selectable values.
Expand All @@ -13268,6 +13365,7 @@ components:
nullable: true
type: array
share_list:
deprecated: true
description: List of email addresses that can be given access to the shared
dashboard.
example:
Expand All @@ -13281,8 +13379,13 @@ components:
type: array
share_type:
$ref: '#/components/schemas/DashboardShareType'
required:
- global_time
status:
$ref: '#/components/schemas/SharedDashboardStatus'
title:
description: Title of the shared dashboard.
type: string
viewing_preferences:
$ref: '#/components/schemas/ViewingPreferences'
type: object
SharedDashboardUpdateRequestGlobalTime:
description: Timeframe setting for the shared dashboard.
Expand Down Expand Up @@ -22710,6 +22813,28 @@ components:
example: 0
format: int64
type: integer
ViewingPreferences:
description: The viewing preferences for a shared dashboard.
properties:
high_density:
description: Whether the widgets on the shared dashboard should be displayed
with high density.
type: boolean
theme:
$ref: '#/components/schemas/ViewingPreferencesTheme'
type: object
ViewingPreferencesTheme:
description: The theme of the shared dashboard view. "system" follows your system's
default viewing theme.
enum:
- system
- light
- dark
type: string
x-enum-varnames:
- SYSTEM
- LIGHT
- DARK
WebhooksIntegration:
description: Datadog-Webhooks integration.
properties:
Expand Down
36 changes: 18 additions & 18 deletions features/v1/dashboards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -936,21 +936,21 @@ Feature: Dashboards
And the response "widgets[0].definition.time.unit" is equal to "minute"
And the response "widgets[0].definition.time.value" is equal to 8

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Create a shared dashboard returns "Bad Request" response
Given new "CreatePublicDashboard" request
And body with value {"dashboard_id": "123-abc-456", "dashboard_type": "custom_timeboard", "global_time": {"live_span": "1h"}, "global_time_selectable_enabled": null, "selectable_template_vars": [{"default_value": "*", "name": "exampleVar", "prefix": "test", "visible_tags": ["selectableValue1", "selectableValue2"]}], "share_list": ["test@datadoghq.com", "test2@email.com"], "share_type": "open"}
And body with value {"dashboard_id": "123-abc-456", "dashboard_type": "custom_timeboard", "embeddable_domains": ["https://domain.atlassian.net/", "http://myserver.com/"], "expiration": null, "global_time": {"live_span": "1h"}, "global_time_selectable_enabled": null, "invitees": [{"access_expiration": "2030-01-01T12:00:00.00Z", "email": "test@datadoghq.com"}, {"access_expiration": null, "email": "test2@datadoghq.com"}], "selectable_template_vars": [{"default_value": "*", "name": "exampleVar", "prefix": "test", "visible_tags": ["selectableValue1", "selectableValue2"]}], "share_list": ["test@datadoghq.com", "test2@email.com"], "share_type": "open", "status": "active", "viewing_preferences": {"theme": "system"}}
When the request is sent
Then the response status is 400 Bad Request

@team:DataDog/dashboards-backend
@team:DataDog/reporting-and-sharing
Scenario: Create a shared dashboard returns "Dashboard Not Found" response
Given new "CreatePublicDashboard" request
And body with value {"dashboard_id": "abc-123-def", "dashboard_type": "custom_timeboard", "share_type": "open", "global_time": {"live_span": "1h"}}
When the request is sent
Then the response status is 404 Dashboard Not Found

@team:DataDog/dashboards-backend
@team:DataDog/reporting-and-sharing
Scenario: Create a shared dashboard returns "OK" response
Given there is a valid "dashboard" in the system
And new "CreatePublicDashboard" request
Expand Down Expand Up @@ -1023,7 +1023,7 @@ Feature: Dashboards
Then the response status is 200 OK
And the response "author_name" is equal to "Frog Account"

@team:DataDog/dashboards-backend
@team:DataDog/reporting-and-sharing
Scenario: Get a shared dashboard returns "OK" response
Given there is a valid "dashboard" in the system
And there is a valid "shared_dashboard" in the system
Expand All @@ -1034,7 +1034,7 @@ Feature: Dashboards
And the response "dashboard_id" has the same value as "dashboard.id"
And the response "token" has the same value as "shared_dashboard.token"

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Get a shared dashboard returns "Shared Dashboard Not Found" response
Given new "GetPublicDashboard" request
And request contains "token" parameter from "REPLACE.ME"
Expand All @@ -1059,14 +1059,14 @@ Feature: Dashboards
Then the response status is 200 OK
And the response has 3 items

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Get all invitations for a shared dashboard returns "Not Found" response
Given new "GetPublicDashboardInvitations" request
And request contains "token" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/dashboards-backend
@team:DataDog/reporting-and-sharing
Scenario: Get all invitations for a shared dashboard returns "OK" response
Given there is a valid "dashboard" in the system
And there is a valid "shared_dashboard" in the system
Expand Down Expand Up @@ -1110,53 +1110,53 @@ Feature: Dashboards
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Revoke a shared dashboard URL returns "OK" response
Given new "DeletePublicDashboard" request
And request contains "token" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Revoke a shared dashboard URL returns "Shared Dashboard Not Found" response
Given new "DeletePublicDashboard" request
And request contains "token" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Shared Dashboard Not Found

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Revoke shared dashboard invitations returns "Not Found" response
Given new "DeletePublicDashboardInvitation" request
And request contains "token" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"email": "test@datadoghq.com"}, "type": "public_dashboard_invitation"}]}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Revoke shared dashboard invitations returns "OK" response
Given new "DeletePublicDashboardInvitation" request
And request contains "token" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"email": "test@datadoghq.com"}, "type": "public_dashboard_invitation"}]}
When the request is sent
Then the response status is 204 OK

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Send shared dashboard invitation email returns "Bad Request" response
Given new "SendPublicDashboardInvitation" request
And request contains "token" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"email": "test@datadoghq.com"}, "type": "public_dashboard_invitation"}]}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Send shared dashboard invitation email returns "Not Found" response
Given new "SendPublicDashboardInvitation" request
And request contains "token" parameter from "REPLACE.ME"
And body with value {"data": [{"attributes": {"email": "test@datadoghq.com"}, "type": "public_dashboard_invitation"}]}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/dashboards-backend
@team:DataDog/reporting-and-sharing
Scenario: Send shared dashboard invitation email returns "OK" response
Given there is a valid "dashboard" in the system
And there is a valid "shared_dashboard" in the system
Expand Down Expand Up @@ -1204,23 +1204,23 @@ Feature: Dashboards
Then the response status is 200 OK
And the response "tags" is equal to ["team:foo", "team:bar"]

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Update a shared dashboard returns "Bad Request" response
Given new "UpdatePublicDashboard" request
And request contains "token" parameter from "REPLACE.ME"
And body with value {"global_time": {"live_span": "1h"}, "share_list": ["test@datadoghq.com", "test2@datadoghq.com"], "share_type": "invite"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/dashboards-backend
@generated @skip @team:DataDog/reporting-and-sharing
Scenario: Update a shared dashboard returns "Item Not Found" response
Given new "UpdatePublicDashboard" request
And request contains "token" parameter from "REPLACE.ME"
And body with value {"global_time": {"live_span": "1h"}, "share_list": ["test@datadoghq.com", "test2@datadoghq.com"], "share_type": "invite"}
When the request is sent
Then the response status is 404 Item Not Found

@team:DataDog/dashboards-backend
@team:DataDog/reporting-and-sharing
Scenario: Update a shared dashboard returns "OK" response
Given there is a valid "dashboard" in the system
And there is a valid "shared_dashboard" in the system
Expand Down
Loading