Fixed publish config issue
[appc.git] / docs / APPC LCM API Guide / APPC LCM API Guide.rst
index 24b7447..a8dffbe 100644 (file)
@@ -572,6 +572,8 @@ Commands, or actions, may be currently supported on all VNF types or a limited s
 +------------------------+-----------+------------------+----------------+----------+------------------------------------------------------------+
 |     DetachVolume       |           |                  |                | Yes      |     Any (uses OpenStack command)                           |
 +------------------------+-----------+------------------+----------------+----------+------------------------------------------------------------+
+|     DistributeTraffic  | Yes       |                  | Yes            | Yes      | Chef and Ansible only (requires self-service onboarding)   |
++------------------------+-----------+------------------+----------------+----------+------------------------------------------------------------+
 |     Evacuate           |           |                  |                | Yes      |     Any (uses OpenStack command)                           |
 +------------------------+-----------+------------------+----------------+----------+------------------------------------------------------------+
 |     HealthCheck        | Yes       |                  |                |          |     Any (requires self-service onboarding)                 |
@@ -582,6 +584,8 @@ Commands, or actions, may be currently supported on all VNF types or a limited s
 +------------------------+-----------+------------------+----------------+----------+------------------------------------------------------------+
 |     QuiesceTraffic     | Yes       |                  |                |          | Chef and Ansible only (requires self-service onboarding)   |
 +------------------------+-----------+------------------+----------------+----------+------------------------------------------------------------+
+|     Reboot             |           |                  |                | Yes      |     Any (uses OpenStack command)                           |
++------------------------+-----------+------------------+----------------+----------+------------------------------------------------------------+
 |     Rebuild            |           |                  |                | Yes      |     Any (uses OpenStack command)                           |
 +------------------------+-----------+------------------+----------------+----------+------------------------------------------------------------+
 |     Restart            |           |                  |                | Yes      |     Any (uses OpenStack command)                           |
@@ -792,9 +796,9 @@ The Audit action does not require any payload parameters.
 +----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+----------------------------------+
 |     **Parameter**    |     **Description**                                                                                                                                       |     **Required?**   |     **Example**                  |
 +======================+===========================================================================================================================================================+=====================+==================================+
-|     publish-config   |     \* If the publish\_config field is set to Y in the payload, then always send the running configuration from the VNF using the message bus             |     Yes             |     "publish-config": "<Y\|N>"   |
+|     publish-config   |     \* If the publish\-config field is set to Y in the payload, then always send the running configuration from the VNF using the message bus             |     Yes             |     "publish-config": "<Y\|N>"   |
 |                      |                                                                                                                                                           |                     |                                  |
-|                      |     \* If the publish\_config field is set to N in the payload, then:                                                                                     |                     |                                  |
+|                      |     \* If the publish\-config field is set to N in the payload, then:                                                                                     |                     |                                  |
 |                      |                                                                                                                                                           |                     |                                  |
 |                      |     - If the result of the audit is ‘match’ (latest APPC config and the running config match), do not send the running configuration                      |                     |                                  |
 |                      |                                                                                                                                                           |                     |                                  |
@@ -976,6 +980,40 @@ Request Payload Parameters:
 |                         | be specified.                          |                 |                                                       |
 +-------------------------+----------------------------------------+-----------------+-------------------------------------------------------+
 
