예제 #1
0
    def generate_bigip_service(self, os_service):
        """ Generate tenant service """
        tenant_service = {}

        pool_id = os_service['pool']['id']

        # {
        #     ...,
        #     "name": "someServiceName",
        #     ...
        # }
        tenant_service['name'] = self.get_bigip_service_name(pool_id)

        tenant_service['template'] = '/Common/%s' \
            % self._F5_LBAAS_IAPP_TEMPLATE_NAME

        # {
        #     ...,
        #     "vars":
        #         [
        #             pool vars, VIP vars, app stats vars
        #         ],
        #     ...
        # }
        tenant_service['variables'] = []

        self.fill_in_pool_info(tenant_service, os_service)
        self.fill_in_vip_info(tenant_service, os_service)
        tenant_service['variables'].append(
            get_tenant_service_var('app_stats', 'enabled'))

        #     "tables":
        #         [
        #             pool members
        #         ],
        #     ...
        # }
        tenant_service['tables'] = []

        self.fill_in_pool_members_table(tenant_service, os_service, True)

        return tenant_service
예제 #2
0
    def generate_bigiq_service(self, os_service, connector):
        """ Generate tenant service """
        tenant_service = {}

        pool_id = os_service['pool']['id']

        # {
        #     ...,
        #     "name": "someServiceName",
        #     ...
        # }
        tenant_service['name'] = self.get_bigiq_service_name(pool_id)

        # {
        #     ...,
        #     "tenantTemplateReference":
        #         {
        #             "link": "https://localhost/mgmt/cm/cloud/tenant/" +
        #                 "templates/iapp/OpenStack-LBaaS-Template"
        #         },
        #     ...
        # }
        tenant_service['tenantTemplateReference'] = \
            {'link': 'https://localhost/mgmt/cm/'
                     'cloud/tenant/templates/iapp/%s'
                     % self._LBAAS_PROVIDER_TEMPLATE_NAME}

        # {
        #     ...,
        #     "vars":
        #         [
        #             pool vars, VIP vars, app stats vars
        #         ],
        #     ...
        # }
        tenant_service[self.varkey] = []

        self.fill_in_pool_info(tenant_service, os_service)
        self.fill_in_vip_info(
            tenant_service, os_service, bigiq_workaround=True)

        tenant_service[self.varkey].append(
            get_tenant_service_var('app_stats', 'enabled'))

        # {
        #     ...,
        #     "tables":
        #         [
        #             pool members
        #         ],
        #     ...
        # }
        tenant_service['tables'] = []

        self.fill_in_pool_members_table(tenant_service, os_service, False)

        # {
        #     ...,
        #     "properties":
        #         [
        #             {
        #                 "id": "cloudConnectorReference",
        #                 "value": "https://localhost/mgmt/cm/cloud/" +
        #         "connectors/openstack/2d595e4f-8cec-4c5b-b921-0fbf1fec6cb5"
        #             }
        #         ],
        #     ...
        # }
        tenant_service['properties'] = []

        tenant_service['properties'].append(
            {'id': 'cloudConnectorReference',
             'value': connector['selfLink']})

        return tenant_service
    def generate_bigiq_service(self, os_service, connector):
        """ Generate tenant service """
        tenant_service = {}

        pool_id = os_service["pool"]["id"]

        # {
        #     ...,
        #     "name": "someServiceName",
        #     ...
        # }
        tenant_service["name"] = self.get_bigiq_service_name(pool_id)

        # {
        #     ...,
        #     "tenantTemplateReference":
        #         {
        #             "link": "https://localhost/mgmt/cm/cloud/tenant/" +
        #                 "templates/iapp/OpenStack-LBaaS-Template"
        #         },
        #     ...
        # }
        tenant_service["tenantTemplateReference"] = {
            "link": "https://localhost/mgmt/cm/" "cloud/tenant/templates/iapp/%s" % self._LBAAS_PROVIDER_TEMPLATE_NAME
        }

        # {
        #     ...,
        #     "vars":
        #         [
        #             pool vars, VIP vars, app stats vars
        #         ],
        #     ...
        # }
        tenant_service[self.varkey] = []

        self.fill_in_pool_info(tenant_service, os_service)
        self.fill_in_vip_info(tenant_service, os_service, bigiq_workaround=True)

        tenant_service[self.varkey].append(get_tenant_service_var("app_stats", "enabled"))

        # {
        #     ...,
        #     "tables":
        #         [
        #             pool members
        #         ],
        #     ...
        # }
        tenant_service["tables"] = []

        self.fill_in_pool_members_table(tenant_service, os_service, False)

        # {
        #     ...,
        #     "properties":
        #         [
        #             {
        #                 "id": "cloudConnectorReference",
        #                 "value": "https://localhost/mgmt/cm/cloud/" +
        #         "connectors/openstack/2d595e4f-8cec-4c5b-b921-0fbf1fec6cb5"
        #             }
        #         ],
        #     ...
        # }
        tenant_service["properties"] = []

        tenant_service["properties"].append({"id": "cloudConnectorReference", "value": connector["selfLink"]})

        return tenant_service