From 7e83d0876ddb84a45e130eeba28bc40ef53c074b Mon Sep 17 00:00:00 2001 From: Yaron Yogev Date: Thu, 27 Jul 2017 09:02:54 +0300 Subject: Calipso initial release for OPNFV Change-Id: I7210c244b0c10fa80bfa8c77cb86c9d6ddf8bc88 Signed-off-by: Yaron Yogev --- app/test/fetch/api_fetch/test_data/api_access.py | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 app/test/fetch/api_fetch/test_data/api_access.py (limited to 'app/test/fetch/api_fetch/test_data/api_access.py') diff --git a/app/test/fetch/api_fetch/test_data/api_access.py b/app/test/fetch/api_fetch/test_data/api_access.py new file mode 100644 index 0000000..2181c48 --- /dev/null +++ b/app/test/fetch/api_fetch/test_data/api_access.py @@ -0,0 +1,55 @@ +############################################################################### +# Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) # +# and others # +# # +# All rights reserved. This program and the accompanying materials # +# are made available under the terms of the Apache License, Version 2.0 # +# which accompanies this distribution, and is available at # +# http://www.apache.org/licenses/LICENSE-2.0 # +############################################################################### +from datetime import datetime, timedelta + + +TIME_WITH_DOT = "2016-10-19T23:21:09.418406Z" +TIME_WITHOUT_DOT = "2016-10-19T23:21:09Z" +ILLEGAL_TIME = "23243423" +TEST_PROJECT = "test" +PROJECT = "admin" +TEST_URL = "test_url" +TEST_HEADER = "test_headers" +TEST_BODY = "test_body" + +RESPONSE = { + 'server': 'Apache', + 'vary': 'X-Auth-Token', + 'content-type': 'application/json', + 'date': 'Wed, 19 Oct 2016 23:15:36 GMT', + 'content-length': '4876', + 'x-openstack-request-id': 'req-01cda259-7f60-4440-99a0-508fed90f815', + 'connection': 'close', + 'status': '200' +} +ERROR_RESPONSE = { + 'connection': 'close', + 'status': '400' +} +GET_CONTENT = b'{"text":"test"}' +CORRECT_AUTH_CONTENT = b'{"access": {"token": {"issued_at": "2016-10-21T23:49:50.000000Z", "expires": "2016-10-22T00:49:50.445603Z", "id": "gAAAAABYCqme1l0qCm6mi3jON4ElweTkhZjGXZ_bYuxLHZGGXgO3T_JLnxKJ7KbK4xA8KjQ-DQe2trDncKQA0M-yeX167wT0xO_rjqqcCA19JV-EeXFfx7QOukkt8eC4pfK1r8Dc_kvBc-bwAemjZ1IvPGu5Nd2f0ktGWre0Qqzbg9QGtCEJUe8", "tenant": {"is_domain": false, "description": "admin tenant", "enabled": true, "id": "8c1751e0ce714736a63fee3c776164da", "parent_id": null, "name": "admin"}, "audit_ids": ["8BvzDPpyRBmeJho-FzKuGA"]}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.0.2:8774/v2/8c1751e0ce714736a63fee3c776164da", "region": "RegionOne", "internalURL": "http://192.168.0.2:8774/v2/8c1751e0ce714736a63fee3c776164da", "id": "274cbbd9fd6d4311b78e78dd3a1df51f", "publicURL": "http://172.16.0.3:8774/v2/8c1751e0ce714736a63fee3c776164da"}], "endpoints_links": [], "type": "compute", "name": "nova"}, {"endpoints": [{"adminURL": "http://192.168.0.2:9696", "region": "RegionOne", "internalURL": "http://192.168.0.2:9696", "id": "8dc28584da224c4b9671171ead3c982a", "publicURL": "http://172.16.0.3:9696"}], "endpoints_links": [], "type": "network", "name": "neutron"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8776/v2/8c1751e0ce714736a63fee3c776164da", "region": "RegionOne", "internalURL": "http://192.168.0.2:8776/v2/8c1751e0ce714736a63fee3c776164da", "id": "2c30937688e944889db4a64fab6816e6", "publicURL": "http://172.16.0.3:8776/v2/8c1751e0ce714736a63fee3c776164da"}], "endpoints_links": [], "type": "volumev2", "name": "cinderv2"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8774/v3", "region": "RegionOne", "internalURL": "http://192.168.0.2:8774/v3", "id": "1df917160dfb4ce5b469764fde22b3ab", "publicURL": "http://172.16.0.3:8774/v3"}], "endpoints_links": [], "type": "computev3", "name": "novav3"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8080", "region": "RegionOne", "internalURL": "http://192.168.0.2:8080", "id": "4f655c8f2bef46a0a7ba4a20bba53666", "publicURL": "http://172.16.0.3:8080"}], "endpoints_links": [], "type": "s3", "name": "swift_s3"}, {"endpoints": [{"adminURL": "http://192.168.0.2:9292", "region": "RegionOne", "internalURL": "http://192.168.0.2:9292", "id": "475c6c77a94e4e63a5a0f0e767f697a8", "publicURL": "http://172.16.0.3:9292"}], "endpoints_links": [], "type": "image", "name": "glance"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8777", "region": "RegionOne", "internalURL": "http://192.168.0.2:8777", "id": "617177a3dcb64560a5a79ab0a91a7225", "publicURL": "http://172.16.0.3:8777"}], "endpoints_links": [], "type": "metering", "name": "ceilometer"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8000/v1", "region": "RegionOne", "internalURL": "http://192.168.0.2:8000/v1", "id": "0f04ec6ed49f4940822161bf677bdfb2", "publicURL": "http://172.16.0.3:8000/v1"}], "endpoints_links": [], "type": "cloudformation", "name": "heat-cfn"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8776/v1/8c1751e0ce714736a63fee3c776164da", "region": "RegionOne", "internalURL": "http://192.168.0.2:8776/v1/8c1751e0ce714736a63fee3c776164da", "id": "05643f2cf9094265b432376571851841", "publicURL": "http://172.16.0.3:8776/v1/8c1751e0ce714736a63fee3c776164da"}], "endpoints_links": [], "type": "volume", "name": "cinder"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8773/services/Admin", "region": "RegionOne", "internalURL": "http://192.168.0.2:8773/services/Cloud", "id": "390dddc753cc4d378b489129d06c4b7d", "publicURL": "http://172.16.0.3:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "nova_ec2"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8004/v1/8c1751e0ce714736a63fee3c776164da", "region": "RegionOne", "internalURL": "http://192.168.0.2:8004/v1/8c1751e0ce714736a63fee3c776164da", "id": "9e60268a5aaf422d9e42f0caab0a19b4", "publicURL": "http://172.16.0.3:8004/v1/8c1751e0ce714736a63fee3c776164da"}], "endpoints_links": [], "type": "orchestration", "name": "heat"}, {"endpoints": [{"adminURL": "http://192.168.0.2:8080/v1/AUTH_8c1751e0ce714736a63fee3c776164da", "region": "RegionOne", "internalURL": "http://192.168.0.2:8080/v1/AUTH_8c1751e0ce714736a63fee3c776164da", "id": "12e78e06595f48339baebdb5d4309c70", "publicURL": "http://172.16.0.3:8080/v1/AUTH_8c1751e0ce714736a63fee3c776164da"}], "endpoints_links": [], "type": "object-store", "name": "swift"}, {"endpoints": [{"adminURL": "http://192.168.0.2:35357/v2.0", "region": "RegionOne", "internalURL": "http://192.168.0.2:5000/v2.0", "id": "404cceb349614eb39857742970408301", "publicURL": "http://172.16.0.3:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "keystone"}], "user": {"username": "admin", "roles_links": [], "name": "admin", "roles": [{"id": "888bdf92213a477ba9f10554bc382e57", "name": "admin"}], "enabled": true, "email": "admin@localhost", "id": "13baa553aae44adca6615e711fd2f6d9"}, "metadata": {"is_admin": 0, "roles": []}}}' +ERROR_AUTH_CONTENT = b'{"access": {}}' +ERROR_TOKEN_CONTENT = b'{"error":{"code":"code","title":"title","message":"message",", URL":"URL"},"access": {}}' + +VALID_TOKENS = { + PROJECT: { + # make sure the expired time of the token is later than now + "expires": (datetime.now() + timedelta(1)).strftime("%Y-%m-%dT%H:%M:%SZ") + } +} + +EMPTY_TOKENS = {} + +REGION_NAME = "RegionOne" +ERROR_REGION_NAME = "ERROR" +SERVICE_NAME = "nova" +ERROR_SERVICE_NAME = "ERROR" + +REGION_URL = "http://10.56.20.239:8774/v2/329e0576da594c62a911d0dccb1238a7" -- cgit 1.2.3-korg 7 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
Triple-O Deployment Architecture
================================

