******************************
Managing Stateful Applications
******************************

Kubernetes is a framework for managing complex applications in a
containerized environment. It provides various facilities for
managing container placement, resource allocation, service discovery,
load balancing, scaling, etc. Kubernetes does not, however, have a
notion of what an application actually is, nor is there a Kubernetes
resource called 'application'.

On a Kubernetes cluster, the pod is
the basic operational unit. Containers are grouped into pods and
deployed as individual units, or they are deployed under the control
of various resource controllers such as ReplicaSet, StatefulSet,
Deployment, etc. How to define a set of related Kubernetes
resources as a single unit is left for users to decide. Fortunately,
a number of solutions that address this problem have evolved in
recent times:

========================= ===================
**Helm Release**          Helm is a tool that streamlines the installation and management of
                          Kubernetes applications. A Helm chart is a collection of
                          specifications describing a related set of Kubernetes resources. A
                          Helm release is a specific instance of a Helm chart which has been
                          deployed to a Kubernetes cluster.
**Custom Operator**       Custom Operators are specialized controllers that automate complex 
                          tasks beyond the scope of what Kubernetes itself provides. They 
                          provide a way to extend the cluster's behavior without making 
                          modifications to Kubernetes itself. Many ISVs have developed Operators 
                          that deploy their software on Kubernetes.
========================= ===================


**Topics covered in this chapter:**

=============================== =================================================================================
``robin app create``            Create an application
``robin app register``          Register a stateful application
``robin app unregister``        Unregister a stateful application
``robin app delete``            Delete an application
``robin app list``              List applications
``robin app info``              Display detailed information about an app
``robin app status``            Display the status of the objects associated with an app
``robin app attach-repo``       Attach an external storage repo to an app
``robin app detach-repo``       Detaches a previously attached repo from an app
``robin app snapshot-schedule`` Configures a snapshot schedule for an app
``robin app backup-schedule``   Configures a backup schedule for an app
``robin app restore``           Revert an app to the point-in-time of specified snapshot or backup
``robin app share``             Share an app with one or more tenant users
``robin app unshare``           Stop sharing an app with one or more tenant users
``robin app list-shares``       List application shares
``robin app change-owner``      Reassign ownership of an app
=============================== =================================================================================


Application life cycle management
=================================

The lack of a proper Application construct in Kubernetes poses a
problem when it comes to managing the life cycle of a complex
application made up of various Kubernetes resources. For example, how
would one snapshot or clone an entire Helm release that spans
PersistVolumeClaims, Secrets, ConfigMaps, SatefulSet, Pods, Services
etc? Or how about snapshotting a web tier, app tier and database tier
each deployed separately using three different kubectl manifest
files?

Robin Applications
==================

Robin provides a framework for managing stateful applications
deployed on a Kubernetes cluster. All resources that together
deliver a service to the end user are collected together into a
single unit, which Robin calls an **Application**. Robin maintains
metadata on each of the application’s associated resources in its
configuration database. This allows Robin to perform life cycle
management operations, such as snapshot, backup, restore, etc., that
encompass all of an application's data and metadata (state of each
Kubernetes resource). 
by Robin:

Helm
^^^^

Helm provides the ability to deploy applications to a Kubernetes
cluster using Helm charts containing all specifications and resources
necessary for application deployment. When Helm deploys an
application, it takes responsibility for creating all relevant
Kubernetes resources. Helm Applications are not automatically known
to Robin CNS. But they can be registered with the Robin CNS
cluster. In order for this to work, all storage for the application
must be from the Robin CNS. The application also needs to be
registered with Robin CNS.


FlexApp
^^^^^^^

Robin CNS also provides a very flexible mechanism for
registering any set of Kubernetes resources as a Robin Application.
The **FlexApp** construct uses label selector rules to group the
resources together. For example, ``--select app=apache --select
app=mysql`` would select Pods and PVCs for a web and database tier
together into a single FlexApp object. To command to create/register
a FlexApp, is detailed in the sections below. 

Helm Releases
=============

A Helm chart is a collection of specifications describing a related
set of Kubernetes resources. A Helm release is a specific instance of
a Helm chart deployed to a Kubernetes cluster. Robin CNS
supports the registration of a Helm release as a HELM Application,
which allows the application to be managed using Robin CNS's
life cycle management facilities. In order for this to work, all
storage for the application must be from the Robin CNS. The
application also needs to be deployed to the user's assigned
Kubernetes namespace.

Moreover Robin allows for the auto-registration of Helm releases
when the config attribute ``k8s_auto_registration`` is set to true. 
This results in any newly created instances of Helm charts being 
exposed to the lifecycle management features Robin provides without 
any user intervention. However there are certain caveats to utilizing this feature:

- Only Helm releases deployed in namespaces which are imported into Robin will be 
  automatically registered.
- One of the following combinations of labels must be present within the objects deployed
  by the release. Either both the ``app`` and ``release`` labels must be present within the
  aforementioned objects or both the ``app.kubernetes.io/name`` and ``app.kubernetes.io/instance`` 
  labels must be present.
- Releases that were created previously in namespaces that
  have since been imported into Robin will not be picked up immediately. 
  As a result there will be an initial delay before the application 
  is made visible to Robin users. Of course, one is always able to manually 
  register the pre-existing application to hasten this process.
- If two Helm releases with the same name are deployed in different imported namespaces, Robin CNP does not auto-register the second app with the same name. 
  Instead it must be registered manually using the ``robin app register`` command as shown below.


Register a Helm3 Release
^^^^^^^^^^^^^^^^^^^^^^^^

The following example assumes superadmin user **admin** is setting up
the Helm environment for Robin  user **user1** who is a member
of Tenant **t1** with namespace **robinapps**.

**Log in as the superadmin user:**

.. code-block:: text

        # robin login admin
        Password: <admin_password>
        User admin is logged into Administrators tenant

**List namespaces :**

.. code-block:: text

        # robin namespace list
        +--------------+----------------------+-------------------+
        | Name         | Owner/Tenant         | Primary Namespace |
        +--------------+----------------------+-------------------+
        | t001-u000003 | admin/Administrators | True              |
        | robinapps    | user1/t1             | True              |
        +--------------+----------------------+-------------------+
        
**Create project with the namespace name and provide needed scc:**


.. code-block:: text

        # oc project robinapps
        # oc adm policy add-scc-to-user privileged -z default 

.. Note:: The commands starting with ``oc`` are applicable for the OpenShift environment.

**Log in as user1:**

.. code-block:: text

        # robin login user1
        Password: <user1_password>
        User user1 is logged into t1 tenant


**Get the current user context for user1:**

The ``robin whoami`` command returns useful information about the
current Robin CNS user. It includes a list of tenants the user is a
member of (user1 is only a member of one tenant) and which tenant
they are currently logged into. Additionally, the whoami output
includes the Kubernetes namespace that has been assigned to the user
for their current tenant. This is the namespace the Helm chart needs
to be installed into.

.. code-block:: text

        # robin whoami
               username: user1
                 tenant: t1
                tenants: ['t1']
              namespace: robinapps
        session_expires: 2020-01-24T11:53:02

**Add the bitnami Helm repo for the current user:**

.. code-block:: text

         # helm repo add bitnami https://charts.bitnami.com/bitnami
         "bitnami" has been added to your repositories
        

**Install the bitnami/mysql Helm chart:**

With respect to the helm command line below, note that
``persistence.storageClass`` is set equal to 'robin'. Using Robin
Storage is a requirement for Helm release registration with Robin. Also note the inclusion of the current user's assigned
namespace in the Helm command line. The ``--namespace``
parameter specifies which Kubernetes namespace the application
resources will be bound to. 

.. code-block:: text

         # helm install demo bitnami/mysql --set global.storageClass=robin --namespace robinapps
         NAME: demo
         LAST DEPLOYED: Thu Aug 19 22:23:54 2021
         NAMESPACE: robinapps
         STATUS: deployed
         REVISION: 1
         NOTES:
         MySQL can be accessed via port 3306 on the following DNS name from within your cluster:
         mysqldb.robinapps.svc.cluster.local
        
        To get your root password run:
        
            MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace robinapps mysqldb -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo)
        
        To connect to your database:
        
        1. Run an Ubuntu pod that you can use as a client:
        
            kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il
        
        2. Install the mysql client:
        
            $ apt-get update && apt-get install mysql-client -y
        
        3. Connect using the mysql cli, then provide your password:
            $ mysql -h mysqldb -p
        
        To connect to your database directly from outside the K8s cluster:
            MYSQL_HOST=127.0.0.1
            MYSQL_PORT=3306
        
            # Execute the following command to route the connection:
            kubectl port-forward svc/mysqldb 3306
        
            mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u root -p${MYSQL_ROOT_PASSWORD}


**Get the Helm3 release name:**

.. code-block:: text

         # helm list --namespace robinapps
         NAME   	NAMESPACE	REVISION	UPDATED                                	STATUS  	CHART      	APP VERSION
         mysqldb	robinapps	1       	2020-10-06 03:37:21.126307438 +0000 UTC	deployed	mysql-1.6.7	5.7.30     


**Manually register Helm3 release as a HELM Application:**

.. code-block:: text

        # robin app register mysqldb --app helm/mysqldb -n robinapps
        Job:  114 Name: K8SAppRegister       State: PREPARED        Error: 0
        Job:  114 Name: K8SAppRegister       State: COMPLETED       Error: 0

.. Note:: If the ``k8s_auto_registration`` config attribute is enabled and all of the aforementioned necessary conditions are met this step need not be performed.

**Verify that the app is registered with Robin:**

.. code-block:: text

         # robin app list
         Helm/Flex Apps: 
         
         +----------+------+--------+----------------------+--------------+-----------+---------+
         | Name     | Type | State  | Owner/Tenant         | Namespace    | Snapshots | Backups |
         +----------+------+--------+----------------------+--------------+-----------+---------+
         | mysqldb  | helm | ONLINE | user1/t1             | robinapps    | 0         | 0       |
         +----------+------+--------+----------------------+--------------+-----------+---------+
         
**Get detailed information about the resulting application:**

.. code-block:: text

         # robin app info mysqldb
         Name                              : mysqldb
         Kind                              : helm
         State                             : ONLINE
         Number of repos                   : 0
         Number of snapshots               : 0
         Number of usable backups          : 0
         Number of archived/failed backups : 0

         Query:
         -------
         {'apps': ['helm/mysqldb@robinapps'], 'namespace': 'robinapps', 'selectors': [], 'resources': []}


Register a Helm2 Release
^^^^^^^^^^^^^^^^^^^^^^^^

.. note:: Support for Helm 2 and Tiller is deprecated. As a result no native Robin commands are provided to facilitate the deployment of Helm 2 and the onus is on the user to ensure Helm 2/Tiller are deployed appropriately. However charts deployed via Helm 2 can still be registered with Robin.

Following is a step-by-step walkthrough, detailing how the Helm environment 
needs to configured for a Robin user, how to install a Helm chart that
generates a Helm release suitable for registration with Robin
CNS, and how to perform a Helm release registration. Note that
the initial steps must be performed by a superadmin user. The
remaining steps are to be performed by the Robin CNS user.

The following example assumes superadmin user **admin** is setting up
the Helm environment for Robin CNS user **user1** who is a member
of Tenant **t1**.

**Log in as the superadmin user:**

.. code-block:: text

        # robin login admin
        Password: <admin_password>
        User admin is logged into Administrators tenant

**Generate a list of Robin CNS users:**

.. code-block:: text

        # robin user list
        ID | Username | Full Name     | Email | Tenants        | Current Tenant | Current Role | Current Namespace | Authentication
        ---+----------+---------------+-------+----------------+----------------+--------------+-------------------+----------------
        3  | admin    | Robin Systems |       | Administrators | Administrators | superadmin   | t001-u000003      | local         
        4  | user1    |               |       | t1             | t1             | user         | robinapps         | local         

Note the Current Namespace for user1: **robinapps**. The Kubernetes resources associated with Tiller (ServiceAccount and RoleBinding) need to be deployed within this namespace.

**Log in as user1:**

.. code-block:: text

        # robin login user1
        Password: <user1_password>
        User user1 is logged into t1 tenant

After logging in, ensure that the necessary CA cert and user cert/key are present within the .helm directory present in the user's HOME directory. Once this is completely Helm 2 needs to be initialized within this namespace via the ``helm2 init`` command or otherwise in order to deploy Tiller into the user's assigned namespace.

**Wait for Tiller to be deployed:**

The below command needs to be repeated until no errors are returned.

.. code-block:: text

        # helm2 list --tls --tiller-namespace=robinapps
        Error: could not find tiller


**Add the bitnami Helm repo for the current user:**

.. code-block:: text

        # helm2 repo add bitnami https://charts.bitnami.com/bitnami
        "bitnami" has been added to your repositories

**Install the bitnami/mysql Helm chart:**

With respect to the helm2 command line below, note that
``persistence.storageClass`` is set equal to 'robin'. Using Robin
Storage is a requirement for Helm release registration with Robin
Platform. Also note the inclusion of the current user's assigned
namespace in two places in the Helm command line. The ``--namespace``
parameter specifies which Kubernetes namespace the application
resources will be bound to. The ``--tiller-namespace`` parameter
tells Helm which namespace Tiller has been deployed to. The namespace
for both parameters must be the same and it must be the namespace
assigned to the user by Robin CNS.

.. code-block:: text

        # helm2 install bitnami/mysql --tls --set persistence.storageClass=robin --namespace robinapps --tiller-namespace=robinapps
        NAME:   billowing-tortoise
        LAST DEPLOYED: Wed Jan 22 21:55:24 2020
        NAMESPACE: robinapps
        STATUS: DEPLOYED
  
        RESOURCES:
        ==> v1/ConfigMap
        NAME                           AGE
        billowing-tortoise-mysql-test  0s
  
        ==> v1/Deployment
        NAME                      AGE
        billowing-tortoise-mysql  0s
  
        ==> v1/PersistentVolumeClaim
        NAME                      AGE
        billowing-tortoise-mysql  0s
  
        ==> v1/Pod(related)
        NAME                                      AGE
        billowing-tortoise-mysql-d4f976d96-89x5c  0s
  
        ==> v1/Secret
        NAME                      AGE
        billowing-tortoise-mysql  0s
  
        ==> v1/Service
        NAME                      AGE
        billowing-tortoise-mysql  0s
  
  
        NOTES:
        MySQL can be accessed via port 3306 on the following DNS name from within your cluster:
        billowing-tortoise-mysql.robinapps.svc.cluster.local
  
        To get your root password run:
  
            MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace robinapps billowing-tortoise-mysql -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo)

        To connect to your database:
  
        1. Run an Ubuntu pod that you can use as a client:
  
            kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il
  
        2. Install the mysql client:
  
            $ apt-get update && apt-get install mysql-client -y
  
        3. Connect using the mysql cli, then provide your password:
            $ mysql -h billowing-tortoise-mysql -p

        To connect to your database directly from outside the K8s cluster:
            MYSQL_HOST=127.0.0.1
            MYSQL_PORT=3306
  
            # Execute the following command to route the connection:
            kubectl port-forward svc/billowing-tortoise-mysql 3306
  
            mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u root -p${MYSQL_ROOT_PASSWORD}

**Get the Helm2 release name:**

Note that the ``--tls`` flag is required for all Helm commands
because Helm and Tiller were configured to require the user’s TLS
cert and key (coped to the .helm directory in a previous step).

.. code-block:: text

        # helm2 list --tls --tiller-namespace=robinapps
        NAME                    REVISION        UPDATED                         STATUS          CHART           APP VERSION     NAMESPACE   
        billowing-tortoise      1               Wed Jan 22 21:55:24 2020        DEPLOYED        mysql-1.6.2     5.7.28          robinapps

**Manually register Helm2 release as a HELM Application:**

.. code-block:: text

        # robin app register mysql --app helm/billowing-tortoise -n robinapps
        Job:  114 Name: K8SAppRegister       State: PREPARED        Error: 0
        Job:  114 Name: K8SAppRegister       State: COMPLETED       Error: 0

.. Note:: If the ``k8s_auto_registration`` config attribute is enabled and all of the aforementioned necessary conditions are met this step need not be performed.

**Get detailed information about the resulting application:**

.. code-block:: text

        # robin app info mysql
        Name                              : mysql 
        Kind                              : helm
        State                             : ONLINE
        Number of repos                   : 0
        Number of snapshots               : 0
        Number of usable backups          : 0
        Number of archived/failed backups : 0

        Query:
        -------
        {'namespace': 'robinapps', 'apps': ['helm/billowing-tortoise'], 'resources': [], 'selectors': []}



Robin FlexApp Applications
==========================

Robin CNS provides a very flexible mechanism for registering any
set of Kubernetes resources as a Robin Application. The **FlexApp**
construct uses label selector rules to group the resources together.
For example, ``--select app=apache --select app=mysql`` would select
Pods and PVCs for a web and database tier together into a single
FlexApp object. To create a FlexApp, use this command:

.. code-block:: text

        # robin app register <app-name>                                    
                             --selector <label-name>=<label-value>
                             --resource <resource-type>/<resource-name>
                             --namespace <namespace>
                             --dry-run

=================================================== =================================
``<name>``                                          Name to assign to FlexApp
``--selector <label-name>=<label-value>``           Resources with these Kubernetes labels would be
                                                    selected to be part of this FlexApp
``--resource <resource-type>/<resource-name>``      Resources of the specified type and name would
                                                    be selected to be part of this FlexApp
``--namespace <namespace>``                         Namespace in which the Kubernetes resources are
                                                    deployed.
``--dry-run``                                       Using this option would display the kind, name 
                                                    and status of the objects to be picked up. Note,
                                                    this will not register the application.
=================================================== =================================


**Selecting resources that have more than one matching label (AND condition):**

This is achieved by comma-seperating label name=value pairs as
follows: ``--select tier=frontend,env=dev`` will select resources
that have both ``tier = frontend`` AND ``env = dev`` labels on it.


**Selecting resources that have at least one of the matching labels (OR condition):**

This is achieved by specifying the ``--select`` option multiple times.
For example: ``--select env=dev --select env=prod`` will select any
resource that has either ``env = dev`` or ``env = prod`` labels on
it.

**Selecting resources of a certain type with matching labels:**

Let's say one wants to select only PersistentVolumeClaims and
StatefulSelect type resources with matching labels. That is, any
other resource with a matching label should not be selected. This is
achieved by specifying the resource name as a prefix to the label
name as follows: ``--select pvc,statefulset:tier=database``

**Explicitly selecting certain resources:**

The ``--resource`` option is used to specify explicitly which
Kubernetes resources are to be made part of the FlexApp. The format
to specify this is as follows: ``--resource
<resource-type>/<resource-name>``, where ``<resource-name>`` is any
of the resources ("Kind") that the Kubernetes cluster recognizes,
such as PersistentVolumeClaims (pvc), StatefulSets, Services, etc.

* Running ``kubectl api-resources`` would list all valid values of ``<resource-type>``
* Running ``kubectl get <resource-type>`` would list all valid ``<resource-name>`` of that specific resource type


Create an Application
=====================

Robin supports the creation of applications from a number of sources:

========================= ===================
from-snapshot             Create a clone of an existing application from one of the application's snapshots
from-backup               Create a new application instance from an application backup
========================= ===================
 

Create an application from a snapshot
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In addition to providing for disaster recovery, application snapshots
allow for the creation of an exact copy, or **clone** of an
application instance. Creating a clone of an existing application
instance can be very useful. For example, it allows for reports to be
run on a database without affecting the source database application,
for UAT tests, for validating patches before applying them to the
production database, etc.

Cloning an application has typically required significant manual or
scripting work and coordination across the storage layer and the
application metadata layer (Kubernetes Pod, StatefulSet, PVC, Service
etc). With Robin one can clone an entire application or application
stack with one single command ``robin app create from-snapshot``. Running this
command creates a clone of an entire application from a previously
taken application snapshot. Once complete the application is ready
for use right away.

Changes made to the clone are not visible in the parent application
from which the clone was created. Similarly, any changes made to the
parent application are not visible to the clone. At the storage
layer, Robin's *thin cloning* technology is leveraged. Which means
that a cloned PersistentVolume is not a physical copy of the source
volume. Instead, it is a virtual copy, where only metadata is
physically copied with the actual data being shared between the clone
and the source. Changes made to either the clone or the source are
localized into their own writable data streams, whereas any common
unmodified data is shared.

To summarize a clone of an existing application instance can be created from an
application snapshot with the following command:

.. code-block:: text

        # robin app create from-snapshot <app_name> <snapshotid>

================ =========================================================
``app_name``     Application instance name 
``snapshotid``   Unique ID of the application snapshot, which can be obtained from the output of ``robin snapshot list``
================ =========================================================

**Example 1 (Create a clone of a Robin app from a snapshot):**

.. code-block:: text

        # robin app create from-snapshot mysql-c1 ec2bdeba447211eaa2028d14cd0bbca6 --rpool default --wait
        Job:  187 Name: ApplicationClone     State: VALIDATED       Error: 0
        Job:  187 Name: ApplicationClone     State: WAITING         Error: 0
        Job:  187 Name: ApplicationClone     State: FINALIZED       Error: 0
        Job:  187 Name: ApplicationClone     State: COMPLETED       Error: 0

