===================
Sharing deployments
===================

After you have :doc:`deployed a project <index>`, you can share the deployment with others to provide them with access to view or interact with it. You can share a deployment publicly, with other Data Science & AI Workbench users, or both. 

Any *collaborators* you add to your deployment will see your deployment in *their* |chart-network| **Deployments** list when they log in to Workbench.

.. note::
    
    Your Workbench Administrator configures the available users and groups with whom you can share your deployments, so check with them if you need a new group created.

Sharing a deployment 
====================

Deployments can be shared from the global Deployments page, or directly from the project itself:

.. tab-set:: 

    .. tab-item:: Sharing from Deployments

        From the |file-code| **Projects** page: 

        #. Select |chart-network| **Deployments** from the left-hand navigation.
        #. Select the specific deployment you want to share, then select |share-nodes| **Share** in the left-hand navigation.

    .. tab-item:: Sharing from a Project

        From the |file-code| **Projects** page:

        #. Open a project you have deployed, then select |chart-network| **Deployments** in the left-hand navigation.
        #. Select the specific deployment you want to share, then select |share-nodes| **Share** in the left-hand navigation.

.. tab-set:: 

    .. tab-item:: Public deployment

        Public deployments are accessible to anyone who has the deployment URL. To share a public deployment, copy and distribute the URL that is generated when you :doc:`deploy the project <index>`.

    .. tab-item:: Private deployment 
        
        To limit access to the deployment to only those users with an access token, switch the **Sharing** toggle from **Public** to **Private**. 

        Private deployments can only be shared with other Workbench users by :ref:`adding them as collaborators <share_project>`. 
        
        If you want your project to be able to be referenced in other code, you must also :ref:`generate and supply a deployment access token <gen_dep_token>` that can be used to connect to the associated deployment. 
        
        *Deployment access tokens should be protected like passwords!*

.. caution::

    If your deployment will serve as an endpoint for other code (e.g., a REST API), *provide a static URL* when :doc:`deploying your project <index>`. Using the generated URL risks breaking references to your deployment, as any changes to the deployment will replace the URL.

.. _gen_dep_token:

Generating a deployment access token
====================================

From the |file-code| **Projects** page:

#. Select |chart-network| **Deployments** from the left-hand navigation.
#. Select the specific deployment you want to generate a token for. 
#. Select |gears| **Settings** in the left-hand navigation.
#. Click **Generate** under **Generate tokens**. 

.. |share-nodes| raw:: html

   <svg class="inline" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M448 112c0 44.2-35.8 80-80 80c-22.9 0-43.6-9.6-58.1-25l-151 75.5c.8 4.4 1.1 8.9 1.1 13.5s-.4 9.1-1.1 13.5l151 75.5c14.6-15.4 35.2-25 58.1-25c44.2 0 80 35.8 80 80s-35.8 80-80 80s-80-35.8-80-80c0-9.7 1.7-19 4.9-27.7L147.2 299.5c-14.3 22-39 36.5-67.2 36.5c-44.2 0-80-35.8-80-80s35.8-80 80-80c28.2 0 52.9 14.5 67.2 36.5l145.7-72.9c-3.2-8.6-4.9-17.9-4.9-27.7c0-44.2 35.8-80 80-80s80 35.8 80 80zM80 304a48 48 0 1 0 0-96 48 48 0 1 0 0 96zM416 112a48 48 0 1 0 -96 0 48 48 0 1 0 96 0zM368 448a48 48 0 1 0 0-96 48 48 0 1 0 0 96z"/></svg>

.. |chart-network| raw:: html
   
   <i class="fa-light fa-chart-network"></i>

