- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
사용자 생성, 편집, 비활성화하기
POST https://api.ap1.datadoghq.com/api/v1/userhttps://api.datadoghq.eu/api/v1/userhttps://api.ddog-gov.com/api/v1/userhttps://api.datadoghq.com/api/v1/userhttps://api.us3.datadoghq.com/api/v1/userhttps://api.us5.datadoghq.com/api/v1/user
Create a user for your organization.
Note: Users can only be created with the admin access role if application keys belong to administrators.
This endpoint requires theuser_access_invite
permission.User object that needs to be created.
{
"access_role": null,
"disabled": false,
"email": "test@datadoghq.com",
"handle": "test@datadoghq.com",
"name": "test user"
}
User created
A Datadog User.
항목
유형
설명
user
object
Create, edit, and disable users.
access_role
enum
The access role of the user. Options are st (standard user), adm (admin user), or ro (read-only user).
Allowed enum values: st,adm,ro,ERROR
disabled
boolean
The new disabled status of the user.
string
The new email of the user.
handle
string
The user handle, must be a valid email.
icon
string
Gravatar icon associated to the user.
name
string
The name of the user.
verified
boolean
Whether or not the user logged in Datadog at least once.
{
"user": {
"access_role": "ro",
"disabled": false,
"email": "test@datadoghq.com",
"handle": "test@datadoghq.com",
"icon": "/path/to/matching/gravatar/icon",
"name": "test user",
"verified": true
}
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Conflict
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
// Create a user returns null access role
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_users::UsersAPI;
use datadog_api_client::datadogV1::model::User;
#[tokio::main]
async fn main() {
let body = User::new()
.access_role(None)
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
POST https://api.ap1.datadoghq.com/api/v2/usershttps://api.datadoghq.eu/api/v2/usershttps://api.ddog-gov.com/api/v2/usershttps://api.datadoghq.com/api/v2/usershttps://api.us3.datadoghq.com/api/v2/usershttps://api.us5.datadoghq.com/api/v2/users
Create a user for your organization.
This endpoint requires the user_access_invite
permission.
OAuth apps require the user_access_invite
authorization scope to access this endpoint.
항목
유형
설명
data [required]
object
Object to create a user.
attributes [required]
object
Attributes of the created user.
email [required]
string
The email of the user.
name
string
The name of the user.
title
string
The title of the user.
relationships
object
Relationships of the user object.
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
{
"data": {
"type": "users",
"attributes": {
"name": "Datadog API Client Python",
"email": "Example-User@datadoghq.com"
}
}
}
OK
Response containing information about a single user.
항목
유형
설명
data
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
included
[ <oneOf>]
Array of objects related to the user.
Option 1
object
Organization object.
attributes
object
Attributes of the organization.
created_at
date-time
Creation time of the organization.
description
string
Description of the organization.
disabled
boolean
Whether or not the organization is disabled.
modified_at
date-time
Time of last organization modification.
name
string
Name of the organization.
public_id
string
Public ID of the organization.
sharing
string
Sharing type of the organization.
url
string
URL of the site that this organization exists at.
id
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
Option 2
object
Permission object.
attributes
object
Attributes of a permission.
created
date-time
Creation time of the permission.
description
string
Description of the permission.
display_name
string
Displayed name for the permission.
display_type
string
Display type.
group_name
string
Name of the permission group.
name
string
Name of the permission.
restricted
boolean
Whether or not the permission is restricted.
id
string
ID of the permission.
type [required]
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
Option 3
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
{
"data": {
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"description": "string",
"disabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"public_id": "string",
"sharing": "string",
"url": "string"
},
"id": "string",
"type": "orgs"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// Create a user returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::UsersAPI;
use datadog_api_client::datadogV2::model::UserCreateAttributes;
use datadog_api_client::datadogV2::model::UserCreateData;
use datadog_api_client::datadogV2::model::UserCreateRequest;
use datadog_api_client::datadogV2::model::UsersType;
#[tokio::main]
async fn main() {
let body = UserCreateRequest::new(UserCreateData::new(
UserCreateAttributes::new("Example-User@datadoghq.com".to_string())
.name("Datadog API Client Python".to_string()),
UsersType::USERS,
));
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.create_user(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
GET https://api.ap1.datadoghq.com/api/v1/userhttps://api.datadoghq.eu/api/v1/userhttps://api.ddog-gov.com/api/v1/userhttps://api.datadoghq.com/api/v1/userhttps://api.us3.datadoghq.com/api/v1/userhttps://api.us5.datadoghq.com/api/v1/user
List all users for your organization.
This endpoint requires the user_access_read
permission.
OAuth apps require the user_access_read
authorization scope to access this endpoint.
OK
Array of Datadog users for a given organization.
항목
유형
설명
users
[object]
Array of users.
access_role
enum
The access role of the user. Options are st (standard user), adm (admin user), or ro (read-only user).
Allowed enum values: st,adm,ro,ERROR
disabled
boolean
The new disabled status of the user.
string
The new email of the user.
handle
string
The user handle, must be a valid email.
icon
string
Gravatar icon associated to the user.
name
string
The name of the user.
verified
boolean
Whether or not the user logged in Datadog at least once.
{
"users": [
{
"access_role": "ro",
"disabled": false,
"email": "test@datadoghq.com",
"handle": "test@datadoghq.com",
"icon": "/path/to/matching/gravatar/icon",
"name": "test user",
"verified": true
}
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
// List all users returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_users::UsersAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.list_users().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
GET https://api.ap1.datadoghq.com/api/v2/usershttps://api.datadoghq.eu/api/v2/usershttps://api.ddog-gov.com/api/v2/usershttps://api.datadoghq.com/api/v2/usershttps://api.us3.datadoghq.com/api/v2/usershttps://api.us5.datadoghq.com/api/v2/users
Get the list of all users in the organization. This list includes
all users even if they are deactivated or unverified.
This endpoint requires the user_access_read
permission.
OAuth apps require the user_access_read
authorization scope to access this endpoint.
이름
유형
설명
page[size]
integer
Size for a given page. The maximum allowed value is 100.
page[number]
integer
Specific page number to return.
sort
string
User attribute to order results by. Sort order is ascending by default.
Sort order is descending if the field
is prefixed by a negative sign, for example sort=-name
. Options: name
,
modified_at
, user_count
.
sort_dir
enum
Direction of sort. Options: asc
, desc
.
Allowed enum values: asc, desc
filter
string
Filter all users by the given string. Defaults to no filtering.
filter[status]
string
Filter on status attribute.
Comma separated list, with possible values Active
, Pending
, and Disabled
.
Defaults to no filtering.
OK
Response containing information about multiple users.
항목
유형
설명
data
[object]
Array of returned users.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
included
[ <oneOf>]
Array of objects related to the users.
Option 1
object
Organization object.
attributes
object
Attributes of the organization.
created_at
date-time
Creation time of the organization.
description
string
Description of the organization.
disabled
boolean
Whether or not the organization is disabled.
modified_at
date-time
Time of last organization modification.
name
string
Name of the organization.
public_id
string
Public ID of the organization.
sharing
string
Sharing type of the organization.
url
string
URL of the site that this organization exists at.
id
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
Option 2
object
Permission object.
attributes
object
Attributes of a permission.
created
date-time
Creation time of the permission.
description
string
Description of the permission.
display_name
string
Displayed name for the permission.
display_type
string
Display type.
group_name
string
Name of the permission group.
name
string
Name of the permission.
restricted
boolean
Whether or not the permission is restricted.
id
string
ID of the permission.
type [required]
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
Option 3
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
meta
object
Object describing meta attributes of response.
page
object
Pagination object.
total_count
int64
Total count.
total_filtered_count
int64
Total count of elements matched by the filter.
{
"data": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
}
],
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"description": "string",
"disabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"public_id": "string",
"sharing": "string",
"url": "string"
},
"id": "string",
"type": "orgs"
}
],
"meta": {
"page": {
"total_count": "integer",
"total_filtered_count": "integer"
}
}
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// List all users returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::ListUsersOptionalParams;
use datadog_api_client::datadogV2::api_users::UsersAPI;
#[tokio::main]
async fn main() {
// there is a valid "user" in the system
let user_data_attributes_email = std::env::var("USER_DATA_ATTRIBUTES_EMAIL").unwrap();
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.list_users(ListUsersOptionalParams::default().filter(user_data_attributes_email.clone()))
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
GET https://api.ap1.datadoghq.com/api/v1/user/{user_handle}https://api.datadoghq.eu/api/v1/user/{user_handle}https://api.ddog-gov.com/api/v1/user/{user_handle}https://api.datadoghq.com/api/v1/user/{user_handle}https://api.us3.datadoghq.com/api/v1/user/{user_handle}https://api.us5.datadoghq.com/api/v1/user/{user_handle}
Get a user’s details.
이름
유형
설명
user_handle [required]
string
The ID of the user.
OK for get user
A Datadog User.
항목
유형
설명
user
object
Create, edit, and disable users.
access_role
enum
The access role of the user. Options are st (standard user), adm (admin user), or ro (read-only user).
Allowed enum values: st,adm,ro,ERROR
disabled
boolean
The new disabled status of the user.
string
The new email of the user.
handle
string
The user handle, must be a valid email.
icon
string
Gravatar icon associated to the user.
name
string
The name of the user.
verified
boolean
Whether or not the user logged in Datadog at least once.
{
"user": {
"access_role": "ro",
"disabled": false,
"email": "test@datadoghq.com",
"handle": "test@datadoghq.com",
"icon": "/path/to/matching/gravatar/icon",
"name": "test user",
"verified": true
}
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
// Get user details returns "OK for get user" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_users::UsersAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.get_user("test@datadoghq.com".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
GET https://api.ap1.datadoghq.com/api/v2/users/{user_id}https://api.datadoghq.eu/api/v2/users/{user_id}https://api.ddog-gov.com/api/v2/users/{user_id}https://api.datadoghq.com/api/v2/users/{user_id}https://api.us3.datadoghq.com/api/v2/users/{user_id}https://api.us5.datadoghq.com/api/v2/users/{user_id}
Get a user in the organization specified by the user’s user_id
.
This endpoint requires the user_access_read
permission.
OAuth apps require the user_access_read
authorization scope to access this endpoint.
이름
유형
설명
user_id [required]
string
The ID of the user.
OK
Response containing information about a single user.
항목
유형
설명
data
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
included
[ <oneOf>]
Array of objects related to the user.
Option 1
object
Organization object.
attributes
object
Attributes of the organization.
created_at
date-time
Creation time of the organization.
description
string
Description of the organization.
disabled
boolean
Whether or not the organization is disabled.
modified_at
date-time
Time of last organization modification.
name
string
Name of the organization.
public_id
string
Public ID of the organization.
sharing
string
Sharing type of the organization.
url
string
URL of the site that this organization exists at.
id
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
Option 2
object
Permission object.
attributes
object
Attributes of a permission.
created
date-time
Creation time of the permission.
description
string
Description of the permission.
display_name
string
Displayed name for the permission.
display_type
string
Display type.
group_name
string
Name of the permission group.
name
string
Name of the permission.
restricted
boolean
Whether or not the permission is restricted.
id
string
ID of the permission.
type [required]
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
Option 3
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
{
"data": {
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"description": "string",
"disabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"public_id": "string",
"sharing": "string",
"url": "string"
},
"id": "string",
"type": "orgs"
}
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// Get user details returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::UsersAPI;
#[tokio::main]
async fn main() {
// there is a valid "user" in the system
let user_data_id = std::env::var("USER_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.get_user(user_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
PUT https://api.ap1.datadoghq.com/api/v1/user/{user_handle}https://api.datadoghq.eu/api/v1/user/{user_handle}https://api.ddog-gov.com/api/v1/user/{user_handle}https://api.datadoghq.com/api/v1/user/{user_handle}https://api.us3.datadoghq.com/api/v1/user/{user_handle}https://api.us5.datadoghq.com/api/v1/user/{user_handle}
Update a user information.
Note: It can only be used with application keys belonging to administrators.
이름
유형
설명
user_handle [required]
string
The ID of the user.
Description of the update.
{
"access_role": "ro",
"disabled": false,
"email": "test@datadoghq.com",
"handle": "test@datadoghq.com",
"name": "test user"
}
User updated
A Datadog User.
항목
유형
설명
user
object
Create, edit, and disable users.
access_role
enum
The access role of the user. Options are st (standard user), adm (admin user), or ro (read-only user).
Allowed enum values: st,adm,ro,ERROR
disabled
boolean
The new disabled status of the user.
string
The new email of the user.
handle
string
The user handle, must be a valid email.
icon
string
Gravatar icon associated to the user.
name
string
The name of the user.
verified
boolean
Whether or not the user logged in Datadog at least once.
{
"user": {
"access_role": "ro",
"disabled": false,
"email": "test@datadoghq.com",
"handle": "test@datadoghq.com",
"icon": "/path/to/matching/gravatar/icon",
"name": "test user",
"verified": true
}
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
// Update a user returns "User updated" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_users::UsersAPI;
use datadog_api_client::datadogV1::model::AccessRole;
use datadog_api_client::datadogV1::model::User;
#[tokio::main]
async fn main() {
let body = User::new()
.access_role(Some(AccessRole::READ_ONLY))
.disabled(false)
.email("test@datadoghq.com".to_string())
.handle("test@datadoghq.com".to_string())
.name("test user".to_string());
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.update_user("test@datadoghq.com".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
PATCH https://api.ap1.datadoghq.com/api/v2/users/{user_id}https://api.datadoghq.eu/api/v2/users/{user_id}https://api.ddog-gov.com/api/v2/users/{user_id}https://api.datadoghq.com/api/v2/users/{user_id}https://api.us3.datadoghq.com/api/v2/users/{user_id}https://api.us5.datadoghq.com/api/v2/users/{user_id}
Edit a user. Can only be used with an application key belonging to an administrator user. This endpoint requires any of the following permissions:
user_access_manage
service_account_write
OAuth apps require the user_access_manage
authorization scope to access this endpoint.
이름
유형
설명
user_id [required]
string
The ID of the user.
항목
유형
설명
data [required]
object
Object to update a user.
attributes [required]
object
Attributes of the edited user.
disabled
boolean
If the user is enabled or disabled.
string
The email of the user.
name
string
The name of the user.
id [required]
string
ID of the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
{
"data": {
"id": "string",
"type": "users",
"attributes": {
"name": "updated",
"disabled": true
}
}
}
OK
Response containing information about a single user.
항목
유형
설명
data
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
included
[ <oneOf>]
Array of objects related to the user.
Option 1
object
Organization object.
attributes
object
Attributes of the organization.
created_at
date-time
Creation time of the organization.
description
string
Description of the organization.
disabled
boolean
Whether or not the organization is disabled.
modified_at
date-time
Time of last organization modification.
name
string
Name of the organization.
public_id
string
Public ID of the organization.
sharing
string
Sharing type of the organization.
url
string
URL of the site that this organization exists at.
id
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
Option 2
object
Permission object.
attributes
object
Attributes of a permission.
created
date-time
Creation time of the permission.
description
string
Description of the permission.
display_name
string
Displayed name for the permission.
display_type
string
Display type.
group_name
string
Name of the permission group.
name
string
Name of the permission.
restricted
boolean
Whether or not the permission is restricted.
id
string
ID of the permission.
type [required]
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
Option 3
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
{
"data": {
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"description": "string",
"disabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"public_id": "string",
"sharing": "string",
"url": "string"
},
"id": "string",
"type": "orgs"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Unprocessable Entity
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// Update a user returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::UsersAPI;
use datadog_api_client::datadogV2::model::UserUpdateAttributes;
use datadog_api_client::datadogV2::model::UserUpdateData;
use datadog_api_client::datadogV2::model::UserUpdateRequest;
use datadog_api_client::datadogV2::model::UsersType;
#[tokio::main]
async fn main() {
// there is a valid "user" in the system
let user_data_id = std::env::var("USER_DATA_ID").unwrap();
let body = UserUpdateRequest::new(UserUpdateData::new(
UserUpdateAttributes::new()
.disabled(true)
.name("updated".to_string()),
user_data_id.clone(),
UsersType::USERS,
));
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.update_user(user_data_id.clone(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
DELETE https://api.ap1.datadoghq.com/api/v1/user/{user_handle}https://api.datadoghq.eu/api/v1/user/{user_handle}https://api.ddog-gov.com/api/v1/user/{user_handle}https://api.datadoghq.com/api/v1/user/{user_handle}https://api.us3.datadoghq.com/api/v1/user/{user_handle}https://api.us5.datadoghq.com/api/v1/user/{user_handle}
Delete a user from an organization.
Note: This endpoint can only be used with application keys belonging to administrators.
이름
유형
설명
user_handle [required]
string
The handle of the user.
User disabled
Array of user disabled for a given organization.
{
"message": "string"
}
Bad Request
Error response object.
{
"errors": [
"Bad Request"
]
}
Authentication error
Error response object.
{
"errors": [
"Bad Request"
]
}
Not Found
Error response object.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
{
"errors": [
"Bad Request"
]
}
// Disable a user returns "User disabled" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV1::api_users::UsersAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.disable_user("test@datadoghq.com".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
DELETE https://api.ap1.datadoghq.com/api/v2/users/{user_id}https://api.datadoghq.eu/api/v2/users/{user_id}https://api.ddog-gov.com/api/v2/users/{user_id}https://api.datadoghq.com/api/v2/users/{user_id}https://api.us3.datadoghq.com/api/v2/users/{user_id}https://api.us5.datadoghq.com/api/v2/users/{user_id}
Disable a user. Can only be used with an application key belonging to an administrator user. This endpoint requires any of the following permissions:
user_access_manage
service_account_write
OAuth apps require the user_access_manage
authorization scope to access this endpoint.
이름
유형
설명
user_id [required]
string
The ID of the user.
OK
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// Disable a user returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::UsersAPI;
#[tokio::main]
async fn main() {
// there is a valid "user" in the system
let user_data_id = std::env::var("USER_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.disable_user(user_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
GET https://api.ap1.datadoghq.com/api/v2/users/{user_id}/orgshttps://api.datadoghq.eu/api/v2/users/{user_id}/orgshttps://api.ddog-gov.com/api/v2/users/{user_id}/orgshttps://api.datadoghq.com/api/v2/users/{user_id}/orgshttps://api.us3.datadoghq.com/api/v2/users/{user_id}/orgshttps://api.us5.datadoghq.com/api/v2/users/{user_id}/orgs
Get a user organization. Returns the user information and all organizations joined by this user.
이름
유형
설명
user_id [required]
string
The ID of the user.
OK
Response containing information about a single user.
항목
유형
설명
data
object
User object returned by the API.
attributes
object
Attributes of user object returned by the API.
created_at
date-time
Creation time of the user.
disabled
boolean
Whether the user is disabled.
string
Email of the user.
handle
string
Handle of the user.
icon
string
URL of the user's icon.
mfa_enabled
boolean
If user has MFA enabled.
modified_at
date-time
Time that the user was last modified.
name
string
Name of the user.
service_account
boolean
Whether the user is a service account.
status
string
Status of the user.
title
string
Title of the user.
verified
boolean
Whether the user is verified.
id
string
ID of the user.
relationships
object
Relationships of the user object returned by the API.
org
object
Relationship to an organization.
data [required]
object
Relationship to organization object.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_orgs
object
Relationship to organizations.
data [required]
[object]
Relationships to organization objects.
id [required]
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
other_users
object
Relationship to users.
data [required]
[object]
Relationships to user objects.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
roles
object
Relationship to roles.
data
[object]
An array containing type and the unique identifier of a role.
id
string
The unique identifier of the role.
type
enum
Roles type.
Allowed enum values: roles
default: roles
type
enum
Users resource type.
Allowed enum values: users
default: users
included
[ <oneOf>]
Array of objects related to the user.
Option 1
object
Organization object.
attributes
object
Attributes of the organization.
created_at
date-time
Creation time of the organization.
description
string
Description of the organization.
disabled
boolean
Whether or not the organization is disabled.
modified_at
date-time
Time of last organization modification.
name
string
Name of the organization.
public_id
string
Public ID of the organization.
sharing
string
Sharing type of the organization.
url
string
URL of the site that this organization exists at.
id
string
ID of the organization.
type [required]
enum
Organizations resource type.
Allowed enum values: orgs
default: orgs
Option 2
object
Permission object.
attributes
object
Attributes of a permission.
created
date-time
Creation time of the permission.
description
string
Description of the permission.
display_name
string
Displayed name for the permission.
display_type
string
Display type.
group_name
string
Name of the permission group.
name
string
Name of the permission.
restricted
boolean
Whether or not the permission is restricted.
id
string
ID of the permission.
type [required]
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
Option 3
object
Role object returned by the API.
attributes
object
Attributes of the role.
created_at
date-time
Creation time of the role.
modified_at
date-time
Time of last role modification.
name
string
The name of the role. The name is neither unique nor a stable identifier of the role.
user_count
int64
Number of users with that role.
id
string
The unique identifier of the role.
relationships
object
Relationships of the role object returned by the API.
permissions
object
Relationship to multiple permissions objects.
data
[object]
Relationships to permission objects.
id
string
ID of the permission.
type
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
type [required]
enum
Roles type.
Allowed enum values: roles
default: roles
{
"data": {
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"disabled": false,
"email": "string",
"handle": "string",
"icon": "string",
"mfa_enabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"service_account": false,
"status": "string",
"title": "string",
"verified": false
},
"id": "string",
"relationships": {
"org": {
"data": {
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
},
"other_orgs": {
"data": [
{
"id": "00000000-0000-beef-0000-000000000000",
"type": "orgs"
}
]
},
"other_users": {
"data": [
{
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
]
},
"roles": {
"data": [
{
"id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
"type": "roles"
}
]
}
},
"type": "users"
},
"included": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"description": "string",
"disabled": false,
"modified_at": "2019-09-19T10:00:00.000Z",
"name": "string",
"public_id": "string",
"sharing": "string",
"url": "string"
},
"id": "string",
"type": "orgs"
}
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// Get a user organization returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::UsersAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api
.list_user_organizations("00000000-0000-9999-0000-000000000000".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
GET https://api.ap1.datadoghq.com/api/v2/users/{user_id}/permissionshttps://api.datadoghq.eu/api/v2/users/{user_id}/permissionshttps://api.ddog-gov.com/api/v2/users/{user_id}/permissionshttps://api.datadoghq.com/api/v2/users/{user_id}/permissionshttps://api.us3.datadoghq.com/api/v2/users/{user_id}/permissionshttps://api.us5.datadoghq.com/api/v2/users/{user_id}/permissions
Get a user permission set. Returns a list of the user’s permissions
granted by the associated user’s roles.
This endpoint requires the user_access_read
permission.
OAuth apps require the user_access_read
authorization scope to access this endpoint.
이름
유형
설명
user_id [required]
string
The ID of the user.
OK
Payload with API-returned permissions.
항목
유형
설명
data
[object]
Array of permissions.
attributes
object
Attributes of a permission.
created
date-time
Creation time of the permission.
description
string
Description of the permission.
display_name
string
Displayed name for the permission.
display_type
string
Display type.
group_name
string
Name of the permission group.
name
string
Name of the permission.
restricted
boolean
Whether or not the permission is restricted.
id
string
ID of the permission.
type [required]
enum
Permissions resource type.
Allowed enum values: permissions
default: permissions
{
"data": [
{
"attributes": {
"created": "2019-09-19T10:00:00.000Z",
"description": "string",
"display_name": "string",
"display_type": "string",
"group_name": "string",
"name": "string",
"restricted": false
},
"id": "string",
"type": "permissions"
}
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// Get a user permissions returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::UsersAPI;
#[tokio::main]
async fn main() {
// there is a valid "user" in the system
let user_data_id = std::env::var("USER_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.list_user_permissions(user_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
POST https://api.ap1.datadoghq.com/api/v2/user_invitationshttps://api.datadoghq.eu/api/v2/user_invitationshttps://api.ddog-gov.com/api/v2/user_invitationshttps://api.datadoghq.com/api/v2/user_invitationshttps://api.us3.datadoghq.com/api/v2/user_invitationshttps://api.us5.datadoghq.com/api/v2/user_invitations
Sends emails to one or more users inviting them to join the organization.
This endpoint requires the user_access_invite
permission.
OAuth apps require the user_access_invite
authorization scope to access this endpoint.
항목
유형
설명
data [required]
[object]
List of user invitations.
relationships [required]
object
Relationships data for user invitation.
user [required]
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type [required]
enum
User invitations type.
Allowed enum values: user_invitations
default: user_invitations
{
"data": [
{
"type": "user_invitations",
"relationships": {
"user": {
"data": {
"type": "users",
"id": "string"
}
}
}
}
]
}
OK
User invitations as returned by the API.
항목
유형
설명
data
[object]
Array of user invitations.
attributes
object
Attributes of a user invitation.
created_at
date-time
Creation time of the user invitation.
expires_at
date-time
Time of invitation expiration.
invite_type
string
Type of invitation.
uuid
string
UUID of the user invitation.
id
string
ID of the user invitation.
relationships
object
Relationships data for user invitation.
user [required]
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
User invitations type.
Allowed enum values: user_invitations
default: user_invitations
{
"data": [
{
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"expires_at": "2019-09-19T10:00:00.000Z",
"invite_type": "string",
"uuid": "string"
},
"id": "string",
"relationships": {
"user": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "user_invitations"
}
]
}
Bad Request
API error response.
{
"errors": [
"Bad Request"
]
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// Send invitation emails returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::UsersAPI;
use datadog_api_client::datadogV2::model::RelationshipToUser;
use datadog_api_client::datadogV2::model::RelationshipToUserData;
use datadog_api_client::datadogV2::model::UserInvitationData;
use datadog_api_client::datadogV2::model::UserInvitationRelationships;
use datadog_api_client::datadogV2::model::UserInvitationsRequest;
use datadog_api_client::datadogV2::model::UserInvitationsType;
use datadog_api_client::datadogV2::model::UsersType;
#[tokio::main]
async fn main() {
// there is a valid "user" in the system
let user_data_id = std::env::var("USER_DATA_ID").unwrap();
let body = UserInvitationsRequest::new(vec![UserInvitationData::new(
UserInvitationRelationships::new(RelationshipToUser::new(RelationshipToUserData::new(
user_data_id.clone(),
UsersType::USERS,
))),
UserInvitationsType::USER_INVITATIONS,
)]);
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.send_invitations(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run
GET https://api.ap1.datadoghq.com/api/v2/user_invitations/{user_invitation_uuid}https://api.datadoghq.eu/api/v2/user_invitations/{user_invitation_uuid}https://api.ddog-gov.com/api/v2/user_invitations/{user_invitation_uuid}https://api.datadoghq.com/api/v2/user_invitations/{user_invitation_uuid}https://api.us3.datadoghq.com/api/v2/user_invitations/{user_invitation_uuid}https://api.us5.datadoghq.com/api/v2/user_invitations/{user_invitation_uuid}
Returns a single user invitation by its UUID.
This endpoint requires the user_access_invite
permission.
OAuth apps require the user_access_invite
authorization scope to access this endpoint.
이름
유형
설명
user_invitation_uuid [required]
string
The UUID of the user invitation.
OK
User invitation as returned by the API.
항목
유형
설명
data
object
Object of a user invitation returned by the API.
attributes
object
Attributes of a user invitation.
created_at
date-time
Creation time of the user invitation.
expires_at
date-time
Time of invitation expiration.
invite_type
string
Type of invitation.
uuid
string
UUID of the user invitation.
id
string
ID of the user invitation.
relationships
object
Relationships data for user invitation.
user [required]
object
Relationship to user.
data [required]
object
Relationship to user object.
id [required]
string
A unique identifier that represents the user.
type [required]
enum
Users resource type.
Allowed enum values: users
default: users
type
enum
User invitations type.
Allowed enum values: user_invitations
default: user_invitations
{
"data": {
"attributes": {
"created_at": "2019-09-19T10:00:00.000Z",
"expires_at": "2019-09-19T10:00:00.000Z",
"invite_type": "string",
"uuid": "string"
},
"id": "string",
"relationships": {
"user": {
"data": {
"id": "00000000-0000-0000-2345-000000000000",
"type": "users"
}
}
},
"type": "user_invitations"
}
}
Authentication error
API error response.
{
"errors": [
"Bad Request"
]
}
Not found
API error response.
{
"errors": [
"Bad Request"
]
}
Too many requests
API error response.
{
"errors": [
"Bad Request"
]
}
// Get a user invitation returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_users::UsersAPI;
#[tokio::main]
async fn main() {
// the "user" has a "user_invitation"
let user_invitation_id = std::env::var("USER_INVITATION_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = UsersAPI::with_config(configuration);
let resp = api.get_invitation(user_invitation_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
First install the library and its dependencies and then save the example to src/main.rs
and run following commands:
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run