**Example 2 (Create a clone (FLEX app) of a HELM app from a snapshot):**

.. code-block:: text

        # robin app create from-snapshot mysql1-c1 d17d19f044ba11ea8e7831d18d69fbab --wait
        Job:  198 Name: K8SApplicationClone  State: PREPARED        Error: 0
        Job:  198 Name: K8SApplicationClone  State: AGENT_WAIT      Error: 0
        Job:  198 Name: K8SApplicationClone  State: COMPLETED       Error: 0


Create an application from a backup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

A application instance can be created from an application backup with
the following command:

.. code-block:: text

        # robin app create from-backup <app_name> <backupid>

================ =========================================================
``app_name``     Application instance name 
``backupid``     Unique ID of the application backup, which can be obtained from the output of ``robin backup list``
================ =========================================================

**Example 1 (Create a Robin app from a backup):**

.. code-block:: text

        # robin app create from-backup mysql-b2 ee529688447211eabaf85b58e9f190fd --rpool default --zone 1580531960 --wait
        Job:  182 Name: ApplicationCreate    State: VALIDATED       Error: 0
        Job:  182 Name: ApplicationCreate    State: WAITING         Error: 0
        Job:  182 Name: ApplicationCreate    State: COMPLETED       Error: 0

**Example 2 (Create a FLEX app from the backup of a HELM app):**

.. code-block:: text

        # robin app create from-backup mysql1-b2 952f3738447211ea99cee7cd7390d6c9 --wait
        Job:  181 Name: K8SApplicationCreate State: PREPARED        Error: 0
        Job:  181 Name: K8SApplicationCreate State: AGENT_WAIT      Error: 0
        Job:  181 Name: K8SApplicationCreate State: COMPLETED       Error: 0


Register a Stateful Application
===============================

.. tabs::

        .. tab:: CLI


            Run this command to register a stateful application with Robin CNS:

            .. code-block:: text

                  # robin app register <appname> 
                                       --app <stateful_app> 
                                       --resource <resource> 
                                       --selector <selector> 
                                       --namespace <namespace>
                                       --dry-run
                                       --specs

            ============================= ========================================
            ``<name>``                    The name to assign to this app in Robin CNS. 
                                          To make it easy to associate with a specific Helm 
                                          release that this app refers to, it is best to use 
                                          a name that matches the helm release name
            ``--app <stateful_app>``      Helm or operator based applications. Ex: helm/<release_name>
            ``--resource <resource>``     Kubernetes native objects. Ex: pvc/<name> or pod/<name>
            ``--selector <selector>``     Kubernetes selectors. Ex: release=mongo-1.0,heritage=tiller
            ``--namespace <namespace>``   Kubernetes namespace in which the application exists
            ``--dry-run``                 Show the kind, name and status of the objects to be picked up. Note
                                          this will not register the application
            ``--specs``                   Show the spec files of the objects to be picked up. Note this will not register
                                          the application
            ============================= ========================================

            **Example 1 (Install Helm chart stable/postgresql and register the resulting Helm release):**

            .. code-block:: text

                  # helm install --tls --name pgsql stable/postgresql --set persistence.storageClass=robin --namespace robinapps --tiller-namespace robinapps

                  # robin app register pgsql --app helm/pgsql --namespace robinapps

            .. note::
                  More than one helm release can be tracked in a single app by specifying ``--app`` command line option twice. For example the following command, ``robin app register myblog --app helm/apache --app helm/mysql`` would track two different helm releases -- (1) ``apache`` and (2) ``mysql`` as a single unit named ``myblog`` in Robin CNS.



Unregister a Stateful Application
=================================

.. tabs::

        .. tab:: CLI

            Issue the following command to unregister a stateful application from
            Robin CNS:

            .. code-block:: text

                  # robin app unregister <appname> 

            ============================= =============================================================
            ``<appname>``                 The name of a previously registered stateful application.
            ============================= =============================================================

            **Example:**

            .. code-block:: text

                  # robin app unregister mysql1 --wait
                  This will remove application 'mysql1' from the cluster. Do you want to continue [y/n] ? y
                  Job:  169 Name: K8SAppUnregister     State: PROCESSED       Error: 0
                  Job:  169 Name: K8SAppUnregister     State: COMPLETED       Error: 0

            .. note::
                  If the app being unregistered is a **Helm release** previously
                  registered on the Robin CNS cluster, it will only be removed
                  from the cluster. The underlying Helm release will be left intact.

        .. tab:: API 

                Unregister a stateful application from Robin CNS.

                **End Point:** /api/v3/robin_server/k8s_app

                **Method:** PUT

                **URL Parameters:** None

                **Data Parameters:**

                - ``action: unregister`` - This mandatory field within the payload specifies that the unregister operation is to be performed.
                - ``name: <app_name>`` - This mandatory field within the payload specifies the name of the application to be unregistered.

                **Port:** RCM Port (default value is 29442)

                **Headers:** 

                - ``Authorization: <auth_token>`` : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

                **Success Response Code:** 202

                **Error Response Code:** 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid Api Usage Error)

                **Example Response:**
                
                .. raw:: html

                        <details><summary><a>Output</a></summary>

                .. code-block:: text

                     {
                        "jobid":178
                     }

                .. raw:: html

                        </details>

Delete an Application
=====================

.. tabs::

        .. tab:: CLI

            Issue the following command to delete a Helm release and remove it from Robin. 

            .. code-block:: text

                  # robin app delete <appname> 
                                       --force          

            ================ ================================================================================
            ``app_name``     Application instance name 
            ``--force``      Force the deletion of the application and all associated Kubernetes objects.
            ================ ================================================================================

            **Example:**

            .. code-block:: text

                  # robin app delete mysql1 --wait -y --force
                  Job:  153 Name: K8SApplicationDeleteHelm State: VALIDATED       Error: 0
                  Job:  153 Name: K8SApplicationDeleteHelm State: COMPLETED       Error: 0

            .. note::
                  By default, ``robin
                  app delete`` will fail without the --force option. To override this behavior,
                  include ``--force`` on the command line. If the desire is to
                  remove the application from Robin CNS but leave the
                  Kubernetes objects intact, then use the ``robin app unregister``
                  command.

        .. tab:: API 

                Delete an application from a Robin CNS cluster

                **End Point:** /api/v6/robin_server/apps/<app_name>

                **Method:** DELETE

                **URL Parameters:** 

                - ``force=true`` : Utilizing this parameter results in the ungraceful termination of an application, which includes not running any relevant hook scripts.
                - ``del_snaps=true`` : Utilizing this parameter results in both the application and its associated snapshots being deleted.

                **Data Parameters:** None 

                **Port:** RCM Port (default value is 29442)

                **Headers:** 

                - ``Authorization: <auth_token>`` : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

                **Success Response Code:** 202

                **Error Response Code:** 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid Api Usage Error)

                **Example Response:**
                
                .. raw:: html

                        <details><summary><a>Output</a></summary>

                .. code-block:: text

                     {
                        "plan":{
                           "enable_metrics":true,
                           "auto_relocate":true,
                           "pvcpolicy":"create",
                           "enable_hooklogs":true,
                           "zoneid":1597147518,
                           "planid":710,
                           "content_id":"64495e524cbc9f133d4b92bcc04e1f94",
                           "name":"test-ds-1",
                           "roles":[
                              {
                                 "name":"server",
                                 "volume_groups":[

                                 ],
                                 "vnodes":[
                                    {
                                       "allocated_host":"cscale-82-140.robinsystems.com",
                                       "cm_keys":[
                                          "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN8WYsAfs0+a1zzAIWIVV5MrZUaur688E08BL7fm+1uBFjBRPEevwrYrNFL7ebjJxYuB1R3WR+IX8Mmz7CiMDvfEiAQL1Ihj4GZ32WSqzZ7MN15UJK4DQWY7sU++VIusyPUj5goVS2mPj0k4zhheNOlC8XaaHgyUq+NjHHDZF5B4mX7huWfM+kC4u5nCvajoHdfeOse4e1n5RlXtlKRqzBbIma6w8Ej32qFxRLvp4lUXzCylYHBLGH42CKWvtxvETwJUb1kIW9DExSnD+u5fd4Dc2D98\/SY79OO4+aa7GA7JV7412S5kWbtq5cpnkDlvhon\/XzLVQlIqIiAJ6ukVmx root@cscale-82-140"
                                       ],
                                       "pod_ns":"t001-u000003",
                                       "hostname":"test-ds-1-server-01.t001-u000003.svc.cluster.local",
                                       "k8s_provider":"robin",
                                       "appid":46,
                                       "vnodehookargs":{
                                          "postcreate":[

                                          ]
                                       },
                                       "numa_allocations":{
                                          "0":{
                                             "isol_shared_cores_used":0,
                                             "gpu_used":0,
                                             "hugepages_1g_used":0,
                                             "hugepages_2m_used":0,
                                             "mem_used":209715200,
                                             "non_isol_cores_used":1,
                                             "isol_dedicated_cores_used":0
                                          }
                                       },
                                       "enable_portmapping":true,
                                       "storage":[
                                          {
                                             "pvcpolicy":"create",
                                             "lvm_type":"None",
                                             "size":1073741824,
                                             "stordriver":{
                                                "type":"das",
                                                "faultdomain":"host",
                                                "protection":0,
                                                "media":"HDD"
                                             },
                                             "disk_tags":{

                                             },
                                             "encryption":"none",
                                             "vol_ns":"t001-u000003",
                                             "snapshot_space_limit":214748365,
                                             "fstype":"ext4",
                                             "protection":0,
                                             "workload":0,
                                             "name":"test-ds-1.server.01.data.1.e5506da8-8c25-460d-926b-146ab4b2c9c8",
                                             "blocksize":4096,
                                             "compression":"disabled",
                                             "type":"data",
                                             "media":"HDD",
                                             "faultdomain":"host",
                                             "lvm_vol_count":"0",
                                             "allocated":{
                                                "partitions":0,
                                                "volumeid":"159",
                                                "params":{

                                                },
                                                "media":72,
                                                "size":1073741824,
                                                "stordriver":{
                                                   "type":"das",
                                                   "faultdomain":"host",
                                                   "protection":0,
                                                   "media":"HDD"
                                                },
                                                "block_size":4096,
                                                "current_snapshot":"active_snap",
                                                "multinode_mounting":false,
                                                "snapshot_space_limit":214748365,
                                                "slice_size":1073741824,
                                                "protection":0,
                                                "next_backupid":1,
                                                "name":"test-ds-1.server.01.data.1.e5506da8-8c25-460d-926b-146ab4b2c9c8",
                                                "next_snapshotid":2,
                                                "qgroupid":158,
                                                "priority":2,
                                                "genkey":1597453455641718,
                                                "appname":"default",
                                                "grpid":158,
                                                "replication":1,
                                                "vtype":0,
                                                "current_snapshotid":1,
                                                "compression":0,
                                                "appid":1,
                                                "resource_poolid":1
                                             },
                                             "replication":1,
                                             "snap_reserved":20,
                                             "device":"\/dev\/sde",
                                             "path":"\/data",
                                             "layout":"round-robin",
                                             "volgrp_name":"test-ds-1.server.01.72.1.100e29ae-e508-4f21-a253-e3c912fcc242",
                                             "k8s_name":"test-ds-1-server-01-data-1-e5506da8"
                                          },
                                          {
                                             "pvcpolicy":"create",
                                             "lvm_type":"None",
                                             "size":1073741824,
                                             "stordriver":{
                                                "type":"das",
                                                "faultdomain":"host",
                                                "protection":0,
                                                "media":"HDD"
                                             },
                                             "disk_tags":{

                                             },
                                             "encryption":"none",
                                             "vol_ns":"t001-u000003",
                                             "snapshot_space_limit":214748365,
                                             "fstype":"raw",
                                             "protection":0,
                                             "workload":0,
                                             "name":"test-ds-1.server.01.block.1.fa7b93eb-46f5-4830-b664-4428ed4088e9",
                                             "blocksize":4096,
                                             "compression":"disabled",
                                             "type":"block",
                                             "media":"HDD",
                                             "faultdomain":"host",
                                             "lvm_vol_count":"0",
                                             "allocated":{
                                                "partitions":0,
                                                "volumeid":"158",
                                                "params":{

                                                },
                                                "media":72,
                                                "size":1073741824,
                                                "stordriver":{
                                                   "type":"das",
                                                   "faultdomain":"host",
                                                   "protection":0,
                                                   "media":"HDD"
                                                },
                                                "block_size":4096,
                                                "current_snapshot":"active_snap",
                                                "multinode_mounting":false,
                                                "snapshot_space_limit":214748365,
                                                "slice_size":1073741824,
                                                "protection":0,
                                                "next_backupid":1,
                                                "name":"test-ds-1.server.01.block.1.fa7b93eb-46f5-4830-b664-4428ed4088e9",
                                                "next_snapshotid":2,
                                                "qgroupid":159,
                                                "priority":2,
                                                "genkey":1597453455638742,
                                                "appname":"default",
                                                "grpid":159,
                                                "replication":1,
                                                "vtype":0,
                                                "current_snapshotid":1,
                                                "compression":0,
                                                "appid":1,
                                                "resource_poolid":1
                                             },
                                             "replication":1,
                                             "snap_reserved":20,
                                             "device":"\/dev\/sdf",
                                             "path":"\/dev\/rda",
                                             "layout":"round-robin",
                                             "volgrp_name":"test-ds-1.server.01.72.1.18e90f5c-d221-4a5b-8fe9-4abc80a84776",
                                             "k8s_name":"test-ds-1-server-01-block-1-fa7b93eb"
                                          }
                                       ],
                                       "id":79,
                                       "utime":1597453464,
                                       "host_ip":"172.21.27.101",
                                       "restart_on_qoscfg":true,
                                       "hosttags":{
                                          "kubernetes.io\/os":[
                                             "linux"
                                          ],
                                          "robin.io\/robinrpool":[
                                             "default"
                                          ],
                                          "kubernetes.io\/arch":[
                                             "amd64"
                                          ]
                                       },
                                       "network":[
                                          {
                                             "name":"robin-default",
                                             "allocated_ip":"172.21.27.101",
                                             "allocated_names":[
                                                "eth0"
                                             ],
                                             "allocated_by":"system",
                                             "interfaces":1,
                                             "ippool":"robin-default",
                                             "driver":"calico",
                                             "allocated_prefix":16,
                                             "allocated_netmask":"255.255.0.0",
                                             "subnet":"172.21.0.0"
                                          }
                                       ],
                                       "bundle_object_id":"64495e524cbc9f133d4b92bcc04e1f94",
                                       "enable_metrics":true,
                                       "bundleid":7,
                                       "appname":"test-ds-1",
                                       "allocated":{
                                          "zonename":"default",
                                          "nodeid":1,
                                          "zoneid":1597147518,
                                          "nodename":"cscale-82-140"
                                       },
                                       "restart_num":15,
                                       "volume_groups":[
                                          {
                                             "volumes":[
                                                "test-ds-1.server.01.data.1.e5506da8-8c25-460d-926b-146ab4b2c9c8"
                                             ],
                                             "layout":"round-robin",
                                             "media":"HDD",
                                             "replicas":1,
                                             "rpoolid":1,
                                             "device_sets":[
                                                {
                                                   "name":"test-ds-1.server.01.72.1.100e29ae-e508-4f21-a253-e3c912fcc242.0.b93bfd54-808f-4839-abf4-c56143f05737",
                                                   "devices":[
                                                      {
                                                         "max_throughput_intensive_vols_per_disk":1,
                                                         "max_latency_sensitive_vols_per_disk":2,
                                                         "tags":{

                                                         },
                                                         "hostname":"cscale-82-140.robinsystems.com",
                                                         "score":96,
                                                         "allocated_slices":2,
                                                         "reattachable":0,
                                                         "stormgr_id":2,
                                                         "protected":0,
                                                         "slices":77,
                                                         "max_volumes_per_disk":10,
                                                         "aslices":5,
                                                         "psize":107374182400,
                                                         "write_unit":4096,
                                                         "type":"HDD",
                                                         "devpath":"\/dev\/disk\/by-id\/scsi-3600224804c48fd7e16c608dea0919064",
                                                         "wwn":"0x600224804c48fd7e16c608dea0919064",
                                                         "pused":167772160,
                                                         "host":"cscale-82-140.robinsystems.com",
                                                         "capacity":107374182400,
                                                         "state":"READY",
                                                         "role":"Storage"
                                                      }
                                                   ],
                                                   "stormgr_id":234
                                                }
                                             ],
                                             "name":"test-ds-1.server.01.72.1.100e29ae-e508-4f21-a253-e3c912fcc242",
                                             "stormgr_id":158
                                          },
                                          {
                                             "volumes":[
                                                "test-ds-1.server.01.block.1.fa7b93eb-46f5-4830-b664-4428ed4088e9"
                                             ],
                                             "layout":"round-robin",
                                             "media":"HDD",
                                             "replicas":1,
                                             "rpoolid":1,
                                             "device_sets":[
                                                {
                                                   "name":"test-ds-1.server.01.72.1.18e90f5c-d221-4a5b-8fe9-4abc80a84776.0.2eb1b314-7f19-4cb8-8627-d652544194d9",
                                                   "devices":[
                                                      {
                                                         "max_throughput_intensive_vols_per_disk":1,
                                                         "max_latency_sensitive_vols_per_disk":2,
                                                         "tags":{

                                                         },
                                                         "hostname":"cscale-82-140.robinsystems.com",
                                                         "score":96,
                                                         "allocated_slices":2,
                                                         "reattachable":0,
                                                         "stormgr_id":2,
                                                         "protected":0,
                                                         "slices":77,
                                                         "max_volumes_per_disk":10,
                                                         "aslices":5,
                                                         "psize":107374182400,
                                                         "write_unit":4096,
                                                         "type":"HDD",
                                                         "devpath":"\/dev\/disk\/by-id\/scsi-3600224804c48fd7e16c608dea0919064",
                                                         "wwn":"0x600224804c48fd7e16c608dea0919064",
                                                         "pused":167772160,
                                                         "host":"cscale-82-140.robinsystems.com",
                                                         "capacity":107374182400,
                                                         "state":"READY",
                                                         "role":"Storage"
                                                      }
                                                   ],
                                                   "stormgr_id":235
                                                }
                                             ],
                                             "name":"test-ds-1.server.01.72.1.18e90f5c-d221-4a5b-8fe9-4abc80a84776",
                                             "stormgr_id":159
                                          }
                                       ],
                                       "rpoolid":1,
                                       "sidecar_info":{
                                          "mem":0,
                                          "cpu":0,
                                          "containers":[

                                          ],
                                          "hugepages_1g":0,
                                          "hugepages_2m":0,
                                          "gpu":0
                                       },
                                       "role":"server",
                                       "vnodehooks":{
                                          "postcreate":"bash postcreate.sh"
                                       },
                                       "engine":"docker",
                                       "desired_status":"ONLINE",
                                       "allocated_host_type":"physical",
                                       "state":"STARTED",
                                       "name":"test-ds-1.server.01",
                                       "enable_hooklogs":true,
                                       "allocated_host_public_hostname":"cscale-82-140.robinsystems.com",
                                       "pod_name":"test-ds-1-server-01",
                                       "jobid":1887,
                                       "cpu":{
                                          "min":0,
                                          "max":1,
                                          "reserve":false
                                       },
                                       "role_name":"server",
                                       "vnodeid":79,
                                       "allocated_host_public_ip":"10.9.82.140",
                                       "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1597122699552\/1597452431325\/k8s-test-10.0",
                                       "root_fs":"\/usr\/local\/robin\/instances\/test-ds-1-server-01.t001-u000003.svc.cluster.local",
                                       "mem":{
                                          "size":209715200,
                                          "hugepages_1g":0,
                                          "hugepages_2m":0
                                       },
                                       "image":{
                                          "name":"robinsys\/centos",
                                          "engine":"docker",
                                          "registry_hostname":"",
                                          "version":"7",
                                          "registry_port":"",
                                          "entrypoint":"entry.sh",
                                          "init_mode":false
                                       },
                                       "env":{
                                          "DOCKER_OPTS":{
                                             "value":"-v \/sys\/fs\/cgroup:\/sys\/fs\/cgroup --cap-add=SYS_ADMIN",
                                             "type":"text"
                                          },
                                          "ROOT_PASSWORD":{
                                             "value":"",
                                             "type":"password"
                                          },
                                          "allocated":{
                                             "ROBINHOST":"cscale-82-140.robinsystems.com",
                                             "DOCKER_OPTS":"-v \/sys\/fs\/cgroup:\/sys\/fs\/cgroup --cap-add=SYS_ADMIN",
                                             "ROBINHOST_TAG_KUBERNETES.IO-ARCH":"amd64",
                                             "ENABLE_SSH":true,
                                             "ROBINHOST_TAG_KUBERNETES.IO-OS":"linux",
                                             "ROBINHOST_TAG_ROBINRPOOL":"default",
                                             "POD_NAME":"test-ds-1-server-01",
                                             "POD_NS":"t001-u000003",
                                             "ROOT_PASSWORD":"",
                                             "K8S_NODE":"cscale-82-140"
                                          },
                                          "ENABLE_SSH":{
                                             "value":true,
                                             "type":"boolean"
                                          }
                                       },
                                       "ctime":1597453464,
                                       "service_uids":[

                                       ],
                                       "calico_inuse":true,
                                       "gpu":{
                                          "min":0,
                                          "max":0
                                       }
                                    }
                                 ],
                                 "image":{
                                    "name":"robinsys\/centos",
                                    "engine":"docker",
                                    "registry_hostname":"",
                                    "version":"7",
                                    "registry_port":"",
                                    "entrypoint":"entry.sh",
                                    "init_mode":false
                                 },
                                 "display_name":"server",
                                 "qgroups":{
                                    "data":{
                                       "wr_weight":1,
                                       "wr_min_window":500,
                                       "rd_min_window":500,
                                       "enabled":false,
                                       "rd_max_iops":2000000,
                                       "wr_min_iops":0,
                                       "wr_max_iops":2000000,
                                       "priority":1,
                                       "rd_weight":1,
                                       "rd_min_iops":0
                                    },
                                    "block":{
                                       "wr_weight":1,
                                       "wr_min_window":500,
                                       "rd_min_window":500,
                                       "enabled":false,
                                       "rd_max_iops":2000000,
                                       "wr_min_iops":0,
                                       "wr_max_iops":2000000,
                                       "priority":1,
                                       "rd_weight":1,
                                       "rd_min_iops":0
                                    }
                                 },
                                 "restart_on_qoscfg":true
                              }
                           ],
                           "from_template":null,
                           "bundle_object_id":"64495e524cbc9f133d4b92bcc04e1f94",
                           "apphooks":{
                              "postdestroy":"python3 postdestroy.py",
                              "allocated":{
                                 "postdestroy":"python3 postdestroy.py",
                                 "postcreate":"python3 postcreate.py",
                                 "precreate":"python3 precreate.py"
                              },
                              "postcreate":"python3 postcreate.py",
                              "precreate":"python3 precreate.py"
                           },
                           "bundleid":7,
                           "snapshot":"enabled",
                           "id":46,
                           "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1597122699552\/1597452431325\/k8s-test-10.0",
                           "robin_version":"5.3.1-182",
                           "restart_num":15,
                           "clone":"enabled",
                           "version":"7",
                           "namespace":"t001-u000003",
                           "rpool":"default",
                           "rpoolid":1,
                           "username":"robin",
                           "tenant":"Administrators",
                           "app_ns":"t001-u000003"
                        },
                        "jobid":1891
                     }

                .. raw:: html

                        </details>


