Delete a change request decision

Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.

DELETE https://api.ap1.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}https://api.ap2.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}https://api.datadoghq.eu/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}https://api.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}https://api.us2.ddog-gov.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}https://api.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}https://api.us3.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}https://api.us5.datadoghq.com/api/v2/change-management/change-request/{change_request_id}/decisions/{decision_id}

Overview

Delete a decision from a change request.

OAuth apps require the cases_write authorization scope to access this endpoint.

Arguments

Path Parameters

Name

Type

Description

change_request_id [required]

string

The identifier of the change request.

decision_id [required]

string

The identifier of the change request decision.

Response

OK

Response object for a change request.

Expand All

Field

Type

Description

data [required]

object

Data object for a change request response.

attributes [required]

object

Attributes of a change request response.

archived_at

date-time

Timestamp of when the change request was archived.

attributes [required]

object

Custom attributes of the change request as key-value pairs.

<any-key>

[string]

change_request_linked_incident_uuid [required]

string

The UUID of the linked incident.

change_request_maintenance_window_query [required]

string

The maintenance window query for the change request.

change_request_plan [required]

string

The plan associated with the change request.

change_request_risk [required]

enum

The risk level of the change request. Allowed enum values: UNDEFINED,LOW,MEDIUM,HIGH

change_request_type [required]

enum

The type of the change request. Allowed enum values: NORMAL,STANDARD,EMERGENCY

closed_at

date-time

Timestamp of when the change request was closed.

created_at [required]

date-time

Timestamp of when the change request was created.

creation_source [required]

string

The source from which the change request was created.

description [required]

string

The description of the change request.

end_date

date-time

The planned end date of the change request.

key [required]

string

The human-readable key of the change request.

modified_at [required]

date-time

Timestamp of when the change request was last modified.

plan_notebook_id [required]

int64

The notebook ID associated with the change request plan.

priority [required]

string

The priority of the change request.

project_id [required]

string

The project UUID associated with the change request.

start_date

date-time

The planned start date of the change request.

status [required]

string

The current status of the change request.

title [required]

string

The title of the change request.

type [required]

string

The case type.

id [required]

string

The identifier of the change request.

relationships

object

Relationships of a change request.

change_request_decisions [required]

object

Relationship to change request decisions.

data [required]

[object]

Array of decision relationship data.

id [required]

string

The decision UUID.

type [required]

enum

Change request decision resource type. Allowed enum values: change_request_decision

created_by [required]

object

Relationship to a user.

data [required]

object

User relationship data.

id [required]

string

The user UUID.

type [required]

string

The user resource type.

modified_by [required]

object

Relationship to a user.

data [required]

object

User relationship data.

id [required]

string

The user UUID.

type [required]

string

The user resource type.

type [required]

enum

Change request resource type. Allowed enum values: change_request

included

[ <oneOf>]

Included resources related to the change request.

Option 1

object

An included user resource.

attributes [required]

object

Attributes of an included user.

email [required]

string

The email of the user.

handle [required]

string

The handle of the user.

name [required]

string

The name of the user.

id [required]

string

The user UUID.

type [required]

string

The resource type.

Option 2

object

An included change request decision resource.

attributes [required]

object

Attributes of a change request decision in a response.

change_request_status [required]

enum

The status of a change request decision. Allowed enum values: REQUESTED,APPROVED,DECLINED

decided_at [required]

date-time

Timestamp of when the decision was made.

decision_reason [required]

string

The reason for the decision.

deleted_at [required]

date-time

Timestamp of when the decision was deleted.

request_reason [required]

string

The reason for requesting the decision.

requested_at [required]

date-time

Timestamp of when the decision was requested.

id [required]

string

The decision UUID.

relationships

object

Relationships of a change request decision.

modified_by [required]

object

Relationship to a user.

data [required]

object

User relationship data.

id [required]

string

The user UUID.

type [required]

string

The user resource type.

requested_by_user [required]

object

Relationship to a user.

data [required]

object

User relationship data.

id [required]

string

The user UUID.

type [required]

string

The user resource type.

requested_user [required]

object

Relationship to a user.

data [required]

object

