Skip to content

Commit

Permalink
F #5075: add changes to documentation (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Huertas Herrero authored Sep 22, 2020
1 parent 3c36a2d commit bf96f93
Show file tree
Hide file tree
Showing 5 changed files with 194 additions and 93 deletions.
73 changes: 36 additions & 37 deletions source/advanced_components/ddc/template/virtual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ We are going to deploy a cluster with the following elements:
marketplaceapps:
- appname: "Ttylinux - KVM"
name: "TTY"
dsid: <%= @datastores[0]['ID'] %>
dsid: <%= @body['provision']['infrastructure']['datastores'][0]['id'] %>
meta:
wait: true
wait_timeout: 30
Expand All @@ -95,7 +95,7 @@ This will deploy the host in Packet, will configure it and will create all the o
marketplaceapps:
- appname: "Ttylinux - KVM"
name: "TTY"
dsid: <%= @datastores[0]['ID'] %>
dsid: <%= @body['provision']['infrastructure']['datastores'][0]['id'] %>
meta:
wait: true
wait_timeout: 30
Expand All @@ -107,31 +107,30 @@ The final result would be the following:

.. prompt:: bash $ auto

$ oneprovision show 24959b5c-8eca-4cd8-a3bb-dac36a7b5c1d -x
<PROVISION>
<ID>24959b5c-8eca-4cd8-a3bb-dac36a7b5c1d</ID>
<NAME>packet_cluster</NAME>
<STATUS>pending</STATUS>
<CLUSTERS>
<ID>100</ID>
</CLUSTERS>
<DATASTORES>
<ID>101</ID>
<ID>100</ID>
</DATASTORES>
<HOSTS>
<ID>0</ID>
</HOSTS>
<NETWORKS>
<ID>0</ID>
</NETWORKS>
<IMAGES>
<ID>0</ID>
</IMAGES>
<TEMPLATES>
<ID>0</ID>
</TEMPLATES>
</PROVISION>
$ oneprovision show 18 -x
<DOCUMENT>
<ID>18</ID>
<UID>0</UID>
<GID>0</GID>
<UNAME>oneadmin</UNAME>
<GNAME>oneadmin</GNAME>
<NAME>testing</NAME>
<TYPE>103</TYPE>
<PERMISSIONS>
<OWNER_U>1</OWNER_U>
<OWNER_M>1</OWNER_M>
<OWNER_A>0</OWNER_A>
<GROUP_U>0</GROUP_U>
<GROUP_M>0</GROUP_M>
<GROUP_A>0</GROUP_A>
<OTHER_U>0</OTHER_U>
<OTHER_M>0</OTHER_M>
<OTHER_A>0</OTHER_A>
</PERMISSIONS>
<TEMPLATE>
<BODY><![CDATA[{"name":"testing","description":null,"start_time":1600684065,"state":3,"provider":"packet","provision":{"infrastructure":{"datastores":[{"name":"tf-images","id":128},{"name":"tf-system","id":129}],"networks":[{"name":"tf-hostonly_nat","id":14}],"hosts":[{"name":"provision-cbbe1e477a1bd5e1324ae66bdffc20e28ae0b0b93f10db43","id":"18"}],"clusters":[{"name":"tf","id":114}]},"resource":{"images":[{"id":18,"name":"test_image"}],"templates":[{"id":15,"name":"test_template"}],"vntemplates":[{"id":11,"name":"vntemplate"}],"flowtemplates":[{"id":19,"name":"my_service"}]}}}]]></BODY>
</TEMPLATE>
</DOCUMENT>

As you can see all the objects have been created and they belong to the same provision. This means, that when you for example delete the provision
all the objects are going to be deleted as once.
Expand Down Expand Up @@ -382,11 +381,11 @@ For this, ERB expressions are available, so you can reference objects that have
images:
- name: "test_image"
ds_id: <%= @datastores[0]['ID'] %>
ds_id: <%= @body['provision']['infrastructure']['datastores'][0]['id'] %>
size: 2048
In this example, we create two datastores (system and images) and an image. We want to store the image in the image datastore we just created, so we can
reference it using the ERB expression ``@datastores[0]['ID']``.
reference it using the ERB expression ``@body['provision']['infrastructure']['datastores'][0]['id']``.