List all Applications
=====================

.. tabs::

        .. tab:: CLI

                The following command will list all applications created or
                registered with Robin CNS:

                .. code-block:: text

                        # robin app list --app-kind <app_kind> 
                                         --app-types <app_type_list>

                ============================ ======================================================================================
                ``--app-kind <app_kind>``    Filter by application kind (valid choices are 'robin', 'helm', and 'flexapp')
                ``--app-types <app_types>``  Filter by application type (valid choices are'MASTER' and 'CLONE')
                ============================ ======================================================================================

                **Example 1 (Listing all Applications):**

                .. code-block:: text

                        # robin app list

                        Helm/Flex Apps: 

                        +-----------+---------+-------------+--------------+--------------+-----------+---------+
                        | Name      | Type    | State       | Owner/Tenant | Namespace    | Snapshots | Backups |
                        +-----------+---------+-------------+--------------+--------------+-----------+---------+
                        | mysql1    | helm    | ONLINE      | admin1/t1    | robinapps | 1         | 1       |
                        | mysql-hb1 | helm    | ONLINE      | admin1/t1    | robinapps | 0         | 0       |
                        | mysql2    | helm    | ONLINE      | admin1/t1    | robinapps | 0         | 0       |
                        | mysql1-b1 | flexapp | INITIALIZED | admin1/t1    | robinapps | 0         | 0       |
                        +-----------+---------+-------------+--------------+--------------+-----------+---------+

        .. tab:: API 

                Returns information on all applications within a cluster including details on their statuses (from Robin's perspective), resource consumption, and their owners.

                **End Point:** /api/v6/robin_server/appsview

                **Method:** GET

                **URL Parameters:** 

                - ``atype=[MASTER,CLONE]`` : Utilizing this parameter filters the results by the type specified. Valid values include MASTER and CLONE.
                - ``akind=[robin,helm,flexapp]`` : Utilizing this parameter filters the results by the kind specified. Valid values include robin, helm and flexapp. 

                **Data Parameters:** None 

                **Port:** RCM Port (default value is 29442)

                **Headers:** 

                - ``Authorization: <auth_token>`` : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

                **Success Response Code:** 200

                **Error Response Code:** 500 (Internal Server Error)

                **Example Response:**
                
                .. raw:: html

                        <details><summary><a>Output</a></summary>

                .. code-block:: text

                     {
                        "robin":{
                           "tenants":[
                              {
                                 "name":"Administrators",
                                 "id":1
                              }
                           ],
                           "rpools":[
                              {
                                 "name":"default",
                                 "id":1
                              }
                           ],
                           "zones":[
                              {
                                 "zoneid":1597969746,
                                 "name":"default",
                                 "id":1
                              }
                           ],
                           "vnodes":[
                              {
                                 "nodeid":1,
                                 "mem":4194304,
                                 "userid":3,
                                 "zoneid":null,
                                 "cpu":1,
                                 "role":"dsbundle",
                                 "gpu":0,
                                 "hugepages_1g":0,
                                 "utime":1598343982,
                                 "hugepages_2m":0,
                                 "hostname":"test-app-new-dsbundle-01.t001-u000003.svc.cluster.local",
                                 "name":"test-app-new.dsbundle.01",
                                 "status":"ONLINE",
                                 "pod_name":"test-app-new-dsbundle-01",
                                 "appid":12,
                                 "engine":"docker",
                                 "tenantid":1,
                                 "state":"STARTED",
                                 "id":12,
                                 "desired_status":"ONLINE",
                                 "pod_ns":"t001-u000003"
                              },
                              {
                                 "nodeid":1,
                                 "mem":1283457024,
                                 "userid":3,
                                 "zoneid":null,
                                 "cpu":1,
                                 "role":"nginx",
                                 "gpu":0,
                                 "hugepages_1g":0,
                                 "utime":1598453564,
                                 "hugepages_2m":0,
                                 "hostname":"demo-nginx-01.t001-u000003.svc.cluster.local",
                                 "name":"demo.nginx.01",
                                 "status":"ONLINE",
                                 "pod_name":"demo-nginx-01",
                                 "appid":13,
                                 "engine":"docker",
                                 "tenantid":1,
                                 "state":"STARTED",
                                 "id":13,
                                 "desired_status":"ONLINE",
                                 "pod_ns":"t001-u000003"
                              }
                           ],
                           "users":[
                              {
                                 "email":null,
                                 "tenantid":1,
                                 "firstname":"Robin",
                                 "id":3,
                                 "username":"robin",
                                 "lastname":"Systems"
                              }
                           ],
                           "nodes":[
                              {
                                 "rpoolid":1,
                                 "memory_used":0,
                                 "nvnodes":0,
                                 "k8s_node_name":"cscale-82-140",
                                 "zoneid":1,
                                 "cpu":40,
                                 "mem":33555701760,
                                 "mem_for_storage":1073741824,
                                 "cpu_prov_factor":10,
                                 "name":"cscale-82-140.robinsystems.com",
                                 "cpu_cores_present":40,
                                 "state":"ONLINE",
                                 "id":1,
                                 "cores_used":0,
                                 "services":"{\"update_time\":1598470070.8638851643,\"services\":{\"stormgr-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:43.555551\",\"MainPID\":2275,\"Id\":\"stormgr-server\"},\"consul-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:28:49.778591\",\"MainPID\":566,\"Id\":\"consul-server\"},\"consul_members\":[{\"Port\":29460,\"Status\":1,\"DelegateMax\":5,\"ProtocolMin\":1,\"Tags\":{\"segment\":\"\",\"bootstrap\":\"1\",\"vsn_min\":\"2\",\"build\":\"0.9.4:40f243a+\",\"vsn_max\":\"3\",\"vsn\":\"2\",\"raft_vsn\":\"2\",\"role\":\"consul\",\"dc\":\"consul\",\"id\":\"9d550700-9fac-4de6-b6bc-1b957e82bda9\",\"wan_join_port\":\"29461\",\"port\":\"29459\"},\"Name\":\"cscale-82-140.robinsystems.com\",\"DelegateMin\":2,\"ProtocolCur\":2,\"DelegateCur\":4,\"Addr\":\"10.9.82.140\",\"ProtocolMax\":5}],\"robin-auth-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:10.587576\",\"MainPID\":1007,\"Id\":\"robin-auth-server\"},\"robin-node-monitor\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:31.387560\",\"MainPID\":1245,\"Id\":\"robin-node-monitor\"},\"robin-watchdog\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:28:54.388588\",\"MainPID\":867,\"Id\":\"robin-watchdog\"},\"sherlock-server\":{\"ActiveState\":\"inactive\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":0,\"MainPID\":0,\"Id\":\"sherlock-server\"},\"httpd\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:46.799549\",\"MainPID\":2590,\"Id\":\"httpd\"},\"robin-file-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:15.559572\",\"MainPID\":1074,\"Id\":\"robin-file-server\"},\"robin-event-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:15.088572\",\"MainPID\":1041,\"Id\":\"robin-event-server\"},\"consul-client\":{\"ActiveState\":\"inactive\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":0,\"MainPID\":0,\"Id\":\"consul-client\"},\"gui-cli\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:46.964548\",\"MainPID\":2622,\"Id\":\"gui-cli\"},\"robin-agent\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:38.987554\",\"MainPID\":1716,\"Id\":\"robin-agent\"},\"robin-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-26 12:27:39.201277\",\"MainPID\":15116,\"Id\":\"robin-server\"},\"iomgr-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 12:51:14.290049\",\"MainPID\":29172,\"Id\":\"iomgr-server\"},\"monitor-server\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:29:47.114548\",\"MainPID\":2662,\"Id\":\"monitor-server\"},\"postgresql-9.6\":{\"ActiveState\":\"active\",\"Type\":\"simple\",\"ExecMainStartTimestamp\":\"2020-08-20 10:28:52.396589\",\"MainPID\":662,\"Id\":\"postgresql-9.6\"},\"consul_dns\":true}}"
                              }
                           ],
                           "bundles":[
                              {
                                 "version":"1.0",
                                 "name":"nginx",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":1
                              },
                              {
                                 "version":"1.0",
                                 "name":"tolerations",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":2
                              },
                              {
                                 "version":"1.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":3
                              },
                              {
                                 "version":"2.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":4
                              },
                              {
                                 "version":"3.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":5
                              },
                              {
                                 "version":"4.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":6
                              },
                              {
                                 "version":"10.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":7
                              },
                              {
                                 "version":"11.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":8
                              },
                              {
                                 "version":"12.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":9
                              },
                              {
                                 "version":"15.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":10
                              },
                              {
                                 "version":"new",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":11
                              },
                              {
                                 "version":"20.0",
                                 "name":"dsbundle",
                                 "share_with_all_tenants":false,
                                 "tenantid":1,
                                 "userid":3,
                                 "zoneid":1,
                                 "limitperbundle":0,
                                 "id":12
                              }
                           ],
                           "apps":[
                              {
                                 "rpoolid":1,
                                 "nvnodes":1,
                                 "zoneid":1,
                                 "mem":4194304,
                                 "atype":"MASTER",
                                 "name":"test-app-new",
                                 "status":"Ready",
                                 "hugepages_1g":0,
                                 "tenantid":1,
                                 "error":0,
                                 "utime":1598343982,
                                 "parentid":null,
                                 "userid":3,
                                 "cpu":1,
                                 "gpu":0,
                                 "bundleid":12,
                                 "hugepages_2m":0,
                                 "health":"Unknown",
                                 "ctime":1598343982,
                                 "unique_id":"a54ef254e6ac11eaa97cc972afea67da",
                                 "state":"ONLINE",
                                 "id":12,
                                 "parent_app":""
                              },
                              {
                                 "rpoolid":1,
                                 "nvnodes":1,
                                 "zoneid":1,
                                 "mem":1283457024,
                                 "atype":"MASTER",
                                 "name":"demo",
                                 "status":"Ready",
                                 "hugepages_1g":0,
                                 "tenantid":1,
                                 "error":0,
                                 "utime":1598453574,
                                 "parentid":null,
                                 "userid":3,
                                 "cpu":1,
                                 "gpu":0,
                                 "bundleid":1,
                                 "hugepages_2m":0,
                                 "health":"Unknown",
                                 "ctime":1598453564,
                                 "unique_id":"ba9df9e8e7ab11eaa8012d67016161bd",
                                 "state":"ONLINE",
                                 "id":13,
                                 "parent_app":""
                              }
                           ]
                        },
                        "k8s":[
                           {
                              "backup_schedule":{

                              },
                              "id":"da5f043ae7d211ea8ed2b5f75df49f21",
                              "query":"{\"namespace\":\"t001-u000003\",\"resources\":[],\"selectors\":[],\"apps\":[\"helm\\\/ideal-giraffe\"]}",
                              "kind":"helm",
                              "tenant":"Administrators",
                              "snapshot_schedule":{

                              },
                              "namespace":"t001-u000003",
                              "name":"demo-helm",
                              "state":"ONLINE",
                              "num_snapshots":0,
                              "username":"robin",
                              "num_backups":0
                           }
                        ]
                     }

                .. raw:: html

                        </details>


Show information about a specific Application
=============================================

.. tabs::

        .. tab:: CLI

                Issue the following command to get detailed information about a
                specific application instance:

                .. code-block:: text

                        # robin app info <app_name>
                                         --namespace <namespace>
                                         --services
                                         --network
                                         --appjson
                                         --volmap
                                         --storage
                                         --status

                ============================= ============================================================================================================================
                ``app_name``                  Application instance name 
                ``--namespace <namespace>``   If there are multiple applications of the same name but in different namespaces this option can be used to distinguish them
                ``--services``                Display information about services for an application
                ``--network``                 Display network information for an application
                ``--appjson``                 Display the application JSON file contents. For non Robin Bundle based applications, the Kubernetes YAML file for each of the objects associated with the application is displayed
                ``--volmap``                  Display the mapping between the application's volumes and the respective disk from which they are allocated
                ``--storage``                 Display the storage statistics associated with the application
                ``--status``                  Display the status of the Kubernetes objects associated with the application
                ============================= ============================================================================================================================

                **Example 1 (Showing information about a HELM app):**

                .. code-block:: text

                        # robin app info mysql1

                        Backups:
                        Name                              : mysql1
                        Kind                              : helm
                        State                             : ONLINE
                        Number of repos                   : 1
                        Number of snapshots               : 1
                        Number of usable backups          : 0
                        Number of archived/failed backups : 1

                        Query:
                        -------
                        {'apps': ['helm/trendy-crocodile'], 'namespace': 'robinapps', 'resources': [], 'selectors': []}

                        Repos:
                        +----------+-----------------------+----------+------------+
                        | Name     | Bucket                | Path     | Permission |
                        +----------+-----------------------+----------+------------+
                        | testrepo | testbucket-1029384756 | dev/tom/ | readwrite  |
                        +----------+-----------------------+----------+------------+

                        Snapshots:
                        +----------------------------------+----------------------------+-------------+--------+----------------------+
                        | Id                               | Name                       | Description | State  | Creation Time        |
                        +----------------------------------+----------------------------+-------------+--------+----------------------+
                        | 327ab8b447b111eaae7f0f55d6e44d6c | mysql1_snapshot-1580863693 | -           | ONLINE | 04 Feb 2020 16:48:19 |
                        +----------------------------------+----------------------------+-------------+--------+----------------------+

                        Archived/Failed Backups:
                        +----------------------------------+--------------------------+-------------+-----------------+----------------------+
                        | Id                               | Name                     | Description | State           | Creation Time        |
                        +----------------------------------+--------------------------+-------------+-----------------+----------------------+
                        | 36b7c9de47b111eaaf8deb154706dccd | mysql1_backup-1580863693 | -           | Deleted locally | 04 Feb 2020 16:48:24 |
                        +----------------------------------+--------------------------+-------------+-----------------+----------------------+

        .. tab:: API 

                Returns detailed information about an application, such as the volumes serving as storage, the resource breakdown and status of each container for every role.

                **End Point:** /api/v6/robin_server/apps/<appname>?info=true&details=vnodes

                **Method:** GET

                **URL Parameters:** None

                **Data Parameters:** None 

                **Port:** RCM Port (default value is 29442)

                **Headers:** 

                - ``Authorization: <auth_token>`` : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

                **Success Response Code:** 200

                **Error Response Code:** 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error)

                **Example Response:**
                
                .. raw:: html

                        <details><summary><a>Output</a></summary>

                .. code-block:: text

                     {
                        "error":0,
                        "updates_available":false,
                        "disk":2147483648,
                        "zoneid":1596601846,
                        "bundle_version":"1.5",
                        "bundle_name":"RIC",
                        "ctime":1596663233,
                        "owner":{
                           "last_name":"Systems",
                           "tenant_id":1,
                           "username":"robin",
                           "first_name":"Robin",
                           "tenant_name":"Administrators",
                           "email":null,
                           "user_id":3
                        },
                        "ainstances":[
                           {
                              "id":6,
                              "role":"server",
                              "memory":209715200,
                              "events":[

                              ],
                              "vnc_port":null,
                              "utime":1596663233,
                              "user":"robin",
                              "state":"STARTED",
                              "name":"test-RIC-1.server.01",
                              "ctime":1596663233,
                              "public_ips":[

                              ],
                              "image_format":"UNKNOWN",
                              "hugepages_2m":0,
                              "storage":[
                                 {
                                    "size":1073741824,
                                    "media":"HDD",
                                    "state":"ONLINE",
                                    "name":"test-RIC-1.server.01.data.1.382f1ad5-1294-4e24-8297-9c6025eacfe5",
                                    "id":"8"
                                 },
                                 {
                                    "size":1073741824,
                                    "media":"HDD",
                                    "state":"ONLINE",
                                    "name":"test-RIC-1.server.01.block.1.1053eaeb-4542-42a5-a173-d69a76703ead",
                                    "id":"9"
                                 }
                              ],
                              "bundle":{
                                 "pathname":"\/usr\/local\/robin\/collections\/file-collection-1596578146092\/1596663217668\/RIC-1.5",
                                 "description":"-",
                                 "tenants":[
                                    "Administrators"
                                 ],
                                 "create_time":"August 05, 2020 14:33:37",
                                 "content_id":"f972a5725d1bfe2671a79d61856f872a",
                                 "zoneid":1596601846,
                                 "share_with_all_tenants":false,
                                 "user":"robin",
                                 "type":"ROBIN",
                                 "name":"RIC",
                                 "nchildren":0,
                                 "version":"1.5",
                                 "file_object_id":1596663217668,
                                 "bundleid":3,
                                 "ntemplates":1,
                                 "tenant":"Administrators",
                                 "collection_id":1596578146092,
                                 "napps":1,
                                 "parent":"",
                                 "groupid":3
                              },
                              "image":{
                                 "version":"",
                                 "file":"",
                                 "name":""
                              },
                              "network_bandwidth":null,
                              "app":"test-RIC-1",
                              "status":"ONLINE",
                              "cpu_cores":1,
                              "config":{
                                 "restart_num":15,
                                 "service_uids":[

                                 ],
                                 "appname":"test-RIC-1",
                                 "allocated_host":"cscale-82-140.robinsystems.com",
                                 "allocated_host_public_ip":"10.9.82.140",
                                 "cpu":{
                                    "max":1,
                                    "min":0,
                                    "reserve":false
                                 },
                                 "sidecar_info":{
                                    "hugepages_1g":0,
                                    "mem":0,
                                    "hugepages_2m":0,
                                    "containers":[

                                    ],
                                    "cpu":0,
                                    "gpu":0
                                 },
                                 "id":6,
                                 "role_name":"server",
                                 "hosttags":{
                                    "kubernetes.io\/os":[
                                       "linux"
                                    ],
                                    "robin.io\/robinrpool":[
                                       "default"
                                    ],
                                    "kubernetes.io\/arch":[
                                       "amd64"
                                    ]
                                 },
                                 "pod_name":"test-ric-1-server-01",
                                 "role":"server",
                                 "rpoolid":1,
                                 "network":[
                                    {
                                       "subnet":"172.21.0.0",
                                       "allocated_by":"system",
                                       "allocated_ip":"172.21.26.94",
                                       "allocated_prefix":16,
                                       "allocated_names":[
                                          "eth0"
                                       ],
                                       "interfaces":1,
                                       "driver":"calico",
                                       "allocated_netmask":"255.255.0.0",
                                       "ippool":"robin-default",
                                       "name":"robin-default"
                                    }
                                 ],
                                 "storage":[
                                    {
                                       "volgrp_name":"test-RIC-1.server.01.72.1.ea297971-f931-4787-99cc-6782e026b77c",
                                       "media":"HDD",
                                       "stordriver":{
                                          "media":"HDD",
                                          "protection":0,
                                          "faultdomain":"host",
                                          "type":"das"
                                       },
                                       "workload":0,
                                       "type":"data",
                                       "snapshot_space_limit":214748365,
                                       "faultdomain":"host",
                                       "name":"test-RIC-1.server.01.data.1.382f1ad5-1294-4e24-8297-9c6025eacfe5",
                                       "blocksize":4096,
                                       "layout":"round-robin",
                                       "disk_tags":{

                                       },
                                       "allocated":{
                                          "media":72,
                                          "volumeid":"8",
                                          "priority":2,
                                          "genkey":1596663220770472,
                                          "grpid":8,
                                          "partitions":0,
                                          "snapshot_space_limit":214748365,
                                          "name":"test-RIC-1.server.01.data.1.382f1ad5-1294-4e24-8297-9c6025eacfe5",
                                          "current_snapshot":"active_snap",
                                          "params":{

                                          },
                                          "stordriver":{
                                             "media":"HDD",
                                             "protection":0,
                                             "faultdomain":"host",
                                             "type":"das"
                                          },
                                          "next_backupid":1,
                                          "appname":"default",
                                          "vtype":0,
                                          "resource_poolid":1,
                                          "current_snapshotid":1,
                                          "block_size":4096,
                                          "size":1073741824,
                                          "replication":1,
                                          "multinode_mounting":false,
                                          "appid":1,
                                          "next_snapshotid":2,
                                          "protection":0,
                                          "compression":0,
                                          "slice_size":1073741824,
                                          "qgroupid":8
                                       },
                                       "pvcpolicy":"create",
                                       "fstype":"ext4",
                                       "snap_reserved":20,
                                       "size":1073741824,
                                       "lvm_vol_count":"0",
                                       "lvm_type":"None",
                                       "encryption":"none",
                                       "protection":0,
                                       "compression":"disabled",
                                       "vol_ns":"t001-u000003",
                                       "replication":1,
                                       "path":"\/data",
                                       "k8s_name":"test-ric-1-server-01-data-1-382f1ad5"
                                    },
                                    {
                                       "volgrp_name":"test-RIC-1.server.01.72.1.1e483fd0-2d5c-434c-aef0-91a87796977a",
                                       "media":"HDD",
                                       "stordriver":{
                                          "media":"HDD",
                                          "protection":0,
                                          "faultdomain":"host",
                                          "type":"das"
                                       },
                                       "workload":0,
                                       "type":"block",
                                       "snapshot_space_limit":214748365,
                                       "faultdomain":"host",
                                       "name":"test-RIC-1.server.01.block.1.1053eaeb-4542-42a5-a173-d69a76703ead",
                                       "blocksize":4096,
                                       "layout":"round-robin",
                                       "disk_tags":{

                                       },
                                       "allocated":{
                                          "media":72,
                                          "volumeid":"9",
                                          "priority":2,
                                          "genkey":1596663220787432,
                                          "grpid":9,
                                          "partitions":0,
                                          "snapshot_space_limit":214748365,
                                          "name":"test-RIC-1.server.01.block.1.1053eaeb-4542-42a5-a173-d69a76703ead",
                                          "current_snapshot":"active_snap",
                                          "params":{

                                          },
                                          "stordriver":{
                                             "media":"HDD",
                                             "protection":0,
                                             "faultdomain":"host",
                                             "type":"das"
                                          },
                                          "next_backupid":1,
                                          "appname":"default",
                                          "vtype":0,
                                          "resource_poolid":1,
                                          "current_snapshotid":1,
                                          "block_size":4096,
                                          "size":1073741824,
                                          "replication":1,
                                          "multinode_mounting":false,
                                          "appid":1,
                                          "next_snapshotid":2,
                                          "protection":0,
                                          "compression":0,
                                          "slice_size":1073741824,
                                          "qgroupid":9
                                       },
                                       "pvcpolicy":"create",
                                       "fstype":"raw",
                                       "snap_reserved":20,
                                       "size":1073741824,
                                       "replication":1,
                                       "lvm_type":"None",
                                       "encryption":"none",
                                       "protection":0,
                                       "compression":"disabled",
                                       "vol_ns":"t001-u000003",
                                       "lvm_vol_count":"0",
                                       "path":"\/dev\/rda",
                                       "k8s_name":"test-ric-1-server-01-block-1-1053eaeb"
                                    }
                                 ],
                                 "cm_keys":[
                                    "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgHRR3k5onnh+hjqpoW\/oLkr37GOs2f8FQVDJUHHrDeB+\/cn9c\/nez4lu9J0FkCe+mQwhnuiCicunZEjVZOWpIvjxblbw6Lh7ZkN+o5mOkcxCayrp3fDFnR1PerJJhRPnJU60zxFYbAGPrQtCywQ+b7J9hLtNaqCBf9eAwVWiLSEcFs0SkrjXjFjXOTCaq8b45AWSYc6ZxhzMsFTkTF3C37rTmEGIijmDvUbq1HRGXtQ2YZrlo\/yjJqn8wk8E+cw+Sh\/PEsudaVzoZRqyQ\/lsWBt\/+0nFON8pYttyXPZjKhuGDB5QNtUZ4kgvzDfr1TF1XEXHfo2PdsswRkQ4rU8bF root@cscale-82-140"
                                 ],
                                 "env":{
                                    "ENABLE_SSH":{
                                       "value":true,
                                       "type":"boolean"
                                    },
                                    "ROOT_PASSWORD":{
                                       "value":"",
                                       "type":"password"
                                    },
                                    "allocated":{
                                       "K8S_NODE":"cscale-82-140",
                                       "ROBINHOST":"cscale-82-140.robinsystems.com",
                                       "POD_NAME":"test-ric-1-server-01",
                                       "ROOT_PASSWORD":"",
                                       "ENABLE_SSH":true,
                                       "ROBINHOST_TAG_ROBINRPOOL":"default",
                                       "ROBINHOST_TAG_KUBERNETES.IO-ARCH":"amd64",
                                       "ROBINHOST_TAG_KUBERNETES.IO-OS":"linux",
                                       "POD_NS":"t001-u000003",
                                       "DOCKER_OPTS":"-v \/sys\/fs\/cgroup:\/sys\/fs\/cgroup --cap-add=SYS_ADMIN"
                                    },
                                    "DOCKER_OPTS":{
                                       "value":"-v \/sys\/fs\/cgroup:\/sys\/fs\/cgroup --cap-add=SYS_ADMIN",
                                       "type":"text"
                                    }
                                 },
                                 "appid":6,
                                 "root_fs":"\/usr\/local\/robin\/instances\/test-ric-1-server-01.t001-u000003.svc.cluster.local",
                                 "enable_hooklogs":true,
                                 "bundle_object_id":"f972a5725d1bfe2671a79d61856f872a",
                                 "numa_allocations":{
                                    "0":{
                                       "hugepages_1g_used":0,
                                       "hugepages_2m_used":0,
                                       "gpu_used":0,
                                       "isol_shared_cores_used":0,
                                       "non_isol_cores_used":1,
                                       "mem_used":209715200,
                                       "isol_dedicated_cores_used":0
                                    }
                                 },
                                 "utime":1596663233,
                                 "volume_groups":[
                                    {
                                       "layout":"round-robin",
                                       "volumes":[
                                          "test-RIC-1.server.01.data.1.382f1ad5-1294-4e24-8297-9c6025eacfe5"
                                       ],
                                       "media":"HDD",
                                       "device_sets":[
                                          {
                                             "devices":[
                                                {
                                                   "tags":{

                                                   },
                                                   "pused":1107296256,
                                                   "allocated_slices":2,
                                                   "type":"HDD",
                                                   "state":"READY",
                                                   "aslices":29,
                                                   "slices":77,
                                                   "stormgr_id":1,
                                                   "max_throughput_intensive_vols_per_disk":1,
                                                   "write_unit":4096,
                                                   "host":"cscale-82-140.robinsystems.com",
                                                   "role":"Storage",
                                                   "protected":0,
                                                   "devpath":"\/dev\/disk\/by-id\/scsi-3600224804c48fd7e16c608dea0919064",
                                                   "reattachable":0,
                                                   "score":84,
                                                   "psize":107374182400,
                                                   "max_volumes_per_disk":10,
                                                   "wwn":"0x600224804c48fd7e16c608dea0919064",
                                                   "capacity":107374182400,
                                                   "hostname":"cscale-82-140.robinsystems.com",
                                                   "max_latency_sensitive_vols_per_disk":2
                                                }
                                             ],
                                             "name":"test-RIC-1.server.01.72.1.ea297971-f931-4787-99cc-6782e026b77c.0.1e8feb41-fd42-4409-b8c1-751331febdc1",
                                             "stormgr_id":8
                                          }
                                       ],
                                       "rpoolid":1,
                                       "name":"test-RIC-1.server.01.72.1.ea297971-f931-4787-99cc-6782e026b77c",
                                       "replicas":1,
                                       "stormgr_id":8
                                    },
                                    {
                                       "layout":"round-robin",
                                       "volumes":[
                                          "test-RIC-1.server.01.block.1.1053eaeb-4542-42a5-a173-d69a76703ead"
                                       ],
                                       "media":"HDD",
                                       "device_sets":[
                                          {
                                             "devices":[
                                                {
                                                   "tags":{

                                                   },
                                                   "pused":1107296256,
                                                   "allocated_slices":2,
                                                   "type":"HDD",
                                                   "state":"READY",
                                                   "aslices":29,
                                                   "slices":77,
                                                   "stormgr_id":1,
                                                   "max_throughput_intensive_vols_per_disk":1,
                                                   "write_unit":4096,
                                                   "host":"cscale-82-140.robinsystems.com",
                                                   "role":"Storage",
                                                   "protected":0,
                                                   "devpath":"\/dev\/disk\/by-id\/scsi-3600224804c48fd7e16c608dea0919064",
                                                   "reattachable":0,
                                                   "score":84,
                                                   "psize":107374182400,
                                                   "max_volumes_per_disk":10,
                                                   "wwn":"0x600224804c48fd7e16c608dea0919064",
                                                   "capacity":107374182400,
                                                   "hostname":"cscale-82-140.robinsystems.com",
                                                   "max_latency_sensitive_vols_per_disk":2
                                                }
                                             ],
                                             "name":"test-RIC-1.server.01.72.1.1e483fd0-2d5c-434c-aef0-91a87796977a.0.5bf728c4-ea26-4e0f-82d7-c584fcf0bd9a",
                                             "stormgr_id":9
                                          }
                                       ],
                                       "rpoolid":1,
                                       "name":"test-RIC-1.server.01.72.1.1e483fd0-2d5c-434c-aef0-91a87796977a",
                                       "replicas":1,
                                       "stormgr_id":9
                                    }
                                 ],
                                 "bundleid":3,
                                 "vnodehooks":{
                                    "postcreate":"bash postcreate.sh"
                                 },
                                 "mem":{
                                    "size":209715200,
                                    "hugepages_1g":0,
                                    "hugepages_2m":0
                                 },
                                 "enable_portmapping":true,
                                 "state":"STARTED",
                                 "name":"test-RIC-1.server.01",
                                 "k8s_provider":"robin",
                                 "ctime":1596663233,
                                 "vnodeid":6,
                                 "allocated":{
                                    "zoneid":1596601846,
                                    "nodename":"cscale-82-140",
                                    "nodeid":1,
                                    "zonename":"default"
                                 },
                                 "image":{
                                    "init_mode":false,
                                    "version":"7",
                                    "registry_hostname":"",
                                    "entrypoint":"entry.sh",
                                    "name":"robinsys\/centos",
                                    "engine":"docker",
                                    "registry_port":""
                                 },
                                 "calico_inuse":true,
                                 "enable_metrics":true,
                                 "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1596578146092\/1596663217668\/RIC-1.5",
                                 "vnodehookargs":{
                                    "postcreate":[

                                    ]
                                 },
                                 "pod_ns":"t001-u000003",
                                 "allocated_host_public_hostname":"cscale-82-140.robinsystems.com",
                                 "allocated_host_type":"physical",
                                 "hostname":"test-ric-1-server-01.t001-u000003.svc.cluster.local",
                                 "host_ip":"172.21.26.94",
                                 "restart_on_qoscfg":true,
                                 "engine":"docker",
                                 "gpu":{
                                    "max":0,
                                    "min":0
                                 }
                              },
                              "physical_host":{
                                 "compute_status":"READY",
                                 "status":1,
                                 "hostname":"cscale-82-140.robinsystems.com",
                                 "compute_state":"ONLINE",
                                 "public_hostname":"cscale-82-140.robinsystems.com",
                                 "compute_services":[
                                    [
                                       "robin-agent",
                                       true
                                    ],
                                    [
                                       "monitor-server",
                                       true
                                    ],
                                    [
                                       "iomgr-server",
                                       true
                                    ]
                                 ],
                                 "state":"ONLINE",
                                 "public_ip":"10.9.82.140"
                              },
                              "gpu_cores":0,
                              "restartpolicy":{
                                 "restarts_done":0,
                                 "burst_count":0,
                                 "burst_start_time":0,
                                 "burst_interval":600,
                                 "id":13,
                                 "restart_limit":15
                              },
                              "distribution":{
                                 "version":"",
                                 "name":""
                              },
                              "root_fs":"\/usr\/local\/robin\/instances\/test-ric-1-server-01.t001-u000003.svc.cluster.local",
                              "volumes":[
                                 {
                                    "size":1073741824,
                                    "media":"HDD",
                                    "state":"ONLINE",
                                    "name":"test-RIC-1.server.01.data.1.382f1ad5-1294-4e24-8297-9c6025eacfe5",
                                    "id":"8"
                                 },
                                 {
                                    "size":1073741824,
                                    "media":"HDD",
                                    "state":"ONLINE",
                                    "name":"test-RIC-1.server.01.block.1.1053eaeb-4542-42a5-a173-d69a76703ead",
                                    "id":"9"
                                 }
                              ],
                              "capacity":{
                                 "threshold":85,
                                 "used":0,
                                 "total":0,
                                 "unit":"Bytes"
                              },
                              "service_ports":null,
                              "tenant":"Administrators",
                              "hugepages_1g":0,
                              "rpool":"default",
                              "autopilot":true,
                              "desired_status":"ONLINE",
                              "ip_addresses":[
                                 "172.21.26.94\/16"
                              ],
                              "engine":"docker",
                              "hostname":"test-ric-1-server-01.t001-u000003.svc.cluster.local"
                           }
                        ],
                        "local_avail":true,
                        "nbackups":0,
                        "id":6,
                        "clone":false,
                        "unique_id":"549c0ac2d76311eab3c057add9d364f3",
                        "parentid":"",
                        "status":"Ready",
                        "atype":"MASTER",
                        "message":"",
                        "nsnapshots":0,
                        "utime":1596663233,
                        "rpool":"default",
                        "autopilot":true,
                        "snapshots":[

                        ],
                        "user_shares":[

                        ],
                        "mem":209715200,
                        "backups":[

                        ],
                        "state":"ONLINE",
                        "name":"test-RIC-1",
                        "cpu":1,
                        "restore_status":{

                        },
                        "appinfo":{

                        },
                        "nvnodes":1,
                        "resources":[

                        ],
                        "health":"Unknown",
                        "config":{
                           "content_id":"f972a5725d1bfe2671a79d61856f872a",
                           "from_template":null,
                           "enable_metrics":true,
                           "kind":"ROBIN",
                           "id":6,
                           "name":"test-RIC-1",
                           "auto_relocate":true,
                           "version":"7",
                           "zoneid":1596601846,
                           "app_ns":"t001-u000003",
                           "namespace":"t001-u000003",
                           "tenant":"Administrators",
                           "clone":"enabled",
                           "pvcpolicy":"create",
                           "planid":6,
                           "restart_num":15,
                           "rpoolid":1,
                           "roles":[
                              {
                                 "qgroups":{
                                    "block":{
                                       "rd_weight":1,
                                       "rd_max_iops":2000000,
                                       "priority":1,
                                       "wr_min_iops":0,
                                       "wr_min_window":500,
                                       "rd_min_iops":0,
                                       "rd_min_window":500,
                                       "enabled":false,
                                       "wr_max_iops":2000000,
                                       "wr_weight":1
                                    },
                                    "data":{
                                       "rd_weight":1,
                                       "rd_max_iops":2000000,
                                       "priority":1,
                                       "wr_min_iops":0,
                                       "wr_min_window":500,
                                       "rd_min_iops":0,
                                       "rd_min_window":500,
                                       "enabled":false,
                                       "wr_max_iops":2000000,
                                       "wr_weight":1
                                    }
                                 },
                                 "vnodes":[
                                    {
                                       "restart_num":15,
                                       "service_uids":[

                                       ],
                                       "appname":"test-RIC-1",
                                       "allocated_host":"cscale-82-140.robinsystems.com",
                                       "allocated_host_public_ip":"10.9.82.140",
                                       "cpu":{
                                          "max":1,
                                          "min":0,
                                          "reserve":false
                                       },
                                       "sidecar_info":{
                                          "hugepages_1g":0,
                                          "mem":0,
                                          "hugepages_2m":0,
                                          "containers":[

                                          ],
                                          "cpu":0,
                                          "gpu":0
                                       },
                                       "id":6,
                                       "role_name":"server",
                                       "hosttags":{
                                          "kubernetes.io\/os":[
                                             "linux"
                                          ],
                                          "robin.io\/robinrpool":[
                                             "default"
                                          ],
                                          "kubernetes.io\/arch":[
                                             "amd64"
                                          ]
                                       },
                                       "pod_name":"test-ric-1-server-01",
                                       "role":"server",
                                       "rpoolid":1,
                                       "status":"ONLINE",
                                       "network":[
                                          {
                                             "subnet":"172.21.0.0",
                                             "allocated_by":"system",
                                             "allocated_ip":"172.21.26.94",
                                             "allocated_prefix":16,
                                             "allocated_names":[
                                                "eth0"
                                             ],
                                             "interfaces":1,
                                             "driver":"calico",
                                             "allocated_netmask":"255.255.0.0",
                                             "ippool":"robin-default",
                                             "name":"robin-default"
                                          }
                                       ],
                                       "storage":[
                                          {
                                             "volgrp_name":"test-RIC-1.server.01.72.1.ea297971-f931-4787-99cc-6782e026b77c",
                                             "media":"HDD",
                                             "stordriver":{
                                                "media":"HDD",
                                                "protection":0,
                                                "faultdomain":"host",
                                                "type":"das"
                                             },
                                             "workload":0,
                                             "type":"data",
                                             "snapshot_space_limit":214748365,
                                             "faultdomain":"host",
                                             "name":"test-RIC-1.server.01.data.1.382f1ad5-1294-4e24-8297-9c6025eacfe5",
                                             "blocksize":4096,
                                             "layout":"round-robin",
                                             "disk_tags":{

                                             },
                                             "allocated":{
                                                "media":72,
                                                "volumeid":"8",
                                                "priority":2,
                                                "genkey":1596663220770472,
                                                "grpid":8,
                                                "partitions":0,
                                                "snapshot_space_limit":214748365,
                                                "name":"test-RIC-1.server.01.data.1.382f1ad5-1294-4e24-8297-9c6025eacfe5",
                                                "current_snapshot":"active_snap",
                                                "params":{

                                                },
                                                "stordriver":{
                                                   "media":"HDD",
                                                   "protection":0,
                                                   "faultdomain":"host",
                                                   "type":"das"
                                                },
                                                "next_backupid":1,
                                                "appname":"default",
                                                "vtype":0,
                                                "resource_poolid":1,
                                                "current_snapshotid":1,
                                                "block_size":4096,
                                                "size":1073741824,
                                                "replication":1,
                                                "multinode_mounting":false,
                                                "appid":1,
                                                "next_snapshotid":2,
                                                "protection":0,
                                                "compression":0,
                                                "slice_size":1073741824,
                                                "qgroupid":8
                                             },
                                             "pvcpolicy":"create",
                                             "fstype":"ext4",
                                             "snap_reserved":20,
                                             "size":1073741824,
                                             "lvm_vol_count":"0",
                                             "lvm_type":"None",
                                             "encryption":"none",
                                             "protection":0,
                                             "compression":"disabled",
                                             "vol_ns":"t001-u000003",
                                             "replication":1,
                                             "path":"\/data",
                                             "k8s_name":"test-ric-1-server-01-data-1-382f1ad5"
                                          },
                                          {
                                             "volgrp_name":"test-RIC-1.server.01.72.1.1e483fd0-2d5c-434c-aef0-91a87796977a",
                                             "media":"HDD",
                                             "stordriver":{
                                                "media":"HDD",
                                                "protection":0,
                                                "faultdomain":"host",
                                                "type":"das"
                                             },
                                             "workload":0,
                                             "type":"block",
                                             "snapshot_space_limit":214748365,
                                             "faultdomain":"host",
                                             "name":"test-RIC-1.server.01.block.1.1053eaeb-4542-42a5-a173-d69a76703ead",
                                             "blocksize":4096,
                                             "layout":"round-robin",
                                             "disk_tags":{

                                             },
                                             "allocated":{
                                                "media":72,
                                                "volumeid":"9",
                                                "priority":2,
                                                "genkey":1596663220787432,
                                                "grpid":9,
                                                "partitions":0,
                                                "snapshot_space_limit":214748365,
                                                "name":"test-RIC-1.server.01.block.1.1053eaeb-4542-42a5-a173-d69a76703ead",
                                                "current_snapshot":"active_snap",
                                                "params":{

                                                },
                                                "stordriver":{
                                                   "media":"HDD",
                                                   "protection":0,
                                                   "faultdomain":"host",
                                                   "type":"das"
                                                },
                                                "next_backupid":1,
                                                "appname":"default",
                                                "vtype":0,
                                                "resource_poolid":1,
                                                "current_snapshotid":1,
                                                "block_size":4096,
                                                "size":1073741824,
                                                "replication":1,
                                                "multinode_mounting":false,
                                                "appid":1,
                                                "next_snapshotid":2,
                                                "protection":0,
                                                "compression":0,
                                                "slice_size":1073741824,
                                                "qgroupid":9
                                             },
                                             "pvcpolicy":"create",
                                             "fstype":"raw",
                                             "snap_reserved":20,
                                             "size":1073741824,
                                             "replication":1,
                                             "lvm_type":"None",
                                             "encryption":"none",
                                             "protection":0,
                                             "compression":"disabled",
                                             "vol_ns":"t001-u000003",
                                             "lvm_vol_count":"0",
                                             "path":"\/dev\/rda",
                                             "k8s_name":"test-ric-1-server-01-block-1-1053eaeb"
                                          }
                                       ],
                                       "cm_keys":[
                                          "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDgHRR3k5onnh+hjqpoW\/oLkr37GOs2f8FQVDJUHHrDeB+\/cn9c\/nez4lu9J0FkCe+mQwhnuiCicunZEjVZOWpIvjxblbw6Lh7ZkN+o5mOkcxCayrp3fDFnR1PerJJhRPnJU60zxFYbAGPrQtCywQ+b7J9hLtNaqCBf9eAwVWiLSEcFs0SkrjXjFjXOTCaq8b45AWSYc6ZxhzMsFTkTF3C37rTmEGIijmDvUbq1HRGXtQ2YZrlo\/yjJqn8wk8E+cw+Sh\/PEsudaVzoZRqyQ\/lsWBt\/+0nFON8pYttyXPZjKhuGDB5QNtUZ4kgvzDfr1TF1XEXHfo2PdsswRkQ4rU8bF root@cscale-82-140"
                                       ],
                                       "env":{
                                          "ENABLE_SSH":{
                                             "value":true,
                                             "type":"boolean"
                                          },
                                          "ROOT_PASSWORD":{
                                             "value":"",
                                             "type":"password"
                                          },
                                          "allocated":{
                                             "K8S_NODE":"cscale-82-140",
                                             "ROBINHOST":"cscale-82-140.robinsystems.com",
                                             "POD_NAME":"test-ric-1-server-01",
                                             "ROOT_PASSWORD":"",
                                             "ENABLE_SSH":true,
                                             "ROBINHOST_TAG_ROBINRPOOL":"default",
                                             "ROBINHOST_TAG_KUBERNETES.IO-ARCH":"amd64",
                                             "ROBINHOST_TAG_KUBERNETES.IO-OS":"linux",
                                             "POD_NS":"t001-u000003",
                                             "DOCKER_OPTS":"-v \/sys\/fs\/cgroup:\/sys\/fs\/cgroup --cap-add=SYS_ADMIN"
                                          },
                                          "DOCKER_OPTS":{
                                             "value":"-v \/sys\/fs\/cgroup:\/sys\/fs\/cgroup --cap-add=SYS_ADMIN",
                                             "type":"text"
                                          }
                                       },
                                       "appid":6,
                                       "root_fs":"\/usr\/local\/robin\/instances\/test-ric-1-server-01.t001-u000003.svc.cluster.local",
                                       "enable_hooklogs":true,
                                       "bundle_object_id":"f972a5725d1bfe2671a79d61856f872a",
                                       "numa_allocations":{
                                          "0":{
                                             "hugepages_1g_used":0,
                                             "hugepages_2m_used":0,
                                             "gpu_used":0,
                                             "isol_shared_cores_used":0,
                                             "non_isol_cores_used":1,
                                             "mem_used":209715200,
                                             "isol_dedicated_cores_used":0
                                          }
                                       },
                                       "utime":1596663233,
                                       "volume_groups":[
                                          {
                                             "layout":"round-robin",
                                             "volumes":[
                                                "test-RIC-1.server.01.data.1.382f1ad5-1294-4e24-8297-9c6025eacfe5"
                                             ],
                                             "media":"HDD",
                                             "device_sets":[
                                                {
                                                   "devices":[
                                                      {
                                                         "tags":{

                                                         },
                                                         "pused":1107296256,
                                                         "allocated_slices":2,
                                                         "type":"HDD",
                                                         "state":"READY",
                                                         "aslices":29,
                                                         "slices":77,
                                                         "stormgr_id":1,
                                                         "max_throughput_intensive_vols_per_disk":1,
                                                         "write_unit":4096,
                                                         "host":"cscale-82-140.robinsystems.com",
                                                         "role":"Storage",
                                                         "protected":0,
                                                         "devpath":"\/dev\/disk\/by-id\/scsi-3600224804c48fd7e16c608dea0919064",
                                                         "reattachable":0,
                                                         "score":84,
                                                         "psize":107374182400,
                                                         "max_volumes_per_disk":10,
                                                         "wwn":"0x600224804c48fd7e16c608dea0919064",
                                                         "capacity":107374182400,
                                                         "hostname":"cscale-82-140.robinsystems.com",
                                                         "max_latency_sensitive_vols_per_disk":2
                                                      }
                                                   ],
                                                   "name":"test-RIC-1.server.01.72.1.ea297971-f931-4787-99cc-6782e026b77c.0.1e8feb41-fd42-4409-b8c1-751331febdc1",
                                                   "stormgr_id":8
                                                }
                                             ],
                                             "rpoolid":1,
                                             "name":"test-RIC-1.server.01.72.1.ea297971-f931-4787-99cc-6782e026b77c",
                                             "replicas":1,
                                             "stormgr_id":8
                                          },
                                          {
                                             "layout":"round-robin",
                                             "volumes":[
                                                "test-RIC-1.server.01.block.1.1053eaeb-4542-42a5-a173-d69a76703ead"
                                             ],
                                             "media":"HDD",
                                             "device_sets":[
                                                {
                                                   "devices":[
                                                      {
                                                         "tags":{

                                                         },
                                                         "pused":1107296256,
                                                         "allocated_slices":2,
                                                         "type":"HDD",
                                                         "state":"READY",
                                                         "aslices":29,
                                                         "slices":77,
                                                         "stormgr_id":1,
                                                         "max_throughput_intensive_vols_per_disk":1,
                                                         "write_unit":4096,
                                                         "host":"cscale-82-140.robinsystems.com",
                                                         "role":"Storage",
                                                         "protected":0,
                                                         "devpath":"\/dev\/disk\/by-id\/scsi-3600224804c48fd7e16c608dea0919064",
                                                         "reattachable":0,
                                                         "score":84,
                                                         "psize":107374182400,
                                                         "max_volumes_per_disk":10,
                                                         "wwn":"0x600224804c48fd7e16c608dea0919064",
                                                         "capacity":107374182400,
                                                         "hostname":"cscale-82-140.robinsystems.com",
                                                         "max_latency_sensitive_vols_per_disk":2
                                                      }
                                                   ],
                                                   "name":"test-RIC-1.server.01.72.1.1e483fd0-2d5c-434c-aef0-91a87796977a.0.5bf728c4-ea26-4e0f-82d7-c584fcf0bd9a",
                                                   "stormgr_id":9
                                                }
                                             ],
                                             "rpoolid":1,
                                             "name":"test-RIC-1.server.01.72.1.1e483fd0-2d5c-434c-aef0-91a87796977a",
                                             "replicas":1,
                                             "stormgr_id":9
                                          }
                                       ],
                                       "bundleid":3,
                                       "vnodehooks":{
                                          "postcreate":"bash postcreate.sh"
                                       },
                                       "mem":{
                                          "size":209715200,
                                          "hugepages_1g":0,
                                          "hugepages_2m":0
                                       },
                                       "enable_portmapping":true,
                                       "state":"STARTED",
                                       "name":"test-RIC-1.server.01",
                                       "k8s_provider":"robin",
                                       "ctime":1596663233,
                                       "vnodeid":6,
                                       "allocated":{
                                          "zoneid":1596601846,
                                          "nodename":"cscale-82-140",
                                          "nodeid":1,
                                          "zonename":"default"
                                       },
                                       "image":{
                                          "init_mode":false,
                                          "version":"7",
                                          "registry_hostname":"",
                                          "entrypoint":"entry.sh",
                                          "name":"robinsys\/centos",
                                          "engine":"docker",
                                          "registry_port":""
                                       },
                                       "calico_inuse":true,
                                       "enable_metrics":true,
                                       "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1596578146092\/1596663217668\/RIC-1.5",
                                       "vnodehookargs":{
                                          "postcreate":[

                                          ]
                                       },
                                       "pod_ns":"t001-u000003",
                                       "allocated_host_public_hostname":"cscale-82-140.robinsystems.com",
                                       "allocated_host_type":"physical",
                                       "hostname":"test-ric-1-server-01.t001-u000003.svc.cluster.local",
                                       "host_ip":"172.21.26.94",
                                       "restart_on_qoscfg":true,
                                       "engine":"docker",
                                       "gpu":{
                                          "max":0,
                                          "min":0
                                       }
                                    }
                                 ],
                                 "name":"server",
                                 "display_name":"server",
                                 "restart_on_qoscfg":true,
                                 "volume_groups":[

                                 ],
                                 "image":{
                                    "init_mode":false,
                                    "version":"7",
                                    "registry_hostname":"",
                                    "entrypoint":"entry.sh",
                                    "name":"robinsys\/centos",
                                    "engine":"docker",
                                    "registry_port":""
                                 }
                              }
                           ],
                           "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1596578146092\/1596663217668\/RIC-1.5",
                           "username":"robin",
                           "robin_version":"5.3.0-171",
                           "enable_hooklogs":true,
                           "bundle_object_id":"f972a5725d1bfe2671a79d61856f872a",
                           "bundleid":3,
                           "rpool":"default",
                           "snapshot":"enabled"
                        },
                        "vnodes":[
                           "test-RIC-1.server.01"
                        ],
                        "repos":[

                        ],
                        "parent_app":"",
                        "app_kind":"robin",
                        "appcfg_autopilot":true,
                        "bundleid":3,
                        "backup_state":"Hydrated",
                        "storagerepos":[

                        ],
                        "gpu":0
                     }

                .. raw:: html

                        </details>

