• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

이 한글 문서는 사용자의 편의를 위해 기계 번역되었습니다.

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하시기 바랍니다.

문제 신고

NerdGraph 튜토리얼: 사용자 그룹 관리

NerdGraph API 를 사용하여 사용자 그룹과 해당 그룹이 액세스할 수 있는 항목을 보고 관리할 수 있습니다. UI에서 이 작업을 수행하는 방법은 사용자 관리 UI 문서 를 참조하세요.

NerdGraph를 사용하여 사용자를 생성하고 해당 정보를 보려면 NerdGraph로 사용자 관리 를 참조하십시오.

요구 사항

NerdGraph를 통해 사용자 및 그룹을 관리하기 위한 몇 가지 요구 사항:

  • 사용자 그룹 및 역할을 사용자 정의하려면 Pro 또는 Enterprise 버전이 필요합니다.

  • SCIM 프로비저닝 을 사용하는 경우 해당 인증 도메인에 대해 그룹을 생성하거나 그룹에 사용자를 추가할 수 없습니다. 그룹과 사용자가 SCIM을 통해 관리되기 때문입니다.

  • 귀하는 최신 사용자 모델 의 사용자여야 합니다.기타 권한 관련 요구 사항:

시작하기 전에

NerdGraph를 사용하여 사용자를 관리하기 전에:

그룹 생성을 위한 제안된 워크플로

이러한 쿼리와 변형을 다양한 방법과 다양한 순서로 사용할 수 있지만 다음은 그룹 설정을 위한 한 가지 일반적인 워크플로입니다.

  1. 사용자 정보사용 가능한 역할 쿼리: 이것은 New Relic에 있는 사용자와 사용 가능한 역할을 이해하는 데 도움이 되는 첫 번째 장소가 될 수 있습니다. 이제 막 시작하는 경우 아직 사용자를 추가하지 않았을 수 있으며 표준 역할만 있을 수 있습니다.
  2. 선택 사항: 새 그룹 만들기 : SCIM 프로비저닝을 사용하는 경우 사용할 수 없습니다. 기존 그룹을 사용하거나 새 그룹을 생성할 수 있습니다. 그룹을 만든 후 역할 및 계정에 대한 액세스 권한을 부여해야 합니다. 그룹 자체는 해당 그룹의 사용자에게 액세스 권한을 부여하지 않습니다. 사용자가 실제로 New Relic에 액세스할 수 있는 역할과 계정이 할당된 경우에만 그룹이 지정됩니다.
  3. 그룹에 대한 액세스 권한 부여 : 그룹에 역할 및 계정에 대한 액세스 권한을 할당합니다.

작업이 완료되면 생성한 그룹에 이미 사용자가 있고 해당 그룹에 하나 이상의 역할과 계정에 대한 액세스 권한이 있는 경우 몇 분 이내에 액세스 권한이 있어야 합니다( EU 지역 New Relic 계정 의 경우 이 작업을 수행할 수 있음). 최대 20분 정도 소요). 사용자가 아직 해당 그룹에 없는 경우(새 그룹을 만든 경우 해당) 해당 그룹에 사용자를 추가 할 수 있습니다.

쿼리 그룹

다음은 지정된 인증 도메인의 기존 그룹을 쿼리하는 예입니다.

{
actor {
organization {
userManagement {
authenticationDomains(id: "YOUR_AUTHENTICATION_DOMAIN_ID") {
authenticationDomains {
groups {
groups {
displayName
id
}
}
}
}
}
}
}
}

기존 역할 쿼리

다음은 역할에 대한 정보를 반환하는 예입니다.

{
actor {
organization {
authorizationManagement {
authenticationDomains {
authenticationDomains {
groups {
groups {
roles {
roles {
accountId
displayName
id
name
organizationId
type
}
}
}
}
}
}
}
}
}
}

다음은 결과의 예입니다.

{
"data": {
"actor": {
"organization": {
"authorizationManagement": {
"authenticationDomains": {
"authenticationDomains": [
{
"groups": {
"groups": [
{
"roles": {
"roles": [
{
"accountId": "account-id",
"displayName": "name",
"id": "id",
"name": "role-name",
"organizationId": null,
"type": "role-type"
},
{
"accountId":null,
"displayName": "name",
"id": "id",
"name": "role-name",
"organizationId": "organization-id",
"type": "role-type"
}
]
}
}
]
}
}
]
}
}
}
}
}
}

사용자 쿼리

사용자 정보 쿼리

