• /
  • ログイン
  • 無料アカウント

NerdGraph tutorial: Move dashboards to other accounts

You can export your dashboards and import them into a new account using queries and mutations in NerdGraph.

ヒント

You can also export your dashboards as an image.

To do so:

  1. Go to the GraphiQL explorer.
  2. Find out which dashboards are available.
  3. Export the desired dashboard.
  4. Import the selected dashboard into a new account.

List your dashboards

Use the following query to retrieve a list of your existing dashboards:

{
actor {
entitySearch(queryBuilder: {type: DASHBOARD}) {
results {
entities {
... on DashboardEntityOutline {
guid
name
accountId
}
}
}
}
}
}

Export a dashboard

Use the following query to export, then extract the dashboard's entity information from the output:

{
  actor {
    entity(guid: "your_guid_xxxxxxx") {
      ... on DashboardEntity {
        name
        permissions
        pages {
          name
          widgets {
            visualization { id }
            title
            layout { row width height column }
            rawConfiguration
          }
        }
      }
    }
  }
}

Example entity information in GraphiQL output:

dashboards_api_entity_section.png

Import a dashboard into a new account

Use the following mutation to import the dashboard into another account:

mutation create($dashboard: Input!) {
  dashboardCreate(accountId: your_new_AccountID, dashboard: $dashboard) {
    entityResult {
      guid
      name
    }
    errors {
      description
    }
  }
}

Follow these steps:

  1. In the Query variables section, name the entity Dashboard (since we declared the input variable as $dashboard).
  2. Copy and paste the entity's output into the new account. It will be copied as an entity.
  3. Change entity to dashboard.

dashboards_api_paste_entity.png

その他のヘルプ

さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:

問題を作成するこのページを編集する
Copyright © 2020 New Relic Inc.