From 285bc0bed6d3f853942d23ca41fce1f55d2c7fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gonz=C3=A1lez?= Date: Wed, 21 Oct 2020 11:32:28 +0200 Subject: [PATCH] F OpenNebula/one#5112: add documentation new gate features --- .../application_insight/onegate_configure.rst | 79 +------------ .../application_insight/onegate_usage.rst | 109 ++++++++++++++++++ .../release_notes/compatibility.rst | 13 +++ 3 files changed, 123 insertions(+), 78 deletions(-) diff --git a/source/advanced_components/application_insight/onegate_configure.rst b/source/advanced_components/application_insight/onegate_configure.rst index 759787ba99..886326e77e 100644 --- a/source/advanced_components/application_insight/onegate_configure.rst +++ b/source/advanced_components/application_insight/onegate_configure.rst @@ -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 ============= diff --git a/source/advanced_components/application_insight/onegate_usage.rst b/source/advanced_components/application_insight/onegate_usage.rst index c68a7c71ed..71c6c60bc3 100644 --- a/source/advanced_components/application_insight/onegate_usage.rst +++ b/source/advanced_components/application_insight/onegate_usage.rst @@ -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 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -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 `` 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 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -404,6 +431,88 @@ Self-awareness "service_info": "http:///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/" \ + --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 ------------------ diff --git a/source/intro_release_notes/release_notes/compatibility.rst b/source/intro_release_notes/release_notes/compatibility.rst index 043cd5b1c9..b077b47543 100644 --- a/source/intro_release_notes/release_notes/compatibility.rst +++ b/source/intro_release_notes/release_notes/compatibility.rst @@ -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 `. + +New OneGate commands +==================== +New commands ``onegate vnet show `` 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