.. |file-code| raw:: html

   <svg class="inline" height="1.2em" width="1.2em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M64 496c-26.5 0-48-21.5-48-48V64c0-26.5 21.5-48 48-48H204.1c1.3 0 2.6 .1 3.9 .2V136c0 22.1 17.9 40 40 40H367.8c.2 1.3 .2 2.6 .2 3.9V448c0 26.5-21.5 48-48 48H64zM358.6 157.3c.9 .9 1.7 1.8 2.4 2.7H248c-13.3 0-24-10.7-24-24V22.9c1 .8 1.9 1.6 2.7 2.4L358.6 157.3zM64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V179.9c0-12.7-5.1-24.9-14.1-33.9L238.1 14.1c-9-9-21.2-14.1-33.9-14.1H64zm85.7 269.7c3.1-3.1 3.1-8.2 0-11.3s-8.2-3.1-11.3 0l-56 56c-3.1 3.1-3.1 8.2 0 11.3l56 56c3.1 3.1 8.2 3.1 11.3 0s3.1-8.2 0-11.3L99.3 320l50.3-50.3zm96-11.3c-3.1-3.1-8.2-3.1-11.3 0s-3.1 8.2 0 11.3L284.7 320l-50.3 50.3c-3.1 3.1-3.1 8.2 0 11.3s8.2 3.1 11.3 0l56-56c3.1-3.1 3.1-8.2 0-11.3l-56-56z"/></svg>

