@himenon/datadog-typescript-openapi
Version:
Implementation of TypeScript generated from DataDog OpenAPI
1,734 lines • 76.3 kB
JavaScript
"use strict";
//
// Generated by @himenon/openapi-typescript-code-generator v0.12.2
//
// OpenApi : 3.0.0
//
//
Object.defineProperty(exports, "__esModule", { value: true });
exports.Client = void 0;
class Client {
constructor(apiClient, baseUrl) {
this.apiClient = apiClient;
this.baseUrl = baseUrl.replace(/\/$/, "");
}
/**
* Get all API keys
* List all API keys available for your account.
* operationId: ListAPIKeys
* Request URI: /api/v2/api_keys
*/
async ListAPIKeys(params, option) {
const url = this.baseUrl + `/api/v2/api_keys`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
filter: { value: params.parameter.filter, explode: false },
"filter[created_at][start]": { value: params.parameter["filter[created_at][start]"], explode: false },
"filter[created_at][end]": { value: params.parameter["filter[created_at][end]"], explode: false },
"filter[modified_at][start]": { value: params.parameter["filter[modified_at][start]"], explode: false },
"filter[modified_at][end]": { value: params.parameter["filter[modified_at][end]"], explode: false },
include: { value: params.parameter.include, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create an API key
* Create an API key.
* operationId: CreateAPIKey
* Request URI: /api/v2/api_keys
*/
async CreateAPIKey(params, option) {
const url = this.baseUrl + `/api/v2/api_keys`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get API key
* Get an API key.
* operationId: GetAPIKey
* Request URI: /api/v2/api_keys/{api_key_id}
*/
async GetAPIKey(params, option) {
const url = this.baseUrl + `/api/v2/api_keys/${params.parameter.api_key_id}`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Delete an API key
* Delete an API key.
* operationId: DeleteAPIKey
* Request URI: /api/v2/api_keys/{api_key_id}
*/
async DeleteAPIKey(params, option) {
const url = this.baseUrl + `/api/v2/api_keys/${params.parameter.api_key_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Edit an API key
* Update an API key.
* operationId: UpdateAPIKey
* Request URI: /api/v2/api_keys/{api_key_id}
*/
async UpdateAPIKey(params, option) {
const url = this.baseUrl + `/api/v2/api_keys/${params.parameter.api_key_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Get all application keys
* List all application keys available for your org
* operationId: ListApplicationKeys
* Request URI: /api/v2/application_keys
*/
async ListApplicationKeys(params, option) {
const url = this.baseUrl + `/api/v2/application_keys`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
filter: { value: params.parameter.filter, explode: false },
"filter[created_at][start]": { value: params.parameter["filter[created_at][start]"], explode: false },
"filter[created_at][end]": { value: params.parameter["filter[created_at][end]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Get an application key
* Get an application key for your org.
* operationId: GetApplicationKey
* Request URI: /api/v2/application_keys/{app_key_id}
*/
async GetApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/application_keys/${params.parameter.app_key_id}`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Delete an application key
* Delete an application key
* operationId: DeleteApplicationKey
* Request URI: /api/v2/application_keys/{app_key_id}
*/
async DeleteApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/application_keys/${params.parameter.app_key_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Edit an application key
* Edit an application key
* operationId: UpdateApplicationKey
* Request URI: /api/v2/application_keys/{app_key_id}
*/
async UpdateApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/application_keys/${params.parameter.app_key_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* List all AuthN Mappings
* List all AuthN Mappings in the org.
* operationId: ListAuthNMappings
* Request URI: /api/v2/authn_mappings
*/
async ListAuthNMappings(params, option) {
const url = this.baseUrl + `/api/v2/authn_mappings`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
include: { value: params.parameter.include, explode: false },
filter: { value: params.parameter.filter, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create an AuthN Mapping
* Create an AuthN Mapping.
* operationId: CreateAuthNMapping
* Request URI: /api/v2/authn_mappings
*/
async CreateAuthNMapping(params, option) {
const url = this.baseUrl + `/api/v2/authn_mappings`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get an AuthN Mapping by UUID
* Get an AuthN Mapping specified by the AuthN Mapping UUID.
* operationId: GetAuthNMapping
* Request URI: /api/v2/authn_mappings/{authn_mapping_id}
*/
async GetAuthNMapping(params, option) {
const url = this.baseUrl + `/api/v2/authn_mappings/${params.parameter.authn_mapping_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Delete an AuthN Mapping
* Delete an AuthN Mapping specified by AuthN Mapping UUID.
* operationId: DeleteAuthNMapping
* Request URI: /api/v2/authn_mappings/{authn_mapping_id}
*/
async DeleteAuthNMapping(params, option) {
const url = this.baseUrl + `/api/v2/authn_mappings/${params.parameter.authn_mapping_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Edit an AuthN Mapping
* Edit an AuthN Mapping.
* operationId: UpdateAuthNMapping
* Request URI: /api/v2/authn_mappings/{authn_mapping_id}
*/
async UpdateAuthNMapping(params, option) {
const url = this.baseUrl + `/api/v2/authn_mappings/${params.parameter.authn_mapping_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Get all application keys owned by current user
* List all application keys available for current user
* operationId: ListCurrentUserApplicationKeys
* Request URI: /api/v2/current_user/application_keys
*/
async ListCurrentUserApplicationKeys(params, option) {
const url = this.baseUrl + `/api/v2/current_user/application_keys`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
filter: { value: params.parameter.filter, explode: false },
"filter[created_at][start]": { value: params.parameter["filter[created_at][start]"], explode: false },
"filter[created_at][end]": { value: params.parameter["filter[created_at][end]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create an application key for current user
* Create an application key for current user
* operationId: CreateCurrentUserApplicationKey
* Request URI: /api/v2/current_user/application_keys
*/
async CreateCurrentUserApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/current_user/application_keys`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get one application key owned by current user
* Get an application key owned by current user
* operationId: GetCurrentUserApplicationKey
* Request URI: /api/v2/current_user/application_keys/{app_key_id}
*/
async GetCurrentUserApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/current_user/application_keys/${params.parameter.app_key_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Delete an application key owned by current user
* Delete an application key owned by current user
* operationId: DeleteCurrentUserApplicationKey
* Request URI: /api/v2/current_user/application_keys/{app_key_id}
*/
async DeleteCurrentUserApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/current_user/application_keys/${params.parameter.app_key_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Edit an application key owned by current user
* Edit an application key owned by current user
* operationId: UpdateCurrentUserApplicationKey
* Request URI: /api/v2/current_user/application_keys/{app_key_id}
*/
async UpdateCurrentUserApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/current_user/application_keys/${params.parameter.app_key_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Get items of a Dashboard List
* Fetch the dashboard list’s dashboard definitions.
* operationId: GetDashboardListItems
* Request URI: /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards
*/
async GetDashboardListItems(params, option) {
const url = this.baseUrl + `/api/v2/dashboard/lists/manual/${params.parameter.dashboard_list_id}/dashboards`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Update items of a dashboard list
* Update dashboards of an existing dashboard list.
* operationId: UpdateDashboardListItems
* Request URI: /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards
*/
async UpdateDashboardListItems(params, option) {
const url = this.baseUrl + `/api/v2/dashboard/lists/manual/${params.parameter.dashboard_list_id}/dashboards`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PUT", url, headers, params.requestBody, undefined, option);
}
/**
* Add Items to a Dashboard List
* Add dashboards to an existing dashboard list.
* operationId: CreateDashboardListItems
* Request URI: /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards
*/
async CreateDashboardListItems(params, option) {
const url = this.baseUrl + `/api/v2/dashboard/lists/manual/${params.parameter.dashboard_list_id}/dashboards`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Delete items from a dashboard list
* Delete dashboards from an existing dashboard list.
* operationId: DeleteDashboardListItems
* Request URI: /api/v2/dashboard/lists/manual/{dashboard_list_id}/dashboards
*/
async DeleteDashboardListItems(params, option) {
const url = this.baseUrl + `/api/v2/dashboard/lists/manual/${params.parameter.dashboard_list_id}/dashboards`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("DELETE", url, headers, params.requestBody, undefined, option);
}
/**
* Get a list of incidents
* Get all incidents for the user's organization.
* operationId: ListIncidents
* Request URI: /api/v2/incidents
*/
async ListIncidents(params, option) {
const url = this.baseUrl + `/api/v2/incidents`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false },
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[offset]": { value: params.parameter["page[offset]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create an incident
* Create an incident.
* operationId: CreateIncident
* Request URI: /api/v2/incidents
*/
async CreateIncident(params, option) {
const url = this.baseUrl + `/api/v2/incidents`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get the details of an incident
* Get the details of an incident by `incident_id`.
* operationId: GetIncident
* Request URI: /api/v2/incidents/{incident_id}
*/
async GetIncident(params, option) {
const url = this.baseUrl + `/api/v2/incidents/${params.parameter.incident_id}`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Delete an existing incident
* Deletes an existing incident from the users organization.
* operationId: DeleteIncident
* Request URI: /api/v2/incidents/{incident_id}
*/
async DeleteIncident(params, option) {
const url = this.baseUrl + `/api/v2/incidents/${params.parameter.incident_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update an existing incident
* Updates an incident. Provide only the attributes that should be updated as this request is a partial update.
* operationId: UpdateIncident
* Request URI: /api/v2/incidents/{incident_id}
*/
async UpdateIncident(params, option) {
const url = this.baseUrl + `/api/v2/incidents/${params.parameter.incident_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false }
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, queryParameters, option);
}
/**
* Send logs
* Send your logs to your Datadog platform over HTTP. Limits per HTTP request are:
*
* - Maximum content size per payload (uncompressed): 5MB
* - Maximum size for a single log: 1MB
* - Maximum array size if sending multiple logs in an array: 1000 entries
*
* Any log exceeding 1MB is accepted and truncated by Datadog:
* - For a single log request, the API truncates the log at 1MB and returns a 2xx.
* - For a multi-logs request, the API processes all logs, truncates only logs larger than 1MB, and returns a 2xx.
*
* Datadog recommends sending your logs compressed.
* Add the `Content-Encoding: gzip` header to the request when sending compressed logs.
*
* The status codes answered by the HTTP API are:
* - 202: Accepted: the request has been accepted for processing
* - 400: Bad request (likely an issue in the payload formatting)
* - 401: Unauthorized (likely a missing API Key)
* - 403: Permission issue (likely using an invalid API Key)
* - 408: Request Timeout, request should be retried after some time
* - 413: Payload too large (batch is above 5MB uncompressed)
* - 429: Too Many Requests, request should be retried after some time
* - 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time
* - 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time
* operationId: SubmitLog
* Request URI: /api/v2/logs
*/
async SubmitLog(params, option) {
const url = this.baseUrl + `/api/v2/logs`;
const headers = {
"Content-Type": params.headers["Content-Type"],
Accept: "application/json",
"Content-Encoding": params.parameter["Content-Encoding"]
};
const queryParameters = {
ddtags: { value: params.parameter.ddtags, explode: false }
};
return this.apiClient.request("POST", url, headers, params.requestBody, queryParameters, option);
}
/**
* Aggregate events
* The API endpoint to aggregate events into buckets and compute metrics and timeseries.
* operationId: AggregateLogs
* Request URI: /api/v2/logs/analytics/aggregate
*/
async AggregateLogs(params, option) {
const url = this.baseUrl + `/api/v2/logs/analytics/aggregate`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get archive order
* Get the current order of your archives.
* This endpoint takes no JSON arguments.
* operationId: GetLogsArchiveOrder
* Request URI: /api/v2/logs/config/archive-order
*/
async GetLogsArchiveOrder(option) {
const url = this.baseUrl + `/api/v2/logs/config/archive-order`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Update archive order
* Update the order of your archives. Since logs are processed sequentially, reordering an archive may change
* the structure and content of the data processed by other archives.
*
* **Note**: Using the `PUT` method updates your archive's order by replacing the current order
* with the new one.
* operationId: UpdateLogsArchiveOrder
* Request URI: /api/v2/logs/config/archive-order
*/
async UpdateLogsArchiveOrder(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/archive-order`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PUT", url, headers, params.requestBody, undefined, option);
}
/**
* Get all archives
* Get the list of configured logs archives with their definitions.
* operationId: ListLogsArchives
* Request URI: /api/v2/logs/config/archives
*/
async ListLogsArchives(option) {
const url = this.baseUrl + `/api/v2/logs/config/archives`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Create an archive
* Create an archive in your organization.
* operationId: CreateLogsArchive
* Request URI: /api/v2/logs/config/archives
*/
async CreateLogsArchive(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/archives`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get an archive
* Get a specific archive from your organization.
* operationId: GetLogsArchive
* Request URI: /api/v2/logs/config/archives/{archive_id}
*/
async GetLogsArchive(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/archives/${params.parameter.archive_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Update an archive
* Update a given archive configuration.
*
* **Note**: Using this method updates your archive configuration by **replacing**
* your current configuration with the new one sent to your Datadog organization.
* operationId: UpdateLogsArchive
* Request URI: /api/v2/logs/config/archives/{archive_id}
*/
async UpdateLogsArchive(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/archives/${params.parameter.archive_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PUT", url, headers, params.requestBody, undefined, option);
}
/**
* Delete an archive
* Delete a given archive from your organization.
* operationId: DeleteLogsArchive
* Request URI: /api/v2/logs/config/archives/{archive_id}
*/
async DeleteLogsArchive(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/archives/${params.parameter.archive_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* List read roles for an archive
* Returns all read roles a given archive is restricted to.
* operationId: ListArchiveReadRoles
* Request URI: /api/v2/logs/config/archives/{archive_id}/readers
*/
async ListArchiveReadRoles(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/archives/${params.parameter.archive_id}/readers`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Grant role to an archive
* Adds a read role to an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/))
* operationId: AddReadRoleToArchive
* Request URI: /api/v2/logs/config/archives/{archive_id}/readers
*/
async AddReadRoleToArchive(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/archives/${params.parameter.archive_id}/readers`;
const headers = {
"Content-Type": "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Revoke role from an archive
* Removes a role from an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/))
* operationId: RemoveRoleFromArchive
* Request URI: /api/v2/logs/config/archives/{archive_id}/readers
*/
async RemoveRoleFromArchive(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/archives/${params.parameter.archive_id}/readers`;
const headers = {
"Content-Type": "application/json"
};
return this.apiClient.request("DELETE", url, headers, params.requestBody, undefined, option);
}
/**
* Get all log-based metrics
* Get the list of configured log-based metrics with their definitions.
* operationId: ListLogsMetrics
* Request URI: /api/v2/logs/config/metrics
*/
async ListLogsMetrics(option) {
const url = this.baseUrl + `/api/v2/logs/config/metrics`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Create a log-based metric
* Create a metric based on your ingested logs in your organization.
* Returns the log-based metric object from the request body when the request is successful.
* operationId: CreateLogsMetric
* Request URI: /api/v2/logs/config/metrics
*/
async CreateLogsMetric(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/metrics`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get a log-based metric
* Get a specific log-based metric from your organization.
* operationId: GetLogsMetric
* Request URI: /api/v2/logs/config/metrics/{metric_id}
*/
async GetLogsMetric(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/metrics/${params.parameter.metric_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Delete a log-based metric
* Delete a specific log-based metric from your organization.
* operationId: DeleteLogsMetric
* Request URI: /api/v2/logs/config/metrics/{metric_id}
*/
async DeleteLogsMetric(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/metrics/${params.parameter.metric_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update a log-based metric
* Update a specific log-based metric from your organization.
* Returns the log-based metric object from the request body when the request is successful.
* operationId: UpdateLogsMetric
* Request URI: /api/v2/logs/config/metrics/{metric_id}
*/
async UpdateLogsMetric(params, option) {
const url = this.baseUrl + `/api/v2/logs/config/metrics/${params.parameter.metric_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Get a list of logs
* List endpoint returns logs that match a log search query.
* [Results are paginated][1].
*
* Use this endpoint to see your latest logs.
*
* **If you are considering archiving logs for your organization,
* consider use of the Datadog archive capabilities instead of the log list API.
* See [Datadog Logs Archive documentation][2].**
*
* [1]: /logs/guide/collect-multiple-logs-with-pagination
* [2]: https://docs.datadoghq.com/logs/archives
* operationId: ListLogsGet
* Request URI: /api/v2/logs/events
*/
async ListLogsGet(params, option) {
const url = this.baseUrl + `/api/v2/logs/events`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"filter[query]": { value: params.parameter["filter[query]"], explode: false },
"filter[index]": { value: params.parameter["filter[index]"], explode: false },
"filter[from]": { value: params.parameter["filter[from]"], explode: false },
"filter[to]": { value: params.parameter["filter[to]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
"page[cursor]": { value: params.parameter["page[cursor]"], explode: false },
"page[limit]": { value: params.parameter["page[limit]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Search logs
* List endpoint returns logs that match a log search query.
* [Results are paginated][1].
*
* Use this endpoint to build complex logs filtering and search.
*
* **If you are considering archiving logs for your organization,
* consider use of the Datadog archive capabilities instead of the log list API.
* See [Datadog Logs Archive documentation][2].**
*
* [1]: /logs/guide/collect-multiple-logs-with-pagination
* [2]: https://docs.datadoghq.com/logs/archives
* operationId: ListLogs
* Request URI: /api/v2/logs/events/search
*/
async ListLogs(params, option) {
const url = this.baseUrl + `/api/v2/logs/events/search`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* List tag configurations
* Returns all configured count/gauge/rate/distribution metric names
* (with additional filters if specified).
* operationId: ListTagConfigurations
* Request URI: /api/v2/metrics
*/
async ListTagConfigurations(params, option) {
const url = this.baseUrl + `/api/v2/metrics`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"filter[configured]": { value: params.parameter["filter[configured]"], explode: false },
"filter[tags_configured]": { value: params.parameter["filter[tags_configured]"], explode: false },
"filter[metric_type]": { value: params.parameter["filter[metric_type]"], explode: false },
"filter[include_percentiles]": { value: params.parameter["filter[include_percentiles]"], explode: false },
"filter[tags]": { value: params.parameter["filter[tags]"], explode: false },
"window[seconds]": { value: params.parameter["window[seconds]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Configure tags for multiple metrics
* Create and define a list of queryable tag keys for a set of existing count, gauge, rate, and distribution metrics.
* Metrics are selected by passing a metric name prefix. Use the Delete method of this API path to remove tag configurations.
* Results can be sent to a set of account email addresses, just like the same operation in the Datadog web app.
* If multiple calls include the same metric, the last configuration applied (not by submit order) is used, do not
* expect deterministic ordering of concurrent calls.
* Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
* operationId: CreateBulkTagsMetricsConfiguration
* Request URI: /api/v2/metrics/config/bulk-tags
*/
async CreateBulkTagsMetricsConfiguration(params, option) {
const url = this.baseUrl + `/api/v2/metrics/config/bulk-tags`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Configure tags for multiple metrics
* Delete all custom lists of queryable tag keys for a set of existing count, gauge, rate, and distribution metrics.
* Metrics are selected by passing a metric name prefix.
* Results can be sent to a set of account email addresses, just like the same operation in the Datadog web app.
* Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
* operationId: DeleteBulkTagsMetricsConfiguration
* Request URI: /api/v2/metrics/config/bulk-tags
*/
async DeleteBulkTagsMetricsConfiguration(params, option) {
const url = this.baseUrl + `/api/v2/metrics/config/bulk-tags`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("DELETE", url, headers, params.requestBody, undefined, option);
}
/**
* List tags by metric name
* View indexed tag key-value pairs for a given metric name.
* operationId: ListTagsByMetricName
* Request URI: /api/v2/metrics/{metric_name}/all-tags
*/
async ListTagsByMetricName(params, option) {
const url = this.baseUrl + `/api/v2/metrics/${params.parameter.metric_name}/all-tags`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* List tag configuration by name
* Returns the tag configuration for the given metric name.
* operationId: ListTagConfigurationByName
* Request URI: /api/v2/metrics/{metric_name}/tags
*/
async ListTagConfigurationByName(params, option) {
const url = this.baseUrl + `/api/v2/metrics/${params.parameter.metric_name}/tags`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Create a tag configuration
* Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.
* Optionally, include percentile aggregations on any distribution metric or configure custom aggregations
* on any count, rate, or gauge metric.
* Can only be used with application keys of users with the `Manage Tags for Metrics` permission.
* operationId: CreateTagConfiguration
* Request URI: /api/v2/metrics/{metric_name}/tags
*/
async CreateTagConfiguration(params, option) {
const url = this.baseUrl + `/api/v2/metrics/${params.parameter.metric_name}/tags`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Delete a tag configuration
* Deletes a metric's tag configuration. Can only be used with application
* keys from users with the `Manage Tags for Metrics` permission.
* operationId: DeleteTagConfiguration
* Request URI: /api/v2/metrics/{metric_name}/tags
*/
async DeleteTagConfiguration(params, option) {
const url = this.baseUrl + `/api/v2/metrics/${params.parameter.metric_name}/tags`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update a tag configuration
* Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations
* of a count, rate, or gauge metric.
* Can only be used with application keys from users with the `Manage Tags for Metrics` permission.
* operationId: UpdateTagConfiguration
* Request URI: /api/v2/metrics/{metric_name}/tags
*/
async UpdateTagConfiguration(params, option) {
const url = this.baseUrl + `/api/v2/metrics/${params.parameter.metric_name}/tags`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* List distinct metric volumes by metric name
* View distinct metrics volumes for the given metric name.
*
* Custom distribution metrics will return both ingested and indexed custom metric volumes.
* For Metrics without Limits™ beta customers, all metrics will return both ingested/indexed volumes.
* Custom metrics generated in-app from other products will return `null` for ingested volumes.
* operationId: ListVolumesByMetricName
* Request URI: /api/v2/metrics/{metric_name}/volumes
*/
async ListVolumesByMetricName(params, option) {
const url = this.baseUrl + `/api/v2/metrics/${params.parameter.metric_name}/volumes`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* List permissions
* Returns a list of all permissions, including name, description, and ID.
* operationId: ListPermissions
* Request URI: /api/v2/permissions
*/
async ListPermissions(option) {
const url = this.baseUrl + `/api/v2/permissions`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Get all processes
* Get all processes for your organization.
* operationId: ListProcesses
* Request URI: /api/v2/processes
*/
async ListProcesses(params, option) {
const url = this.baseUrl + `/api/v2/processes`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
search: { value: params.parameter.search, explode: false },
tags: { value: params.parameter.tags, explode: false },
from: { value: params.parameter.from, explode: false },
to: { value: params.parameter.to, explode: false },
"page[limit]": { value: params.parameter["page[limit]"], explode: false },
"page[cursor]": { value: params.parameter["page[cursor]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* List roles
* Returns all roles, including their names and IDs.
* operationId: ListRoles
* Request URI: /api/v2/roles
*/
async ListRoles(params, option) {
const url = this.baseUrl + `/api/v2/roles`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
filter: { value: params.parameter.filter, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create role
* Create a new role for your organization.
* operationId: CreateRole
* Request URI: /api/v2/roles
*/
async CreateRole(params, option) {
const url = this.baseUrl + `/api/v2/roles`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get a role
* Get a role in the organization specified by the role’s `role_id`.
* operationId: GetRole
* Request URI: /api/v2/roles/{role_id}
*/
async GetRole(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Delete role
* Disables a role.
* operationId: DeleteRole
* Request URI: /api/v2/roles/{role_id}
*/
async DeleteRole(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update a role
* Edit a role. Can only be used with application keys belonging to administrators.
* operationId: UpdateRole
* Request URI: /api/v2/roles/{role_id}
*/
async UpdateRole(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Create a new role by cloning an existing role
* Clone an existing role
* operationId: CloneRole
* Request URI: /api/v2/roles/{role_id}/clone
*/
async CloneRole(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}/clone`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* List permissions for a role
* Returns a list of all permissions for a single role.
* operationId: ListRolePermissions
* Request URI: /api/v2/roles/{role_id}/permissions
*/
async ListRolePermissions(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}/permissions`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Grant permission to a role
* Adds a permission to a role.
* operationId: AddPermissionToRole
* Request URI: /api/v2/roles/{role_id}/permissions
*/
async AddPermissionToRole(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}/permissions`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Revoke permission
* Removes a permission from a role.
* operationId: RemovePermissionFromRole
* Request URI: /api/v2/roles/{role_id}/permissions
*/
async RemovePermissionFromRole(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}/permissions`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("DELETE", url, headers, params.requestBody, undefined, option);
}
/**
* Get all users of a role
* Gets all users of a role.
* operationId: ListRoleUsers
* Request URI: /api/v2/roles/{role_id}/users
*/
async ListRoleUsers(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}/users`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
filter: { value: params.parameter.filter, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Add a user to a role
* Adds a user to a role.
* operationId: AddUserToRole
* Request URI: /api/v2/roles/{role_id}/users
*/
async AddUserToRole(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}/users`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Remove a user from a role
* Removes a user from a role.
* operationId: RemoveUserFromRole
* Request URI: /api/v2/roles/{role_id}/users
*/
async RemoveUserFromRole(params, option) {
const url = this.baseUrl + `/api/v2/roles/${params.parameter.role_id}/users`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("DELETE", url, headers, params.requestBody, undefined, option);
}
/**
* Get the latest Cloud Workload Security policy
* The download endpoint generates a Cloud Workload Security policy file from your currently active
* Cloud Workload Security rules, and downloads them as a .policy file. This file can then be deployed to
* your agents to update the policy running in your environment.
* operationId: DownloadCloudWorkloadPolicyFile
* Request URI: /api/v2/security/cloud_workload/policy/download
*/
async DownloadCloudWorkloadPolicyFile(option) {
const url = this.baseUrl + `/api/v2/security/cloud_workload/policy/download`;
const headers = {
Accept: "application/yaml"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Get all Cloud Workload Security Agent rules
* Get the list of Agent rules.
* operationId: ListCloudWorkloadSecurityAgentRules
* Request URI: /api/v2/security_monitoring/cloud_workload_security/agent_rules
*/
async ListCloudWorkloadSecurityAgentRules(option) {
const url = this.baseUrl + `/api/v2/security_monitoring/cloud_workload_security/agent_rules`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Create a Cloud Workload Security Agent rule
* Create a new Agent rule with the given parameters.
* operationId: CreateCloudWorkloadSecurityAgentRule
* Request URI: /api/v2/security_monitoring/cloud_workload_security/agent_rules
*/
async CreateCloudWorkloadSecurityAgentRule(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/cloud_workload_security/agent_rules`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get a Cloud Workload Security Agent rule
* Get the details of a specific Agent rule.
* operationId: GetCloudWorkloadSecurityAgentRule
* Request URI: /api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}
*/
async GetCloudWorkloadSecurityAgentRule(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/cloud_workload_security/agent_rules/${params.parameter.agent_rule_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Delete a Cloud Workload Security Agent rule
* Delete a specific Agent rule.
* operationId: DeleteCloudWorkloadSecurityAgentRule
* Request URI: /api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}
*/
async DeleteCloudWorkloadSecurityAgentRule(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/cloud_workload_security/agent_rules/${params.parameter.agent_rule_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update a Cloud Workload Security Agent rule
* Update a specific Agent rule.
* Returns the Agent rule object when the request is successful.
* operationId: UpdateCloudWorkloadSecurityAgentRule
* Request URI: /api/v2/security_monitoring/cloud_workload_security/agent_rules/{agent_rule_id}
*/
async UpdateCloudWorkloadSecurityAgentRule(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/cloud_workload_security/agent_rules/${params.parameter.agent_rule_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Get all security filters
* Get the list of configured security filters with their definitions.
* operationId: ListSecurityFilters
* Request URI: /api/v2/security_monitoring/configuration/security_filters
*/
async ListSecurityFilters(option) {
const url = this.baseUrl + `/api/v2/security_monitoring/configuration/security_filters`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Create a security filter
* Create a security filter.
*
* See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/)
* for more examples.
* operationId: CreateSecurityFilter
* Request URI: /api/v2/security_monitoring/configuration/security_filters
*/
async CreateSecurityFilter(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/configuration/security_filters`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get a security filter
* Get the details of a specific security filter.
*
* See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/)
* for more examples.
* operationId: GetSecurityFilter
* Request URI: /api/v2/security_monitoring/configuration/security_filters/{security_filter_id}
*/
async GetSecurityFilter(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/configuration/security_filters/${params.parameter.security_filter_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Delete a security filter
* Delete a specific security filter.
* operationId: DeleteSecurityFilter
* Request URI: /api/v2/security_monitoring/configuration/security_filters/{security_filter_id}
*/
async DeleteSecurityFilter(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/configuration/security_filters/${params.parameter.security_filter_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update a security filter
* Update a specific security filter.
* Returns the security filter object when the request is successful.
* operationId: UpdateSecurityFilter
* Request URI: /api/v2/security_monitoring/configuration/security_filters/{security_filter_id}
*/
async UpdateSecurityFilter(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/configuration/security_filters/${params.parameter.security_filter_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* List rules
* List rules.
* operationId: ListSecurityMonitoringRules
* Request URI: /api/v2/security_monitoring/rules
*/
async ListSecurityMonitoringRules(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/rules`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create a detection rule
* Create a detection rule.
* operationId: CreateSecurityMonitoringRule
* Request URI: /api/v2/security_monitoring/rules
*/
async CreateSecurityMonitoringRule(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/rules`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get a rule's details
* Get a rule's details.
* operationId: GetSecurityMonitoringRule
* Request URI: /api/v2/security_monitoring/rules/{rule_id}
*/
async GetSecurityMonitoringRule(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/rules/${params.parameter.rule_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Update an existing rule
* Update an existing rule. When updating `cases`, `queries` or `options`, the whole field
* must be included. For example, when modifying a query all queries must be included.
* Default rules can only be updated to be enabled and to change notifications.
* operationId: UpdateSecurityMonitoringRule
* Request URI: /api/v2/security_monitoring/rules/{rule_id}
*/
async UpdateSecurityMonitoringRule(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/rules/${params.parameter.rule_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PUT", url, headers, params.requestBody, undefined, option);
}
/**
* Delete an existing rule
* Delete an existing rule. Default rules cannot be deleted.
* operationId: DeleteSecurityMonitoringRule
* Request URI: /api/v2/security_monitoring/rules/{rule_id}
*/
async DeleteSecurityMonitoringRule(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/rules/${params.parameter.rule_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Get a quick list of security signals
* The list endpoint returns security signals that match a search query.
* Both this endpoint and the POST endpoint can be used interchangeably when listing
* security signals.
* operationId: ListSecurityMonitoringSignals
* Request URI: /api/v2/security_monitoring/signals
*/
async ListSecurityMonitoringSignals(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/signals`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"filter[query]": { value: params.parameter["filter[query]"], explode: false },
"filter[from]": { value: params.parameter["filter[from]"], explode: false },
"filter[to]": { value: params.parameter["filter[to]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
"page[cursor]": { value: params.parameter["page[cursor]"], explode: false },
"page[limit]": { value: params.parameter["page[limit]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Get a list of security signals
* Returns security signals that match a search query.
* Both this endpoint and the GET endpoint can be used interchangeably for listing
* security signals.
* operationId: SearchSecurityMonitoringSignals
* Request URI: /api/v2/security_monitoring/signals/search
*/
async SearchSecurityMonitoringSignals(params, option) {
const url = this.baseUrl + `/api/v2/security_monitoring/signals/search`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Create a service account
* Create a service account for your organization.
* operationId: CreateServiceAccount
* Request URI: /api/v2/service_accounts
*/
async CreateServiceAccount(params, option) {
const url = this.baseUrl + `/api/v2/service_accounts`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* List application keys for this service account
* List all application keys available for this service account.
* operationId: ListServiceAccountApplicationKeys
* Request URI: /api/v2/service_accounts/{service_account_id}/application_keys
*/
async ListServiceAccountApplicationKeys(params, option) {
const url = this.baseUrl + `/api/v2/service_accounts/${params.parameter.service_account_id}/application_keys`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
filter: { value: params.parameter.filter, explode: false },
"filter[created_at][start]": { value: params.parameter["filter[created_at][start]"], explode: false },
"filter[created_at][end]": { value: params.parameter["filter[created_at][end]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create an application key for this service account
* Create an application key for this service account.
* operationId: CreateServiceAccountApplicationKey
* Request URI: /api/v2/service_accounts/{service_account_id}/application_keys
*/
async CreateServiceAccountApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/service_accounts/${params.parameter.service_account_id}/application_keys`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get one application key for this service account
* Get an application key owned by this service account.
* operationId: GetServiceAccountApplicationKey
* Request URI: /api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}
*/
async GetServiceAccountApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/service_accounts/${params.parameter.service_account_id}/application_keys/${params.parameter.app_key_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Delete an application key for this service account
* Delete an application key owned by this service account.
* operationId: DeleteServiceAccountApplicationKey
* Request URI: /api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}
*/
async DeleteServiceAccountApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/service_accounts/${params.parameter.service_account_id}/application_keys/${params.parameter.app_key_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Edit an application key for this service account
* Edit an application key owned by this service account.
* operationId: UpdateServiceAccountApplicationKey
* Request URI: /api/v2/service_accounts/{service_account_id}/application_keys/{app_key_id}
*/
async UpdateServiceAccountApplicationKey(params, option) {
const url = this.baseUrl + `/api/v2/service_accounts/${params.parameter.service_account_id}/application_keys/${params.parameter.app_key_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Get a list of all incident services
* Get all incident services uploaded for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident services.
* operationId: ListIncidentServices
* Request URI: /api/v2/services
*/
async ListIncidentServices(params, option) {
const url = this.baseUrl + `/api/v2/services`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false },
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[offset]": { value: params.parameter["page[offset]"], explode: false },
filter: { value: params.parameter.filter, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create a new incident service
* Creates a new incident service.
* operationId: CreateIncidentService
* Request URI: /api/v2/services
*/
async CreateIncidentService(params, option) {
const url = this.baseUrl + `/api/v2/services`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get details of an incident service
* Get details of an incident service. If the `include[users]` query parameter is provided,
* the included attribute will contain the users related to these incident services.
* operationId: GetIncidentService
* Request URI: /api/v2/services/{service_id}
*/
async GetIncidentService(params, option) {
const url = this.baseUrl + `/api/v2/services/${params.parameter.service_id}`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Delete an existing incident service
* Deletes an existing incident service.
* operationId: DeleteIncidentService
* Request URI: /api/v2/services/{service_id}
*/
async DeleteIncidentService(params, option) {
const url = this.baseUrl + `/api/v2/services/${params.parameter.service_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update an existing incident service
* Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update.
* operationId: UpdateIncidentService
* Request URI: /api/v2/services/{service_id}
*/
async UpdateIncidentService(params, option) {
const url = this.baseUrl + `/api/v2/services/${params.parameter.service_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Get a list of all incident teams
* Get all incident teams for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident teams.
* operationId: ListIncidentTeams
* Request URI: /api/v2/teams
*/
async ListIncidentTeams(params, option) {
const url = this.baseUrl + `/api/v2/teams`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false },
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[offset]": { value: params.parameter["page[offset]"], explode: false },
filter: { value: params.parameter.filter, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create a new incident team
* Creates a new incident team.
* operationId: CreateIncidentTeam
* Request URI: /api/v2/teams
*/
async CreateIncidentTeam(params, option) {
const url = this.baseUrl + `/api/v2/teams`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get details of an incident team
* Get details of an incident team. If the `include[users]` query parameter is provided,
* the included attribute will contain the users related to these incident teams.
* operationId: GetIncidentTeam
* Request URI: /api/v2/teams/{team_id}
*/
async GetIncidentTeam(params, option) {
const url = this.baseUrl + `/api/v2/teams/${params.parameter.team_id}`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
include: { value: params.parameter.include, explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Delete an existing incident team
* Deletes an existing incident team.
* operationId: DeleteIncidentTeam
* Request URI: /api/v2/teams/{team_id}
*/
async DeleteIncidentTeam(params, option) {
const url = this.baseUrl + `/api/v2/teams/${params.parameter.team_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update an existing incident team
* Updates an existing incident team. Only provide the attributes which should be updated as this request is a partial update.
* operationId: UpdateIncidentTeam
* Request URI: /api/v2/teams/{team_id}
*/
async UpdateIncidentTeam(params, option) {
const url = this.baseUrl + `/api/v2/teams/${params.parameter.team_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Send invitation emails
* Sends emails to one or more users inviting them to join the organization.
* operationId: SendInvitations
* Request URI: /api/v2/user_invitations
*/
async SendInvitations(params, option) {
const url = this.baseUrl + `/api/v2/user_invitations`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get a user invitation
* Returns a single user invitation by its UUID.
* operationId: GetInvitation
* Request URI: /api/v2/user_invitations/{user_invitation_uuid}
*/
async GetInvitation(params, option) {
const url = this.baseUrl + `/api/v2/user_invitations/${params.parameter.user_invitation_uuid}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* List all users
* Get the list of all users in the organization. This list includes
* all users even if they are deactivated or unverified.
* operationId: ListUsers
* Request URI: /api/v2/users
*/
async ListUsers(params, option) {
const url = this.baseUrl + `/api/v2/users`;
const headers = {
Accept: "application/json"
};
const queryParameters = {
"page[size]": { value: params.parameter["page[size]"], explode: false },
"page[number]": { value: params.parameter["page[number]"], explode: false },
sort: { value: params.parameter.sort, explode: false },
sort_dir: { value: params.parameter.sort_dir, explode: false },
filter: { value: params.parameter.filter, explode: false },
"filter[status]": { value: params.parameter["filter[status]"], explode: false }
};
return this.apiClient.request("GET", url, headers, undefined, queryParameters, option);
}
/**
* Create a user
* Create a user for your organization.
* operationId: CreateUser
* Request URI: /api/v2/users
*/
async CreateUser(params, option) {
const url = this.baseUrl + `/api/v2/users`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("POST", url, headers, params.requestBody, undefined, option);
}
/**
* Get user details
* Get a user in the organization specified by the user’s `user_id`.
* operationId: GetUser
* Request URI: /api/v2/users/{user_id}
*/
async GetUser(params, option) {
const url = this.baseUrl + `/api/v2/users/${params.parameter.user_id}`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Disable a user
* Disable a user. Can only be used with an application key belonging
* to an administrator user.
* operationId: DisableUser
* Request URI: /api/v2/users/{user_id}
*/
async DisableUser(params, option) {
const url = this.baseUrl + `/api/v2/users/${params.parameter.user_id}`;
const headers = {};
return this.apiClient.request("DELETE", url, headers, undefined, undefined, option);
}
/**
* Update a user
* Edit a user. Can only be used with an application key belonging
* to an administrator user.
* operationId: UpdateUser
* Request URI: /api/v2/users/{user_id}
*/
async UpdateUser(params, option) {
const url = this.baseUrl + `/api/v2/users/${params.parameter.user_id}`;
const headers = {
"Content-Type": "application/json",
Accept: "application/json"
};
return this.apiClient.request("PATCH", url, headers, params.requestBody, undefined, option);
}
/**
* Get a user organization
* Get a user organization. Returns the user information and all organizations
* joined by this user.
* operationId: ListUserOrganizations
* Request URI: /api/v2/users/{user_id}/orgs
*/
async ListUserOrganizations(params, option) {
const url = this.baseUrl + `/api/v2/users/${params.parameter.user_id}/orgs`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
/**
* Get a user permissions
* Get a user permission set. Returns a list of the user’s permissions
* granted by the associated user's roles.
* operationId: ListUserPermissions
* Request URI: /api/v2/users/{user_id}/permissions
*/
async ListUserPermissions(params, option) {
const url = this.baseUrl + `/api/v2/users/${params.parameter.user_id}/permissions`;
const headers = {
Accept: "application/json"
};
return this.apiClient.request("GET", url, headers, undefined, undefined, option);
}
}
exports.Client = Client;