Apex is based on the OpenStack Triple-O project as distributed by
the RDO Project.  It is important to understand the basics
of a Triple-O deployment to help make decisions that will assist in
successfully deploying OPNFV.

Triple-O stands for OpenStack On OpenStack.  This means that OpenStack
will be used to install OpenStack. The target OPNFV deployment is an
OpenStack cloud with NFV features built-in that will be deployed by a
smaller all-in-one deployment of OpenStack.  In this deployment
methodology there are two OpenStack installations. They are referred
to as the undercloud and the overcloud. The undercloud is used to
deploy the overcloud.

The undercloud is the all-in-one installation of OpenStack that includes
baremetal provisioning capability.  The undercloud will be deployed as a
virtual machine on a Jump Host.

The overcloud is OPNFV. Configuration will be passed into undercloud and
the undercloud will use OpenStack's orchestration component, named Heat, to
execute a deployment that will provision the target OPNFV nodes.

Apex High Availability Architecture
===================================

Undercloud
----------

The undercloud is not Highly Available. End users do not depend on the
undercloud. It is only for management purposes.

Overcloud
---------

Apex will deploy three control nodes in an HA deployment. Each of these nodes
will run the following services:

- Stateless OpenStack services
- MariaDB / Galera
- RabbitMQ
- OpenDaylight
- HA Proxy
- Pacemaker & VIPs
- Ceph Monitors and OSDs

