- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
GET /aws/account
List all AWS accounts linked to your Cloudcraft account.
The response is an array of AWS accounts. Each entry includes the account ID and name, access control, and user information.
The provided account IDs are required to access the other AWS-related APIs.
OK
{
"accounts": [
{
"CreatorId": "us46e9aa-5806-4cd6-8e78-c22d58602d09",
"createdAt": "2022-01-01T21:18:59.057Z",
"externalId": "ex53e827-a724-4a2a-9fec-b13761540785",
"id": "awfda35c-82fe-4edf-b9e9-ffd48f041c22",
"name": "Development",
"roleArn": "arn:aws:iam::1234567890:role/cloudcraft",
"updatedAt": "2022-01-01T21:19:03.487Z"
}
]
}
Unauthorized
curl --location 'https://api.cloudcraft.co/aws/account'
package main
import (
"context"
"log"
"os"
"github.com/DataDog/cloudcraft-go"
)
func main() {
// Get the API key from the environment.
key, ok := os.LookupEnv("CLOUDCRAFT_API_KEY")
if !ok {
log.Fatal("missing env var: CLOUDCRAFT_API_KEY")
}
// Create new Config to initialize a Client.
cfg := cloudcraft.NewConfig(key)
// Create a new Client instance with the given Config.
client, err := cloudcraft.NewClient(cfg)
if err != nil {
log.Fatal(err)
}
// List all AWS accounts in the Cloudcraft account.
accounts, _, err := client.AWS.List(context.Background())
if err != nil {
log.Fatal(err)
}
// Print the name of each account.
for _, account := range accounts {
log.Println(account.Name)
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.cloudcraft.co/aws/account")
.method("GET", body)
.build();
Response response = client.newCall(request).execute();
from cloudcraftco import Cloudcraft
cloudcraft = Cloudcraft()
accounts = cloudcraft.list_aws_accounts()
require "uri"
require "net/http"
url = URI("https://api.cloudcraft.co/aws/account")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
response = https.request(request)
puts response.read_body
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
fetch("https://api.cloudcraft.co/aws/account", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
POST /aws/account
Register a new AWS account with Cloudcraft.
The body of the request should contain the account properties in JSON format. The response contains the created account object, including the newly assigned ID for use with other API endpoints.
OK
{
"CreatorId": "us46e9aa-5806-4cd6-8e78-c22d58602d09",
"createdAt": "2022-01-01T01:37:55.709Z",
"externalId": "ex53e827-a724-4a2a-9fec-b13761540785",
"id": "awfda35c-82fe-4edf-b9e9-ffd48f041c22 ",
"name": "AWS account name (for example prod or staging)",
"roleArn": "arn:aws:iam::1234567890:role/cloudcraft",
"updatedAt": "2022-01-01T01:37:55.709Z"
}
Unauthorized
Forbidden, insufficient privileges
curl --location 'https://api.cloudcraft.co/aws/account' \
--header 'Content-Type: application/json' \
--data '{"name": "AWS account name (for example, prod or staging)",
"roleArn": "arn:aws:iam::1234567890:role/cloudcraft",
}'
package main
import (
"context"
"log"
"os"
"github.com/DataDog/cloudcraft-go"
)
func main() {
// Get the API key from the environment.
key, ok := os.LookupEnv("CLOUDCRAFT_API_KEY")
if !ok {
log.Fatal("missing env var: CLOUDCRAFT_API_KEY")
}
// Check if the command line arguments are correct.
if len(os.Args) != 3 {
log.Fatalf("usage: %s <account-name> <role-arn>", os.Args[0])
}
// Create new Config to initialize a Client.
cfg := cloudcraft.NewConfig(key)
// Create a new Client instance with the given Config.
client, err := cloudcraft.NewClient(cfg)
if err != nil {
log.Fatal(err)
}
// Create a new AWS Account with the name and role ARN coming from command
// line arguments.
account, _, err := client.AWS.Create(
context.Background(),
&cloudcraft.AWSAccount{
Name: os.Args[1],
RoleARN: os.Args[2],
})
if err != nil {
log.Fatal(err)
}
// Print the account ID.
log.Println(account.ID)
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"AWS account name (for example prod or staging)\",\n \"roleArn\": \"arn:aws:iam::1234567890:role/cloudcraft\"\n}\n");
Request request = new Request.Builder()
.url("https://api.cloudcraft.co/aws/account")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
from cloudcraftco import Cloudcraft
cloudcraft = Cloudcraft()
data = {"name": "AWS Account.", "roleArn": 'your-role-arn'}
result = cloudcraft.create_aws_account(data)
require "uri"
require "json"
require "net/http"
url = URI("https://api.cloudcraft.co/aws/account")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request.body = JSON.dump({
"name": "AWS account name (for example, prod or staging)",
"roleArn": "arn:aws:iam::1234567890:role/cloudcraft",
})
response = https.request(request)
puts response.read_body
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
var raw = JSON.stringify({
HERE"name": "AWS account name (for example, prod or staging)",
"roleArn": "arn:aws:iam::1234567890:role/cloudcraft",
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.cloudcraft.co/aws/account", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
GET /aws/account/iamParameters
List the parameters required for you to register a new IAM role in AWS for use with Cloudcraft.
Combined with the AWS CLI to generate IAM roles, this endpoint can facilitate fully automated role creation at scale for organizations with many AWS accounts.
OK
{
"accountId": "1234567890",
"awsConsoleUrl": "https://console.aws.amazon.com/iam/home?#/roles...",
"externalId": "ex53e827-a724-4a2a-9fec-b13761540785"
}
Unauthorized
curl --location 'https://api.cloudcraft.co/aws/account/iamParameters'
package main
import (
"context"
"encoding/json"
"log"
"os"
"github.com/DataDog/cloudcraft-go"
)
func main() {
// Get the API key from the environment.
key, ok := os.LookupEnv("CLOUDCRAFT_API_KEY")
if !ok {
log.Fatal("missing env var: CLOUDCRAFT_API_KEY")
}
// Create new Config to initialize a Client.
cfg := cloudcraft.NewConfig(key)
// Create a new Client instance with the given Config.
client, err := cloudcraft.NewClient(cfg)
if err != nil {
log.Fatal(err)
}
// Get the IAM parameters required for registering a new IAM Role in AWS for
// use with Cloudcraft.
params, _, err := client.AWS.IAMParameters(context.Background())
if err != nil {
log.Fatal(err)
}
// Pretty print all IAM parameters returned by the API.
pretty, _ := json.MarshalIndent(params, "", " ")
log.Println(string(pretty))
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.cloudcraft.co/aws/account/iamParameters")
.method("GET", body)
.build();
Response response = client.newCall(request).execute();
from cloudcraftco import Cloudcraft
cloudcraft = Cloudcraft()
params = cloudcraft.read_aws_role_parameters()
require "uri"
require "net/http"
url = URI("https://api.cloudcraft.co/aws/account/iamParameters")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
response = https.request(request)
puts response.read_body
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
fetch("https://api.cloudcraft.co/aws/account/iamParameters", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
DELETE /aws/account/{account_id}
Delete a registered AWS account.
OK
Unauthorized
Forbidden, insufficient privileges
AWS account not found
curl --location --request DELETE 'https://api.cloudcraft.co/aws/account/{account_id}'
package main
import (
"context"
"log"
"os"
"github.com/DataDog/cloudcraft-go"
)
func main() {
// Get the API key from the environment.
key, ok := os.LookupEnv("CLOUDCRAFT_API_KEY")
if !ok {
log.Fatal("missing env var: CLOUDCRAFT_API_KEY")
}
// Show usage if the number of command line arguments is not correct.
if len(os.Args) != 2 {
log.Fatalf("usage: %s <account-id>", os.Args[0])
}
// Create new Config to initialize a Client.
cfg := cloudcraft.NewConfig(key)
// Create a new Client instance with the given Config.
client, err := cloudcraft.NewClient(cfg)
if err != nil {
log.Fatal(err)
}
// Delete the AWS account with the ID taken from a command line argument.
_, err = client.AWS.Delete(
context.Background(),
os.Args[1],
)
if err != nil {
log.Fatal(err)
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.cloudcraft.co/aws/account/{account_id}")
.method("DELETE", body)
.build();
Response response = client.newCall(request).execute();
from cloudcraftco import Cloudcraft
cloudcraft = Cloudcraft()
account_id = 'your account id'
result = cloudcraft.delete_aws_account(account_id)
require "uri"
require "net/http"
url = URI("https://api.cloudcraft.co/aws/account/{account_id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = https.request(request)
puts response.read_body
var requestOptions = {
method: 'DELETE',
redirect: 'follow'
};
fetch("https://api.cloudcraft.co/aws/account/{account_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
PUT /aws/account/{account_id}
Update an AWS account registered in Cloudcraft.
The body of the request should contain the account properties in JSON format. The response contains the updated account object.
OK
Unauthorized
Forbidden, insufficient privileges
curl --location --request PUT 'https://api.cloudcraft.co/aws/account/{account_id}' \
--data '{"name": "My updated AWS Account",
"roleArn": "arn:aws:iam::1234567890:role/cloudcraft",
}'
package main
import (
"context"
"log"
"os"
"github.com/DataDog/cloudcraft-go"
)
func main() {
// Get the API key from the environment.
key, ok := os.LookupEnv("CLOUDCRAFT_API_KEY")
if !ok {
log.Fatal("missing env var: CLOUDCRAFT_API_KEY")
}
// Check if the command line arguments are correct.
if len(os.Args) != 4 {
log.Fatalf("usage: %s <account-id> <account-name> <role-arn>", os.Args[0])
}
// Create new Config to initialize a Client.
cfg := cloudcraft.NewConfig(key)
// Create a new Client instance with the given Config.
client, err := cloudcraft.NewClient(cfg)
if err != nil {
log.Fatal(err)
}
// Update the AWS Account with the ID, name and role ARN coming from command
// line arguments.
_, err = client.AWS.Update(
context.Background(),
&cloudcraft.AWSAccount{
ID: os.Args[1],
Name: os.Args[2],
RoleARN: os.Args[3],
})
if err != nil {
log.Fatal(err)
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"My updated AWS Account\",\n \"roleArn\": \"arn:aws:iam::1234567890:role/cloudcraft\"\n}\n");
Request request = new Request.Builder()
.url("https://api.cloudcraft.co/aws/account/{account_id}")
.method("PUT", body)
.build();
Response response = client.newCall(request).execute();
from cloudcraftco import Cloudcraft
cloudcraft = Cloudcraft()
account_id = 'your account id'
data = {"name": "Updated AWS Account.", "roleArn": 'your-role-arn'}
result = cloudcraft.update_aws_account(account_id, data)
require "uri"
require "net/http"
url = URI("https://api.cloudcraft.co/aws/account/{account_id}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request.body = "{\n \"name\": \"My updated AWS Account\",\n \"roleArn\": \"arn:aws:iam::1234567890:role/cloudcraft\"\n}\n"
response = https.request(request)
puts response.read_body
var raw = "{\n \"name\": \"My updated AWS Account\",\n \"roleArn\": \"arn:aws:iam::1234567890:role/cloudcraft\"\n}\n";
var requestOptions = {
method: 'PUT',
body: raw,
redirect: 'follow'
};
fetch("https://api.cloudcraft.co/aws/account/{account_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
GET /aws/account/{account_id}/{region}/{format}
Scan and render one region of an AWS account into a blueprint in JSON, SVG, PNG, PDF, or MxGraph format.
The time required to generate the snapshot depends on the number of resources in the AWS region.
The API behaves as a long poll, with a wait time of up to 120 seconds for the result. For most
environments, the API call will therefore directly return a blueprint. If
the wait time is exceeded, a 202 Accepted
response is returned with a{code: STILL_PROCESSING, retry: true ...}
JSON body. The snapshot will continue processing in the background, and a retry will either immediately return the result or continue waiting.
OK
Wait time exceeded
{
"code": "STILL_PROCESSING",
"message": "Result wait time exceeded. Processing continues in the background, retry to receive result.",
"retry": true
}
Unauthorized
Forbidden, insufficient privileges
AWS account not found
curl --location 'https://api.cloudcraft.co/aws/account/{account_id}/{region}/{format}'
package main
import (
"context"
"log"
"os"
"github.com/DataDog/cloudcraft-go"
)
func main() {
// Get the API key from the environment.
key, ok := os.LookupEnv("CLOUDCRAFT_API_KEY")
if !ok {
log.Fatal("missing env var: CLOUDCRAFT_API_KEY")
}
// Check if the command line arguments are correct.
if len(os.Args) != 2 {
log.Fatalf("usage: %s <account-id>", os.Args[0])
}
// Create new Config to initialize a Client.
cfg := cloudcraft.NewConfig(key)
// Create a new Client instance with the given Config.
client, err := cloudcraft.NewClient(cfg)
if err != nil {
log.Fatal(err)
}
// Create a new snapshot of the us-east-1 region with the given account-id
// coming from a command line argument.
snapshot, _, err := client.AWS.Snapshot(
context.Background(),
os.Args[1],
"us-east-1",
"png",
&cloudcraft.SnapshotParams{
Width: 1920,
Height: 1080,
},
)
if err != nil {
log.Fatal(err)
}
// Save the snapshot to a file.
if err := os.WriteFile("snapshot.png", snapshot, 0o600); err != nil {
log.Fatal(err)
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.cloudcraft.co/aws/account/{account_id}/{region}/{format}")
.method("GET", body)
.build();
Response response = client.newCall(request).execute();
from cloudcraftco import Cloudcraft
cloudcraft = Cloudcraft()
account_id = 1234
options = {"grid": True, "scale": 1.5}
region = "us-east-1"
file_format = "png"
snapshot = cloudcraft.snapshot_aws_account(account_id, region, file_format, options)
with open(f'snapshot.{file_format}', "wb") as binary_file:
binary_file.write(snapshot)
require "uri"
require "net/http"
url = URI("https://api.cloudcraft.co/aws/account/{account_id}/{region}/{format}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
response = https.request(request)
puts response.read_body
var requestOptions = {
method: 'GET',
redirect: 'follow'
};
fetch("https://api.cloudcraft.co/aws/account/{account_id}/{region}/{format}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));