@ datadog/ action- catalog
类型脚本客户端库 数据犬动作目录。为50+集成(包括AWS、Azure、GCP、GitHub、Slack、Jira、PagerDuty、Datadog API等)的执行行动提供完全的打入功能.
安装
npm install @datadog/action-catalog
# or
yarn add @datadog/action-catalog
设置
在调用任何动作功能之前, 您必须注册执行程序 。 这使得图书馆可以在任何运行时间环境中工作.
import { setExecuteActionImplementation } from '@datadog/action-catalog/action-execution';
setExecuteActionImplementation(async (actionId, request) => {
// Your implementation for executing actions against the Datadog API
const response = await fetch(
`https://api.datadoghq.com/api/v2/actions/${actionId}/execute`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'DD-API-KEY': process.env.DD_API_KEY,
'DD-APPLICATION-KEY': process.env.DD_APP_KEY,
},
body: JSON.stringify(request),
},
);
return response.json();
});
使用量
从集成特定切入点导入动作功能. 每项职能都用请求投入和响应产出来打字.
import { listObjects } from '@datadog/action-catalog/aws/s3';
import { createMonitor } from '@datadog/action-catalog/dd/monitor';
import { deleteChat } from '@datadog/action-catalog/slack/chat';
// List S3 objects
const objects = await listObjects({
inputs: {
bucket: 'my-bucket',
region: 'us-east-1',
},
});
// Create a Datadog monitor
const monitor = await createMonitor({
inputs: {
name: 'High CPU Alert',
monitorType: 'metric alert',
message: 'CPU usage is above 90%',
},
});
// Delete a Slack message
await deleteChat({
inputs: {
channel: 'C1234567890',
ts: '1234567890.123456',
teamId: 'T1234567890',
},
});
支持的整合
每种集成方式作为单独的导入路径,在 @datadog/action-catalog/<integration>/<module>数字 :
| 一体化 | 导入路径 | 说明 |
|---|---|---|
| 自动取款机 | aws/s3, (中文(简体) ), aws/ec2, (中文(简体) ), aws/lambda, (中文(简体) ), aws/ecs, (中文(简体) ), aws/rds,, , , , , , , , . | 40+ AWS 服务模块 |
| 阿苏雷 | azure/vm, (中文(简体) ), azure/aks, (中文(简体) ), azure/functions, (中文(简体) ), azure/sql,, , , , , , , , . | Azure 云服务 |
| GCP 全球气候方案 | gcp/compute, (中文(简体) ), gcp/container, (中文(简体) ), gcp/functions, (中文(简体) ), gcp/sql,, , , , , , , , . | 谷歌云服务 |
| 数据犬 | dd/monitor, (中文(简体) ), dd/dashboard, (中文(简体) ), dd/logs, (中文(简体) ), dd/incidents,, , , , , , , , . | 数据犬平台 APIs |
| GitHub 图像 | github/repos, (中文(简体) ), github/pulls, (中文(简体) ), github/issues, (中文(简体) ), github/actions,, , , , , , , , . | GitHub API 操作 |
| 吉特拉布语Name | gitlab/projects, (中文(简体) ), gitlab/pipelines, (中文(简体) ), gitlab/mergerequests,, , , , , , , , . | GitLab API 操作 |
| 偷懒 | slack/chat, (中文(简体) ), slack/conversations, (中文(简体) ), slack/reactions,, , , , , , , , . | Slack API 操作 |
| 贾拉 | jira/jira | Jira 问题管理 |
| 寻呼功能 | pagerduty/pagerduty, (中文(简体) ), pagerduty/integration | 事件管理 |
| 行动 | opsgenie/opsgenie | 警报和事件管理 |
| 现在服务 | servicenow/servicenow | 信息技术服务管理 |
| 云雾花 | cloudflare/cloudflare, (中文(简体) ), cloudflare/workers,, , , , , , , , . | 云层服务 |
| 线性 | linear/issues, (中文(简体) ), linear/projects, (中文(简体) ), linear/teams,, , , , , , , , . | 项目管理 |
| 单击 | clickup/tasks, (中文(简体) ), clickup/spaces, (中文(简体) ), clickup/goals,, , , , , , , , . | 项目管理 |
| 奥克塔 | okta/okta | 身份管理 |
| 开放AI | openai/openai | AI/ML APIs |
| 安东尼 | anthropic/anthropic | AI/ML APIs |
| HTTP 密码 | http/http | 通用 HTTP 请求 |
参见《公约》现有整合的完整清单 数据犬动作目录文档。 。 。 .
API 模式
每个动作功能都遵循相同的模式:
function actionName(request: { inputs: ActionInputs }): Promise<ActionOutputs>;
inputs——动作参数,每个动作全部打入.- 回返 ——承诺解决打入式行动响应.
许可证
麻省理工学院