Application Sharing and the Reasignment of Application Ownership
================================================================

Each application is assigned to a user and a tenant. The user is the
application's owner (creator) and the tenant is the tenant they were
logged into when they created the app. By default, a regular tenant
user (a user assigned the ``user`` role) can only access and manage
applications they own. There are times, however, when it might be
desirable for an application to be shared with multiple tenant users.
For example, a tenant administrator might want a group of users to
share management responsibilities for an application. To accomplish
this, the tenant admin can give each user shared access to the app
with permission to perform specific administrative tasks, such as
starting and stopping the app, creating snapshots and backups, etc.
In addition to application sharing, there are also times when the
ownership of an application needs to be reassigned from one tenant
user to another. For example, if the application's owner needs to be
removed from the tenant.

Applications are multi-object entities consisting of the application
control object and one or more instance (vnode) objects. There is a
very tight coupling between these objects that requires they all be
assigned to the same user and tenant. In addition to the objects
making up the application, an application may have one or more
snapshots or clones associated with it.

* A application **snapshot** contains a point-in-time copy of the
  application's data and operational state. Snapshot's can be used to
  revert (roll back) an app to a particular point in time, or when
  creating an application clone.

* An application **clone** is an application instance, however it does
  not exist independently. The volumes allocated for an application
  clone are shared with the parent app (linked by the sanpshot the
  clone was created from). 

