Skip to content

Latest commit

 

History

History
609 lines (419 loc) · 17.2 KB

KeyManagementApi.md

File metadata and controls

609 lines (419 loc) · 17.2 KB

datadog-api-client.v1.KeyManagementApi

All URIs are relative to https://api.datadoghq.com

Method HTTP request Description
createAPIKey POST /api/v1/api_key Create an API key
createApplicationKey POST /api/v1/application_key Create an application key
deleteAPIKey DELETE /api/v1/api_key/{key} Delete an API key
deleteApplicationKey DELETE /api/v1/application_key/{key} Delete an application key
getAPIKey GET /api/v1/api_key/{key} Get API key
getApplicationKey GET /api/v1/application_key/{key} Get an application key
listAPIKeys GET /api/v1/api_key Get all API keys
listApplicationKeys GET /api/v1/application_key Get all application keys
updateAPIKey PUT /api/v1/api_key/{key} Edit an API key
updateApplicationKey PUT /api/v1/application_key/{key} Edit an application key

createAPIKey

ApiKeyResponse createAPIKey(body)

Creates an API key with a given name.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

let params: v1.KeyManagementApiCreateAPIKeyRequest = {
  // ApiKey
  body: {
    name: "example user",
  },
};

apiInstance
  .createAPIKey(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

Name Type Description Notes
body ApiKey

Return type

ApiKeyResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Forbidden -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createApplicationKey

ApplicationKeyResponse createApplicationKey(body)

Create an application key with a given name.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

let params: v1.KeyManagementApiCreateApplicationKeyRequest = {
  // ApplicationKey
  body: {
    name: "example user",
  },
};

apiInstance
  .createApplicationKey(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

Name Type Description Notes
body ApplicationKey

Return type

ApplicationKeyResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Forbidden -
409 Conflict -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteAPIKey

ApiKeyResponse deleteAPIKey()

Delete a given API key.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

let params: v1.KeyManagementApiDeleteAPIKeyRequest = {
  // string | The specific API key you are working with.
  key: "key_example",
};

apiInstance
  .deleteAPIKey(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

Name Type Description Notes
key [string] The specific API key you are working with. defaults to undefined

Return type

ApiKeyResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteApplicationKey

ApplicationKeyResponse deleteApplicationKey()

Delete a given application key.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

let params: v1.KeyManagementApiDeleteApplicationKeyRequest = {
  // string | The specific APP key you are working with.
  key: "key_example",
};

apiInstance
  .deleteApplicationKey(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

Name Type Description Notes
key [string] The specific APP key you are working with. defaults to undefined

Return type

ApplicationKeyResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAPIKey

ApiKeyResponse getAPIKey()

Get a given API key.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

let params: v1.KeyManagementApiGetAPIKeyRequest = {
  // string | The specific API key you are working with.
  key: "key_example",
};

apiInstance
  .getAPIKey(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

Name Type Description Notes
key [string] The specific API key you are working with. defaults to undefined

Return type

ApiKeyResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getApplicationKey

ApplicationKeyResponse getApplicationKey()

Get a given application key.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

let params: v1.KeyManagementApiGetApplicationKeyRequest = {
  // string | The specific APP key you are working with.
  key: "key_example",
};

apiInstance
  .getApplicationKey(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

Name Type Description Notes
key [string] The specific APP key you are working with. defaults to undefined

Return type

ApplicationKeyResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listAPIKeys

ApiKeyListResponse listAPIKeys()

Get all API keys available for your account.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

apiInstance
  .listAPIKeys()
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

ApiKeyListResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
403 Forbidden -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listApplicationKeys

ApplicationKeyListResponse listApplicationKeys()

Get all application keys available for your Datadog account.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

apiInstance
  .listApplicationKeys()
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

This endpoint does not need any parameter.

Return type

ApplicationKeyListResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
403 Forbidden -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateAPIKey

ApiKeyResponse updateAPIKey(body)

Edit an API key name.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

let params: v1.KeyManagementApiUpdateAPIKeyRequest = {
  // string | The specific API key you are working with.
  key: "key_example",
  // ApiKey
  body: {
    name: "example user",
  },
};

apiInstance
  .updateAPIKey(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

Name Type Description Notes
body ApiKey
key [string] The specific API key you are working with. defaults to undefined

Return type

ApiKeyResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateApplicationKey

ApplicationKeyResponse updateApplicationKey(body)

Edit an application key name.

Example

import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.KeyManagementApi(configuration);

let params: v1.KeyManagementApiUpdateApplicationKeyRequest = {
  // string | The specific APP key you are working with.
  key: "key_example",
  // ApplicationKey
  body: {
    name: "example user",
  },
};

apiInstance
  .updateApplicationKey(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Parameters

Name Type Description Notes
body ApplicationKey
key [string] The specific APP key you are working with. defaults to undefined

Return type

ApplicationKeyResponse

Authorization

apiKeyAuth, appKeyAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
409 Conflict -

[Back to top] [Back to API list] [Back to Model list] [Back to README]