Skip to content

Commit

Permalink
Improve doc for Data Lake
Browse files Browse the repository at this point in the history
  • Loading branch information
lmazuel committed Nov 14, 2016
1 parent 020664e commit 325d837
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 2 deletions.
2 changes: 1 addition & 1 deletion azure-mgmt-datalake-analytics/README.rst
Expand Up @@ -37,7 +37,7 @@ Usage
=====

For code examples, see `Data Lake Analytics Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/datalakeanalyticsmanagement.html>`__
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-datalake-analytics.html>`__
on readthedocs.org.


Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-datalake-store/README.rst
Expand Up @@ -37,7 +37,7 @@ Usage
=====

For code examples, see `Data Lake Store Management
<https://azure-sdk-for-python.readthedocs.org/en/latest/datalakestoremanagement.html>`__
<https://azure-sdk-for-python.readthedocs.org/en/latest/sample_azure-mgmt-datalake-store.html>`__
on readthedocs.org.


Expand Down
2 changes: 2 additions & 0 deletions doc/index.rst
Expand Up @@ -123,6 +123,8 @@ All documentation of management libraries for Azure are on this website. This in
* :doc:`Cognitive Services<sample_azure-mgmt-cognitiveservices>` : Create CS accounts and more
* :doc:`Commerce - Billing API<resourcemanagementcommerce>` : RateCard and Usage Billing API
* :doc:`Compute<resourcemanagementcomputenetwork>` : Create virtual machines and more
* :doc:`Data Lake Analytics<sample_azure-mgmt-datalake-analytics>` : Manage account, job, catalog and more
* :doc:`Data Lake Store<sample_azure-mgmt-datalake-store>` : Manage account and more
* :doc:`DevTestLabs<sample_azure-mgmt-devtestlabs>` : Create labs and more
* :doc:`DNS<sample_azure-mgmt-dns>` : Create DNS zone, record set and more
* :doc:`IoTHub<sample_azure-mgmt-iothub>` : Create IoTHub account and more
Expand Down
73 changes: 73 additions & 0 deletions doc/sample_azure-mgmt-datalake-analytics.rst
@@ -0,0 +1,73 @@
Azure Data Lake Management Analytics
====================================

For general information on resource management, see :doc:`Resource Management<resourcemanagement>`.

Create the management client
----------------------------

The following code creates an instance of the management client.

You will need to provide your ``subscription_id`` which can be retrieved
from `your subscription list <https://manage.windowsazure.com/#Workspaces/AdminTasks/SubscriptionMapping>`__.

See :doc:`Resource Management Authentication <quickstart_authentication>`
for details on handling Azure Active Directory authentication with the Python SDK, and creating a ``Credentials`` instance.

.. code:: python
from azure.mgmt.datalake.analytics import (
DataLakeAnalyticsAccountManagementClient,
DataLakeAnalyticsCatalogManagementClient,
DataLakeAnalyticsJobManagementClient
)
from azure.common.credentials import UserPassCredentials
# Replace this with your subscription id
subscription_id = '33333333-3333-3333-3333-333333333333'
# See above for details on creating different types of AAD credentials
credentials = UserPassCredentials(
'user@domain.com', # Your user
'my_password', # Your password
)
account_client = DataLakeAnalyticsAccountManagementClient(
credentials,
subscription_id
)
catalog_client = DataLakeAnalyticsCatalogManagementClient(
credentials,
subscription_id
)
job_client = DataLakeAnalyticsJobManagementClient(
credentials,
subscription_id
)
Registration
------------

Some operations in the ARM APIs require a one-time registration of the
provider with your subscription.

Use the following code to do the registration. You can use the same
credentials you created in the previous section.

.. code:: python
from azure.mgmt.resource.resources import ResourceManagementClient
resource_client = ResourceManagementClient(
credentials,
subscription_id
)
resource_client.providers.register('Microsoft.DataLakeAnalytics')
Samples
-------

Samples writing in progress! In the meantime, you should look at the unit tests of this package:

https://github.com/Azure/azure-sdk-for-python/blob/master/azure-mgmt/tests/test_mgmt_datalake_analytics.py

61 changes: 61 additions & 0 deletions doc/sample_azure-mgmt-datalake-store.rst
@@ -0,0 +1,61 @@
Azure Data Lake Management Store
================================

For general information on resource management, see :doc:`Resource Management<resourcemanagement>`.

Create the management client
----------------------------

The following code creates an instance of the management client.

You will need to provide your ``subscription_id`` which can be retrieved
from `your subscription list <https://manage.windowsazure.com/#Workspaces/AdminTasks/SubscriptionMapping>`__.

See :doc:`Resource Management Authentication <quickstart_authentication>`
for details on handling Azure Active Directory authentication with the Python SDK, and creating a ``Credentials`` instance.

.. code:: python
from azure.mgmt.datalake.store import DataLakeStoreAccountManagementClient
from azure.common.credentials import UserPassCredentials
# Replace this with your subscription id
subscription_id = '33333333-3333-3333-3333-333333333333'
# See above for details on creating different types of AAD credentials
credentials = UserPassCredentials(
'user@domain.com', # Your user
'my_password', # Your password
)
client = DataLakeStoreAccountManagementClient(
credentials,
subscription_id
)
Registration
------------

Some operations in the ARM APIs require a one-time registration of the
provider with your subscription.

Use the following code to do the registration. You can use the same
credentials you created in the previous section.

.. code:: python
from azure.mgmt.resource.resources import ResourceManagementClient
resource_client = ResourceManagementClient(
credentials,
subscription_id
)
resource_client.providers.register('Microsoft.DataLakeStore')
Samples
-------

Samples writing in progress! In the meantime, you should look at the unit tests of this package:

https://github.com/Azure/azure-sdk-for-python/blob/master/azure-mgmt/tests/test_mgmt_datalake_store.py

0 comments on commit 325d837

Please sign in to comment.