Class: Dd2tf::Import::User
- Inherits:
-
Base
- Object
- Base
- Dd2tf::Import::User
show all
- Defined in:
- lib/dd2tf/import/user.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #print
Instance Method Details
#resource_type ⇒ Object
4
5
6
|
# File 'lib/dd2tf/import/user.rb', line 4
def resource_type
"datadog_user"
end
|
#resources ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/dd2tf/import/user.rb', line 8
def resources
resources = []
users = @client.get_all_users[1]["users"]
users.each do |user|
user_name = user["name"].to_s.underscore.gsub(" ", "_").gsub(::Dd2tf::UNALLOWED_RESOURCE_TITLE_REGEXP, '')
resource_id = user["email"]
resources << { resource_id: resource_id, resource_name: user_name }
end
resources
end
|