다음은 사용자에 대한 정보를 쿼리하는 예입니다.

{
actor {
organization {
userManagement {
authenticationDomains {
authenticationDomains {
groups {
groups {
users {
users {
id
email
name
timeZone
}
}
}
}
}
}
}
}
}
}

다음은 결과의 예입니다.

{
"data": {
"actor": {
"organization": {
"userManagement": {
"authenticationDomains": {
"authenticationDomains": [
{
"groups": {
"groups": [
{
"users": {
"users": [
{
"email": "example@newrelic.com",
"id": "123456789",
"name": "Example Relic",
"timeZone": "Etc/UTC"
}
]
}
}
]
}
}
]
}
}
}
}
}
}

사용자의 그룹 구성원 쿼리

다음은 사용자가 속한 그룹을 쿼리하는 예입니다.

{
actor {
organization {
userManagement {
authenticationDomains {
authenticationDomains {
users {
users {
groups {
groups {
displayName
}
}
email
}
}
}
}
}
}
}
}

다음은 응답 예시입니다.

{
"data": {
"actor": {
"organization": {
"userManagement": {
"authenticationDomains": {
"authenticationDomains": [
{
"users": {
"users": [
{
"email": "pete@example.com",
"groups": {
"groups": [
{
"displayName": "Admin"
},
{
"displayName": "Basic Sub Account"
}
]
}
},

그룹 만들기

다음은 그룹 을 만드는 예입니다.

mutation {
userManagementCreateGroup(
createGroupOptions: {
authenticationDomainId: "YOUR_AUTH_DOMAIN_ID"
displayName: "GROUP_DISPLAY_NAME"
}
) {
group {
displayName
id
}
}
}

성공적인 응답:

{
"data": {
"userManagementCreateGroup": {
"group": {
"displayName": "GROUP_DISPLAY_NAME"
"id": "GROUP_ID"
}
}
}
}

사용자 그룹 업데이트

다음은 그룹 업데이트의 예입니다.

mutation {
userManagementUpdateGroup(
updateGroupOptions: {
displayName: "YOUR_UPDATED_GROUP_NAME"
id: "YOUR_GROUP_ID"
}
) {
group {
id
displayName
}
}
}

성공에 대한 응답:

{
"data": {
"userManagementUpdateGroup": {
"group": {
"displayName": "YOUR_UPDATED_GROUP_NAME",
"id": "GROUP_ID"
}
}
}
}

실패에 대한 응답:

{
"data": {
"userManagementUpdateGroup": null
},
"errors": [
{
"extensions": {
"errorClass": "SERVER_ERROR"
},
"locations": [
{
"column": 3,
"line": 2
}
],
"message": "Group could not be found",
"path": ["userManagementUpdateGroup"]
}
]
}

그룹 삭제

다음은 그룹 을 삭제하는 예입니다.

mutation {
userManagementDeleteGroup(groupOptions: { id: "YOUR_GROUP_ID" }) {
group {
id
}
}
}

성공에 대한 응답:

{
"data": {
"userManagementDeleteGroup": {
"group": {
"id": "GROUP_ID"
}
}
}
}

실패에 대한 응답:

{
"data": {
"userManagementDeleteGroup": null
},
"errors": [
{
"extensions": {
"errorClass": "SERVER_ERROR"
},
"locations": [
{
"column": 3,
"line": 2
}
],
"message": "Couldn't find Group with 'id'='ENTERED_GROUP_ID",
"path": ["userManagementDeleteGroup"]
}
]
}

그룹에 사용자 추가

다음은 그룹에 사용자를 추가하는 예입니다.

mutation {
userManagementAddUsersToGroups(
addUsersToGroupsOptions: {
groupIds: [FIRST_GROUP_ID, SECOND_GROUP_ID]
userIds: [YOUR_USERS_IDS]
}
) {
groups {
displayName
id
}
}
}

성공에 대한 응답:

{
"data": {
"userManagementAddUsersToGroups": {
"groups": [
{
"displayName": "GROUP_1_NAME",
"id": "GROUP_ID_1"
},
{
"displayName": "GROUP_NAME_2",
"id": "GROUP_ID_2"
}
]
}
}
}

실패에 대한 응답:

{
"data": {
"userManagementAddUsersToGroups": null
},
"errors": [
{
"extensions": {
"errorClass": "SERVER_ERROR"
},
"locations": [
{
"column": 3,
"line": 2
}
],
"message": "The following ids were not found: group_ids: 'NON_EXISTENT_GROUP_ID'",
"path": ["userManagementAddUsersToGroups"]
}
]
}

그룹에서 사용자 제거

다음은 그룹에서 사용자를 제거하는 예입니다.

mutation {
userManagementRemoveUsersFromGroups(
removeUsersFromGroupsOptions: {
groupIds: [YOUR_GROUP_IDS]
userIds: [YOUR_USER_IDS]
}
) {
groups {
displayName
id
}
}
}

성공에 대한 응답:

{
"data": {
"userManagementRemoveUsersFromGroups": {
"groups": [
{
"displayName": "YOUR_GROUP_NAME",
"id": "YOUR_GROUP_ID"
}
]
}
}
}

실패에 대한 응답:

{
"data": {
"userManagementRemoveUsersFromGroups": null
},
"errors": [
{
"extensions": {
"errorClass": "SERVER_ERROR"
},
"locations": [
{
"column": 3,
"line": 2
}
],
"message": "The following ids were not found: user_ids: 'NON-EXISTENT_USER_ID'",
"path": ["userManagementRemoveUsersFromGroups"]
}
]
}

그룹에 액세스 권한 부여

다음은 역할 및 계정에 대한 액세스 권한을 그룹에 부여하는 예입니다.

mutation {
authorizationManagementGrantAccess(
grantAccessOptions: {
groupId: "YOUR_GROUP_ID"
accountAccessGrants: {
accountId: YOUR_ACCOUNT_ID
roleId: "YOUR_ROLE_ID"
}
}
) {
roles {
displayName
accountId
}
}
}

성공에 대한 응답:

{
"data": {
"authorizationManagementGrantAccess": {
"roles": [
{
"displayName": "ROLE_NAME_1",
"id": "ROLE_ID_1"
},
{
"displayName": "ROLE_NAME_2",
"id": "ROLE_ID_2"
},
{
"displayName": "ROLE_NAME_3",
"id": "ROLE_ID_3"
},
{
"displayName": "ROLE_NAME_4",
"id": "ROLE_ID_4"
}
]
}
}
}

실패에 대한 응답:

{
"data": {
"authorizationManagementGrantAccess": null
},
"errors": [
{
"extensions": {
"errorClass": "SERVER_ERROR"
},
"locations": [
{
"column": 3,
"line": 2
}
],
"message": "Validation failed: Role must exist, Role can't be blank, Role scope does not match granted_on type",
"path": ["authorizationManagementGrantAccess"]
}
]
}

역할 ID 찾기

그룹에 대한 액세스 권한 부여와 같은 일부 사용 사례의 경우 역할 ID, 즉 New Relic에서 해당 역할을 나타내는 숫자 ID가 필요할 수 있습니다.

기본 역할관리 설정 에 대한 몇 가지 ID는 다음과 같습니다.

  • All product admin [모든 제품 관리자]: 1254.

  • Standard user [일반 사용자]: 1253.

  • Read only [읽기 전용]: 1252.

  • 조직 관리자 설정 1994

    • Read only [읽기 전용]: 1995
  • Authentication domain setting [인증 도메인 설정]:

    • Manage [관리]: 1996
    • Read only [읽기 전용]: 1997
    • Add users [사용자 추가]: 14517
    • Read users [사용자 읽기]: 14603
  • Group admin [그룹 관리자]: 14516

다음은 사용자 정의 역할의 ID를 찾는 쿼리입니다.

{
actor {
organization {
authorizationManagement {
authenticationDomains(id: "YOUR_AUTHENTICATION_DOMAIN_ID") {
authenticationDomains {
groups {
groups {
displayName
id
roles {
roles {
roleId
name
}
}
}
}
}
}
}
}
}
}

그룹에서 권한 부여 취소

다음은 그룹에서 액세스 권한을 제거하는 예입니다.

mutation {
authorizationManagementRevokeAccess(
revokeAccessOptions: {
accountAccessGrants: {
accountId: YOUR_ACCOUNT_ID
roleId: "YOUR_ROLE_ID"
}
groupId: "YOUR_GROUP_ID"
}
) {
roles {
accountId
displayName
}
}
}

성공에 대한 응답:

{
"data": {
"authorizationManagementRevokeAccess": {
"roles": [
{
"displayName": "ROLE_NAME_1",
"id": "ROLE_ID_1"
},
{
"displayName": "ROLE_NAME_2",
"id": "ROLE_ID_2"
},
{
"displayName": "ROLE_NAME_3",
"id": "ROLE_ID_3"
}
]
}
}
}
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.