이 페이지는 아직 영어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

서비스 레벨 목표 수정

SLO 상태 수정 기능을 이용하면 특정 시간대에 SLO 상태와 오류 예산에 부정적인 영향이 발생하는 것을 예방할 수 있습니다. 계획된 유지 보수 시간, 비즈니스 외 시간, 또는 실제 오류가 발생하지 않을 시간대 등 다양한 목적으로 상태 수정 기능을 사용할 수 있습니다. 자세한 내용은 SLO 상태 수정을 참고하세요.

POST https://api.ap1.datadoghq.com/api/v1/slo/correctionhttps://api.datadoghq.eu/api/v1/slo/correctionhttps://api.ddog-gov.com/api/v1/slo/correctionhttps://api.datadoghq.com/api/v1/slo/correctionhttps://api.us3.datadoghq.com/api/v1/slo/correctionhttps://api.us5.datadoghq.com/api/v1/slo/correction

개요

Create an SLO Correction. This endpoint requires the slos_corrections permission.

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

요청

Body Data (required)

Create an SLO Correction

Expand All

항목

유형

설명

data

object

The data object associated with the SLO correction to be created.

attributes

object

The attribute object associated with the SLO correction to be created.

category [required]

enum

Category the SLO correction belongs to. Allowed enum values: Scheduled Maintenance,Outside Business Hours,Deployment,Other

description

string

Description of the correction being made.

duration

int64

Length of time (in seconds) for a specified rrule recurring SLO correction.

end

int64

Ending time of the correction in epoch seconds.

rrule

string

The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections are FREQ, INTERVAL, COUNT, UNTIL and BYDAY.

slo_id [required]

string

ID of the SLO that this correction applies to.

start [required]

int64

Starting time of the correction in epoch seconds.

timezone

string

The timezone to display in the UI for the correction times (defaults to "UTC").

type [required]

enum

SLO correction resource type. Allowed enum values: correction

default: correction

{
  "data": {
    "attributes": {
      "category": "Scheduled Maintenance",
      "description": "Example-Service-Level-Objective-Correction",
      "end": 1636632671,
      "slo_id": "string",
      "start": 1636629071,
      "timezone": "UTC"
    },
    "type": "correction"
  }
}
{
  "data": {
    "attributes": {
      "category": "Scheduled Maintenance",
      "description": "Example-Service-Level-Objective-Correction",
      "slo_id": "string",
      "start": 1636629071,
      "duration": 3600,
      "rrule": "FREQ=DAILY;INTERVAL=10;COUNT=5",
      "timezone": "UTC"
    },
    "type": "correction"
  }
}

응답

OK

The response object of an SLO correction.

Expand All

항목

유형

설명

data

object

The response object of a list of SLO corrections.

attributes

object

The attribute object associated with the SLO correction.

category

enum

Category the SLO correction belongs to. Allowed enum values: Scheduled Maintenance,Outside Business Hours,Deployment,Other

created_at

int64

The epoch timestamp of when the correction was created at.

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

description

string

Description of the correction being made.

duration

int64

Length of time (in seconds) for a specified rrule recurring SLO correction.

end

int64

Ending time of the correction in epoch seconds.

modified_at

int64

The epoch timestamp of when the correction was modified at.

modifier

object

Modifier of the object.

email

string

Email of the Modifier.

handle

string

Handle of the Modifier.

name

string

Name of the Modifier.

rrule

string

The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections are FREQ, INTERVAL, COUNT, UNTIL and BYDAY.

slo_id

string

ID of the SLO that this correction applies to.

start

int64

Starting time of the correction in epoch seconds.

timezone

string

The timezone to display in the UI for the correction times (defaults to "UTC").

id

string

The ID of the SLO correction.

type

enum

SLO correction resource type. Allowed enum values: correction

default: correction