Stateless OpenStack services
  All running stateless OpenStack services are load balanced by HA Proxy.
  Pacemaker monitors the services and ensures that they are running.

Stateful OpenStack services
  All running stateful OpenStack services are load balanced by HA Proxy.
  They are monitored by pacemaker in an active/passive failover configuration.

MariaDB / Galera
  The MariaDB database is replicated across the control nodes using Galera.
  Pacemaker is responsible for a proper start up of the Galera cluster. HA
  Proxy provides and active/passive failover methodology to connections to the
  database.

RabbitMQ
  The message bus is managed by Pacemaker to ensure proper start up and
  establishment of clustering across cluster members.

OpenDaylight
  OpenDaylight is currently installed on all three control nodes and started as
  an HA cluster unless otherwise noted for that scenario.  OpenDaylight's
  database, known as MD-SAL, breaks up pieces of the database into "shards".
  Each shard will have its own election take place, which will determine
  which OpenDaylight node is the leader for that shard.  The other
  OpenDaylight nodes in the cluster will be in standby.  Every Open vSwitch
  node connects to every OpenDaylight to enable HA.

HA Proxy
  HA Proxy is monitored by Pacemaker to ensure it is running across all nodes
  and available to balance connections.

Pacemaker & VIPs
  Pacemaker has relationships and restraints setup to ensure proper service
  start up order and Virtual IPs associated with specific services are running
  on the proper host.

Ceph Monitors & OSDs
  The Ceph monitors run on each of the control nodes. Each control node also
  has a Ceph OSD running on it. By default the OSDs use an autogenerated
  virtual disk as their target device. A non-autogenerated device can be
  specified in the deploy file.

VM Migration is configured and VMs can be evacuated as needed or as invoked
by tools such as heat as part of a monitored stack deployment in the overcloud.


OPNFV Scenario Architecture
===========================

OPNFV distinguishes different types of SDN controllers, deployment options, and
features into "scenarios".  These scenarios are universal across all OPNFV
installers, although some may or may not be supported by each installer.

The standard naming convention for a scenario is:
<VIM platform>-<SDN type>-<feature>-<ha/noha>

The only supported VIM type is "OS" (OpenStack), while SDN types can be any
supported SDN controller.  "feature" includes things like ovs_dpdk, sfc, etc.
"ha" or "noha" determines if the deployment will be highly available.  If "ha"
is used at least 3 control nodes are required.

OPNFV Scenarios in Apex
=======================