+ConfigModify Request
+^^^^^^^^^^^^^^^^^^^^
+
+    Examples::
+
+              {
+                     "input": {
+                          "common-header": {
+                              "timestamp": "2017-10-25T11:10:04.244Z",
+                              "api-ver": "2.00",
+                              "originator-id": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+                              "request-id": "664be3d2-6c12-4f4b-a3e7-c349acced200",
+                              "sub-request-id": "1",
+                              "flags": {
+                                  "force": "TRUE",
+                                  "ttl": 60000
+                              }
+                          },
+                          "action": "ConfigModify",
+                          "action-identifiers": {
+                              "vnf-id": "<VNF_ID>"
+                          },
+                          "payload": "{ \"config-url\":\"5f517fd4-bf3d-43bc-8147-1b61776d7ded\",
+                                        \"config-json\": \"{\"pg-streams\":{
+                                        \"pg-stream\": [{ \"id\":\"fw_udp1\", \"is-enabled\": \"true\" }, 
+                                        {\"id\": \"fw_udp2\", \"is-enabled\":\"true\" }, 
+                                        { \"id\": \"fw_udp3\",\"is-enabled\": \"true\" },
+                                        { \"id\":\"fw_udp4\", \"is-enabled\": \"true\" }, 
+                                        {\"id\": \"fw_udp5\", \"is-enabled\":\"true\" }]}}"
+                          }
+                      }
+             }
+
+
 ConfigModify Response
 ^^^^^^^^^^^^^^^^^^^^^
 
@@ -995,7 +1033,7 @@ A successful ConfigBackup request returns a success response.
 A failed ConfigBackup action returns a failure response code and the specific failure message in the response block.
 
 +------------------------------+-----------------------------------------------------------+
-|     **Target URL**           |     /restconf/operations/appc-provider-lcm:configbackup   |
+|     **Target URL**           |     /restconf/operations/appc-provider-lcm:config-backup  |
 +------------------------------+-----------------------------------------------------------+
 |     **Action**               |     ConfigBackup                                          |
 +------------------------------+-----------------------------------------------------------+
@@ -1176,6 +1214,67 @@ DetachVolume Response:
        -  itemNotFound
        -  conflict
 
+DistributeTraffic
+-----------------
+
+The Distribute Traffic LCM action is used to distribute traffic across different instances of VNF, VNFC or VM.
+The entity for which Distribute Traffic LCM action is being invoked is called an anchor point that is responsible for final
+realization of request. Parameters present in configuration file specify where and how traffic should be distributed,
+including: traffic destination points like VNFs, VNFCs or VMs; distribution weights; rollback strategy.
+Format of configuration file is specific to each VNF type.
+
+This command is executed using an Ansible playbook or Chef cookbook.
+
+Request Structure:
+
++--------------------------+--------------------------------------------------------------+
+| **Target URL**           | /restconf/operations/appc-provider-lcm:distribute-traffic    |
++--------------------------+--------------------------------------------------------------+
+| **Action**               | DistributeTraffic                                            |
++--------------------------+--------------------------------------------------------------+
+| **Action-identifiers**   | vnf-id, vserver-id, vnfc-name                                |
++--------------------------+--------------------------------------------------------------+
+| **Payload Parameters**   | See below                                                    |
++--------------------------+--------------------------------------------------------------+
+| **Revision History**     | New in Casablanca                                            |
++--------------------------+--------------------------------------------------------------+
+
+Request Payload Parameters:
+
++---------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------------------------------------------------------------+
+| **Parameter**                   |     **Description**                                                                                                                                              |     **Required?**   |     **Example**                                                           |
++=================================+==================================================================================================================================================================+=====================+===========================================================================+
+|     configuration-parameters    |     A set of instance specific configuration parameters should be specified. If provided, APP-C replaces variables in the configuration template with the        |     No              |    "payload":                                                             |
+|                                 |     values supplied. The parameters are associated with request template defined with CDT                                                                        |                     |    "{\\"configuration-parameters\\":{                                     |
+|                                 |                                                                                                                                                                  |                     |    \\"config_file_name\\":\\"/opt/onap/ccsdk/Playbooks/dt/config\\",      |
+|                                 |                                                                                                                                                                  |                     |    \\"playbook\\":\\"ansible_vfw_distributetraffic@0.00.yml\\",           |
+|                                 |                                                                                                                                                                  |                     |    \\"node_list\\":\\"[vpkg-1]\\"                                         |
+|                                 |                                                                                                                                                                  |                     |    }                                                                      |
+|                                 |                                                                                                                                                                  |                     |    }"                                                                     |
++---------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------------------------------------------------------------+
+
+Exemplary CDT template for Ansible protocol::
+
+    {
+        "PlaybookName": ${playbook},
+        "NodeList": ${node_list},
+        "EnvParameters": {
+            "ConfigFileName": "${config_file_name}"
+         },
+        "Timeout": 3600
+    }
+
+EnvParameters includes protocol specific parameters, here with name of configuration file having additional parameters for Ansible playbook or Chef cookbook.
+Distribute Traffic config file can have such parameters like traffic destinations, distribution weights or rollback strategy.
+
+DistributeTraffic Response
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The response does not include any payload parameters.
+
+**Success:** A successful distribute returns a success status code 400 after all traffic has been distributed.
+
+**Failure:** A failed distribute returns a failure code 401 and the failure message from the Ansible or Chef server in the response payload block.
 
 Evacuate
 --------
@@ -1436,7 +1535,63 @@ The response does not include any payload parameters.
 
     A specific error message is returned if there is a timeout error.
 
+Reboot
+-------
+
+The Reboot is used to reboot a VM.
+
+There are two types supported: HARD and SOFT. A SOFT reboot attempts a graceful shutdown and restart of the server. A HARD reboot attempts a forced shutdown and restart of the server. The HARD reboot corresponds to the power cycles of the server.
+
+**NOTE:** The command implementation is based on OpenStack functionality.  For further details, see http://developer.openstack.org/api-ref/compute/.
+
++------------------------------+-----------------------------------------------------------------------------------------------+
+| **Input Block**              | api-ver should be set to 2.00 for current version of Reboot                                   |
++------------------------------+-----------------------------------------------------------------------------------------------+
+|     **Target URL**           |     /restconf/operations/appc-provider-lcm:reboot                                             |
++------------------------------+-----------------------------------------------------------------------------------------------+
+|     **Action**               |     Reboot                                                                                    |
++------------------------------+-----------------------------------------------------------------------------------------------+
+|     **Action-identifiers**   |     Vnf-id, vserver-id                                                                        |
++------------------------------+-----------------------------------------------------------------------------------------------+
+|     **Payload Parameters**   |     See table below                                                                           |
++------------------------------+-----------------------------------------------------------------------------------------------+
+|     **Revision History**     |     New in R3 release.                                                                        |
++------------------------------+-----------------------------------------------------------------------------------------------+
 
+Payload Parameters
+
++-----------------+-----------------------------------------------+-----------------+-----------------------------------------+
+| **Parameter**   |     **Description**                           | **Required?**   | **Example**                             |
++=================+===============================================+=================+=========================================+
+| type            |     The type of reboot.  Values are           | No              |                                         |
+|                 |     HARD and SOFT.  If not                    |                 |                                         |
+|                 |     specified, SOFT reboot is                 |                 | "payload":                              |
+|                 |     performed.                                |                 | "{\\"type\\": \\"HARD\\",               |
+|                 |                                               |                 |   \\"vm-id\\": \\"<VM-ID>\\",           |
+|                 |                                               |                 | \\"identity-url\\":                     |
+|                 |                                               |                 | \\"<IDENTITY-URL>\\"                    |
+|                 |                                               |                 | }"                                      | 
++-----------------+-----------------------------------------------+-----------------+                                         |
+| vm-id           |     The unique identifier (UUID) of           | Yes             |                                         |
+|                 |     the resource. For backwards-              |                 |                                         |
+|                 |     compatibility, this can be the self-      |                 |                                         |
+|                 |     link URL of the VM.                       |                 |                                         |
+|                 |                                               |                 |                                         |
+|                 |                                               |                 |                                         |
+|                 |                                               |                 |                                         |
+|                 |                                               |                 |                                         |
++-----------------+-----------------------------------------------+-----------------+                                         |
+| identity-url    |     The identity url used to access the       | Yes             |                                         |
+|                 |     resource.                                 |                 |                                         |
++-----------------+-----------------------------------------------+-----------------+-----------------------------------------+
+
+Reboot Response
+^^^^^^^^^^^^^^^
+
+**Success:** A successful Rebuild returns a success status code 400.  
+
+**Failure:** A failed Rebuild returns a failure code 401 and the failure message.
 
 Rebuild
 -------
