annotate Sphinx/source/plugins/google-cloud-platform.rst @ 255:949a13b92195

google
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 26 Jun 2019 22:31:25 +0200
parents 63cc25161330
children 8a8d8a908c6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
254
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 .. _google:
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 Google Cloud Platform plugin
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 ============================
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 .. contents::
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
255
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
9
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
10 Introduction
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
11 ------------
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
12
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
13 Osimis freely provides the `source code
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
14 <https://bitbucket.org/osimis/orthanc-gcp/src>`__ of a dedicated
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
15 plugin to interface Orthanc with the Healthcare API of `Google Cloud
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
16 Platform (GCP)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
17 <https://en.wikipedia.org/wiki/Google_Cloud_Platform>`__ thanks to
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
18 `DICOMweb <https://www.dicomstandard.org/dicomweb/>`__.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
19
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
20 This GCP plugin notably enables the upload of DICOM images through
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
21 STOW-RS, the querying of the cloud content through QIDO-RS, and the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
22 retrieval of remote content through WADO-RS. These operations can be
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
23 possibly scripted thanks to the REST API of Orthanc.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
24
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
25 Concretely, the GCP plugin manages the credentials to Google Cloud
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
26 Platform. It requires the official :ref:`DICOMweb plugin <dicomweb>`
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
27 to be installed. As soon as Orthanc is started, the GCP plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
28 automatically acquires and refreshes the `authentication tokens
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
29 <https://cloud.google.com/docs/authentication/>`__, transparently
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
30 updating the remote :ref:`DICOMweb servers <dicomweb-client-config>`
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
31 that are known to the DICOMweb plugin. The authentication tokens can
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
32 be derived either from service accounts, or from user accounts.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
33
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
34 This page makes the assumption that you have created a Google Cloud
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
35 Platform project, in which you have enabled the `Healthcare API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
36 <https://cloud.google.com/healthcare/>`__, and in which you have
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
37 created a `DICOM store
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
38 <https://cloud.google.com/healthcare/docs/how-tos/dicom>`__.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
39
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
40 Under the hood, the GCP plugin is built on the top of the official
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
41 `Google Cloud Platform C++ Client Libraries
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
42 <https://github.com/googleapis/google-cloud-cpp>`__.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
43
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
44
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
45
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
46 Compilation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
47 -----------
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
48
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
49 .. highlight:: text
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
50
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
51 The procedure to compile the GCP plugin is similar of that for the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
52 :ref:`core of Orthanc <compiling>`. The following commands should work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
53 on any recent UNIX-like distribution (including GNU/Linux)::
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
54
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
55 $ mkdir Build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
56 $ cd Build
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
57 $ cmake .. -DSTATIC_BUILD=ON -DCMAKE_BUILD_TYPE=Release
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
58 $ make
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
59
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
60 The compilation produces a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
61 ``OrthancGoogleCloudPlatform`` that contains the DICOMweb
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
62 plugin. Pre-compiled binaries for Microsoft Windows `are available
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
63 <http://www.orthanc-server.com/browse.php?path=/plugin-google-cloud>`__,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
64 and are included in the `Windows installers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
65 <https://www.orthanc-server.com/download-windows.php>`__.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
66
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
67
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
68
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
69 Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
70 -------------
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
71
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
72
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
73 Common parameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
74 ^^^^^^^^^^^^^^^^^
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
75
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
76 As explained above, the GCP plugin requires the :ref:`official
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
77 DICOMweb plugin <dicomweb>` to be installed (with version above
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
78 1.0).
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
79
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
80 Furthermore, as obtaining the authentication tokens for Google Cloud
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
81 Platform necessitates a sequence of HTTPS requests, the Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
82 :ref:`configuration options <configuration>` must specify how the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
83 authenticity of the Google servers is checked. You have two
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
84 possibilities to that end:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
85
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
86 1. Disabling the verification of the remote servers (**not recommended
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
87 in production**). This is done by setting option ``HttpsVerifyPeers``
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
88 to ``false``.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
89
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
90 2. Providing a list of `trusted Certificate Authorities (CA)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
91 <https://curl.haxx.se/docs/sslcerts.html>`__ to the HTTPS client
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
92 that is internally used by Orthanc (namely, `cURL
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
93 <https://en.wikipedia.org/wiki/CURL>`__). This is done by properly
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
94 setting ``HttpsVerifyPeers`` option, so that it points to a file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
95 containing a store of CA certificates. Depending on your operating
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
96 system, this file can be found as follows:
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
97
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
98 * On Debian-based system, the standard file
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
99 ``/etc/ssl/certs/ca-certificates.crt`` can be used.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
100 * On other systems, the cURL project provides `CA certificates
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
101 <https://curl.haxx.se/docs/caextract.html>`__ that are extracted
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
102 from Mozilla.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
103
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
104 Note that to debug HTTPS communications, you have the possibility
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
105 of setting the ``HttpVerbose`` configuration option of Orthanc to ``true``.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
106
254
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107
63cc25161330 skeleton of gcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108
255
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
109 Service account
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
110 ^^^^^^^^^^^^^^^
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
111
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
112 As explained on the `Google documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
113 <https://cloud.google.com/docs/authentication/#service_accounts>`__,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
114 *"a service account is a Google account that represents an
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
115 application, as opposed to representing an end user"*. This is
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
116 presumably the most common situation in the case of Orthanc.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
117
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
118 You first have to `create a service account
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
119 <https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account>`__
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
120 for your application. This will produce a JSON file (say,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
121 ``dicom-osimis.json``) that you have to store securely on the server
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
122 that will run Orthanc.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
123
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
124 .. highlight:: json
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
125
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
126 Secondly, you have to modify the :ref:`Orthanc configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
127 <configuration>` in order to provide the GCP plugin with your service
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
128 account file and with the parameters of your `DICOM store
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
129 <https://cloud.google.com/healthcare/docs/how-tos/dicom>`__. Here is a
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
130 sample, minimalistic configuration of Orthanc::
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
131
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
132 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
133 "HttpsCACertificates": "/etc/ssl/certs/ca-certificates.crt",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
134 "Plugins" : [ "." ],
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
135 "GoogleCloudPlatform" : {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
136 "Accounts": {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
137 "my-google" : {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
138 "Project" : "osimis-test",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
139 "Location" : "europe-west2",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
140 "Dataset" : "test",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
141 "DicomStore" : "dicom",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
142 "ServiceAccountFile" : "dicom-osimis.json"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
143 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
144 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
145 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
146 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
147
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
148
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
149 In this example, once the GCP plugin has succeeded to authenticate
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
150 using the service account, the DICOMweb plugin will provide access to
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
151 the cloud DICOM store at URI ``/dicom-web/servers/my-google/`` of the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
152 REST API of Orthanc.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
153
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
154
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
155 User account
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
156 ^^^^^^^^^^^^
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
157
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
158 User account is an alternative to service account, and can be used
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
159 *"when the application needs to access resources on behalf of an end
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
160 user"* (check out the `Google documentation
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
161 <https://cloud.google.com/docs/authentication/#user_accounts>`__).
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
162
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
163 .. highlight:: json
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
164
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
165 The easiest way of setting up a user account is through the `gcloud
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
166 command-line tool <https://cloud.google.com/sdk/gcloud/>`__.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
167 `Google's quickstarts
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
168 <https://cloud.google.com/sdk/docs/quickstarts>`__ explain how to
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
169 initialize the environment depending on your operating system (check
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
170 out the "Initialize the SDK" sections, which essentially boil down to
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
171 calling ``gcloud init``).
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
172
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
173
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
174 .. highlight:: bash
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
175
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
176 Once the ``gcloud init`` command-line has been invoked, you can
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
177 extract credentials for Orthanc by typing the following command::
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
178
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
179 $ gcloud auth print-access-token --format json
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
180
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
181
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
182 .. highlight:: json
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
183
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
184 This command produces JSON file containing all the required
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
185 information, that can be written to a file (say,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
186 ``dicom-user.json``). Given this file, here is a sample, minimalistic
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
187 configuration of Orthanc::
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
188
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
189 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
190 "HttpsCACertificates": "/etc/ssl/certs/ca-certificates.crt",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
191 "Plugins" : [ "." ],
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
192 "GoogleCloudPlatform" : {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
193 "Accounts": {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
194 "my-google" : {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
195 "Project" : "osimis-test",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
196 "Location" : "europe-west2",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
197 "Dataset" : "test",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
198 "DicomStore" : "dicom",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
199 "AuthorizedUserFile" : "dicom-osimis.json"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
200 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
201 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
202 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
203 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
204
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
205 In this example, once the GCP plugin has succeeded to authenticate
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
206 using the user account, the DICOMweb plugin will provide access to the
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
207 cloud DICOM store at URI ``/dicom-web/servers/my-google/`` of the REST
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
208 API of Orthanc.
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
209
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
210
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
211 .. highlight:: bash
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
212
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
213 Note that only 3 fields in the JSON file produced by the ``gcloud auth
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
214 print-access-token`` are required: ``client_id``, ``client_secret``,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
215 and ``refresh_token``. Instead of using the full JSON file, you can
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
216 extract only these fields, e.g. using the `jq
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
217 <https://stedolan.github.io/jq/>`__ command-line tool::
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
218
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
219 $ gcloud auth print-access-token --format json | jq '{ AuthorizedUserClientId: .client_id, AuthorizedUserClientSecret:.client_secret, AuthorizedUserRefreshToken:.refresh_token }'
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
220 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
221 "AuthorizedUserClientId": "XXXXXXXXXX.apps.googleusercontent.com",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
222 "AuthorizedUserClientSecret": "ZmssLNXXXXXX",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
223 "AuthorizedUserRefreshToken": "1/e2ngXXXXXX"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
224 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
225
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
226
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
227 .. highlight:: json
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
228
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
229 You can use this information as follows in order to create a
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
230 configuration for Orthanc that is equivalent to the one using the full
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
231 JSON::
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
232
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
233 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
234 "HttpsCACertificates": "/etc/ssl/certs/ca-certificates.crt",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
235 "Plugins" : [ "." ],
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
236 "GoogleCloudPlatform" : {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
237 "Accounts": {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
238 "my-google" : {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
239 "Project" : "osimis-test",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
240 "Location" : "europe-west2",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
241 "Dataset" : "test",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
242 "DicomStore" : "dicom",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
243 "AuthorizedUserClientId": "XXXXXXXXXX.apps.googleusercontent.com",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
244 "AuthorizedUserClientSecret": "ZmssLNXXXXXX",
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
245 "AuthorizedUserRefreshToken": "1/e2ngXXXXXX"
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
246 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
247 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
248 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 254
diff changeset
249 }