Requiring all application objects be assigned to the same user and
tenant ensures that the user (the application's owner) will be able
to access and manage all resources associated with the application.
This is especially true when it comes to app deletion. An app cannot
be deleted if there are any snapshots or clones associated with it,
and the app's owner will not be able to delete them (or even see
them) if they are ownd by another user. Any snapshot or clone created
by a user with shared access to an app will be assigned to the same
user and tenant as the app. The user creating the snapshot or clone
will automatically be given shared access to the objects they
created, however, so they can access it.

.. note::

        * The sharing of applications and the reassignment of their
          ownership is closely aligned with the sharing of namespaces.
          Before a user to be given access to an application, they first
          must be given access to the namespace the application is
          deployed to. Note that the sharing of a namespace is a separate
          operation from the sharing of an application.

        * When reassigning ownership of an application, the ownership of
          all related snapshots and application clones will also be
          changed.

        * If a user’s shared access to an app is revoked, then shared
          access to all snapshots and clones associated with that app will
          also be revoked.

        * An application clone must be deployed in the same namespace the
          parent is deployed in. Even if it’s possible for applications
          deployed to different namespaces to share storage volume (from a
          pure storage point of view), to allow it makes validity checking
          scenarios very complicated and error prone.

        * A user with shared access to an app will not automatically have
          access to snapshots and application clones associated with the
          app. They can be given shared access, however (by a tenantadmin
          or superadmin user).

        * A user with shared access to an app (and adequate share
          permissions) will be able to create and manage the snapshots and
          clones they create.

        * A user with shared access to an app will **not** be allowed to
          delete the app (only the app owner, a tenantadmin, or superadmin
          should be able to do that).

        * Even though there is a relationship between an app and backups
          crated from that app, the above ownership rule doesn't apply.
          That's because backups can exist independent of the apps they
          were created from, and even from the cluster they were created
          on.


Sharing an Application
^^^^^^^^^^^^^^^^^^^^^^

.. tabs::

        .. tab:: CLI

            Run the following command to share an app with one or more users:

            .. code-block:: text

                  # robin app share name [user_list]
                                         --operations <operations>
                                         --all-tenant-users

            ============================= =======================================================================
            ``name``                      Application instance name 
            ``user_list``                 Optional comma separated list of users the application
                                          will be shared with
            ``--operations <operations>`` Comma separated list of operations the users will be
                                          allowed to perform on the shared application. To allow
                                          all valid operations to be performed, specify
                                          'ALL_OPERATIONS' on the command line (default value is
                                          'view')
            ``--all-tenant-users``        Share app with all tenant users. Note this option is required when no 
                                          users are explicitly specified
            ============================= =======================================================================

            **Example:**

            .. code-block:: text

                  # robin app share demo robin --wait
                  Job:  101 Name: ApplicationShare     State: PROCESSED       Error: 0
                  Job:  101 Name: ApplicationShare     State: COMPLETED       Error: 0

            .. note::

                  The ability to share an application is subject to Robin Role Based
                  Access Control (RBAC). By default, only Cluster and Tenant
                  Administrators (users assigned the **superadmin** 
                  or **tenantadmin** role for the specified tenant) have
                  permission to do so. See the section on :ref:`UserManagement` for
                  details on how Robin RBAC works.

                  * Tenant Administrators will only be able to share applications
                    that are bound to their tenant.

                  * Applications can only be shared with users who are members of
                    the tenant the application is bound to.


Stop Sharing an Application
^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. tabs::

        .. tab:: CLI

            Run the following command to stop sharing an app with one or more users:

            .. code-block:: text

                  # robin app unshare name [user_list]
                                           --operations <operations>
                                           --all-tenant-users

            ============================== =======================================================================
            ``name``                       Application instance name 
            ``user_list``                  Optional comma separated list of users the application
                                           will no longer be shared with 
            ``--operations <operations>``  Comma separated list of operations the users will no longer be
                                           allowed to perform on the shared application. To prevent all 
                                           all valid operations from being performed, specify 'ALL_OPERATIONS' 
                                           on the command line.
            ``--all-tenant-users``         Stop sharing app with all tenant users for specified operations. Note this 
                                           option is required when no users are explicitly specified
            ============================== =======================================================================

            **Example:**

            .. code-block:: text

                  # robin app unshare demo robin --wait
                  Job:  102 Name: ApplicationUnshare   State: VALIDATED       Error: 0
                  Job:  102 Name: ApplicationUnshare   State: COMPLETED       Error: 0

            .. note::

                  The ability to stop sharing an application is subject to Robin
                  Role Based Access Control (RBAC). By default, only Cluster and
                  Tenant Administrators (users assigned the **superadmin**
                  or **tenantadmin** role for the specified
                  tenant) have permission to do so. See the section on
                  :ref:`UserManagement` for details on how Robin RBAC works.

                  * Tenant Administrators will only be able to stop sharing 
                    applications that are bound to their tenant.


List Application Shares
^^^^^^^^^^^^^^^^^^^^^^^

.. tabs::

        .. tab:: CLI

            Run the following command to list application shares:

            .. code-block:: text

                  # robin app list-shares [username]

            =========================== =======================================================================
            ``username``                The username of the user to show application shares for. If a
                                        username is not supplied, application shares for 
                                        all users are shown.
            =========================== =======================================================================

            **Example:**

            .. code-block:: text

                  # robin app list-shares
                  App Id | App Name | Operation | Users
                  -------+----------+-----------+-------
                  1      | demo     | view      | robin

            .. note::

                  The ability to view application shares is subject to Robin Role
                  Based Access Control (RBAC). By default, only Cluster and Tenant
                  Administrators (users assigned the **superadmin** 
                  or **tenantadmin** role for the specified tenant) have
                  permission to do so. See the section on :ref:`UserManagement` for
                  details on how Robin RBAC works.


Reassign Ownership of an Application
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. tabs::

        .. tab:: CLI

               Run the following command to reassign ownership of an app to a different tenant user:

               .. code-block:: text

                     # robin app change-owner <app_names> [username]


               =========================== =======================================================================
               ``app_names``               Comma separated list of one or more application names
               ``username``                The username of the new owner. If a username is not 
                                           provided then ownership of the app will be reassigned 
                                           to the current user.
               =========================== =======================================================================

               **Example:**

               .. code-block:: text

                     # robin app change-owner demo user1
                     Job:   72 Name: ApplicationChangeOwner State: VALIDATED       Error: 0
                     Job:   72 Name: ApplicationChangeOwner State: COMPLETED       Error: 0

               .. note::

                     The ability to reassign ownership of an app is subject to Robin
                     Role Based Access Control (RBAC). By default, only Cluster and
                     Tenant Administrators (users assigned the **superadmin**
                     or **tenantadmin** role for the specified
                     tenant) have permission to do so. See the section on
                     :ref:`UserManagement` for details on how Robin RBAC works.

                     * Tenant Administrators will only be able to reassign ownership
                       of applications that are bound to their tenant.

                     * Ownership of an app can only be reassigned to a user who is a
                       member of the tenant the application is bound to.

        .. tab:: API 

                Reassigns ownership of an application to a different tenant user.

                **End Point:** /api/v3/robin_server/apps/<app_name>

                **Method:** PUT

                **URL Parameters:** None

                **Data Parameters:**

                - ``action: change_owner`` - This mandatory field within the payload specifies that the change owner operation is to be performed.
                - ``username: <username>`` - This mandatory field within the payload specifies the name of the user to whom the application's ownership will be reassigned to.

                **Port:** RCM Port (default value is 29442)

                **Headers:** 

                - ``Authorization: <auth_token>`` : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

                **Success Response Code:** 202

                **Error Response Code:** 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid Api Usage Error)

                **Example Response:**
                
                .. raw:: html

                        <details><summary><a>Output</a></summary>

                .. code-block:: text

                     {
                        "plan":{
                           "opcode":null,
                           "current_user":{
                              "session_expires":"2020-09-18T17:25:02",
                              "user_id":3,
                              "tenant_role":"superadmin",
                              "user_contexts":[
                                 "robin",
                                 "robin"
                              ],
                              "username":"robin",
                              "user_permissions":{
                                 
                              },
                              "tenant":"Administrators",
                              "user_context":"robin",
                              "user_capabilities":[
                                 "AllSuperAdminCapabilities"
                              ],
                              "ip_addr":"172.17.0.1",
                              "namespace":"t001-u000003",
                              "tenant_id":1,
                              "tenants":[
                                 "t2",
                                 "Administrators"
                              ]
                           },
                           "username":"user1",
                           "namespace":"t001-u000003",
                           "kind":"robin",
                           "name":"demo",
                           "action":"change_owner",
                           "include_children":true
                        },
                        "jobid":73
                     }
                     
                .. raw:: html

                        </details>