{
  "data": {
    "attributes": {
      "category": "Scheduled Maintenance",
      "created_at": "integer",
      "creator": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "description": "string",
      "duration": 3600,
      "end": "integer",
      "modified_at": "integer",
      "modifier": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "rrule": "FREQ=DAILY;INTERVAL=10;COUNT=5",
      "slo_id": "string",
      "start": "integer",
      "timezone": "string"
    },
    "id": "string",
    "type": "correction"
  }
}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

SLO Not Found

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Create an SLO correction returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.ServiceLevelObjectiveCorrectionsApi;
import com.datadog.api.client.v1.model.SLOCorrectionCategory;
import com.datadog.api.client.v1.model.SLOCorrectionCreateData;
import com.datadog.api.client.v1.model.SLOCorrectionCreateRequest;
import com.datadog.api.client.v1.model.SLOCorrectionCreateRequestAttributes;
import com.datadog.api.client.v1.model.SLOCorrectionResponse;
import com.datadog.api.client.v1.model.SLOCorrectionType;
import java.time.OffsetDateTime;

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

    // there is a valid "slo" in the system
    String SLO_DATA_0_ID = System.getenv("SLO_DATA_0_ID");

    SLOCorrectionCreateRequest body =
        new SLOCorrectionCreateRequest()
            .data(
                new SLOCorrectionCreateData()
                    .attributes(
                        new SLOCorrectionCreateRequestAttributes()
                            .category(SLOCorrectionCategory.SCHEDULED_MAINTENANCE)
                            .description("Example-Service-Level-Objective-Correction")
                            .end(OffsetDateTime.now().plusHours(1).toInstant().getEpochSecond())
                            .sloId(SLO_DATA_0_ID)
                            .start(OffsetDateTime.now().toInstant().getEpochSecond())
                            .timezone("UTC"))
                    .type(SLOCorrectionType.CORRECTION));

    try {
      SLOCorrectionResponse result = apiInstance.createSLOCorrection(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceLevelObjectiveCorrectionsApi#createSLOCorrection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}
// Create an SLO correction with rrule returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.ServiceLevelObjectiveCorrectionsApi;
import com.datadog.api.client.v1.model.SLOCorrectionCategory;
import com.datadog.api.client.v1.model.SLOCorrectionCreateData;
import com.datadog.api.client.v1.model.SLOCorrectionCreateRequest;
import com.datadog.api.client.v1.model.SLOCorrectionCreateRequestAttributes;
import com.datadog.api.client.v1.model.SLOCorrectionResponse;
import com.datadog.api.client.v1.model.SLOCorrectionType;
import java.time.OffsetDateTime;

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

    // there is a valid "slo" in the system
    String SLO_DATA_0_ID = System.getenv("SLO_DATA_0_ID");

    SLOCorrectionCreateRequest body =
        new SLOCorrectionCreateRequest()
            .data(
                new SLOCorrectionCreateData()
                    .attributes(
                        new SLOCorrectionCreateRequestAttributes()
                            .category(SLOCorrectionCategory.SCHEDULED_MAINTENANCE)
                            .description("Example-Service-Level-Objective-Correction")
                            .sloId(SLO_DATA_0_ID)
                            .start(OffsetDateTime.now().toInstant().getEpochSecond())
                            .duration(3600L)
                            .rrule("FREQ=DAILY;INTERVAL=10;COUNT=5")
                            .timezone("UTC"))
                    .type(SLOCorrectionType.CORRECTION));

    try {
      SLOCorrectionResponse result = apiInstance.createSLOCorrection(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceLevelObjectiveCorrectionsApi#createSLOCorrection");
      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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"

GET https://api.ap1.datadoghq.com/api/v1/slo/correctionhttps://api.datadoghq.eu/api/v1/slo/correctionhttps://api.ddog-gov.com/api/v1/slo/correctionhttps://api.datadoghq.com/api/v1/slo/correctionhttps://api.us3.datadoghq.com/api/v1/slo/correctionhttps://api.us5.datadoghq.com/api/v1/slo/correction

개요

Get all Service Level Objective corrections. This endpoint requires the slos_read permission.

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

인수

쿼리 문자열

이름

유형

설명

offset

integer

The specific offset to use as the beginning of the returned response.

limit

integer

The number of SLO corrections to return in the response. Default is 25.

응답

OK

A list of SLO correction objects.

Expand All

항목

유형

설명

data

[object]

The list of SLO corrections objects.

attributes

object

The attribute object associated with the SLO correction.

category

enum

Category the SLO correction belongs to. Allowed enum values: Scheduled Maintenance,Outside Business Hours,Deployment,Other

created_at

int64

The epoch timestamp of when the correction was created at.

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

description

string

Description of the correction being made.

duration

int64

Length of time (in seconds) for a specified rrule recurring SLO correction.

end

int64

Ending time of the correction in epoch seconds.

modified_at

int64

The epoch timestamp of when the correction was modified at.

modifier

object

Modifier of the object.

email

string

Email of the Modifier.

handle

string

Handle of the Modifier.

name

string

Name of the Modifier.

rrule

string

The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections are FREQ, INTERVAL, COUNT, UNTIL and BYDAY.

slo_id

string

ID of the SLO that this correction applies to.

start

int64

Starting time of the correction in epoch seconds.

timezone

string

The timezone to display in the UI for the correction times (defaults to "UTC").

id

string

The ID of the SLO correction.

type

enum

SLO correction resource type. Allowed enum values: correction

default: correction

meta

object

Object describing meta attributes of response.

page

object

Pagination object.

total_count

int64

Total count.

total_filtered_count

int64

Total count of elements matched by the filter.

{
  "data": [
    {
      "attributes": {
        "category": "Scheduled Maintenance",
        "created_at": "integer",
        "creator": {
          "email": "string",
          "handle": "string",
          "name": "string"
        },
        "description": "string",
        "duration": 3600,
        "end": "integer",
        "modified_at": "integer",
        "modifier": {
          "email": "string",
          "handle": "string",
          "name": "string"
        },
        "rrule": "FREQ=DAILY;INTERVAL=10;COUNT=5",
        "slo_id": "string",
        "start": "integer",
        "timezone": "string"
      },
      "id": "string",
      "type": "correction"
    }
  ],
  "meta": {
    "page": {
      "total_count": "integer",
      "total_filtered_count": "integer"
    }
  }
}

Forbidden

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Get all SLO corrections returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.ServiceLevelObjectiveCorrectionsApi;
import com.datadog.api.client.v1.api.ServiceLevelObjectiveCorrectionsApi.ListSLOCorrectionOptionalParameters;
import com.datadog.api.client.v1.model.SLOCorrectionListResponse;

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

    try {
      SLOCorrectionListResponse result =
          apiInstance.listSLOCorrection(
              new ListSLOCorrectionOptionalParameters().offset(1L).limit(1L));
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceLevelObjectiveCorrectionsApi#listSLOCorrection");
      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.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" java "Example.java"

GET https://api.ap1.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.datadoghq.eu/api/v1/slo/correction/{slo_correction_id}https://api.ddog-gov.com/api/v1/slo/correction/{slo_correction_id}https://api.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.us3.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.us5.datadoghq.com/api/v1/slo/correction/{slo_correction_id}

개요

Get an SLO correction.

인수

경로 파라미터

이름

유형

설명

slo_correction_id [required]

string

The ID of the SLO correction object.

응답

OK

The response object of an SLO correction.

Expand All

항목

유형

설명

data

object

The response object of a list of SLO corrections.

attributes

object

The attribute object associated with the SLO correction.

category

enum

Category the SLO correction belongs to. Allowed enum values: Scheduled Maintenance,Outside Business Hours,Deployment,Other

created_at

int64

The epoch timestamp of when the correction was created at.

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

description

string

Description of the correction being made.

duration

int64

Length of time (in seconds) for a specified rrule recurring SLO correction.

end

int64

Ending time of the correction in epoch seconds.

modified_at

int64

The epoch timestamp of when the correction was modified at.

modifier

object

Modifier of the object.

email

string

Email of the Modifier.

handle

string

Handle of the Modifier.

name

string

Name of the Modifier.

rrule

string

The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections are FREQ, INTERVAL, COUNT, UNTIL and BYDAY.

slo_id

string

ID of the SLO that this correction applies to.

start

int64

Starting time of the correction in epoch seconds.

timezone

string

The timezone to display in the UI for the correction times (defaults to "UTC").

id

string

The ID of the SLO correction.

type

enum

SLO correction resource type. Allowed enum values: correction

default: correction

{
  "data": {
    "attributes": {
      "category": "Scheduled Maintenance",
      "created_at": "integer",
      "creator": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "description": "string",
      "duration": 3600,
      "end": "integer",
      "modified_at": "integer",
      "modifier": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "rrule": "FREQ=DAILY;INTERVAL=10;COUNT=5",
      "slo_id": "string",
      "start": "integer",
      "timezone": "string"
    },
    "id": "string",
    "type": "correction"
  }
}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Get an SLO correction for an SLO returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.ServiceLevelObjectiveCorrectionsApi;
import com.datadog.api.client.v1.model.SLOCorrectionResponse;

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

    // there is a valid "correction" for "slo"
    String CORRECTION_DATA_ID = System.getenv("CORRECTION_DATA_ID");

    try {
      SLOCorrectionResponse result = apiInstance.getSLOCorrection(CORRECTION_DATA_ID);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceLevelObjectiveCorrectionsApi#getSLOCorrection");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

PATCH https://api.ap1.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.datadoghq.eu/api/v1/slo/correction/{slo_correction_id}https://api.ddog-gov.com/api/v1/slo/correction/{slo_correction_id}https://api.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.us3.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.us5.datadoghq.com/api/v1/slo/correction/{slo_correction_id}

개요

Update the specified SLO correction object.

인수

경로 파라미터

이름

유형

설명

slo_correction_id [required]

string

The ID of the SLO correction object.

요청

Body Data (required)

The edited SLO correction object.

Expand All

항목

유형

설명

data

object

The data object associated with the SLO correction to be updated.

attributes

object

The attribute object associated with the SLO correction to be updated.

category

enum

Category the SLO correction belongs to. Allowed enum values: Scheduled Maintenance,Outside Business Hours,Deployment,Other

description

string

Description of the correction being made.

duration

int64

Length of time (in seconds) for a specified rrule recurring SLO correction.

end

int64

Ending time of the correction in epoch seconds.

rrule

string

The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections are FREQ, INTERVAL, COUNT, UNTIL and BYDAY.

start

int64

Starting time of the correction in epoch seconds.

timezone

string

The timezone to display in the UI for the correction times (defaults to "UTC").

type

enum

SLO correction resource type. Allowed enum values: correction

default: correction

{
  "data": {
    "attributes": {
      "category": "Deployment",
      "description": "Example-Service-Level-Objective-Correction",
      "end": 1636632671,
      "start": 1636629071,
      "timezone": "UTC"
    },
    "type": "correction"
  }
}

응답

OK

The response object of an SLO correction.

Expand All

항목

유형

설명

data

object

The response object of a list of SLO corrections.

attributes

object

The attribute object associated with the SLO correction.

category

enum

Category the SLO correction belongs to. Allowed enum values: Scheduled Maintenance,Outside Business Hours,Deployment,Other

created_at

int64

The epoch timestamp of when the correction was created at.

creator

object

Object describing the creator of the shared element.

email

string

Email of the creator.

handle

string

Handle of the creator.

name

string

Name of the creator.

description

string

Description of the correction being made.

duration

int64

Length of time (in seconds) for a specified rrule recurring SLO correction.

end

int64

Ending time of the correction in epoch seconds.

modified_at

int64

The epoch timestamp of when the correction was modified at.

modifier

object

Modifier of the object.

email

string

Email of the Modifier.

handle

string

Handle of the Modifier.

name

string

Name of the Modifier.

rrule

string

The recurrence rules as defined in the iCalendar RFC 5545. The supported rules for SLO corrections are FREQ, INTERVAL, COUNT, UNTIL and BYDAY.

slo_id

string

ID of the SLO that this correction applies to.

start

int64

Starting time of the correction in epoch seconds.

timezone

string

The timezone to display in the UI for the correction times (defaults to "UTC").

id

string

The ID of the SLO correction.

type

enum

SLO correction resource type. Allowed enum values: correction

default: correction

{
  "data": {
    "attributes": {
      "category": "Scheduled Maintenance",
      "created_at": "integer",
      "creator": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "description": "string",
      "duration": 3600,
      "end": "integer",
      "modified_at": "integer",
      "modifier": {
        "email": "string",
        "handle": "string",
        "name": "string"
      },
      "rrule": "FREQ=DAILY;INTERVAL=10;COUNT=5",
      "slo_id": "string",
      "start": "integer",
      "timezone": "string"
    },
    "id": "string",
    "type": "correction"
  }
}

Bad Request

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Forbidden

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Not Found

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Update an SLO correction returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.ServiceLevelObjectiveCorrectionsApi;
import com.datadog.api.client.v1.model.SLOCorrectionCategory;
import com.datadog.api.client.v1.model.SLOCorrectionResponse;
import com.datadog.api.client.v1.model.SLOCorrectionType;
import com.datadog.api.client.v1.model.SLOCorrectionUpdateData;
import com.datadog.api.client.v1.model.SLOCorrectionUpdateRequest;
import com.datadog.api.client.v1.model.SLOCorrectionUpdateRequestAttributes;
import java.time.OffsetDateTime;

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

    // there is a valid "correction" for "slo"
    String CORRECTION_DATA_ID = System.getenv("CORRECTION_DATA_ID");

    SLOCorrectionUpdateRequest body =
        new SLOCorrectionUpdateRequest()
            .data(
                new SLOCorrectionUpdateData()
                    .attributes(
                        new SLOCorrectionUpdateRequestAttributes()
                            .category(SLOCorrectionCategory.DEPLOYMENT)
                            .description("Example-Service-Level-Objective-Correction")
                            .end(OffsetDateTime.now().plusHours(1).toInstant().getEpochSecond())
                            .start(OffsetDateTime.now().toInstant().getEpochSecond())
                            .timezone("UTC"))
                    .type(SLOCorrectionType.CORRECTION));

    try {
      SLOCorrectionResponse result = apiInstance.updateSLOCorrection(CORRECTION_DATA_ID, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceLevelObjectiveCorrectionsApi#updateSLOCorrection");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

DELETE https://api.ap1.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.datadoghq.eu/api/v1/slo/correction/{slo_correction_id}https://api.ddog-gov.com/api/v1/slo/correction/{slo_correction_id}https://api.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.us3.datadoghq.com/api/v1/slo/correction/{slo_correction_id}https://api.us5.datadoghq.com/api/v1/slo/correction/{slo_correction_id}

개요

Permanently delete the specified SLO correction object.

인수

경로 파라미터

이름

유형

설명

slo_correction_id [required]

string

The ID of the SLO correction object.

응답

OK

Forbidden

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Not found

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

항목

유형

설명

errors [required]

[string]

Array of errors returned by the API.

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

코드 사례

// Delete an SLO correction returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.ServiceLevelObjectiveCorrectionsApi;

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

    try {
      apiInstance.deleteSLOCorrection("slo_correction_id");
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling ServiceLevelObjectiveCorrectionsApi#deleteSLOCorrection");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"