Edit maintenance update

PATCH https://api.ap1.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}https://api.ap2.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}https://api.datadoghq.eu/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}https://api.ddog-gov.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}https://api.us2.ddog-gov.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}https://api.uk1.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}https://api.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}https://api.us3.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}https://api.us5.datadoghq.com/api/v2/statuspages/{page_id}/maintenances/{maintenance_id}/updates/{update_id}

Overview

Edits the message of a specific maintenance update. Editing is allowed regardless of the parent maintenance’s status, including completed and canceled maintenances. This endpoint requires the status_pages_incident_write permission.

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

Arguments

Path Parameters

Name

Type

Description

page_id [required]

string

The ID of the status page.

maintenance_id [required]

string

The ID of the maintenance.

update_id [required]

string

The ID of the maintenance update.

Request

Body Data (required)

Expand All

Field

Type

Description

data

object

The data object for editing a maintenance update.

attributes

object

Attributes for editing a maintenance update.

description

string

The message body of the update.

id [required]

string

The ID of the maintenance update to edit. Must match the update_id path parameter.

type [required]

enum

Maintenance updates resource type. Allowed enum values: maintenance_updates

default: maintenance_updates

{
  "data": {
    "attributes": {
      "description": ""
    },
    "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
    "type": "maintenance_updates"
  }
}

Response

OK

Response object for a maintenance update.

Expand All

Field

Type

Description

data

object

The data object for a maintenance update.

attributes

object

Attributes of a maintenance update resource.

components_affected

[object]

Components affected at the time of the update.

id [required]

uuid

The ID of the component. Must be a component of type component.

name

string

The name of the component.

status [required]

enum

The status of the component. Allowed enum values: operational,maintenance

created_at

date-time

The date and time the update was created.

description

string

The message body of the update.

manual_transition

boolean

Whether the update was applied manually by a user (true) or automatically by the system (false).

modified_at

date-time

The date and time the update was last modified.

started_at

date-time

The date and time the update started.

status

enum

The status of the maintenance update. Allowed enum values: scheduled,in_progress,completed,canceled

id [required]

uuid

The ID of the maintenance update.

relationships

object

Relationships of a maintenance update resource.

created_by_user

object

A user relationship of a maintenance update.

data [required]

object

The data object identifying a Datadog user linked to a maintenance update.

id [required]

uuid

The ID of the Datadog user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

last_modified_by_user

object

A user relationship of a maintenance update.

data [required]

object

The data object identifying a Datadog user linked to a maintenance update.

id [required]

uuid

The ID of the Datadog user.

type [required]

enum

Users resource type. Allowed enum values: users

default: users

maintenance

object

The parent maintenance of the update.

data [required]

object

The maintenance linked to a maintenance update.

id [required]

uuid

The ID of the maintenance.

type [required]

enum

Maintenances resource type. Allowed enum values: maintenances

default: maintenances

type [required]

enum

Maintenance updates resource type. Allowed enum values: maintenance_updates

default: maintenance_updates