Attach an External Storage Repo to an Application
=================================================

.. tabs::

        .. tab:: CLI

            Robin CNS allows entire applications, plus their data to be
            backed up to an external storage device or service such as AWS S3,
            Google GCS object stores, etc. Repo management is explained at length
            `here <repo.html>`_. Issue the following command to attach a
            repo to an application:

            .. code-block:: text

                  # robin app attach-repo <app_name> <repo_name>
                                                     --app-namespace <app_ns>

            ============================== =========================================================
            ``app_name``                    Application instance name 
            ``repo_name``                   Name of the storage repo
            ``--app-namespace <app_ns>``    If there are multiple applications of the same name but in different namespaces this option can be used to distinguish them
            ============================== =========================================================


            **Example:**

            .. code-block:: text

                  # robin app attach-repo mysql-c1 testrepo --wait
                  Job:  115 Name: ApplicationAddRepo   State: VALIDATED       Error: 0
                  Job:  115 Name: ApplicationAddRepo   State: COMPLETED       Error: 0

        .. tab:: API 

                Attaches a repo to an application in order to enable backups for it.

                **End Point:** /api/v3/robin_server/apps/<appname>

                **Method:** PUT

                **URL Parameters:** None

                **Data Parameters:**

                - ``action: add_repo`` - This mandatory field within the payload specifies that the repo attach operation is to be performed.
                - ``repo_name: <repo_name>`` - This mandatory field within the payload specifies the repo to be attached to the application.
                - ``name: <appname>`` - This mandatory field within the payload specifies the application to which the aforementioned repo should be attached.
                - ``namespace: <app_ns>`` - Utilizing this parameter results in only applications within the specified namespace being considered.

                **Port:** RCM Port (default value is 29442)

                **Headers:** 

                - ``Authorization: <auth_token>`` : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

                **Success Response Code:** 202

                **Error Response Code:** 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid Api Usage Error)

                **Example Response:**
                
                .. raw:: html

                        <details><summary><a>Output</a></summary>

                .. code-block:: text

                     {
                        "plan":{
                           "action":"add_repo",
                           "name":"mysql-jf6s",
                           "current_user":{
                              "user_context":"robin",
                              "tenants":[
                                 "Administrators"
                              ],
                              "namespace":"t001-u000003",
                              "session_expires":"2020-09-09T00:09:42",
                              "tenant_role":"superadmin",
                              "tenant":"Administrators",
                              "user_permissions":{

                              },
                              "user_contexts":[
                                 "robin",
                                 "robin-k8s-cluster"
                              ],
                              "user_capabilities":[
                                 "AllSuperAdminCapabilities"
                              ],
                              "ip_addr":"172.17.0.1",
                              "user_id":3,
                              "tenant_id":1,
                              "username":"robin"
                           },
                           "namespace":"t001-u000003",
                           "opcode":null,
                           "kind":"robin",
                           "repo_name":"app-repompsq"
                        },
                        "jobid":725
                     }

                .. raw:: html

                        </details>


Detach an External Storage Repo from an Application
===================================================

.. tabs::

        .. tab:: CLI

            A previously attached storage repo can be detached from an
            Application using this command:

            .. code-block:: text

                  # robin app detach-repo <app_name> <repo_name>
                                                     --app-namespace <app_ns>
                                                     --yes

            ============================== =================================================================
            ``app_name``                    Application instance name 
            ``repo_name``                   Name of the storage repo
            ``--app-namespace <app_ns>``    If there are multiple applications of the same name but in different namespaces this option can be used to distinguish them
            ``--yes``                       Do not prompt the user for confirmation
            ============================== =================================================================

            **Example:**

            .. code-block:: text

                  # robin app detach-repo mysql-c1 testrepo --wait
                  Job:  116 Name: ApplicationRemoveRepo State: PREPARED        Error: 0
                  Job:  116 Name: ApplicationRemoveRepo State: COMPLETED       Error: 0

        .. tab:: API 

                Detaches a previously attached repo from an application.

                **End Point:** /api/v3/robin_server/apps/<appname>

                **Method:** PUT

                **URL Parameters:** None

                **Data Parameters:**

                - ``action: remove_repo`` - This mandatory field within the payload specifies that the repo detach operation is to be performed.
                - ``repo_name: <repo_name>`` - This mandatory field within the payload specifies the repo to be detached from the application.
                - ``name: <appname>`` - This mandatory field within the payload specifies the application from which the aforementioned repo should be detached.
                - ``namespace: <app_ns>`` - Utilizing this parameter results in only applications within the specified namespace being considered.

                **Port:** RCM Port (default value is 29442)

                **Headers:** 

                - ``Authorization: <auth_token>`` : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

                **Success Response Code:** 202

                **Error Response Code:** 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid Api Usage Error)

                **Example Response:**
                
                .. raw:: html

                        <details><summary><a>Output</a></summary>

                .. code-block:: text

                     {
                        "plan":{
                           "purge":false,
                           "namespace":"t001-u000003",
                           "current_user":{
                              "user_context":"robin",
                              "tenants":[
                                 "Administrators"
                              ],
                              "namespace":"t001-u000003",
                              "session_expires":"2020-09-09T00:09:42",
                              "tenant_role":"superadmin",
                              "tenant":"Administrators",
                              "user_permissions":{

                              },
                              "user_contexts":[
                                 "robin",
                                 "robin-k8s-cluster"
                              ],
                              "user_capabilities":[
                                 "AllSuperAdminCapabilities"
                              ],
                              "ip_addr":"172.17.0.1",
                              "user_id":3,
                              "tenant_id":1,
                              "username":"robin"
                           },
                           "action":"remove_repo",
                           "name":"mysql-jf6s",
                           "kind":"robin",
                           "opcode":null,
                           "repo_name":"app-repompsq"
                        },
                        "jobid":730
                     }

                .. raw:: html

                        </details>

.. _SnapshotSchedules:


Manage Application Snapshot Schedules
=====================================

.. tabs::

        .. tab:: CLI

            Robin CNS allows configuring a schedule to automatically
            snapshot applications and set retention policies. The advantage is
            that an application can always be rolled back to a point in time when
            it was healthy. The schedule can be set via a JSON file or a CRON
            string. Issue the following command to set up a snapshot schedule for
            an app:

            .. code-block:: text

                  # robin app snapshot-schedule <app_name> 
                                                --snapshot-schedule <schedule>
                                                --snapshot-schedule-cron <schedule>        
                                                --retain <retained_snapshots>
                                                --app-namespace <app_ns>
                                                --disable
                                                --enable

            ======================================== =========================================================
            ``app_name``                             Application instance name 
            ``--snapshot-scheedule <schedule>``      Snapshot schedule specified as JSON
            ``--snapshot-scheedule-cron <schedule>`` Snapshot schedule specified as CRON string
            ``--retain <retained_snapshots>``        Number of snapshots to retain with the specified schedule
            ``--app-namespace <app_ns>``             If there are multiple applications of the same name but in different namespaces this option can be used to distinguish them
            ``--disable``                            Disable the specified schedule
            ``--enable``                             Enable the specified schedule
            ======================================== =========================================================

            The fields that can be specified in the JSON file describing a schedule are:

            =============== ===========================================================================================
            ``frequency``   The overall frequency at which to take snapshots. Valid values 
                            include: 'hourly', 'daily', 'weekly', 'monthly'.
            ``minute``      An integer between 1-59 representing the minute at which the operation should 
                            be run. This field is optional, and the default value is 1 if not specified.
            ``hour``        An integer between 0-23 representing the hour at which the operation should 
                            be run. This field is optional, and the default value is 0 if not specified.
            ``weekday``     An integer between 0-6 representing the day of the week on which the operation should 
                            be run. Sunday is represented by 0 and so on and so forth. This field is optional, 
                            and the default value is 0 if not specified. 
            ``monthday``    An integer between 1-28 representing the day of the month on which the operation should 
                            be run. This field is optional, and the default value is 1 if not specified. 
            =============== ===========================================================================================

            .. Note:: Only one snapshot schedule of each frequency type can be created. You cannot set 2 different hourly snapshot schedules. However, 1 hourly and 1 weekly schedule is a supported combination. 

            **Snapshot Schedule as a JSON:**

            Here's an example of a JSON file describing a snapshot schedule:

            .. code-block:: json

               {
                  "frequency": "weekly",
                  "weekday": 3,
                  "hour": 5,
                  "minute": 30,
               }

            The above JSON will configure a snapshot schedule running every week on Wednesday at 05:30 AM. 

            .. code-block:: text

                  # robin app snapshot-schedule a1 --snapshot-schedule demo_sched.json --retain 2 --enable --wait
                  Job:  116 Name: ApplicationSetSnapBack State: PREPARED        Error: 0
                  Job:  116 Name: ApplicationSetSnapBack State: COMPLETED       Error: 0

            **Snapshot Schedule as a CRON:**

            Robin allows one to specify a snapshot schedule via a CRON string with the standardised format. However there are three caveats. First the minute parameter of the string must always be set as minutely snapshot schedules are not supported.
            In a similar vein the parameter indicating the month must also be set (if applicable) as yearly schedules are not supported either. Finally one cannot specify both a day of the month and a day of the week as it is not 
            a support configuration.

            Here's an example of a CRON string describing a snapshot schedule:

            .. code-block:: text

                  30 5 * * 3

            The above CRON string configures a snapshot schedule running every week on Wednesday at 05:30 AM. 

            .. code-block:: text

                  # robin app snapshot-schedule a1 --snapshot-scheedule-cron "30 5 * * 3" --retain 2 --enable --wait
                  Job:  116 Name: ApplicationSetSnapBack State: PREPARED        Error: 0
                  Job:  116 Name: ApplicationSetSnapBack State: COMPLETED       Error: 0

.. _BackupSchedules:


Manage Application Backup Schedules
=====================================

.. tabs::

        .. tab:: CLI

            Robin CNS allows configuring a schedule to automatically
            backup application snapshots and set retention policies. The advantage is
            that an application can always be restored to the state saved in the backup.
            The schedule can be set via a JSON file or a CRON
            string. Issue the following command to set up a backup schedule for
            an app:

            .. note:: A snapshot schedule must be configured for the application before a backup schedule can be set.

            .. code-block:: text

                  # robin app backup-schedule <app_name> 
                                              --backup-schedule <schedule>
                                              --backup-schedule-cron <schedule>        
                                              --retain <retained_backups>
                                              --filter <snap_filter>
                                              --app-namespace <app_ns>
                                              --disable
                                              --enable

            ======================================== =========================================================
            ``app_name``                             Application instance name 
            ``--backup-scheedule <schedule>``        Backup schedule specified as JSON
            ``--backup-scheedule-cron <schedule>``   Backup schedule specified as CRON string
            ``--retain <retained_backups>``          Number of backups to retain with the specified schedule
            ``--filter <snap_filter>``               Frequency of snapshot schedule to backup
            ``--app-namespace <app_ns>``             If there are multiple applications of the same name but in different namespaces this option can be used to distinguish them
            ``--disable``                            Disable the specified schedule
            ``--enable``                             Enable the specified schedule
            ======================================== =========================================================

            The fields that can be specified in the JSON file describing a schedule are:

            =============== ===========================================================================================
            ``frequency``   The overall frequency at which to take backups. Valid values 
                            include: 'hourly', 'daily', 'weekly', 'monthly'.
            ``minute``      An integer between 1-59 representing the minute at which the operation should 
                            be run. This field is optional, and the default value is 1 if not specified.
            ``hour``        An integer between 0-23 representing the hour at which the operation should 
                            be run. This field is optional, and the default value is 0 if not specified.
            ``weekday``     An integer between 0-6 representing the day of the week on which the operation should 
                            be run. Sunday is represented by 0 and so on and so forth. This field is optional, 
                            and the default value is 0 if not specified. 
            ``monthday``    An integer between 1-28 representing the day of the month on which the operation should 
                            be run. This field is optional, and the default value is 1 if not specified. 
            =============== ===========================================================================================

            .. Note:: Only one backup schedule of each frequency type can be created. You cannot set 2 different hourly backup schedules. However, 1 hourly and 1 weekly schedule is a supported combination. 

            **Backup Schedule as a JSON:**

            Here's an example of a JSON file describing a backup schedule:

            .. code-block:: json

               {
                  "frequency": "weekly",
                  "weekday": 0,
                  "hour": 7,
                  "minute": 15,
               }

            The above JSON will configure a backup schedule running every week on Sunday at 07:15 AM. 

            .. code-block:: text

                  # robin app backup-schedule a1 --backup-schedule demo_sched.json --retain 3 --enable --filter daily --wait
                  Job:  116 Name: ApplicationSetSnapBack State: PREPARED        Error: 0
                  Job:  116 Name: ApplicationSetSnapBack State: COMPLETED       Error: 0

            **Backup Schedule as a CRON:**

            Robin allows one to specify a backup schedule via a CRON string with the standardised format. However there are three caveats. First the minute parameter of the string must always be set as minutely backup schedules are not supported.
            In a similar vein the parameter indicating the month must also be set (if applicable) as yearly schedules are not supported either. Finally one cannot specify both a day of the month and a day of the week as it is not 
            a support configuration.

            Here's an example of a CRON string describing a snapshot schedule:

            .. code-block:: text

                  15 7 * * 0

            The above CRON string will configure a backup schedule running every week on Sunday at 07:15 AM. 

            .. code-block:: text

                  # robin app backup-schedule a1 --backup-scheedule-cron "15 7 * * 0" --retain 2 --enable --filter daily --wait
                  Job:  116 Name: ApplicationSetSnapBack State: PREPARED        Error: 0
                  Job:  116 Name: ApplicationSetSnapBack State: COMPLETED       Error: 0


Restore an Application from a Snapshot or Backup
================================================