User relationship data.

id [required]

string

The user UUID.

type [required]

string

The user resource type.

type [required]

enum

Change request decision resource type. Allowed enum values: change_request_decision

{
  "data": {
    "attributes": {
      "archived_at": "2019-09-19T10:00:00.000Z",
      "attributes": {
        "<any-key>": []
      },
      "change_request_linked_incident_uuid": "",
      "change_request_maintenance_window_query": "",
      "change_request_plan": "",
      "change_request_risk": "LOW",
      "change_request_type": "NORMAL",
      "closed_at": "2019-09-19T10:00:00.000Z",
      "created_at": "2024-01-01T00:00:00Z",
      "creation_source": "CS_MANUAL",
      "description": "Deploying new payment service v2.1",
      "end_date": "2024-01-02T15:00:00Z",
      "key": "CHM-1234",
      "modified_at": "2024-01-01T00:00:00Z",
      "plan_notebook_id": 0,
      "priority": "NOT_DEFINED",
      "project_id": "d4bbe1af-f36e-42f1-87c1-493ca35c320e",
      "start_date": "2024-01-01T03:00:00Z",
      "status": "OPEN",
      "title": "Deploy new payment service",
      "type": "CHANGE_REQUEST"
    },
    "id": "CHM-1234",
    "relationships": {
      "change_request_decisions": {
        "data": [
          {
            "id": "decision-id-0",
            "type": "change_request_decision"
          }
        ]
      },
      "created_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      },
      "modified_by": {
        "data": {
          "id": "00000000-0000-0000-0000-000000000000",
          "type": "user"
        }
      }
    },
    "type": "change_request"
  },
  "included": [
    {
      "attributes": {
        "email": "john.doe@example.com",
        "handle": "john.doe@example.com",
        "name": "John Doe"
      },
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "user"
    }
  ]
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short 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.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short 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.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Path parameters
export change_request_id="CHM-1234"
export decision_id="decision-id-0"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/change-management/change-request/${change_request_id}/decisions/${decision_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete a change request decision returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.change_management_api import ChangeManagementApi

configuration = Configuration()
configuration.unstable_operations["delete_change_request_decision"] = True
with ApiClient(configuration) as api_client:
    api_instance = ChangeManagementApi(api_client)
    response = api_instance.delete_change_request_decision(
        change_request_id="change_request_id",
        decision_id="decision_id",
    )

    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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Delete a change request decision returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.delete_change_request_decision".to_sym] = true
end
api_instance = DatadogAPIClient::V2::ChangeManagementAPI.new
p api_instance.delete_change_request_decision("change_request_id", "decision_id")

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Delete a change request decision 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"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.DeleteChangeRequestDecision", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewChangeManagementApi(apiClient)
	resp, r, err := api.DeleteChangeRequestDecision(ctx, "change_request_id", "decision_id")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ChangeManagementApi.DeleteChangeRequestDecision`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `ChangeManagementApi.DeleteChangeRequestDecision`:\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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Delete a change request decision returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ChangeManagementApi;
import com.datadog.api.client.v2.model.ChangeRequestResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.deleteChangeRequestDecision", true);
    ChangeManagementApi apiInstance = new ChangeManagementApi(defaultClient);

    try {
      ChangeRequestResponse result =
          apiInstance.deleteChangeRequestDecision("CHM-1234", "decision-id-0");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ChangeManagementApi#deleteChangeRequestDecision");
      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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Delete a change request decision returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_change_management::ChangeManagementAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.DeleteChangeRequestDecision", true);
    let api = ChangeManagementAPI::with_config(configuration);
    let resp = api
        .delete_change_request_decision("change_request_id".to_string(), "decision_id".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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Delete a change request decision returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteChangeRequestDecision"] = true;
const apiInstance = new v2.ChangeManagementApi(configuration);

const params: v2.ChangeManagementApiDeleteChangeRequestDecisionRequest = {
  changeRequestId: "change_request_id",
  decisionId: "decision_id",
};

apiInstance
  .deleteChangeRequestDecision(params)
  .then((data: v2.ChangeRequestResponse) => {
    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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"