공유 대시보드 업데이트하기
https://api.datadoghq.com/api/v1/dashboard/public/{token}https://api.us3.datadoghq.com/api/v1/dashboard/public/{token}https://api.us5.datadoghq.com/api/v1/dashboard/public/{token}https://api.datadoghq.eu/api/v1/dashboard/public/{token}https://api.ap1.datadoghq.com/api/v1/dashboard/public/{token}https://api.ap2.datadoghq.com/api/v1/dashboard/public/{token}https://api.uk1.datadoghq.com/api/v1/dashboard/public/{token}https://api.ddog-gov.com/api/v1/dashboard/public/{token}https://api.us2.ddog-gov.com/api/v1/dashboard/public/{token}개요
지정된 토큰과 연결된 공유 대시보드를 업데이트합니다.
This endpoint requires any of the following permissions:
dashboards_public_sharedashboards_embed_sharedashboards_invite_share
OAuth apps require one of the following authorization scopes to access this endpoint: dashboards_public_share, dashboards_embed_share, dashboards_invite_share.
인수
경로 파라미터
token [required]The token of the shared dashboard.
요청
Body Data (required)
대시보드 업데이트 요청 본문입니다.
embeddable_domains공유 대시보드의 설정을 업데이트합니다.
expirationThe time when an OPEN shared dashboard becomes publicly unavailable.
global_timeTimeframe setting for the shared dashboard.
live_spanDashboard global time live_span selection
15m, 1h, 4h, 1d, 2d, 1w, 1mo, 3moglobal_time_selectable_enabledWhether to allow viewers to select a different global time setting for the shared dashboard.
inviteesThe SharedDashboard invitees.
access_expirationTime of the invitee expiration. Null means the invite will not expire.
email [required]Email of the invitee.
selectable_template_varsList of objects representing template variables on the shared dashboard which can have selectable values.
default_valueThe default value of the template variable.
nameName of the template variable.
prefixThe tag/attribute key associated with the template variable.
typeThe type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
visible_tagsList of visible tag values on the shared dashboard.
share_listDEPRECATED List of email addresses that can be given access to the shared dashboard.
share_typeType of sharing access (either open to anyone who has the public URL or invite-only).
open, invite, embedstatusActive means the dashboard is publicly available. Paused means the dashboard is not publicly available.
active, pausedtitleTitle of the shared dashboard.
viewing_preferencesThe viewing preferences for a shared dashboard.
high_densityWhether the widgets on the shared dashboard should be displayed with high density.
themeThe theme of the shared dashboard view. "system" follows your system's default viewing theme.
system, light, darkUpdate a shared dashboard returns "OK" response
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}Update a shared dashboard with selectable_template_vars returns "OK" response
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}응답
OK
The metadata object associated with how a dashboard has been/will be shared.
authorUser who shared the dashboard.
handleIdentifier of the user who shared the dashboard.
nameName of the user who shared the dashboard.
createdDate the dashboard was shared.
dashboard_id [required]ID of the dashboard to share.
dashboard_type [required]The type of the associated private dashboard.
custom_timeboard, custom_screenboardembeddable_domainsThe SharedDashboard embeddable_domains.
expirationThe time when an OPEN shared dashboard becomes publicly unavailable.
global_timeObject containing the live span selection for the dashboard.
live_spanDashboard global time live_span selection
15m, 1h, 4h, 1d, 2d, 1w, 1mo, 3moglobal_time_selectable_enabledWhether to allow viewers to select a different global time setting for the shared dashboard.
inviteesThe SharedDashboard invitees.
access_expirationTime of the invitee expiration. Null means the invite will not expire.
created_atTime that the invitee was created.
email [required]Email of the invitee.
last_accessedThe last time the shared dashboard was accessed. Null if never accessed.
public_urlURL of the shared dashboard.
selectable_template_varsList of objects representing template variables on the shared dashboard which can have selectable values.
default_valueThe default value of the template variable.
nameName of the template variable.
prefixThe tag/attribute key associated with the template variable.
typeThe type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
visible_tagsList of visible tag values on the shared dashboard.
share_listDEPRECATED List of email addresses that can receive an invitation to access to the shared dashboard.
share_typeType of sharing access (either open to anyone who has the public URL or invite-only).
open, invite, embedstatusActive means the dashboard is publicly available. Paused means the dashboard is not publicly available.
active, pausedtitleTitle of the shared dashboard.
tokenA unique token assigned to the shared dashboard.
viewing_preferencesThe viewing preferences for a shared dashboard.
high_densityWhether the widgets on the shared dashboard should be displayed with high density.
themeThe theme of the shared dashboard view. "system" follows your system's default viewing theme.
system, light, dark{
"author": {
"handle": "test@datadoghq.com",
"name": "string"
},
"created": "2019-09-19T10:00:00.000Z",
"dashboard_id": "123-abc-456",
"dashboard_type": "custom_timeboard",
"embeddable_domains": [
"https://domain.atlassian.net/",
"http://myserver.com/"
],
"expiration": "2019-09-19T10:00:00.000Z",
"global_time": {
"live_span": "1h"
},
"global_time_selectable_enabled": false,
"invitees": [
{
"access_expiration": "2019-09-19T10:00:00.000Z",
"created_at": "2019-09-19T10:00:00.000Z",
"email": "test@datadoghq.com"
}
],
"last_accessed": "2019-09-19T10:00:00.000Z",
"public_url": "string",
"selectable_template_vars": [
{
"default_value": "*",
"name": "exampleVar",
"prefix": "test",
"type": "string",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
],
"share_list": [
"test@datadoghq.com",
"test2@email.com"
],
"share_type": "string",
"status": "active",
"title": "string",
"token": "string",
"viewing_preferences": {
"high_density": false,
"theme": "string"
}
}Bad Request
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Authentication Error
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Item Not Found
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}Too many requests
Error response object.
errors [required]Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}코드 예시
Update a shared dashboard returns "OK" response
# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open"
}
EOFUpdate a shared dashboard with selectable_template_vars returns "OK" response
# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOF# Path parameters
export token="CHANGE_ME"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X PUT "https://api.${DD_SITE}/api/v1/dashboard/public/${token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"global_time": {
"live_span": "15m"
},
"share_list": [],
"share_type": "open",
"selectable_template_vars": [
{
"default_value": "*",
"name": "group_by_var",
"type": "group",
"visible_tags": [
"selectableValue1",
"selectableValue2"
]
}
]
}
EOFUpdate a shared dashboard returns "OK" response
// Update a shared dashboard returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
// there is a valid "shared_dashboard" in the system
SharedDashboardToken := os.Getenv("SHARED_DASHBOARD_TOKEN")
body := datadogV1.SharedDashboardUpdateRequest{
GlobalTime: *datadogV1.NewNullableSharedDashboardUpdateRequestGlobalTime(&datadogV1.SharedDashboardUpdateRequestGlobalTime{
LiveSpan: datadogV1.DASHBOARDGLOBALTIMELIVESPAN_PAST_FIFTEEN_MINUTES.Ptr(),
}),
ShareList: *datadog.NewNullableList(&[]string{}),
ShareType: *datadogV1.NewNullableDashboardShareType(datadogV1.DASHBOARDSHARETYPE_OPEN.Ptr()),
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewDashboardsApi(apiClient)
resp, r, err := api.UpdatePublicDashboard(ctx, SharedDashboardToken, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.UpdatePublicDashboard`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.UpdatePublicDashboard`:\n%s\n", responseContent)
}
Update a shared dashboard with selectable_template_vars returns "OK" response
// Update a shared dashboard with selectable_template_vars returns "OK" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)
func main() {
// there is a valid "shared_dashboard" in the system
SharedDashboardToken := os.Getenv("SHARED_DASHBOARD_TOKEN")
body := datadogV1.SharedDashboardUpdateRequest{
GlobalTime: *datadogV1.NewNullableSharedDashboardUpdateRequestGlobalTime(&datadogV1.SharedDashboardUpdateRequestGlobalTime{
LiveSpan: datadogV1.DASHBOARDGLOBALTIMELIVESPAN_PAST_FIFTEEN_MINUTES.Ptr(),
}),
ShareList: *datadog.NewNullableList(&[]string{}),
ShareType: *datadogV1.NewNullableDashboardShareType(datadogV1.DASHBOARDSHARETYPE_OPEN.Ptr()),
SelectableTemplateVars: []datadogV1.SelectableTemplateVariableItems{
{
DefaultValue: datadog.PtrString("*"),
Name: datadog.PtrString("group_by_var"),
Type: *datadog.NewNullableString(datadog.PtrString("group")),
VisibleTags: *datadog.NewNullableList(&[]string{
"selectableValue1",
"selectableValue2",
}),
},
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV1.NewDashboardsApi(apiClient)
resp, r, err := api.UpdatePublicDashboard(ctx, SharedDashboardToken, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DashboardsApi.UpdatePublicDashboard`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `DashboardsApi.UpdatePublicDashboard`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"Update a shared dashboard returns "OK" response
// Update a shared dashboard returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.DashboardsApi;
import com.datadog.api.client.v1.model.DashboardGlobalTimeLiveSpan;
import com.datadog.api.client.v1.model.DashboardShareType;
import com.datadog.api.client.v1.model.SharedDashboard;
import com.datadog.api.client.v1.model.SharedDashboardUpdateRequest;
import com.datadog.api.client.v1.model.SharedDashboardUpdateRequestGlobalTime;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
// there is a valid "shared_dashboard" in the system
String SHARED_DASHBOARD_TOKEN = System.getenv("SHARED_DASHBOARD_TOKEN");
SharedDashboardUpdateRequest body =
new SharedDashboardUpdateRequest()
.globalTime(
new SharedDashboardUpdateRequestGlobalTime()
.liveSpan(DashboardGlobalTimeLiveSpan.PAST_FIFTEEN_MINUTES))
.shareType(DashboardShareType.OPEN);
try {
SharedDashboard result = apiInstance.updatePublicDashboard(SHARED_DASHBOARD_TOKEN, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DashboardsApi#updatePublicDashboard");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Update a shared dashboard with selectable_template_vars returns "OK" response
// Update a shared dashboard with selectable_template_vars returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.DashboardsApi;
import com.datadog.api.client.v1.model.DashboardGlobalTimeLiveSpan;
import com.datadog.api.client.v1.model.DashboardShareType;
import com.datadog.api.client.v1.model.SelectableTemplateVariableItems;
import com.datadog.api.client.v1.model.SharedDashboard;
import com.datadog.api.client.v1.model.SharedDashboardUpdateRequest;
import com.datadog.api.client.v1.model.SharedDashboardUpdateRequestGlobalTime;
import java.util.Arrays;
import java.util.Collections;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
DashboardsApi apiInstance = new DashboardsApi(defaultClient);
// there is a valid "shared_dashboard" in the system
String SHARED_DASHBOARD_TOKEN = System.getenv("SHARED_DASHBOARD_TOKEN");
SharedDashboardUpdateRequest body =
new SharedDashboardUpdateRequest()
.globalTime(
new SharedDashboardUpdateRequestGlobalTime()
.liveSpan(DashboardGlobalTimeLiveSpan.PAST_FIFTEEN_MINUTES))
.shareType(DashboardShareType.OPEN)
.selectableTemplateVars(
Collections.singletonList(
new SelectableTemplateVariableItems()
.defaultValue("*")
.name("group_by_var")
.type("group")
.visibleTags(Arrays.asList("selectableValue1", "selectableValue2"))));
try {
SharedDashboard result = apiInstance.updatePublicDashboard(SHARED_DASHBOARD_TOKEN, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DashboardsApi#updatePublicDashboard");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"Update a shared dashboard returns "OK" response
"""
Update a shared dashboard returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard_global_time_live_span import DashboardGlobalTimeLiveSpan
from datadog_api_client.v1.model.dashboard_share_type import DashboardShareType
from datadog_api_client.v1.model.shared_dashboard_update_request import SharedDashboardUpdateRequest
from datadog_api_client.v1.model.shared_dashboard_update_request_global_time import (
SharedDashboardUpdateRequestGlobalTime,
)
# there is a valid "shared_dashboard" in the system
SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"]
body = SharedDashboardUpdateRequest(
global_time=SharedDashboardUpdateRequestGlobalTime(
live_span=DashboardGlobalTimeLiveSpan.PAST_FIFTEEN_MINUTES,
),
share_list=[],
share_type=DashboardShareType.OPEN,
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = DashboardsApi(api_client)
response = api_instance.update_public_dashboard(token=SHARED_DASHBOARD_TOKEN, body=body)
print(response)
Update a shared dashboard with selectable_template_vars returns "OK" response
"""
Update a shared dashboard with selectable_template_vars returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.dashboards_api import DashboardsApi
from datadog_api_client.v1.model.dashboard_global_time_live_span import DashboardGlobalTimeLiveSpan
from datadog_api_client.v1.model.dashboard_share_type import DashboardShareType
from datadog_api_client.v1.model.selectable_template_variable_items import SelectableTemplateVariableItems
from datadog_api_client.v1.model.shared_dashboard_update_request import SharedDashboardUpdateRequest
from datadog_api_client.v1.model.shared_dashboard_update_request_global_time import (
SharedDashboardUpdateRequestGlobalTime,
)
# there is a valid "shared_dashboard" in the system
SHARED_DASHBOARD_TOKEN = environ["SHARED_DASHBOARD_TOKEN"]
body = SharedDashboardUpdateRequest(
global_time=SharedDashboardUpdateRequestGlobalTime(
live_span=DashboardGlobalTimeLiveSpan.PAST_FIFTEEN_MINUTES,
),
share_list=[],
share_type=DashboardShareType.OPEN,
selectable_template_vars=[
SelectableTemplateVariableItems(
default_value="*",
name="group_by_var",
type="group",
visible_tags=[
"selectableValue1",
"selectableValue2",
],
),
],
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = DashboardsApi(api_client)
response = api_instance.update_public_dashboard(token=SHARED_DASHBOARD_TOKEN, body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"Update a shared dashboard returns "OK" response
# Update a shared dashboard returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
# there is a valid "shared_dashboard" in the system
SHARED_DASHBOARD_TOKEN = ENV["SHARED_DASHBOARD_TOKEN"]
body = DatadogAPIClient::V1::SharedDashboardUpdateRequest.new({
global_time: DatadogAPIClient::V1::SharedDashboardUpdateRequestGlobalTime.new({
live_span: DatadogAPIClient::V1::DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES,
}),
share_list: [],
share_type: DatadogAPIClient::V1::DashboardShareType::OPEN,
})
p api_instance.update_public_dashboard(SHARED_DASHBOARD_TOKEN, body)
Update a shared dashboard with selectable_template_vars returns "OK" response
# Update a shared dashboard with selectable_template_vars returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V1::DashboardsAPI.new
# there is a valid "shared_dashboard" in the system
SHARED_DASHBOARD_TOKEN = ENV["SHARED_DASHBOARD_TOKEN"]
body = DatadogAPIClient::V1::SharedDashboardUpdateRequest.new({
global_time: DatadogAPIClient::V1::SharedDashboardUpdateRequestGlobalTime.new({
live_span: DatadogAPIClient::V1::DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES,
}),
share_list: [],
share_type: DatadogAPIClient::V1::DashboardShareType::OPEN,
selectable_template_vars: [
DatadogAPIClient::V1::SelectableTemplateVariableItems.new({
default_value: "*",
name: "group_by_var",
type: "group",
visible_tags: [
"selectableValue1",
"selectableValue2",
],
}),
],
})
p api_instance.update_public_dashboard(SHARED_DASHBOARD_TOKEN, body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"Update a shared dashboard returns "OK" response
// Update a shared dashboard returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI;
use datadog_api_client::datadogV1::model::DashboardGlobalTimeLiveSpan;
use datadog_api_client::datadogV1::model::DashboardShareType;
use datadog_api_client::datadogV1::model::SharedDashboardUpdateRequest;
use datadog_api_client::datadogV1::model::SharedDashboardUpdateRequestGlobalTime;
#[tokio::main]
async fn main() {
// there is a valid "shared_dashboard" in the system
let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
let body = SharedDashboardUpdateRequest::new()
.global_time(Some(
SharedDashboardUpdateRequestGlobalTime::new()
.live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
))
.share_list(Some(vec![]))
.share_type(Some(DashboardShareType::OPEN));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api
.update_public_dashboard(shared_dashboard_token.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Update a shared dashboard with selectable_template_vars returns "OK" response
// Update a shared dashboard with selectable_template_vars returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_dashboards::DashboardsAPI;
use datadog_api_client::datadogV1::model::DashboardGlobalTimeLiveSpan;
use datadog_api_client::datadogV1::model::DashboardShareType;
use datadog_api_client::datadogV1::model::SelectableTemplateVariableItems;
use datadog_api_client::datadogV1::model::SharedDashboardUpdateRequest;
use datadog_api_client::datadogV1::model::SharedDashboardUpdateRequestGlobalTime;
#[tokio::main]
async fn main() {
// there is a valid "shared_dashboard" in the system
let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
let body = SharedDashboardUpdateRequest::new()
.global_time(Some(
SharedDashboardUpdateRequestGlobalTime::new()
.live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
))
.selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
.default_value("*".to_string())
.name("group_by_var".to_string())
.type_(Some("group".to_string()))
.visible_tags(Some(vec![
"selectableValue1".to_string(),
"selectableValue2".to_string(),
]))]))
.share_list(Some(vec![]))
.share_type(Some(DashboardShareType::OPEN));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api
.update_public_dashboard(shared_dashboard_token.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runUpdate a shared dashboard returns "OK" response
/**
* Update a shared dashboard returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v1.DashboardsApi(configuration);
// there is a valid "shared_dashboard" in the system
const SHARED_DASHBOARD_TOKEN = process.env.SHARED_DASHBOARD_TOKEN as string;
const params: v1.DashboardsApiUpdatePublicDashboardRequest = {
body: {
globalTime: {
liveSpan: "15m",
},
shareList: [],
shareType: "open",
},
token: SHARED_DASHBOARD_TOKEN,
};
apiInstance
.updatePublicDashboard(params)
.then((data: v1.SharedDashboard) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Update a shared dashboard with selectable_template_vars returns "OK" response
/**
* Update a shared dashboard with selectable_template_vars returns "OK" response
*/
import { client, v1 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v1.DashboardsApi(configuration);
// there is a valid "shared_dashboard" in the system
const SHARED_DASHBOARD_TOKEN = process.env.SHARED_DASHBOARD_TOKEN as string;
const params: v1.DashboardsApiUpdatePublicDashboardRequest = {
body: {
globalTime: {
liveSpan: "15m",
},
shareList: [],
shareType: "open",
selectableTemplateVars: [
{
defaultValue: "*",
name: "group_by_var",
type: "group",
visibleTags: ["selectableValue1", "selectableValue2"],
},
],
},
token: SHARED_DASHBOARD_TOKEN,
};
apiInstance
.updatePublicDashboard(params)
.then((data: v1.SharedDashboard) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"