.. code::
Expand All @@ -400,10 +399,10 @@ reference it using the ERB expression ``@datastores[0]['ID']``.
memory: 1
cpu: 1
disk:
- image_id: <%= @images[0]['ID'] %>
- image_id: <%= @body['provision']['resource']['images'][0]['id'] %>
In this example, we create an image and a template. We want the template to have a disk referencing to the new image, so we can reference it using
the ERB expression ``<%= @images[0]['ID'] %>``.
the ERB expression ``@body['provision']['resource']['images'][0]['id']``.

.. warning:: The order of objects creation is the following:

Expand Down Expand Up @@ -482,7 +481,7 @@ Here you can check a full provision template example:
images:
- name: "test_image"
ds_id: <%= @datastores[0]['ID'] %>
ds_id: <%= @body['provision']['infrastructure']['datastores'][0]['id'] %>
size: 2048
meta:
uid: 1
Expand All @@ -492,7 +491,7 @@ Here you can check a full provision template example:
marketplaceapps:
- appid: 238
name: "test_image2"
dsid: <%= @datastores[0]['ID'] %>
dsid: <%= @body['provision']['infrastructure']['datastores'][0]['id'] %>
meta:
uid: 1
gid: 100
Expand All @@ -504,9 +503,9 @@ Here you can check a full provision template example:
memory: 1
cpu: 1
disk:
- image_id: <%= @images[1]['ID'] %>
- image_id: <%= @body['provision']['resource']['images'][1]['id'] %>
nic:
- network_id: <%= @networks[0]['ID'] %>
- network_id: <%= @body['provision']['infrastructure']['networks'][0]['id'] %>
meta:
uid: 1
gid: 100
Expand All @@ -519,14 +518,14 @@ Here you can check a full provision template example:
- ip: "10.0.0.1"
size: 10
type: "IP4"
cluster_ids: <%= @clusters[0]['ID'] %>
cluster_ids: <%= @body['provision']['infrastructure']['clusters'][0]['id'] %>
flowtemplates:
- name: "my_service"
deployment: "straight"
roles:
- name: "frontend"
vm_template: <%= @templates[0]['ID'] %>
vm_template: <%= @body['provision']['resource']['templates'][0]['id'] %>
meta:
uid: 1
gid: 100
157 changes: 143 additions & 14 deletions source/advanced_components/ddc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,23 @@ List

The ``list`` command lists all provisions.

Parameters:

+------------------+-------------------------------+-----------+
| Parameter | Description | Mandatory |
+==================+===============================+===========+
| ``--csv`` | Show output as CSV | NO |
+------------------+-------------------------------+-----------+
| ``--json`` | Show output as JSON | NO |
+------------------+-------------------------------+-----------+
| ``--done`` | Show provisions in DONE state | NO |
+------------------+-------------------------------+-----------+

.. prompt:: bash $ auto

$ oneprovision list
ID NAME CLUSTERS HOSTS VNETS DATASTORES STAT
8fc831e6-9066-4c57-9ee4-4b11fea98f00 myprovision 1 1 1 2 configured
ID NAME CLUSTERS HOSTS VNETS DATASTORES STAT
18 myprovision 1 1 1 2 RUNNING

Show
----
Expand All @@ -115,29 +127,49 @@ Parameters:
+------------------+---------------------+-----------+
| ``--csv`` | Show output as CSV | NO |
+------------------+---------------------+-----------+
| ``--json`` | Show output as JSON | NO |
+------------------+---------------------+-----------+
| ``--xml`` | Show output as XML | NO |
+------------------+---------------------+-----------+

Examples:

.. prompt:: bash $ auto

$ oneprovision show 8fc831e6-9066-4c57-9ee4-4b11fea98f00
PROVISION INFORMATION
ID : 8fc831e6-9066-4c57-9ee4-4b11fea98f00
NAME : myprovision
STATUS : configured
$ oneprovision show 18
PROVISION 18 INFORMATION
ID : 18
NAME : testing
STATE : RUNNING

Provision Infrastructure Resources