.. tabs::

        .. tab:: CLI

            An application can be restored to the point-in-time state saved within an
            associated snapshot or backup (a snapshot that has been pushed to a storage
            repo). Issue the following command to recover an app to a specific
            point-in-time:

            .. code-block:: text

                  # robin app restore <app_name> 
                                      --snapshotid <snapshotid> 
                                      --backupid <backupid>
                                      --skip-rx-pvcs
                                      --include-rx-pvcs


            ============================== =========================================================
            ``app_name``                   Application instance name 
            ``--snapshotid <snapshotid>``  ID of application snapshot
            ``--backupid <backupid>``      ID of application backup
            ``--skip-rx-pvcs``             Skip restoring RWX and ROX PVCs
            ``--include-rx-pvcs``          Include the restoration of RWX and ROX PVCs
            ============================== =========================================================

            .. note::
                  One of ``--snapshotid`` or ``--backupid`` must be provided.

            **Example:**

            .. code-block:: text

                  # robin app restore mysql1 --snapshotid 2b388be6497211eaba7a190f2cdd554f --wait 
                  Job:  188 Name: K8SApplicationRollback State: PREPARED        Error: 0
                  Job:  188 Name: K8SApplicationRollback State: AGENT_WAIT      Error: 0
                  Job:  188 Name: K8SApplicationRollback State: COMPLETED       Error: 0



        .. tab:: API 

                Restores an application to the point-in-time state saved within an associated snapshot or backup (a snapshot that has been pushed to a storage repo).

                **End Point:** /api/v3/robin_server/robin_server/apps/<appname>

                **Method:** PUT

                **URL Parameters:** None

                **Data Parameters:** 

                - ``action: rollback`` - This mandatory field within the payload specifies that the restore operation is to be performed.
                - ``snapshotid: <snapshotid>`` - Utilizing this parameter, by specifiying the UUID of a snapshot, results in the application being rolled back to the state saved in the aformentioned snapshot.
                - ``backupid: <backupid>`` - Utilizing this parameter, by specifiying the UUID of a backup, results in the application being rolled back to the state saved in the aformentioned backup.

                .. note::
                        One of ``snapshotid`` or ``backupid`` must be provided.

                **Port:** RCM Port (default value is 29442)

                **Headers:** 

                - ``Authorization: <auth_token>`` : Authorization token to identify which user is sending the request. The token can be acquired from the login API.

                **Success Response Code:** 202

                **Error Response Code:** 500 (Internal Server Error), 404 (Not Found Error), 401 (Unauthorized Error), 400 (Invalid API Usage Error)

                **Example Response:**
                
                .. raw:: html

                        <details><summary><a>Output</a></summary>

                .. code-block:: text

                     {
                        "plan":{
                           "snap_app":{
                              "roles":[
                                 {
                                    "vnodes":[
                                       {
                                          "service_uids":[
                                             "390f55e2-56dd-46f1-8c94-4f0c38c92aeb"
                                          ],
                                          "rpoolid":1,
                                          "network":[
                                             {
                                                "subnet":"172.21.0.0",
                                                "ippool":"robin-default",
                                                "interfaces":1,
                                                "allocated_ip":"172.21.24.104",
                                                "allocated_prefix":16,
                                                "name":"robin-default",
                                                "allocated_by":"system",
                                                "driver":"calico",
                                                "allocated_names":[
                                                   "eth0"
                                                ],
                                                "allocated_netmask":"255.255.0.0"
                                             }
                                          ],
                                          "sidecar_info":{
                                             "mem":0,
                                             "gpu":0,
                                             "hugepages_2m":0,
                                             "containers":[

                                             ],
                                             "cpu":0,
                                             "hugepages_1g":0
                                          },
                                          "hosttags":{
                                             "robinhost":[
                                                "cscale-82-239"
                                             ],
                                             "kubernetes.io\/arch":[
                                                "amd64"
                                             ],
                                             "rnodetype":[
                                                "robin-worker-node"
                                             ],
                                             "nodetype":[
                                                "robin-node"
                                             ],
                                             "domain":[
                                                "ROBIN"
                                             ],
                                             "kubernetes.io\/os":[
                                                "linux"
                                             ],
                                             "robin.io\/robinrpool":[
                                                "default"
                                             ],
                                             "robinrpool":[
                                                "default"
                                             ]
                                          },
                                          "enable_hooklogs":true,
                                          "cmdlineargs":"-W",
                                          "vnodehooks":{
                                             "prestart":"bash vnode_sample opr=prestart",
                                             "postcreate":"bash check_mysql",
                                             "poststart":"bash check_mysql",
                                             "postgrow":"bash check_mysql",
                                             "postrollback":"bash check_mysql",
                                             "poststop":"bash vnode_sample opr=poststop",
                                             "pregrow":"bash vnode_sample opr=pregrow",
                                             "prerollback":"bash vnode_sample opr=prerollback",
                                             "preclone":"bash vnode_sample opr=preclone",
                                             "prestop":"bash vnode_sample opr=prestop",
                                             "precreate":"bash vnode_sample opr=precreate",
                                             "postsnapshot":"bash unquiesce.sh",
                                             "presnapshot":"bash quiesce.sh",
                                             "postclone":"bash check_mysql",
                                             "postdestroy":"bash vnode_sample opr=postdestroy",
                                             "predestroy":"bash vnode_sample opr=predestroy"
                                          },
                                          "hostname":"lak-mysql-01.t001-u000003.svc.cluster.local",
                                          "bundle_object_id":"7be85809d7ecf1544e461df868f163ad",
                                          "enable_portmapping":true,
                                          "image":{
                                             "entrypoint":"custom-entrypoint.sh",
                                             "engine":"docker",
                                             "version":"5.7",
                                             "registry_hostname":"",
                                             "name":"mysql",
                                             "registry_port":""
                                          },
                                          "numa_allocations":{
                                             "0":{
                                                "gpu_used":0,
                                                "isol_dedicated_cores_used":0,
                                                "hugepages_1g_used":0,
                                                "non_isol_cores_used":1,
                                                "isol_shared_cores_used":0,
                                                "hugepages_2m_used":0,
                                                "mem_used":1073741824
                                             }
                                          },
                                          "calico_inuse":true,
                                          "allocated_host_public_hostname":"cscale-82-239.robinsystems.com",
                                          "allocated":{
                                             "zoneid":1595331866,
                                             "zonename":"default",
                                             "nodename":"cscale-82-239",
                                             "nodeid":4
                                          },
                                          "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1595307896158\/1595307917814\/mysql-5.7",
                                          "host_ip":"172.21.24.104",
                                          "appid":43,
                                          "mem":{
                                             "hugepages_2m":0,
                                             "size":1073741824,
                                             "hugepages_1g":0
                                          },
                                          "gpu":{
                                             "max":0,
                                             "min":0
                                          },
                                          "state":"STARTED",
                                          "enable_metrics":true,
                                          "allocated_host_public_ip":"10.9.82.239",
                                          "commandline":"-W",
                                          "cpu":{
                                             "max":1,
                                             "min":0
                                          },
                                          "allocated_host_type":"physical",
                                          "allocated_host":"cscale-82-239.robinsystems.com",
                                          "role":"mysql",
                                          "ctime":1599592323,
                                          "volume_groups":[
                                             {
                                                "stormgr_id":56,
                                                "name":"lak.mysql.01.72.1.2519c51d-f90d-4753-9fd8-bc689b32938c",
                                                "layout":"round-robin",
                                                "volumes":[
                                                   "lak.mysql.01.data.1.db34409d-5077-4505-9382-b74cab487726"
                                                ],
                                                "media":"HDD",
                                                "device_sets":[
                                                   {
                                                      "stormgr_id":75,
                                                      "name":"lak.mysql.01.72.1.2519c51d-f90d-4753-9fd8-bc689b32938c.0.cc0ba584-9372-4828-9058-24918a6093a9",
                                                      "devices":[
                                                         {
                                                            "role":"Storage",
                                                            "max_throughput_intensive_vols_per_disk":1,
                                                            "pused":1006632960,
                                                            "reattachable":0,
                                                            "protected":0,
                                                            "max_latency_sensitive_vols_per_disk":2,
                                                            "wwn":"0x6002248067f958fce9788c6f585a1eb7",
                                                            "psize":107374182400,
                                                            "hostname":"cscale-82-239.robinsystems.com",
                                                            "write_unit":4096,
                                                            "aslices":49,
                                                            "slices":77,
                                                            "capacity":107374182400,
                                                            "tags":{

                                                            },
                                                            "allocated_slices":2,
                                                            "stormgr_id":6,
                                                            "type":"HDD",
                                                            "state":"READY",
                                                            "score":74,
                                                            "devpath":"\/dev\/disk\/by-id\/scsi-36002248067f958fce9788c6f585a1eb7",
                                                            "max_volumes_per_disk":40,
                                                            "host":"cscale-82-239.robinsystems.com"
                                                         }
                                                      ]
                                                   }
                                                ],
                                                "rpoolid":1,
                                                "replicas":1
                                             }
                                          ],
                                          "restart_num":15,
                                          "pod_name":"lak-mysql-01",
                                          "vnodeid":16,
                                          "engine":"docker",
                                          "appname":"lak",
                                          "storage":[
                                             {
                                                "faultdomain":"host",
                                                "protection":0,
                                                "snap_reserved":20,
                                                "media":"HDD",
                                                "encryption":"none",
                                                "workload":0,
                                                "fstype":"ext4",
                                                "replication":1,
                                                "layout":"round-robin",
                                                "volgrp_name":"lak.mysql.01.72.1.2519c51d-f90d-4753-9fd8-bc689b32938c",
                                                "snapname":"snap1",
                                                "lvm_vol_count":"0",
                                                "path":"\/var\/lib\/mysql",
                                                "compression":"disabled",
                                                "blocksize":4096,
                                                "k8s_name":"lak-mysql-01-data-1-db34409d",
                                                "vol_ns":"t001-u000003",
                                                "disk_tags":{

                                                },
                                                "allocated":{
                                                   "media":72,
                                                   "stordriver":{
                                                      "media":"HDD",
                                                      "type":"das",
                                                      "faultdomain":"host",
                                                      "protection":0
                                                   },
                                                   "replication":1,
                                                   "next_backupid":1,
                                                   "appname":"default",
                                                   "resource_poolid":1,
                                                   "vtype":0,
                                                   "current_snapshotid":1,
                                                   "slice_size":1073741824,
                                                   "protection":0,
                                                   "multinode_mounting":false,
                                                   "volumeid":"56",
                                                   "compression":0,
                                                   "priority":2,
                                                   "params":{

                                                   },
                                                   "qgroupid":58,
                                                   "next_snapshotid":2,
                                                   "appid":1,
                                                   "name":"lak.mysql.01.data.1.db34409d-5077-4505-9382-b74cab487726",
                                                   "block_size":4096,
                                                   "snapshot_space_limit":214748365,
                                                   "current_snapshot":"active_snap",
                                                   "size":1073741824,
                                                   "genkey":1599592280515667,
                                                   "snapname":"snap1",
                                                   "grpid":56,
                                                   "partitions":0
                                                },
                                                "lvm_type":"None",
                                                "type":"data",
                                                "snapshot_space_limit":214748365,
                                                "size":1073741824,
                                                "name":"lak.mysql.01.data.1.db34409d-5077-4505-9382-b74cab487726",
                                                "pvcpolicy":"create",
                                                "stordriver":{
                                                   "media":"HDD",
                                                   "type":"das",
                                                   "faultdomain":"host",
                                                   "protection":0
                                                }
                                             }
                                          ],
                                          "services":[
                                             {
                                                "vnodename":"lak-mysql-01",
                                                "selectors":{
                                                   "robin.io\/vnode":"lak-mysql-01"
                                                },
                                                "labels":{
                                                   "namespace":"t001-u000003",
                                                   "robin.io\/username":"robin",
                                                   "robin.io\/tenant_id":"1",
                                                   "robin.io\/user_id":"3",
                                                   "scope":"vnode",
                                                   "robin.io\/tenant":"Administrators"
                                                },
                                                "appname":"lak",
                                                "k8s_name":"lak-mysql-01-np-0",
                                                "ports":[
                                                   {
                                                      "port":3306,
                                                      "name":"tcp-port3306",
                                                      "protocol":"TCP",
                                                      "target_port":3306,
                                                      "node_port":30640
                                                   }
                                                ],
                                                "cluster_ip":"172.19.45.11",
                                                "type":"NodePort"
                                             }
                                          ],
                                          "env":{
                                             "MYSQL_USER":{
                                                "type":"text",
                                                "value":"robin"
                                             },
                                             "MYSQL_DATABASE":{
                                                "type":"text",
                                                "value":"robin"
                                             },
                                             "allocated":{
                                                "MYSQL_USER":"robin",
                                                "ROBINHOST_TAG_ROBINHOST":"cscale-82-239",
                                                "ROBINHOST_TAG_KUBERNETES.IO-ARCH":"amd64",
                                                "ROBINHOST_TAG_NODETYPE":"robin-node",
                                                "MYSQL_PASSWORD":"robin123",
                                                "POD_NS":"t001-u000003",
                                                "ROBINHOST":"cscale-82-239.robinsystems.com",
                                                "POD_NAME":"lak-mysql-01",
                                                "MYSQL_ROOT_PASSWORD":"robin123",
                                                "K8S_NODE":"cscale-82-239",
                                                "MYSQL_DATABASE":"robin",
                                                "ROBINHOST_TAG_DOMAIN":"ROBIN",
                                                "ROBINHOST_TAG_RNODETYPE":"robin-worker-node",
                                                "ROBINHOST_TAG_ROBINRPOOL":"default",
                                                "ROBINHOST_TAG_KUBERNETES.IO-OS":"linux"
                                             },
                                             "MYSQL_ROOT_PASSWORD":{
                                                "type":"password",
                                                "value":"robin123"
                                             },
                                             "MYSQL_PASSWORD":{
                                                "type":"password",
                                                "value":"robin123"
                                             }
                                          },
                                          "root_fs":"\/usr\/local\/robin\/instances\/lak-mysql-01.t001-u000003.svc.cluster.local",
                                          "restart_on_qoscfg":true,
                                          "k8s_provider":"robin",
                                          "vnodehookargs":{
                                             "postdestroy":[
                                                "opr=postdestroy"
                                             ],
                                             "prestart":[
                                                "opr=prestart"
                                             ],
                                             "postcreate":[

                                             ],
                                             "poststart":[

                                             ],
                                             "postrollback":[

                                             ],
                                             "postgrow":[

                                             ],
                                             "poststop":[
                                                "opr=poststop"
                                             ],
                                             "pregrow":[
                                                "opr=pregrow"
                                             ],
                                             "prerollback":[
                                                "opr=prerollback"
                                             ],
                                             "preclone":[
                                                "opr=preclone"
                                             ],
                                             "prestop":[
                                                "opr=prestop"
                                             ],
                                             "precreate":[
                                                "opr=precreate"
                                             ],
                                             "postsnapshot":[

                                             ],
                                             "postclone":[

                                             ],
                                             "presnapshot":[

                                             ],
                                             "predestroy":[
                                                "opr=predestroy"
                                             ]
                                          },
                                          "role_name":"mysql",
                                          "name":"lak.mysql.01",
                                          "cm_keys":[
                                             "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKS44FJBT75q64OPV8s1WL\/lFbMogtnSm9wk6i+uQArrteNI6DhMYnBV8GC+Dttr2sxurxm\/QEW3Pa9OKhtCtT\/CQ0h+w7u8f8Mu77zAtAd4rhFAtuK86wiZPp8vSRp3Q2l7TMC31VV08wa7fulk\/SSF6maJRQxxmH2lNOsHYOHZve4TSZ+FuGT5h0KMAtGjy7jDSfdt4nBFb\/EzVuUE70y8x8q7SmObQGCDBoQlC\/QwcmBJ+T25l7fDfVTSXSjCRb2wN2DIxUA7Cr1hNRoZNPAAFahq+jWYYS+aKaXVe6cR6GEtgQ66ey7Zn8ZHOrmW9n9LEnYT\/CmzV6l4gwfyIp root@cscale-82-236",
                                             "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxdMba+MjIxpx8IzmIodVTs13BJj3BAsRaeOpIC3g07eKcb\/WCJ3E9kFvOyJzqX1KmOpYqwtYG0zTwd+xPlc9fudEoORLM2jAt5JZQliT8IDGLyRYqhsOaL+HPKeO8VU9u0sd8938OXGKEJQ1Qt0DQcXuXTSDYGefS24TaWxJ6r\/bbM0WXYrJiFc83LemUHGq\/vdNpXNbGiAMPCTF3\/ZkHsIQTJd8dmBXn3VsEcRbvSGnHIXvQjRZRJp5hBVl\/zFZtGFuT7Rs1IVpZtsO81hFCkgAX\/jonSglX193+A5oCFPeTsfOD01A3r9x3qdcgtSwxkU5ElmksR6BNt0pXenO7 root@cscale-82-238",
                                             "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwaDQ4NFtH5X1NVdUW\/trWG0W3LaLOQdz0LIwTMiYo707zpW5STz6R4qRCyonqA5DGx9KicnDvbLYXrDtEFczf68j3N9mgm4QKQ5NAUsKgCrXD\/musfl7T0kwmADh4tWI1pbnEJNAfY+xOvKqd1MQIoXNY3jDHlZghb0un+ZnCkxlEwLNUEZySdVhuUitK6fH0abpbLDSWAqqWvzBQMeTYVD91KJPqQXPyejQcjw31dmFYQJ+Ru7Nm0+iifXIZ4poyGZuxNZL9K0F4j+mS+LQav+dAnQGfL62HyAZhHmFoqF9l1GQs6qwrWU6UaZPLAt3XaghtDJwXTks6vEkjibNN root@cscale-82-237"
                                          ],
                                          "utime":1599592323,
                                          "pod_ns":"t001-u000003",
                                          "bundleid":4,
                                          "id":16
                                       }
                                    ],
                                    "image":{
                                       "entrypoint":"custom-entrypoint.sh",
                                       "engine":"docker",
                                       "version":"5.7",
                                       "registry_hostname":"",
                                       "name":"mysql",
                                       "registry_port":""
                                    },
                                    "commandline":"-W",
                                    "volume_groups":[

                                    ],
                                    "display_name":"Runs mysql database server",
                                    "qgroups":{
                                       "data":{
                                          "rd_min_iops":0,
                                          "enabled":false,
                                          "wr_min_iops":0,
                                          "priority":1,
                                          "rd_weight":1,
                                          "wr_max_iops":2000000,
                                          "wr_weight":1,
                                          "rd_max_iops":2000000,
                                          "wr_min_window":500,
                                          "rd_min_window":500
                                       }
                                    },
                                    "restart_on_qoscfg":true,
                                    "name":"mysql",
                                    "service_ports":[
                                       3306
                                    ]
                                 }
                              ],
                              "desc":"",
                              "rpool":"default",
                              "enable_hooklogs":true,
                              "bundle_object_id":"7be85809d7ecf1544e461df868f163ad",
                              "from_template":null,
                              "parentid":43,
                              "clonemode":"unfenced",
                              "auto_relocate":true,
                              "name":"lak_snap1",
                              "clone":"enabled",
                              "snapname":"snap1",
                              "robin_version":"5.3.1-349",
                              "snapshot":"enabled",
                              "parent_last_known_state":6,
                              "restart_num":15,
                              "namespace":"t001-u000003",
                              "planid":522,
                              "rpoolid":1,
                              "tenant":"Administrators",
                              "content_id":"7be85809d7ecf1544e461df868f163ad",
                              "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1595307896158\/1595307917814\/mysql-5.7",
                              "app_ns":"t001-u000003",
                              "bundleid":4,
                              "master_name":"lak",
                              "apphooks":{
                                 "postdestroy":"bash app_sample postdestroy",
                                 "prestart":"bash app_sample prestart",
                                 "validate":"python3.4 validate_template.py",
                                 "health":"python3.4 health.py",
                                 "postcreate":"bash app_sample postcreate",
                                 "poststart":"bash app_sample poststart",
                                 "allocated":{
                                    "prestart":"bash app_sample prestart",
                                    "validate":"python3.4 validate_template.py",
                                    "health":"python3.4 health.py",
                                    "postcreate":"bash app_sample postcreate",
                                    "poststart":"bash app_sample poststart",
                                    "postgrow":"bash app_sample postgrow",
                                    "postrollback":"bash app_sample postrollback",
                                    "poststop":"bash app_sample poststop",
                                    "pregrow":"bash app_sample pregrow",
                                    "prerollback":"bash app_sample prerollback",
                                    "preclone":"bash app_sample preclone",
                                    "prestop":"bash app_sample prestop",
                                    "precreate":"bash app_sample precreate",
                                    "postsnapshot":"bash app_sample postsnapshot",
                                    "presnapshot":"bash app_sample presnapshot",
                                    "postclone":"bash app_sample postclone",
                                    "postdestroy":"bash app_sample postdestroy",
                                    "predestroy":"bash app_sample predestroy"
                                 },
                                 "postrollback":"bash app_sample postrollback",
                                 "postgrow":"bash app_sample postgrow",
                                 "poststop":"bash app_sample poststop",
                                 "pregrow":"bash app_sample pregrow",
                                 "prerollback":"bash app_sample prerollback",
                                 "preclone":"bash app_sample preclone",
                                 "prestop":"bash app_sample prestop",
                                 "precreate":"bash app_sample precreate",
                                 "postsnapshot":"bash app_sample postsnapshot",
                                 "postclone":"bash app_sample postclone",
                                 "presnapshot":"bash app_sample presnapshot",
                                 "predestroy":"bash app_sample predestroy"
                              },
                              "enable_metrics":true,
                              "zoneid":1595331866,
                              "id":43,
                              "pvcpolicy":"create",
                              "username":"robin"
                           },
                           "orig_app":{
                              "roles":[
                                 {
                                    "qgroups":{
                                       "data":{
                                          "rd_min_iops":0,
                                          "wr_min_iops":0,
                                          "wr_weight":1,
                                          "priority":1,
                                          "rd_weight":1,
                                          "wr_max_iops":2000000,
                                          "enabled":false,
                                          "rd_max_iops":2000000,
                                          "wr_min_window":500,
                                          "rd_min_window":500
                                       }
                                    },
                                    "image":{
                                       "entrypoint":"custom-entrypoint.sh",
                                       "engine":"docker",
                                       "version":"5.7",
                                       "registry_hostname":"",
                                       "name":"mysql",
                                       "registry_port":""
                                    },
                                    "commandline":"-W",
                                    "restart_on_qoscfg":true,
                                    "volume_groups":[

                                    ],
                                    "display_name":"Runs mysql database server",
                                    "vnodes":[
                                       {
                                          "service_uids":[
                                             "390f55e2-56dd-46f1-8c94-4f0c38c92aeb"
                                          ],
                                          "rpoolid":1,
                                          "network":[
                                             {
                                                "subnet":"172.21.0.0",
                                                "ippool":"robin-default",
                                                "interfaces":1,
                                                "allocated_ip":"172.21.24.104",
                                                "allocated_prefix":16,
                                                "name":"robin-default",
                                                "allocated_by":"system",
                                                "driver":"calico",
                                                "allocated_names":[
                                                   "eth0"
                                                ],
                                                "allocated_netmask":"255.255.0.0"
                                             }
                                          ],
                                          "sidecar_info":{
                                             "mem":0,
                                             "gpu":0,
                                             "hugepages_2m":0,
                                             "containers":[

                                             ],
                                             "cpu":0,
                                             "hugepages_1g":0
                                          },
                                          "hosttags":{
                                             "robin.io\/robinrpool":[
                                                "default"
                                             ],
                                             "robinrpool":[
                                                "default"
                                             ],
                                             "rnodetype":[
                                                "robin-worker-node"
                                             ],
                                             "nodetype":[
                                                "robin-node"
                                             ],
                                             "domain":[
                                                "ROBIN"
                                             ],
                                             "kubernetes.io\/os":[
                                                "linux"
                                             ],
                                             "robinhost":[
                                                "cscale-82-239"
                                             ],
                                             "kubernetes.io\/arch":[
                                                "amd64"
                                             ]
                                          },
                                          "enable_hooklogs":true,
                                          "cmdlineargs":"-W",
                                          "vnodehooks":{
                                             "postdestroy":"bash vnode_sample opr=postdestroy",
                                             "prestart":"bash vnode_sample opr=prestart",
                                             "postcreate":"bash check_mysql",
                                             "poststart":"bash check_mysql",
                                             "postrollback":"bash check_mysql",
                                             "postgrow":"bash check_mysql",
                                             "poststop":"bash vnode_sample opr=poststop",
                                             "pregrow":"bash vnode_sample opr=pregrow",
                                             "prerollback":"bash vnode_sample opr=prerollback",
                                             "preclone":"bash vnode_sample opr=preclone",
                                             "prestop":"bash vnode_sample opr=prestop",
                                             "precreate":"bash vnode_sample opr=precreate",
                                             "postsnapshot":"bash unquiesce.sh",
                                             "postclone":"bash check_mysql",
                                             "presnapshot":"bash quiesce.sh",
                                             "predestroy":"bash vnode_sample opr=predestroy"
                                          },
                                          "hostname":"lak-mysql-01.t001-u000003.svc.cluster.local",
                                          "bundle_object_id":"7be85809d7ecf1544e461df868f163ad",
                                          "enable_portmapping":true,
                                          "image":{
                                             "entrypoint":"custom-entrypoint.sh",
                                             "engine":"docker",
                                             "version":"5.7",
                                             "registry_hostname":"",
                                             "name":"mysql",
                                             "registry_port":""
                                          },
                                          "numa_allocations":{
                                             "0":{
                                                "gpu_used":0,
                                                "isol_dedicated_cores_used":0,
                                                "hugepages_1g_used":0,
                                                "non_isol_cores_used":1,
                                                "isol_shared_cores_used":0,
                                                "hugepages_2m_used":0,
                                                "mem_used":1073741824
                                             }
                                          },
                                          "commandline":"-W",
                                          "calico_inuse":true,
                                          "allocated_host_public_hostname":"cscale-82-239.robinsystems.com",
                                          "allocated":{
                                             "zoneid":1595331866,
                                             "zonename":"default",
                                             "nodename":"cscale-82-239",
                                             "nodeid":4
                                          },
                                          "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1595307896158\/1595307917814\/mysql-5.7",
                                          "host_ip":"172.21.24.104",
                                          "appid":43,
                                          "mem":{
                                             "hugepages_1g":0,
                                             "size":1073741824,
                                             "hugepages_2m":0
                                          },
                                          "gpu":{
                                             "max":0,
                                             "min":0
                                          },
                                          "storage":[
                                             {
                                                "faultdomain":"host",
                                                "snapshot_space_limit":214748365,
                                                "snap_reserved":20,
                                                "media":"HDD",
                                                "encryption":"none",
                                                "workload":0,
                                                "fstype":"ext4",
                                                "replication":1,
                                                "layout":"round-robin",
                                                "volgrp_name":"lak.mysql.01.72.1.2519c51d-f90d-4753-9fd8-bc689b32938c",
                                                "lvm_vol_count":"0",
                                                "path":"\/var\/lib\/mysql",
                                                "compression":"disabled",
                                                "type":"data",
                                                "blocksize":4096,
                                                "k8s_name":"lak-mysql-01-data-1-db34409d",
                                                "vol_ns":"t001-u000003",
                                                "disk_tags":{

                                                },
                                                "allocated":{
                                                   "media":72,
                                                   "replication":1,
                                                   "next_backupid":1,
                                                   "appname":"default",
                                                   "resource_poolid":1,
                                                   "vtype":0,
                                                   "current_snapshotid":2,
                                                   "next_snapshotid":2,
                                                   "compression":0,
                                                   "multinode_mounting":false,
                                                   "volumeid":"56",
                                                   "priority":2,
                                                   "params":{

                                                   },
                                                   "snapshot_space_limit":214748365,
                                                   "qgroupid":58,
                                                   "slice_size":1073741824,
                                                   "appid":1,
                                                   "name":"lak.mysql.01.data.1.db34409d-5077-4505-9382-b74cab487726",
                                                   "block_size":4096,
                                                   "protection":0,
                                                   "current_snapshot":"active_snap",
                                                   "size":1073741824,
                                                   "partitions":0,
                                                   "genkey":1599592280515667,
                                                   "grpid":56,
                                                   "stordriver":{
                                                      "media":"HDD",
                                                      "type":"das",
                                                      "faultdomain":"host",
                                                      "protection":0
                                                   }
                                                },
                                                "lvm_type":"None",
                                                "name":"lak.mysql.01.data.1.db34409d-5077-4505-9382-b74cab487726",
                                                "protection":0,
                                                "size":1073741824,
                                                "pvcpolicy":"create",
                                                "stordriver":{
                                                   "media":"HDD",
                                                   "type":"das",
                                                   "faultdomain":"host",
                                                   "protection":0
                                                }
                                             }
                                          ],
                                          "enable_metrics":true,
                                          "allocated_host_public_ip":"10.9.82.239",
                                          "state":"STARTED",
                                          "cpu":{
                                             "max":1,
                                             "min":0
                                          },
                                          "allocated_host_type":"physical",
                                          "allocated_host":"cscale-82-239.robinsystems.com",
                                          "role":"mysql",
                                          "ctime":1599592323,
                                          "volume_groups":[
                                             {
                                                "rpoolid":1,
                                                "name":"lak.mysql.01.72.1.2519c51d-f90d-4753-9fd8-bc689b32938c",
                                                "device_sets":[
                                                   {
                                                      "name":"lak.mysql.01.72.1.2519c51d-f90d-4753-9fd8-bc689b32938c.0.cc0ba584-9372-4828-9058-24918a6093a9",
                                                      "stormgr_id":75,
                                                      "devices":[
                                                         {
                                                            "role":"Storage",
                                                            "max_throughput_intensive_vols_per_disk":1,
                                                            "pused":1006632960,
                                                            "reattachable":0,
                                                            "protected":0,
                                                            "max_latency_sensitive_vols_per_disk":2,
                                                            "wwn":"0x6002248067f958fce9788c6f585a1eb7",
                                                            "psize":107374182400,
                                                            "hostname":"cscale-82-239.robinsystems.com",
                                                            "write_unit":4096,
                                                            "aslices":49,
                                                            "slices":77,
                                                            "capacity":107374182400,
                                                            "tags":{

                                                            },
                                                            "allocated_slices":2,
                                                            "stormgr_id":6,
                                                            "type":"HDD",
                                                            "state":"READY",
                                                            "score":74,
                                                            "devpath":"\/dev\/disk\/by-id\/scsi-36002248067f958fce9788c6f585a1eb7",
                                                            "max_volumes_per_disk":40,
                                                            "host":"cscale-82-239.robinsystems.com"
                                                         }
                                                      ]
                                                   }
                                                ],
                                                "volumes":[
                                                   "lak.mysql.01.data.1.db34409d-5077-4505-9382-b74cab487726"
                                                ],
                                                "layout":"round-robin",
                                                "media":"HDD",
                                                "stormgr_id":56,
                                                "replicas":1
                                             }
                                          ],
                                          "restart_num":15,
                                          "pod_name":"lak-mysql-01",
                                          "vnodeid":16,
                                          "engine":"docker",
                                          "appname":"lak",
                                          "services":[
                                             {
                                                "vnodename":"lak-mysql-01",
                                                "selectors":{
                                                   "robin.io\/vnode":"lak-mysql-01"
                                                },
                                                "labels":{
                                                   "namespace":"t001-u000003",
                                                   "robin.io\/username":"robin",
                                                   "robin.io\/tenant":"Administrators",
                                                   "robin.io\/user_id":"3",
                                                   "scope":"vnode",
                                                   "robin.io\/tenant_id":"1"
                                                },
                                                "appname":"lak",
                                                "k8s_name":"lak-mysql-01-np-0",
                                                "ports":[
                                                   {
                                                      "protocol":"TCP",
                                                      "name":"tcp-port3306",
                                                      "port":3306,
                                                      "target_port":3306,
                                                      "node_port":30640
                                                   }
                                                ],
                                                "cluster_ip":"172.19.45.11",
                                                "type":"NodePort"
                                             }
                                          ],
                                          "env":{
                                             "MYSQL_USER":{
                                                "type":"text",
                                                "value":"robin"
                                             },
                                             "MYSQL_DATABASE":{
                                                "type":"text",
                                                "value":"robin"
                                             },
                                             "allocated":{
                                                "MYSQL_USER":"robin",
                                                "ROBINHOST_TAG_ROBINHOST":"cscale-82-239",
                                                "ROBINHOST_TAG_KUBERNETES.IO-ARCH":"amd64",
                                                "POD_NS":"t001-u000003",
                                                "ROBINHOST_TAG_NODETYPE":"robin-node",
                                                "MYSQL_PASSWORD":"robin123",
                                                "POD_NAME":"lak-mysql-01",
                                                "ROBINHOST":"cscale-82-239.robinsystems.com",
                                                "ROBINHOST_TAG_ROBINRPOOL":"default",
                                                "K8S_NODE":"cscale-82-239",
                                                "MYSQL_DATABASE":"robin",
                                                "ROBINHOST_TAG_DOMAIN":"ROBIN",
                                                "ROBINHOST_TAG_RNODETYPE":"robin-worker-node",
                                                "MYSQL_ROOT_PASSWORD":"robin123",
                                                "ROBINHOST_TAG_KUBERNETES.IO-OS":"linux"
                                             },
                                             "MYSQL_ROOT_PASSWORD":{
                                                "type":"password",
                                                "value":"robin123"
                                             },
                                             "MYSQL_PASSWORD":{
                                                "type":"password",
                                                "value":"robin123"
                                             }
                                          },
                                          "root_fs":"\/usr\/local\/robin\/instances\/lak-mysql-01.t001-u000003.svc.cluster.local",
                                          "restart_on_qoscfg":true,
                                          "k8s_provider":"robin",
                                          "vnodehookargs":{
                                             "prestart":[
                                                "opr=prestart"
                                             ],
                                             "postcreate":[

                                             ],
                                             "poststart":[

                                             ],
                                             "postgrow":[

                                             ],
                                             "postrollback":[

                                             ],
                                             "poststop":[
                                                "opr=poststop"
                                             ],
                                             "pregrow":[
                                                "opr=pregrow"
                                             ],
                                             "prerollback":[
                                                "opr=prerollback"
                                             ],
                                             "preclone":[
                                                "opr=preclone"
                                             ],
                                             "prestop":[
                                                "opr=prestop"
                                             ],
                                             "precreate":[
                                                "opr=precreate"
                                             ],
                                             "postsnapshot":[

                                             ],
                                             "presnapshot":[

                                             ],
                                             "postclone":[

                                             ],
                                             "postdestroy":[
                                                "opr=postdestroy"
                                             ],
                                             "predestroy":[
                                                "opr=predestroy"
                                             ]
                                          },
                                          "role_name":"mysql",
                                          "name":"lak.mysql.01",
                                          "cm_keys":[
                                             "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKS44FJBT75q64OPV8s1WL\/lFbMogtnSm9wk6i+uQArrteNI6DhMYnBV8GC+Dttr2sxurxm\/QEW3Pa9OKhtCtT\/CQ0h+w7u8f8Mu77zAtAd4rhFAtuK86wiZPp8vSRp3Q2l7TMC31VV08wa7fulk\/SSF6maJRQxxmH2lNOsHYOHZve4TSZ+FuGT5h0KMAtGjy7jDSfdt4nBFb\/EzVuUE70y8x8q7SmObQGCDBoQlC\/QwcmBJ+T25l7fDfVTSXSjCRb2wN2DIxUA7Cr1hNRoZNPAAFahq+jWYYS+aKaXVe6cR6GEtgQ66ey7Zn8ZHOrmW9n9LEnYT\/CmzV6l4gwfyIp root@cscale-82-236",
                                             "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxdMba+MjIxpx8IzmIodVTs13BJj3BAsRaeOpIC3g07eKcb\/WCJ3E9kFvOyJzqX1KmOpYqwtYG0zTwd+xPlc9fudEoORLM2jAt5JZQliT8IDGLyRYqhsOaL+HPKeO8VU9u0sd8938OXGKEJQ1Qt0DQcXuXTSDYGefS24TaWxJ6r\/bbM0WXYrJiFc83LemUHGq\/vdNpXNbGiAMPCTF3\/ZkHsIQTJd8dmBXn3VsEcRbvSGnHIXvQjRZRJp5hBVl\/zFZtGFuT7Rs1IVpZtsO81hFCkgAX\/jonSglX193+A5oCFPeTsfOD01A3r9x3qdcgtSwxkU5ElmksR6BNt0pXenO7 root@cscale-82-238",
                                             "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwaDQ4NFtH5X1NVdUW\/trWG0W3LaLOQdz0LIwTMiYo707zpW5STz6R4qRCyonqA5DGx9KicnDvbLYXrDtEFczf68j3N9mgm4QKQ5NAUsKgCrXD\/musfl7T0kwmADh4tWI1pbnEJNAfY+xOvKqd1MQIoXNY3jDHlZghb0un+ZnCkxlEwLNUEZySdVhuUitK6fH0abpbLDSWAqqWvzBQMeTYVD91KJPqQXPyejQcjw31dmFYQJ+Ru7Nm0+iifXIZ4poyGZuxNZL9K0F4j+mS+LQav+dAnQGfL62HyAZhHmFoqF9l1GQs6qwrWU6UaZPLAt3XaghtDJwXTks6vEkjibNN root@cscale-82-237"
                                          ],
                                          "utime":1599592323,
                                          "pod_ns":"t001-u000003",
                                          "bundleid":4,
                                          "id":16
                                       }
                                    ],
                                    "name":"mysql",
                                    "service_ports":[
                                       3306
                                    ]
                                 }
                              ],
                              "rpool":"default",
                              "enable_hooklogs":true,
                              "bundle_object_id":"7be85809d7ecf1544e461df868f163ad",
                              "clonemode":"unfenced",
                              "auto_relocate":true,
                              "name":"lak",
                              "clone":"enabled",
                              "from_template":null,
                              "robin_version":"5.3.1-349",
                              "snapshot":"enabled",
                              "restart_num":15,
                              "namespace":"t001-u000003",
                              "planid":522,
                              "rpoolid":1,
                              "tenant":"Administrators",
                              "content_id":"7be85809d7ecf1544e461df868f163ad",
                              "bundle_path":"\/usr\/local\/robin\/collections\/file-collection-1595307896158\/1595307917814\/mysql-5.7",
                              "app_ns":"t001-u000003",
                              "bundleid":4,
                              "apphooks":{
                                 "prestart":"bash app_sample prestart",
                                 "validate":"python3.4 validate_template.py",
                                 "health":"python3.4 health.py",
                                 "postcreate":"bash app_sample postcreate",
                                 "poststart":"bash app_sample poststart",
                                 "allocated":{
                                    "postdestroy":"bash app_sample postdestroy",
                                    "prestart":"bash app_sample prestart",
                                    "validate":"python3.4 validate_template.py",
                                    "health":"python3.4 health.py",
                                    "postcreate":"bash app_sample postcreate",
                                    "poststart":"bash app_sample poststart",
                                    "postrollback":"bash app_sample postrollback",
                                    "postgrow":"bash app_sample postgrow",
                                    "poststop":"bash app_sample poststop",
                                    "pregrow":"bash app_sample pregrow",
                                    "prerollback":"bash app_sample prerollback",
                                    "preclone":"bash app_sample preclone",
                                    "prestop":"bash app_sample prestop",
                                    "precreate":"bash app_sample precreate",
                                    "postsnapshot":"bash app_sample postsnapshot",
                                    "postclone":"bash app_sample postclone",
                                    "presnapshot":"bash app_sample presnapshot",
                                    "predestroy":"bash app_sample predestroy"
                                 },
                                 "postrollback":"bash app_sample postrollback",
                                 "postgrow":"bash app_sample postgrow",
                                 "poststop":"bash app_sample poststop",
                                 "pregrow":"bash app_sample pregrow",
                                 "prerollback":"bash app_sample prerollback",
                                 "preclone":"bash app_sample preclone",
                                 "prestop":"bash app_sample prestop",
                                 "precreate":"bash app_sample precreate",
                                 "postsnapshot":"bash app_sample postsnapshot",
                                 "presnapshot":"bash app_sample presnapshot",
                                 "postclone":"bash app_sample postclone",
                                 "postdestroy":"bash app_sample postdestroy",
                                 "predestroy":"bash app_sample predestroy"
                              },
                              "enable_metrics":true,
                              "zoneid":1595331866,
                              "username":"robin",
                              "pvcpolicy":"create",
                              "id":43
                           }
                        },
                        "jobid":744
                     }

                .. raw:: html

                        </details>