Apex provides pre-built scenario files in /etc/opnfv-apex which a user can
select from to deploy the desired scenario.  Simply pass the desired file to
the installer as a (-d) deploy setting.  Read further in the Apex documentation
to learn more about invoking the deploy command.  Below is quick reference
matrix for OPNFV scenarios supported in Apex.  Please refer to the respective
OPNFV Docs documentation for each scenario in order to see a full scenario
description.  Also, please refer to release notes for information about known
issues per scenario.  The following scenarios correspond to a supported
<Scenario>.yaml deploy settings file:

+-------------------------+-------------+---------------+
| **Scenario**            | **Owner**   | **Supported** |
+-------------------------+-------------+---------------+
| os-nosdn-nofeature-ha   | Apex        | Yes           |
+-------------------------+-------------+---------------+
| os-nosdn-nofeature-noha | Apex        | Yes           |
+-------------------------+-------------+---------------+
| os-nosdn-bar-ha         | Barometer   | No            |
+-------------------------+-------------+---------------+
| os-nosdn-bar-noha       | Barometer   | No            |
+-------------------------+-------------+---------------+
| os-nosdn-calipso-noha   | Calipso     | Yes           |
+-------------------------+-------------+---------------+
| os-nosdn-ovs_dpdk-ha    | Apex        | No            |
+-------------------------+-------------+---------------+
| os-nosdn-ovs_dpdk-noha  | Apex        | No            |
+-------------------------+-------------+---------------+
| os-nosdn-fdio-ha        | FDS         | No            |
+-------------------------+-------------+---------------+
| os-nosdn-fdio-noha      | FDS         | No            |
+-------------------------+-------------+---------------+
| os-nosdn-kvm_ovs_dpdk-ha| KVM for NFV | No            |
+-------------------------+-------------+---------------+
| os-nosdn-kvm_ovs_dpdk   | KVM for NFV | No            |
| -noha                   |             |               |
+-------------------------+-------------+---------------+
| os-nosdn-performance-ha | Apex        | No            |
+-------------------------+-------------+---------------+
| os-odl-nofeature-ha     | Apex        | Yes           |
+-------------------------+-------------+---------------+
| os-odl-nofeature-noha   | Apex        | Yes           |
+-------------------------+-------------+---------------+
| os-odl-ovs_dpdk-ha      | Apex        | No            |
+-------------------------+-------------+---------------+
| os-odl-ovs_dpdk-noha    | Apex        | No            |
+-------------------------+-------------+---------------+
| os-odl-bgpvpn-ha        | SDNVPN      | Yes           |
+-------------------------+-------------+---------------+
| os-odl-bgpvpn-noha      | SDNVPN      | Yes           |
+-------------------------+-------------+---------------+
| os-odl-sriov-ha         | Apex        | No            |
+-------------------------+-------------+---------------+
| os-odl-sriov-noha       | Apex        | No            |
+-------------------------+-------------+---------------+
| os-odl-l2gw-ha          | Apex        | No            |
+-------------------------+-------------+---------------+
| os-odl-l2gw-noha        | Apex        | No            |
+-------------------------+-------------+---------------+
| os-odl-sfc-ha           | SFC         | Yes           |
+-------------------------+-------------+---------------+
| os-odl-sfc-noha         | SFC         | Yes           |
+-------------------------+-------------+---------------+
| os-odl-gluon-noha       | Gluon       | No            |
+-------------------------+-------------+---------------+
| os-odl-csit-noha        | Apex        | No            |
+-------------------------+-------------+---------------+
| os-odl-fdio-ha          | FDS         | No            |
+-------------------------+-------------+---------------+
| os-odl-fdio-noha        | FDS         | No            |
+-------------------------+-------------+---------------+
| os-odl-fdio_dvr-ha      | FDS         | No            |
+-------------------------+-------------+---------------+
| os-odl-fdio_dvr-noha    | FDS         | No            |
+-------------------------+-------------+---------------+
| os-onos-nofeature-ha    | ONOSFW      | No            |
+-------------------------+-------------+---------------+
| os-onos-sfc-ha          | ONOSFW      | No            |
+-------------------------+-------------+---------------+
| os-ovn-nofeature-noha   | Apex        | No            |
+-------------------------+-------------+---------------+
| os-ovn-nofeature-ha     | Apex        | Yes           |
+-------------------------+-------------+---------------+