CLUSTERS
184
114: tf

DATASTORES
128: tf-images
129: tf-system

HOSTS
766
18: provision-cbbe1e477a1bd5e1324ae66bdffc20e28ae0b0b93f10db43

VNETS
135
NETWORKS
14: tf-hostonly_nat

DATASTORES
318
319
Provision Resource Resources

FLOWTEMPLATES
19: my_service

IMAGES
18: test_image

TEMPLATES
15: test_template

VNTEMPLATES
11: vntemplate

Configure
---------
Expand Down Expand Up @@ -400,6 +432,103 @@ The ``oneprovision vnet delete`` command deletes the virtual network.
2018-11-27 13:02:08 INFO : Deleting vnet 136
VNET 136: deleted

Images
------

Individual images from the provision can be managed by the ``oneprovision image`` subcommands.

Image List
^^^^^^^^^^

The ``oneprovision image list`` command lists all images.

.. prompt:: bash $ auto

$ oneprovision image list
ID USER GROUP NAME DATASTORE SIZE TYPE PER STAT RVMS
0 serverad users test_image tf-images 2G OS No rdy 0

Image Delete
^^^^^^^^^^^^

The ``oneprovision image delete`` command deletes the image.

.. prompt:: bash $ auto

$ oneprovision image delete 0 -d
2018-11-27 13:02:08 INFO : Deleting image 0
IMAGE 0: deleted

Templates
---------

Individual VM templates from the provision can be managed by the ``oneprovision template`` subcommands.

Template List
^^^^^^^^^^^^^

The ``oneprovision template list`` command lists all templates.

.. prompt:: bash $ auto

$ oneprovision template list
ID USER GROUP NAME REGTIME
0 oneadmin oneadmin test_template 09/21 14:17:28

Template Delete
^^^^^^^^^^^^^^^

The ``oneprovision template delete`` command deletes the template.

.. prompt:: bash $ auto

$ oneprovision template delete 0 -d
2018-11-27 13:02:08 INFO : Deleting template 0
TEMPLATE 0: deleted

VNet Templates
--------------

Individual VNet templates from the provision can be managed by the ``oneprovision vntemplate`` subcommands.

VNet Template List
^^^^^^^^^^^^^^^^^^

The ``oneprovision vntemplate list`` command lists all VNet templates.

.. prompt:: bash $ auto

$ oneprovision vntemplate list
ID USER GROUP NAME REGTIME
0 oneadmin oneadmin vntemplate 09/21 14:17:28

VNet Template Delete
^^^^^^^^^^^^^^^^^^^^

The ``oneprovision vntemplate delete`` command deletes the VNet template.

.. prompt:: bash $ auto

$ oneprovision vntemplate delete 0 -d
2018-11-27 13:02:08 INFO : Deleting vntemplate 0
VNTEMPLATE 0: deleted

Flow Templates
--------------

Individual Flow templates from the provision can be managed by the ``oneprovision flowtemplate`` subcommands.

Flow Template Delete
^^^^^^^^^^^^^^^^^^^^

The ``oneprovision flowtemplate delete`` command deletes the Flow template.

.. prompt:: bash $ auto

$ oneprovision flowtemplate delete 0 -d
2018-11-27 13:02:08 INFO : Deleting flowtemplate 0
FLOWTEMPLATE 0: deleted

.. _ddc_usage_log:

Logging Modes
Expand Down
2 changes: 0 additions & 2 deletions source/integration/infrastructure_integration/devel-pm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,9 @@ Example:
<NAME>provision-c968cbcf40716f8e18caddbb8757c2ca7ed0942a357d511b</NAME>
<IM_MAD>kvm</IM_MAD>
<VM_MAD>kvm</VM_MAD>
<PM_MAD>packet</PM_MAD>
<TEMPLATE>
<IM_MAD>kvm</IM_MAD>
<VM_MAD>kvm</VM_MAD>
<PM_MAD>packet</PM_MAD>
<PROVISION>
<PACKET_TOKEN>*****</PACKET_TOKEN>
<PACKET_PROJECT>*****</PROJECT>
Expand Down
Loading

0 comments on commit bf96f93

Please sign in to comment.