@@ -1741,7 +1896,7 @@ A successful StopApplication request returns a success response.
 A failed StopApplication action returns a failure response code and the specific failure message in the response block.
 
 +------------------------------+--------------------------------------------------------------+
-|     **Target URL**           |     /restconf/operations/appc-provider-lcm:stopapplication   |
+|     **Target URL**           |     /restconf/operations/appc-provider-lcm:stop-application  |
 +------------------------------+--------------------------------------------------------------+
 |     **Action**               |     StopApplication                                          |
 +------------------------------+--------------------------------------------------------------+
@@ -1785,11 +1940,21 @@ This command can be applied to any VNF type. The only restriction is that the VN
 +------------------------------+---------------------------------------------------+
 |     **Action-identifiers**   |     Vnf-id                                        |
 +------------------------------+---------------------------------------------------+
-|     **Payload Parameters**   |     None                                          |
+|     **Payload Parameters**   |     See below                                     |
 +------------------------------+---------------------------------------------------+
 |     **Revision History**     |     Unchanged in this release.                    |
 +------------------------------+---------------------------------------------------+
 
++----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+----------------------------------+
+|     **Parameter**    |     **Description**                                                                                                                                       |     **Required?**   |     **Example**                  |
++======================+===========================================================================================================================================================+=====================+==================================+
+|     publish-config   |     \* If the publish\-config field is set to Y in the payload, then always write the running configuration to file                                       |     Yes             |     "publish-config": "<Y\|N>"   |
+|                      |                                                                                                                                                           |                     |                                  |
+|                      |     \* If the publish\-config field is set to N in the payload, then running configuration is not written to the file                                     |                     |                                  |
+|                      |                                                                                                                                                           |                     |                                  |
++----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+----------------------------------+
+
+
 Unlock
 ------