.. |gears| raw:: html

   <svg class="inline" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M146.2 40.7l-6.9 25.1c-1.4 5.2-5.4 9.4-10.6 11c-14.6 4.6-27.9 12.4-39 22.5c-4 3.7-9.6 5.1-14.9 3.7L49.7 96.4c-2.2 3.1-4.3 6.3-6.3 9.6l-2.4 4.2c-1.8 3.3-3.5 6.6-5 10l18.3 18.5c3.8 3.9 5.4 9.4 4.2 14.7C56.8 160.7 56 168.2 56 176s.8 15.3 2.4 22.5c1.2 5.3-.4 10.8-4.2 14.7L35.9 231.8c1.5 3.4 3.2 6.7 5 10l2.5 4.3c2 3.3 4.1 6.5 6.3 9.6L74.9 249c5.3-1.4 10.9 0 14.9 3.7c11.1 10.2 24.3 17.9 39 22.5c5.2 1.6 9.2 5.8 10.6 11l6.9 25.1c4.5 .5 9.1 .7 13.8 .7s9.2-.2 13.8-.7l6.9-25.1c1.4-5.2 5.4-9.4 10.6-11c14.6-4.6 27.9-12.4 39-22.5c4-3.7 9.6-5.1 14.9-3.7l25.2 6.6c2.2-3 4.2-6.1 6.1-9.3l2.8-4.8c1.7-3.2 3.4-6.4 4.8-9.7l-18.3-18.5c-3.8-3.9-5.4-9.4-4.2-14.7c1.6-7.2 2.4-14.8 2.4-22.6s-.8-15.3-2.4-22.6c-1.2-5.3 .4-10.8 4.2-14.7l18.3-18.5c-1.5-3.3-3.1-6.5-4.8-9.7l-2.8-4.8c-1.9-3.2-4-6.3-6.1-9.3L245.1 103c-5.3 1.4-10.9 0-14.9-3.7c-11.1-10.2-24.3-17.9-39-22.5c-5.2-1.6-9.2-5.8-10.6-11l-6.9-25.1c-4.5-.5-9.1-.7-13.8-.7s-9.2 .2-13.8 .7zM130.8 10.5C140.3 8.9 150.1 8 160 8s19.7 .9 29.1 2.5c6.1 1.1 11 5.6 12.7 11.5l7.5 27.2c13.1 5.1 25.1 12.1 35.9 20.7l27.3-7.1c6-1.6 12.3 .5 16.3 5.2c5.6 6.7 10.7 13.8 15.2 21.3l.2 .3 0 0 2.9 5.1 .2 .3 0 0c4.1 7.5 7.7 15.4 10.7 23.6c2.1 5.8 .7 12.3-3.6 16.7l-19.8 20.1c1 6.8 1.6 13.7 1.6 20.7s-.5 13.9-1.6 20.7l19.8 20.1c4.3 4.4 5.8 10.9 3.6 16.7c-3 8.2-6.6 16-10.7 23.6l-.2 .3 0 0-3 5.1-.2 .3 0 0c-4.5 7.5-9.6 14.6-15.2 21.3c-4 4.7-10.3 6.8-16.3 5.2l-27.3-7.1c-10.7 8.6-22.8 15.6-35.8 20.7L201.8 330c-1.6 6-6.6 10.5-12.7 11.5c-9.5 1.7-19.2 2.5-29.1 2.5s-19.7-.9-29.2-2.5c-6.1-1.1-11-5.6-12.7-11.5l-7.5-27.2c-13.1-5.1-25.1-12.1-35.8-20.7l-27.3 7.1c-6 1.6-12.3-.5-16.3-5.2c-5.7-6.8-10.9-14-15.4-21.6l-.1-.2 0 0-2.6-4.5-.1-.2 0 0c-4.2-7.6-7.9-15.6-10.9-23.9c-2.1-5.8-.7-12.3 3.6-16.7l19.8-20.1C24.5 189.9 24 183 24 176s.5-13.9 1.6-20.7L5.7 135.2c-4.3-4.4-5.8-10.9-3.6-16.7c3-8.3 6.7-16.3 10.9-23.9l.1-.2 0 0 2.6-4.5 .1-.2 0 0C20.4 82 25.6 74.8 31.3 68c4-4.7 10.3-6.8 16.3-5.2l27.3 7.1c10.7-8.6 22.8-15.6 35.8-20.7L118.2 22c1.6-6 6.6-10.5 12.7-11.5zM104 176a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm56 24a24 24 0 1 0 0-48 24 24 0 1 0 0 48zM328.7 365.8l25.1 6.9c5.2 1.4 9.4 5.4 11 10.6c4.6 14.6 12.4 27.9 22.5 39c3.7 4 5.1 9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6 20.7-1.6s13.9 .5 20.7 1.6l20.1-19.8c4.4-4.3 10.9-5.8 16.7-3.6c8.2 3 16 6.6 23.6 10.7l.3 .2 0 0 5.1 3 .3 .2 0 0c7.5 4.5 14.6 9.6 21.3 15.2c4.7 4 6.7 10.3 5.2 16.3l-7.1 27.3c8.6 10.7 15.6 22.8 20.7 35.8l27.2 7.5c6 1.6 10.5 6.6 11.5 12.7c1.7 9.5 2.5 19.2 2.5 29.1s-.9 19.7-2.5 29.2c-1.1 6.1-5.6 11-11.5 12.7l-27.2 7.5c-5.1 13.1-12.1 25.1-20.7 35.8l7.1 27.3c1.6 6-.5 12.3-5.2 16.3c-6.8 5.7-14 10.9-21.6 15.4l-.2 .1 0 0-4.5 2.6-.2 .1 0 0c-7.6 4.2-15.6 7.9-23.9 10.9c-5.8 2.1-12.3 .7-16.7-3.6l-20.1-19.8c-6.8 1-13.7 1.6-20.7 1.6s-13.9-.5-20.7-1.6l-20.1 19.8c-4.4 4.3-10.9 5.8-16.7 3.6c-8.3-3-16.3-6.7-23.9-10.9l-.2-.1 0 0-4.5-2.6-.2-.1 0 0c-7.6-4.6-14.9-9.8-21.6-15.4c-4.7-4-6.8-10.3-5.2-16.3l7.1-27.3c-8.6-10.7-15.6-22.8-20.7-35.8L310 393.8c-6-1.6-10.5-6.6-11.5-12.7zM464 408a56 56 0 1 1 0-112 56 56 0 1 1 0 112zm24-56a24 24 0 1 0 -48 0 24 24 0 1 0 48 0z"/></svg>

