config.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <div class="gf-form-group">
  2. <div class="grafana-info-box">
  3. <h5>GCP Service Account</h5>
  4. <p>
  5. To authenticate with the Stackdriver API, you need to create a Google Cloud Platform (GCP) Service Account for
  6. the Project you want to show data for. A Grafana datasource integrates with one GCP Project. If you want to
  7. visualize data from multiple GCP Projects then you need to create one datasource per GCP Project.
  8. </p>
  9. <p>
  10. The <strong>Monitoring Viewer</strong> role provides all the permissions that Grafana needs.
  11. </p>
  12. <p>
  13. The following APIs need to be enabled on GCP for the datasource to work:
  14. <ul>
  15. <li><a class="external-link" target="_blank" href="https://console.cloud.google.com/apis/library/monitoring.googleapis.com">Monitoring
  16. API</a></li>
  17. <li><a class="external-link" target="_blank" href="https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com">Resource
  18. Manager API</a></li>
  19. </ul>
  20. </p>
  21. <p>Detailed instructions on how to create a Service Account can be found <a class="external-link" target="_blank"
  22. href="http://docs.grafana.org/datasources/stackdriver/">in
  23. the documentation.</a></p>
  24. </div>
  25. </div>
  26. <div class="gf-form-group">
  27. <div class="gf-form">
  28. <h3>Service Account Authentication</h3>
  29. <info-popover mode="header">Upload your Service Account key file or paste in the contents of the file. The file
  30. contents will be encrypted and saved in the Grafana database.</info-popover>
  31. </div>
  32. <gf-form-switch class="gf-form" label="Use GCE default Authentication" checked="ctrl.current.jsonData.gceAutomaticAuthentication"
  33. switch-class="max-width-4" label-class="width-16"></gf-form-switch>
  34. <div ng-if="!ctrl.current.jsonData.clientEmail && !ctrl.inputDataValid">
  35. <div class="gf-form-group" ng-if="!ctrl.inputDataValid">
  36. <div class="gf-form">
  37. <form>
  38. <dash-upload on-upload="ctrl.onUpload(dash)" btn-text="Upload Service Account key file"></dash-upload>
  39. </form>
  40. </div>
  41. </div>
  42. <div class="gf-form-group">
  43. <h5 class="section-heading" ng-if="!ctrl.inputDataValid">Or paste Service Account key JSON</h5>
  44. <div class="gf-form" ng-if="!ctrl.inputDataValid">
  45. <textarea rows="10" data-share-panel-url="" class="gf-form-input" ng-model="ctrl.jsonText" ng-paste="ctrl.onPasteJwt($event)"></textarea>
  46. </div>
  47. <div ng-repeat="valError in ctrl.validationErrors" class="text-error p-l-1">
  48. <i class="fa fa-warning"></i>
  49. {{valError}}
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="gf-form-group" ng-if="ctrl.inputDataValid || ctrl.current.jsonData.clientEmail">
  55. <h6>Uploaded Key Details</h6>
  56. <div class="gf-form">
  57. <span class="gf-form-label width-9">Project</span>
  58. <input class="gf-form-input width-40" disabled type="text" ng-model="ctrl.current.jsonData.defaultProject" />
  59. </div>
  60. <div class="gf-form">
  61. <span class="gf-form-label width-9">Client Email</span>
  62. <input class="gf-form-input width-40" disabled type="text" ng-model="ctrl.current.jsonData.clientEmail" />
  63. </div>
  64. <div class="gf-form">
  65. <span class="gf-form-label width-9">Token URI</span>
  66. <input class="gf-form-input width-40" disabled type="text" ng-model='ctrl.current.jsonData.tokenUri' />
  67. </div>
  68. <div class="gf-form" ng-if="ctrl.current.secureJsonFields.privateKey">
  69. <span class="gf-form-label width-9">Private Key</span>
  70. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  71. </div>
  72. <div class="gf-form width-18">
  73. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="ctrl.resetValidationMessages()">Reset Service
  74. Account Key </a>
  75. <info-popover mode="right-normal">
  76. Reset to clear the uploaded key and upload a new file.
  77. </info-popover>
  78. </div>
  79. </div>
  80. <p class="gf-form-label" ng-hide="ctrl.current.secureJsonFields.privateKey"><i class="fa fa-save"></i> Do not forget to save your changes after uploading a file.</p>
  81. <div class="grafana-info-box" ng-hide="ctrl.current.secureJsonFields.privateKey">
  82. Do not forget to save your changes after uploading a file.
  83. </div>