|
| 1 | +# Bulk update org group memberships returns "OK" response |
| 2 | + |
| 3 | +require "datadog_api_client" |
| 4 | +DatadogAPIClient.configure do |config| |
| 5 | + config.unstable_operations["v2.bulk_update_org_group_memberships".to_sym] = true |
| 6 | +end |
| 7 | +api_instance = DatadogAPIClient::V2::OrgGroupsAPI.new |
| 8 | + |
| 9 | +body = DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateRequest.new({ |
| 10 | + data: DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateData.new({ |
| 11 | + attributes: DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateAttributes.new({ |
| 12 | + orgs: [ |
| 13 | + DatadogAPIClient::V2::GlobalOrgIdentifier.new({ |
| 14 | + org_site: "datadoghq.com", |
| 15 | + org_uuid: "c3d4e5f6-a7b8-9012-cdef-012345678901", |
| 16 | + }), |
| 17 | + ], |
| 18 | + }), |
| 19 | + relationships: DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateRelationships.new({ |
| 20 | + source_org_group: DatadogAPIClient::V2::OrgGroupRelationshipToOne.new({ |
| 21 | + data: DatadogAPIClient::V2::OrgGroupRelationshipToOneData.new({ |
| 22 | + id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789", |
| 23 | + type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS, |
| 24 | + }), |
| 25 | + }), |
| 26 | + target_org_group: DatadogAPIClient::V2::OrgGroupRelationshipToOne.new({ |
| 27 | + data: DatadogAPIClient::V2::OrgGroupRelationshipToOneData.new({ |
| 28 | + id: "a1b2c3d4-e5f6-7890-abcd-ef0123456789", |
| 29 | + type: DatadogAPIClient::V2::OrgGroupType::ORG_GROUPS, |
| 30 | + }), |
| 31 | + }), |
| 32 | + }), |
| 33 | + type: DatadogAPIClient::V2::OrgGroupMembershipBulkUpdateType::ORG_GROUP_MEMBERSHIP_BULK_UPDATES, |
| 34 | + }), |
| 35 | +}) |
| 36 | +p api_instance.bulk_update_org_group_memberships(body) |
0 commit comments