|
1 | | -Python Client for Cloud IoT API (`Alpha`_) |
2 | | -========================================== |
3 | | - |
4 | | -`Cloud IoT API`_: Registers and manages IoT (Internet of Things) devices that connect to the |
5 | | -Google Cloud Platform. |
6 | | - |
7 | | -- `Client Library Documentation`_ |
8 | | -- `Product Documentation`_ |
9 | | - |
10 | | -.. _Alpha: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst |
11 | | -.. _Cloud IoT API: https://cloud.google.com/iot |
12 | | -.. _Client Library Documentation: https://googlecloudplatform.github.io/google-cloud-python/latest/iot/index.html |
13 | | -.. _Product Documentation: https://cloud.google.com/iot |
14 | | - |
15 | | -Quick Start |
16 | | ------------ |
17 | | - |
18 | | -In order to use this library, you first need to go through the following steps: |
19 | | - |
20 | | -1. `Select or create a Cloud Platform project.`_ |
21 | | -2. `Enable billing for your project.`_ |
22 | | -3. `Enable the Cloud IoT API.`_ |
23 | | -4. `Setup Authentication.`_ |
24 | | - |
25 | | -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project |
26 | | -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project |
27 | | -.. _Enable the Cloud IoT API.: https://cloud.google.com/iot |
28 | | -.. _Setup Authentication.: https://googlecloudplatform.github.io/google-cloud-python/latest/core/auth.html |
29 | | - |
30 | | -Installation |
31 | | -~~~~~~~~~~~~ |
32 | | - |
33 | | -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to |
34 | | -create isolated Python environments. The basic problem it addresses is one of |
35 | | -dependencies and versions, and indirectly permissions. |
36 | | - |
37 | | -With `virtualenv`_, it's possible to install this library without needing system |
38 | | -install permissions, and without clashing with the installed system |
39 | | -dependencies. |
40 | | - |
41 | | -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ |
42 | | - |
43 | | - |
44 | | -Mac/Linux |
45 | | -^^^^^^^^^ |
46 | | - |
47 | | -.. code-block:: console |
48 | | -
|
49 | | - pip install virtualenv |
50 | | - virtualenv <your-env> |
51 | | - source <your-env>/bin/activate |
52 | | - <your-env>/bin/pip install google-cloud-iot |
53 | | -
|
54 | | -
|
55 | | -Windows |
56 | | -^^^^^^^ |
57 | | - |
58 | | -.. code-block:: console |
59 | | -
|
60 | | - pip install virtualenv |
61 | | - virtualenv <your-env> |
62 | | - <your-env>\Scripts\activate |
63 | | - <your-env>\Scripts\pip.exe install google-cloud-iot |
64 | | -
|
65 | | -Preview |
66 | | -~~~~~~~ |
67 | | - |
68 | | -DeviceManagerClient |
69 | | -^^^^^^^^^^^^^^^^^^^ |
70 | | - |
71 | | -.. code:: py |
72 | | -
|
73 | | - from google.cloud import iot_v1 |
74 | | -
|
75 | | - client = iot_v1.DeviceManagerClient() |
76 | | -
|
77 | | - parent = client.location_path('[PROJECT]', '[LOCATION]') |
78 | | -
|
79 | | -
|
80 | | - # Iterate over all results |
81 | | - for element in client.list_device_registries(parent): |
82 | | - # process element |
83 | | - pass |
84 | | -
|
85 | | - # Or iterate over results one page at a time |
86 | | - for page in client.list_device_registries(parent, options=CallOptions(page_token=INITIAL_PAGE)): |
87 | | - for element in page: |
88 | | - # process element |
89 | | - pass |
90 | | -
|
91 | | -Next Steps |
92 | | -~~~~~~~~~~ |
93 | | - |
94 | | -- Read the `Client Library Documentation`_ for Cloud IoT API |
95 | | - API to see other available methods on the client. |
96 | | -- Read the `Cloud IoT API Product documentation`_ to learn |
97 | | - more about the product and see How-to Guides. |
98 | | -- View this `repository’s main README`_ to see the full list of Cloud |
99 | | - APIs that we cover. |
100 | | - |
101 | | -.. _Cloud IoT API Product documentation: https://cloud.google.com/iot |
102 | | -.. _repository’s main README: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst |
| 1 | +.. include:: /../iot/README.rst |
103 | 2 |
|
104 | 3 | Api Reference |
105 | 4 | ------------- |
|
0 commit comments