Revert App
https://api.datadoghq.com/api/v2/app-builder/apps/{app_id}/reverthttps://api.us3.datadoghq.com/api/v2/app-builder/apps/{app_id}/reverthttps://api.us5.datadoghq.com/api/v2/app-builder/apps/{app_id}/reverthttps://api.datadoghq.eu/api/v2/app-builder/apps/{app_id}/reverthttps://api.ap1.datadoghq.com/api/v2/app-builder/apps/{app_id}/reverthttps://api.ap2.datadoghq.com/api/v2/app-builder/apps/{app_id}/reverthttps://api.uk1.datadoghq.com/api/v2/app-builder/apps/{app_id}/reverthttps://api.ddog-gov.com/api/v2/app-builder/apps/{app_id}/reverthttps://api.us2.ddog-gov.com/api/v2/app-builder/apps/{app_id}/revertDescripción general
Revert an app to a previous version. The version to revert to is selected through the version query parameter. The reverted version becomes the new latest version of the app.
Argumentos
Parámetros de ruta
app_id [required]The ID of the app.
Cadenas de consulta
version [required]The version number of the app to revert to. Cannot be latest. The special value deployed can be used to revert to the currently published version.
Respuesta
OK
The response object after an app is successfully updated.
dataThe data object containing the updated app definition.
attributes [required]The updated app definition attributes, such as name, description, and components.
componentsThe UI components that make up the app.
eventsEvents to listen for on the grid component.
nameThe triggering action for the event.
pageChange, tableRowClick, _tableRowButtonClick, change, submit, click, toggleOpen, close, open, executionFinishedtypeThe response to the event.
custom, setComponentState, triggerQuery, openModal, closeModal, openUrl, downloadFile, setStateVariableValueidThe ID of the grid component. This property is deprecated; use name to identify individual components instead.
name [required]A unique identifier for this grid component. This name is also visible in the app editor.
properties [required]Properties of a grid component.
backgroundColorThe background color of the grid.
defaultchildrenThe child components of the grid.
eventsEvents to listen for on the UI component.
nameThe triggering action for the event.
pageChange, tableRowClick, _tableRowButtonClick, change, submit, click, toggleOpen, close, open, executionFinishedtypeThe response to the event.
custom, setComponentState, triggerQuery, openModal, closeModal, openUrl, downloadFile, setStateVariableValueidThe ID of the UI component. This property is deprecated; use name to identify individual components instead.
name [required]A unique identifier for this UI component. This name is also visible in the app editor.
properties [required]Properties of a UI component. Different component types can have their own additional unique properties. See the components documentation for more detail on each component type and its properties.
childrenThe child components of the UI component.
isVisibleWhether the UI component is visible. If this is a string, it must be a valid JavaScript expression that evaluates to a boolean.
Object 1Object 2If this is a string, it must be a valid JavaScript expression that evaluates to a boolean.
type [required]The UI component type.
table, textInput, textArea, button, text, select, modal, schemaForm, checkbox, tabsShow 10 more
vegaChart, radioButtons, numberInput, fileInput, jsonInput, gridCell, dateRangePicker, search, container, calloutValueisVisibleWhether the grid component and its children are visible. If a string, it must be a valid JavaScript expression that evaluates to a boolean.
Object 1Object 2truetype [required]The grid component type.
gridgriddescriptionThe human-readable description for the app.
favoriteWhether the app is marked as a favorite by the current user.
nameThe name of the app.
queriesAn array of queries, such as external actions and state variables, that the app uses.
<type=action>An action query. This query type is used to trigger an action, such as sending a HTTP request.
eventsEvents to listen for downstream of the action query.
nameThe triggering action for the event.
pageChange, tableRowClick, _tableRowButtonClick, change, submit, click, toggleOpen, close, open, executionFinishedtypeThe response to the event.
custom, setComponentState, triggerQuery, openModal, closeModal, openUrl, downloadFile, setStateVariableValueid [required]The ID of the action query.
name [required]A unique identifier for this action query. This name is also used to access the query's result throughout the app.
properties [required]The properties of the action query.
conditionWhether to run this query. If specified, the query will only run if this condition evaluates to true in JavaScript and all other conditions are also met.
Object 1Object 2debounceInMsThe minimum time in milliseconds that must pass before the query can be triggered again. This is useful for preventing accidental double-clicks from triggering the query multiple times.
Object 1Object 2If this is a string, it must be a valid JavaScript expression that evaluates to a number.
mockedOutputsThe mocked outputs of the action query. This is useful for testing the app without actually running the action.
Object 1Object 2The mocked outputs of the action query.
enabled [required]Whether to enable the mocked outputs for testing.
Object 1Object 2If this is a string, it must be a valid JavaScript expression that evaluates to a boolean.
outputsThe mocked outputs of the action query, serialized as JSON.
onlyTriggerManuallyDetermines when this query is executed. If set to false, the query will run when the app loads and whenever any query arguments change. If set to true, the query will only run when manually triggered from elsewhere in the app.
Object 1Object 2If this is a string, it must be a valid JavaScript expression that evaluates to a boolean.
outputsThe post-query transformation function, which is a JavaScript function that changes the query's .outputs property after the query's execution.
pollingIntervalInMsIf specified, the app will poll the query at the specified interval in milliseconds. The minimum polling interval is 15 seconds. The query will only poll when the app's browser tab is active.
Object 1Object 2If this is a string, it must be a valid JavaScript expression that evaluates to a number.
requiresConfirmationWhether to prompt the user to confirm this query before it runs.
Object 1Object 2If this is a string, it must be a valid JavaScript expression that evaluates to a boolean.
showToastOnErrorWhether to display a toast to the user when the query returns an error.
Object 1Object 2If this is a string, it must be a valid JavaScript expression that evaluates to a boolean.
spec [required]The definition of the action query.
Object 1Object 2The action query spec object.
connectionGroupThe connection group to use for an action query.
idThe ID of the connection group.
tagsThe tags of the connection group.
connectionIdThe ID of the custom connection to use for this action query.
fqn [required]The fully qualified name of the action type.
inputsThe inputs to the action query. These are the values that are passed to the action when it is triggered.
Object 1Object 2The inputs to the action query. See the Actions Catalog for more detail on each action and its inputs.
type [required]The action query type.
actionaction<type=dataTransform>A data transformer, which is custom JavaScript code that executes and transforms data when its inputs change.
id [required]The ID of the data transformer.
name [required]A unique identifier for this data transformer. This name is also used to access the transformer's result throughout the app.
properties [required]The properties of the data transformer.
outputsA JavaScript function that returns the transformed data.
type [required]The data transform type.
dataTransformdataTransform<type=stateVariable>A variable, which can be set and read by other components in the app.
id [required]The ID of the state variable.
name [required]A unique identifier for this state variable. This name is also used to access the variable's value throughout the app.
properties [required]The properties of the state variable.
defaultValueThe default value of the state variable.
type [required]The state variable type.
stateVariablestateVariablerootInstanceNameThe name of the root component of the app. This must be a grid component that contains all other components.
tagsA list of tags for the app, which can be used to filter apps.
id [required]The ID of the updated app.
type [required]The app definition type.
appDefinitionsappDefinitionsincludedData on the version of the app that was published.
attributesThe attributes object containing the version ID of the published app.
app_version_idThe version ID of the app that was published. For an unpublished app, this is always the nil UUID (00000000-0000-0000-0000-000000000000).
idThe deployment ID.
metaMetadata object containing the publication creation information.
created_atTimestamp of when the app was published.
user_idThe ID of the user who published the app.
user_nameThe name (or email address) of the user who published the app.
user_uuidThe UUID of the user who published the app.
typeThe deployment type.
deploymentdeploymentmetaMetadata of an app.
created_atTimestamp of when the app was created.
deleted_atTimestamp of when the app was deleted.
org_idThe Datadog organization ID that owns the app.
updated_atTimestamp of when the app was last updated.
updated_since_deploymentWhether the app was updated since it was last published. Published apps are pinned to a specific version and do not automatically update when the app is updated.
user_idThe ID of the user who created the app.
user_nameThe name (or email address) of the user who created the app.
user_uuidThe UUID of the user who created the app.
versionThe version number of the app. This starts at 1 and increments with each update.
relationshipThe app's publication relationship and custom connections.
connectionsArray of custom connections used by the app.
attributesThe custom connection attributes.
nameThe name of the custom connection.
onPremRunnerInformation about the Private Action Runner used by the custom connection, if the custom connection is associated with a Private Action Runner.
idThe Private Action Runner ID.
urlThe URL of the Private Action Runner.
idThe ID of the custom connection.
typeThe custom connection type.
custom_connectionscustom_connectionsdeploymentInformation pointing to the app's publication status.
dataData object containing the deployment ID.
idThe deployment ID.
typeThe deployment type.
deploymentdeploymentmetaMetadata object containing the publication creation information.
created_atTimestamp of when the app was published.
user_idThe ID of the user who published the app.
user_nameThe name (or email address) of the user who published the app.
user_uuidThe UUID of the user who published the app.
{
"data": {
"attributes": {
"components": [
{
"events": [
{
"name": "click",
"type": "triggerQuery"
}
],
"id": "string",
"name": "",
"properties": {
"backgroundColor": "string",
"children": [
{
"events": [
{
"name": "click",
"type": "triggerQuery"
}
],
"id": "string",
"name": "",
"properties": {
"children": [],
"isVisible": {
"type": "undefined"
}
},
"type": "text"
}
],
"isVisible": {
"type": "undefined"
}
},
"type": "grid"
}
],
"description": "string",
"favorite": false,
"name": "string",
"queries": [
{
"events": [
{
"name": "click",
"type": "triggerQuery"
}
],
"id": "65bb1f25-52e1-4510-9f8d-22d1516ed693",
"name": "fetchPendingOrders",
"properties": {
"condition": {
"type": "undefined"
},
"debounceInMs": {
"example": "undefined",
"format": "undefined",
"type": "undefined"
},
"mockedOutputs": {
"type": "undefined"
},
"onlyTriggerManually": {
"type": "undefined"
},
"outputs": "${((outputs) => {return outputs.body.data})(self.rawOutputs)}",
"pollingIntervalInMs": {
"example": "undefined",
"format": "undefined",
"minimum": "undefined",
"type": "undefined"
},
"requiresConfirmation": {
"type": "undefined"
},
"showToastOnError": {
"type": "undefined"
},
"spec": {
"type": ""
}
},
"type": "action"
}
],
"rootInstanceName": "string",
"tags": [
"service:webshop-backend",
"team:webshop"
]
},
"id": "65bb1f25-52e1-4510-9f8d-22d1516ed693",
"type": "appDefinitions"
},
"included": [
{
"attributes": {
"app_version_id": "65bb1f25-52e1-4510-9f8d-22d1516ed693"
},
"id": "65bb1f25-52e1-4510-9f8d-22d1516ed693",
"meta": {
"created_at": "2019-09-19T10:00:00.000Z",
"user_id": "integer",
"user_name": "string",
"user_uuid": "65bb1f25-52e1-4510-9f8d-22d1516ed693"
},
"type": "deployment"
}
],
"meta": {
"created_at": "2019-09-19T10:00:00.000Z",
"deleted_at": "2019-09-19T10:00:00.000Z",
"org_id": "integer",
"updated_at": "2019-09-19T10:00:00.000Z",
"updated_since_deployment": false,
"user_id": "integer",
"user_name": "string",
"user_uuid": "65bb1f25-52e1-4510-9f8d-22d1516ed693",
"version": "integer"
},
"relationship": {
"connections": [
{
"attributes": {
"name": "string",
"onPremRunner": {
"id": "string",
"url": "string"
}
},
"id": "65bb1f25-52e1-4510-9f8d-22d1516ed693",
"type": "custom_connections"
}
],
"deployment": {
"data": {
"id": "65bb1f25-52e1-4510-9f8d-22d1516ed693",
"type": "deployment"
},
"meta": {
"created_at": "2019-09-19T10:00:00.000Z",
"user_id": "integer",
"user_name": "string",
"user_uuid": "65bb1f25-52e1-4510-9f8d-22d1516ed693"
}
}
}
}Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Forbidden
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Not Found
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Ejemplo de código
# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Path parameters
export app_id="65bb1f25-52e1-4510-9f8d-22d1516ed693"
# Required query arguments
export version="2"
# 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 POST "https://api.${DD_SITE}/api/v2/app-builder/apps/${app_id}/revert?version=${version}" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"// Revert App 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/datadogV2"
"github.com/google/uuid"
)
func main() {
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewAppBuilderApi(apiClient)
resp, r, err := api.RevertApp(ctx, uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), "version")
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AppBuilderApi.RevertApp`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `AppBuilderApi.RevertApp`:\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"// Revert App returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.AppBuilderApi;
import com.datadog.api.client.v2.model.UpdateAppResponse;
import java.util.UUID;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
AppBuilderApi apiInstance = new AppBuilderApi(defaultClient);
try {
UpdateAppResponse result =
apiInstance.revertApp(UUID.fromString("65bb1f25-52e1-4510-9f8d-22d1516ed693"), "2");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AppBuilderApi#revertApp");
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""""
Revert App returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.app_builder_api import AppBuilderApi
from uuid import UUID
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = AppBuilderApi(api_client)
response = api_instance.revert_app(
app_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
version="version",
)
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"# Revert App returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::AppBuilderAPI.new
p api_instance.revert_app("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "version")
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"// Revert App returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_app_builder::AppBuilderAPI;
use uuid::Uuid;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = AppBuilderAPI::with_config(configuration);
let resp = api
.revert_app(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
"version".to_string(),
)
.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="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run/**
* Revert App returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
const apiInstance = new v2.AppBuilderApi(configuration);
const params: v2.AppBuilderApiRevertAppRequest = {
appId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
version: "version",
};
apiInstance
.revertApp(params)
.then((data: v2.UpdateAppResponse) => {
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"