{
  "data": {
    "attributes": {
      "components_affected": [
        {
          "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
          "name": "string",
          "status": "operational"
        }
      ],
      "created_at": "2019-09-19T10:00:00.000Z",
      "description": "string",
      "manual_transition": false,
      "modified_at": "2019-09-19T10:00:00.000Z",
      "started_at": "2019-09-19T10:00:00.000Z",
      "status": "string"
    },
    "id": "1234abcd-12ab-34cd-56ef-123456abcdef",
    "relationships": {
      "created_by_user": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "last_modified_by_user": {
        "data": {
          "id": "",
          "type": "users"
        }
      },
      "maintenance": {
        "data": {
          "id": "",
          "type": "maintenances"
        }
      }
    },
    "type": "maintenance_updates"
  }
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

                  ## default
# 

# Path parameters
export page_id="CHANGE_ME"
export maintenance_id="CHANGE_ME"
export update_id="CHANGE_ME"
# Curl command
curl -X PATCH "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.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/statuspages/${page_id}/maintenances/${maintenance_id}/updates/${update_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "description": "We have completed maintenance on the API to improve performance." }, "id": "00000000-0000-0000-0000-000000000000", "type": "maintenance_updates" } } EOF
"""
Edit maintenance update returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.status_pages_api import StatusPagesApi
from datadog_api_client.v2.model.patch_maintenance_update_request import PatchMaintenanceUpdateRequest
from datadog_api_client.v2.model.patch_maintenance_update_request_data import PatchMaintenanceUpdateRequestData
from datadog_api_client.v2.model.patch_maintenance_update_request_data_attributes import (
    PatchMaintenanceUpdateRequestDataAttributes,
)
from datadog_api_client.v2.model.patch_maintenance_update_request_data_type import PatchMaintenanceUpdateRequestDataType
from uuid import UUID

body = PatchMaintenanceUpdateRequest(
    data=PatchMaintenanceUpdateRequestData(
        attributes=PatchMaintenanceUpdateRequestDataAttributes(
            description="We have completed maintenance on the API to improve performance.",
        ),
        id="00000000-0000-0000-0000-000000000000",
        type=PatchMaintenanceUpdateRequestDataType.MAINTENANCE_UPDATES,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = StatusPagesApi(api_client)
    response = api_instance.patch_maintenance_update(
        page_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
        maintenance_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
        update_id=UUID("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
        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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" python3 "example.py"
# Edit maintenance update returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::StatusPagesAPI.new

body = DatadogAPIClient::V2::PatchMaintenanceUpdateRequest.new({
  data: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestData.new({
    attributes: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestDataAttributes.new({
      description: "We have completed maintenance on the API to improve performance.",
    }),
    id: "00000000-0000-0000-0000-000000000000",
    type: DatadogAPIClient::V2::PatchMaintenanceUpdateRequestDataType::MAINTENANCE_UPDATES,
  }),
})
p api_instance.patch_maintenance_update("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body)

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.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" rb "example.rb"
// Edit maintenance update 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() {
	body := datadogV2.PatchMaintenanceUpdateRequest{
		Data: &datadogV2.PatchMaintenanceUpdateRequestData{
			Attributes: &datadogV2.PatchMaintenanceUpdateRequestDataAttributes{
				Description: datadog.PtrString("We have completed maintenance on the API to improve performance."),
			},
			Id:   "00000000-0000-0000-0000-000000000000",
			Type: datadogV2.PATCHMAINTENANCEUPDATEREQUESTDATATYPE_MAINTENANCE_UPDATES,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewStatusPagesApi(apiClient)
	resp, r, err := api.PatchMaintenanceUpdate(ctx, uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), uuid.MustParse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), body)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `StatusPagesApi.PatchMaintenanceUpdate`:\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.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" go run "main.go"
// Edit maintenance update returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.StatusPagesApi;
import com.datadog.api.client.v2.model.MaintenanceUpdate;
import com.datadog.api.client.v2.model.PatchMaintenanceUpdateRequest;
import com.datadog.api.client.v2.model.PatchMaintenanceUpdateRequestData;
import com.datadog.api.client.v2.model.PatchMaintenanceUpdateRequestDataAttributes;
import com.datadog.api.client.v2.model.PatchMaintenanceUpdateRequestDataType;
import java.util.UUID;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    StatusPagesApi apiInstance = new StatusPagesApi(defaultClient);

    PatchMaintenanceUpdateRequest body =
        new PatchMaintenanceUpdateRequest()
            .data(
                new PatchMaintenanceUpdateRequestData()
                    .attributes(
                        new PatchMaintenanceUpdateRequestDataAttributes()
                            .description(
                                "We have completed maintenance on the API to improve performance."))
                    .id("00000000-0000-0000-0000-000000000000")
                    .type(PatchMaintenanceUpdateRequestDataType.MAINTENANCE_UPDATES));

    try {
      MaintenanceUpdate result =
          apiInstance.patchMaintenanceUpdate(
              UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
              UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
              UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
              body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling StatusPagesApi#patchMaintenanceUpdate");
      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.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"
// Edit maintenance update returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
use datadog_api_client::datadogV2::model::PatchMaintenanceUpdateRequest;
use datadog_api_client::datadogV2::model::PatchMaintenanceUpdateRequestData;
use datadog_api_client::datadogV2::model::PatchMaintenanceUpdateRequestDataAttributes;
use datadog_api_client::datadogV2::model::PatchMaintenanceUpdateRequestDataType;
use uuid::Uuid;

#[tokio::main]
async fn main() {
    let body = PatchMaintenanceUpdateRequest::new().data(
        PatchMaintenanceUpdateRequestData::new(
            "00000000-0000-0000-0000-000000000000".to_string(),
            PatchMaintenanceUpdateRequestDataType::MAINTENANCE_UPDATES,
        )
        .attributes(
            PatchMaintenanceUpdateRequestDataAttributes::new().description(
                "We have completed maintenance on the API to improve performance.".to_string(),
            ),
        ),
    );
    let configuration = datadog::Configuration::new();
    let api = StatusPagesAPI::with_config(configuration);
    let resp = api
        .patch_maintenance_update(
            Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
            Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
            Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
            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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
/**
 * Edit maintenance update returns "OK" response
 */

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

const configuration = client.createConfiguration();
const apiInstance = new v2.StatusPagesApi(configuration);

const params: v2.StatusPagesApiPatchMaintenanceUpdateRequest = {
  body: {
    data: {
      attributes: {
        description:
          "We have completed maintenance on the API to improve performance.",
      },
      id: "00000000-0000-0000-0000-000000000000",
      type: "maintenance_updates",
    },
  },
  pageId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
  maintenanceId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
  updateId: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
};

apiInstance
  .patchMaintenanceUpdate(params)
  .then((data: v2.MaintenanceUpdate) => {
    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.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" tsc "example.ts"