Skip to content

Commit

Permalink
F OpenNebula/one#5112: add documentation new gate features
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian González committed Oct 21, 2020
1 parent 3997058 commit 285bc0b
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,84 +46,7 @@ The OneGate configuration file can be found at ``/etc/one/onegate-server.conf``.
* ``permissions`` By default OneGate exposes all the available API calls, each of the actions can be enabled/disabled in the server configuration.
* ``restricted_attrs`` Attrs that cannot be modified when updating a VM template
* ``restricted_actions`` Actions that cannot be performed on a VM

This is the default file

.. code-block:: yaml
################################################################################
# Server Configuration
################################################################################
# OpenNebula sever contact information
#
:one_xmlrpc: http://localhost:2633/RPC2
# Server Configuration
#
:host: 127.0.0.1
:port: 5030
# SSL proxy URL that serves the API (set if is being used)
#:ssl_server: https://service.endpoint.fqdn:port/
################################################################################
# Log
################################################################################
# Log debug level
# 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG
#
:debug_level: 3
################################################################################
# Auth
################################################################################
# Authentication driver for incomming requests
# onegate, based on token provided in the context
#
:auth: onegate
# Authentication driver to communicate with OpenNebula core
# cipher, for symmetric cipher encryption of tokens
# x509, for x509 certificate encryption of tokens
#
:core_auth: cipher
################################################################################
# OneFlow Endpoint
################################################################################
:oneflow_server: http://localhost:2474
################################################################################
# Permissions
################################################################################
:permissions:
:vm:
:show: true
:show_by_id: true
:update: true
:update_by_id: true
:action_by_id: true
:service:
:show: true
:change_cardinality: true
# Attrs that cannot be modified when updating a VM template
:restricted_attrs
- SCHED_REQUIREMENTS
- SERVICE_ID
- ROLE_NAME
# Actions that cannot be performed on a VM
:restricted_actions
#- deploy
#- delete
#- hold
...
* ``vnet_template_attributes`` Attributes of the Virtual Network template that will be retrieved for vnets

Start OneGate
=============
Expand Down
109 changes: 109 additions & 0 deletions source/advanced_components/application_insight/onegate_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ If no argument is provided, the information of the current Virtual Machine will
STATE : RUNNING
IP : 192.168.122.23
.. note:: Specifying a VM ID different of a different VM will only works to retrieve information of VMs in the same OneFlow Service or the same Virtual Router.

Retrieving information of the Service
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down Expand Up @@ -133,6 +135,31 @@ You can use the option ``onegate service show --extended`` to get all the inform
For a detailed version use the ``--json`` option and all the information will be returned in JSON format. You can combine **extended** and **json** to get all the information in JSON format.

Retrieving Information of the Virtual Router
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Using the ``onegate vrouter show`` command the information of the Virtual Machine will be retrieved. For a detailed version use the ``--json`` option and all the information will be returned in JSON format.

.. code::
$ onegate vrouter show
VROUTER 0
NAME : vr
VMS : 1
Retrieving Information of the Virtual Network
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Using the ``onegate vnet show <ID>`` command the information of a Virtual Network will be retrieved. For a detailed version use the ``--json`` option and all the information will be returned in JSON format, when using this option the ``--extended`` option can be used to increase the information retrieved by the command.

.. code::
$ onegate vnet show 0
VNET
ID : 0
.. note:: This option is only available for Virtual Routers and only Virtual Networks related to that Virtual Router (i.e Virtual Network attached or related somehow in the reservation hierarchy with another attached Virtual Network) can be retrieved.

Updating the VM Information
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Expand Down Expand Up @@ -404,6 +431,88 @@ Self-awareness
"service_info": "http://<onegate_endpoint>/service"
}

* ``GET ${ONEGATE_ENDPOINT}/vrouter``: To request information about the Virtual Router. The information is returned in JSON format and is ready for public cloud usage.

.. prompt:: text $ auto

$ curl -X "GET" "${ONEGATE_ENDPOINT}/vrouter" \
--header "X-ONEGATE-TOKEN: `cat token.txt`" \
--header "X-ONEGATE-VMID: $VMID"

{
"VROUTER": {
"NAME": "vr",
"ID": "0",
"VMS": {
"ID": [
"1"
]
},
"TEMPLATE": {
"NIC": [
{
"NETWORK": "vnet",
"NETWORK_ID": "0",
"NIC_ID": "0"
}
],
"TEMPLATE_ID": "0"
}
}
}

* ``GET ${ONEGATE_ENDPOINT}/vnet``: To request information about a Virtual Network. The information is returned in JSON format and is ready for public cloud usage.

.. prompt:: text $ auto

$ curl -X "GET" "${ONEGATE_ENDPOINT}/vnet/<VNET_ID>" \
--header "X-ONEGATE-TOKEN: `cat token.txt`" \
--header "X-ONEGATE-VMID: $VMID"

{
"VNET": {
"ID": "0",
"NAME": "vnet",
"USED_LEASES": "1",
"VROUTERS": {
"ID": [
"0"
]
},
"PARENT_NETWORK_ID": {
},
"AR_POOL": {
"AR": [
{
"AR_ID": "0",
"IP": "192.168.122.100",
"MAC": "02:00:c0:a8:7a:64",
"SIZE": "10",
"TYPE": "IP4",
"MAC_END": "02:00:c0:a8:7a:6d",
"IP_END": "192.168.122.109",
"USED_LEASES": "1",
"LEASES": {
"LEASE": [
{
"IP": "192.168.122.100",
"MAC": "02:00:c0:a8:7a:64",
"VM": "1"
}
]
}
}
]
},
"TEMPLATE": {
"NETWORK_ADDRESS": "192.168.122.0",
"NETWORK_MASK": "255.255.255.0",
"GATEWAY": "192.168.122.1",
"DNS": "1.1.1.1"
}
}
}


Self-configuration
------------------
Expand Down
13 changes: 13 additions & 0 deletions source/intro_release_notes/release_notes/compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,16 @@ All the states that make Virtual Machines to remain in the host are taken in acc
Azure driver
============
Azure driver was revamped to support Azure Resource Manager, there are new attributes requried to be defined for the Azure host. Please refer to the :ref:`Azure driver <azg>`.

New OneGate commands
====================
New commands ``onegate vnet show <ID>`` and ``onegate vrouter show`` have been added. In order to be able to use them the corresponding permissions needs to be added at ``/etc/one/onegate-server.conf``:

.. code::
:permissions:
...
:vrouter:
:show: true
:vnet:
:show_by_id: true

0 comments on commit 285bc0b

Please sign in to comment.