Configure Snapshot Space Limits for an Application volume
==========================================================

Robin currently does not support changing the snapshot limit at the application level directly in the CNS product. However it can be achieved by changing the snapshot limit of individual volumes of the application. In order to determine the volumes associated with an application use the ``robin app info --volmap`` command, detailed `here <apps.html#show-information-about-a-specific-application>`_. Once the name of the volume(s) have been determined the ``robin volume snapshot-limit``, detailed `here <users_guide_5_X/source/manage_storage.rst>`_, can be used. 


Register KubeVirt VMs as Applications and Manage 
================================================
Robin CNS supports registering `KubeVirt <https://kubevirt.io/>`_  VMs as applications that are created on the Anthos Cluster. 
In Robin CNS, the app is treated as a FlexApp. For more information on creating VMs on Anthos, see `here <https://cloud.google.com/anthos/clusters/docs/bare-metal/latest/vm-runtime/quickstart>`_. 


You can perform the following operations for the registered VMs: 

 - Register a VM as an application 
 - Create a snapshot of a VM Registered as an Application 
 - Back up a VM snapshot to an external repo
 - Create an application from the backup
 - Restore a VM from backup/Snapshot 
  
 .. Note:: Importing an application backup(a VM registered as an applicaiton) from another cluster is not supported. 

Register a VM as an application 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Registering a KubeVirt VM as an application enables you to manage it as a regular application registered on Robin CNS. 
The VM registers as a Flexapp type of application in Robin CNS.   

For easy identification of VMs after they registered as applications, use some text to denote that they are VMs when creating your VMs. For example, ubuntu-VM.

**Prerequisites**

- VMs are created on the Anthos cluster using KubeVirt. 
- PVC, gdisk, serviceaccount name, and namespace name of the VM are required.
 
Complete the following steps to register a VM as an application:

1. View the list of VMs by running the following command. 

.. code-block:: text

   # kubectl get gvm 

2. Get the VM details required for registering the VM. (PVC name, gdisk name, namespace)

.. code-block:: text

   # kubectl describe gvm <gvmname>

3. Register the required VM as an application.
   
.. code-block:: text

  # robin app register <GVM name> --resource gdisk/<name> --resource pvc/<name> --namespace <name>

**Example**

.. code-block:: text 

      
      root@eqx04-flash06:~# robin app register ubuntu-vm300 --resource vm/ubuntu-vm300 --resource gdisk/ubuntu-vm300-boot-disk --resource pvc/ubuntu-vm300-boot-disk --namespace default
      Job: 2283 Name: K8SAppRegister       State: VALIDATED       Error: 0
      Job: 2283 Name: K8SAppRegister       State: COMPLETED       Error: 0

      root@eqx04-flash06:~# robin app list
      Helm/Flex Apps: 

      +--------------+---------+--------+----------------------+-----------+-----------+---------+
      | Name         | Type    | State  | Owner/Tenant         | Namespace | Snapshots | Backups |
      +--------------+---------+--------+----------------------+-----------+-----------+---------+
      | ubuntu-vm300 | flexapp | ONLINE | admin/Administrators | default   | 0         | 0       |
      +--------------+---------+--------+----------------------+-----------+-----------+---------+


Create a snapshot of a VM Registered as an Application 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can create a snapshot of VM that is created using KubeVirt on Google Anthos and the VM is registered as an application on Robin CNS. 

Complete the following steps to create a snapshot of a VM: 

1. View the list of applications to know the app name for creating a snapshot of a VM that is registered as an app. 

.. code-block:: text 

   # robin app list 
    
2. Create a snapshot of a VM by running the following command. 

.. code-block:: text    

   # robin snapshot create <VM name>

**Example**

.. code-block:: text  

   root@eqx04-flash06:~# robin snapshot create ubuntu-vm300
   Submitted job '2286'. Use 'robin job wait 2286' to track the progress

Back up a VM snapshot to an External Repo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can back up a VM snapshot to an external repo just like any other snapshots. Before backing up you need to attach a repo to the application.
Cluster Administrator user with the superadmin role can create backups from all App snapshots.

**Prerequisites**

You must have a registered repo to create a backup.

Complete the following steps to back up a snapshot of a VM:

1. Get the registered list of repos on CNS by running the following command.  
   
   .. code-block:: text  

     # robin repo list 

2. Attach an external storage repo to the VM that is registered as an application by running the following command.

   .. code-block:: text

    # robin app attach-repo <app_name> <repo_name> 

   .. Note:: Use the ``--app-namespace`` option if there are more than one application with the same name on different namespaces.

   **Example:**

   .. code-block:: text
    
      root@eqx04-flash06:~# robin app attach-repo ubuntu-vm300 repo2 --wait
      Job: 2284 Name: K8SApplicationAddRepo State: PROCESSED       Error: 0
      Job: 2284 Name: K8SApplicationAddRepo State: COMPLETED       Error: 0  

3. View the list of snapshots to know the snapshot name and app name for backing up to an external repo.

   .. code-block:: text

      # robin snapshot list

4. Create a backup by running the following command.

   .. code-block:: text

      # robin backup create <appname> <repo> --snapshotid <id> 
   
   **Example**

   .. code-block:: text 

      root@eqx04-flash06:~# robin backup create ubuntu-vm300 repo2 --wait --snapshotid 4f77bd82475d11eea92ec1962eeb5011
      Creating app backup 'ubuntu-vm300_backup-1693417783' from snapshot '4f77bd82475d11eea92ec1962eeb5011'
      Job: 2293 Name: K8SApplicationBackup State: VALIDATED       Error: 0
      Job: 2293 Name: K8SApplicationBackup State: AGENT_WAIT      Error: 0
      Job: 2293 Name: K8SApplicationBackup State: COMPLETED       Error: 0

5. Verify the created backup by running the following command

  .. code-block:: text

     # robin backup list

Create a VM from Backup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can create another VM using the backup of a VM that is registered as an application. 
When you create a VM from the backup, Robin CNS creates an application on the Robin CNS and a VM on the Kubernetes cluster. 

.. Note:: When you create an application from the backup, you must provide the same namespace as the VM.  

Complete the following steps to create an application from the backup.

1. Get the backup ID by running the following command.

  .. code-block:: text
    
   # robin backup list

2. Create a new app using the backup of the VM by running the following command.    
   
   .. code-block:: text

    # robin app create from-backup <app_name> <backupid> --namespace <orgianl VM namespace>

  **Example**
 
   .. code-block:: text 

      root@eqx04-flash06:~# robin app create from-backup from-backup-ubuntu-vm200 2375e1904bf711eeaf88555b5defa5cc --namespace default --wait
      Job: 36807 Name: K8SApplicationCreate State: VALIDATED       Error: 0
      Job: 36807 Name: K8SApplicationCreate State: PREPARED        Error: 0
      Job: 36807 Name: K8SApplicationCreate State: AGENT_WAIT      Error: 0
      Job: 36807 Name: K8SApplicationCreate State: COMPLETED       Error: 0

3. Verify the newly created app by running the following command.

   .. code-block:: text 

     # robin app list  

4. Verify the newly cretaed VM by running the following command. 
   
   .. code-block:: text 

    # kubectl get gvm   


Create a VM from Snapshot
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
You can create another VM using the snapshot of a VM that is registered as an application.


Complete the following steps to create an application from the backup.

1. Get the snapshot ID by running the following command.

  .. code-block:: text
    
    # robin snapshot list

2. Create a new app using the snapshot of the VM by running the following command.    
   
  .. code-block:: text

    # robin app create from-snapshot <app_name> <snapshotid> --namespace <orgianl VM namespace>

**Example**
 
 .. code-block:: text 

    root@eqx04-flash06:~# robin app create from-snapshot from-snapshot-ubuntu-vm200 2379e1904bf711eeaf88555b5defa5cc --namespace default --wait
    Job: 36807 Name: K8SApplicationCreate State: VALIDATED       Error: 0
    Job: 36807 Name: K8SApplicationCreate State: PREPARED        Error: 0
    Job: 36807 Name: K8SApplicationCreate State: AGENT_WAIT      Error: 0
    Job: 36807 Name: K8SApplicationCreate State: COMPLETED       Error: 0

3. Verify the newly created app by running the following command.

   .. code-block:: text 

     # robin app list  

4. Verify the newly cretaed VM by running the following command. 
   
   .. code-block:: text 

    # kubectl get gvm