Пример #1
0
 def services(self, request, rest_api_modscope, a_provider, dialog,
              service_catalogs):
     try:
         return _services(request, rest_api_modscope, a_provider, dialog,
                          service_catalogs)
     except:
         pass
Пример #2
0
def services_vms_list(appliance, request, provider, catalog_item):
    ui_services, vms = [], []
    service_template = appliance.rest_api.collections.service_templates.get(
        name=catalog_item.name)

    for num in range(1, 3):
        rest_service = _services(request,
                                 appliance,
                                 provider=provider,
                                 service_template=service_template)[0]
        ui_services.append(
            MyService(appliance,
                      name=rest_service.name,
                      description=rest_service.description))
        vms.append(
            appliance.rest_api.collections.vms.get(
                name=f'{catalog_item.prov_data["catalog"]["vm_name"]}000{num}')
        )

    return ui_services, vms
Пример #3
0
def services(request, rest_api, a_provider):
    if version.current_version() >= '5.7':
        # create simple service using REST API
        bodies = [service_body() for _ in range(3)]
        collection = rest_api.collections.services
        new_services = collection.action.create(*bodies)
        assert rest_api.response.status_code == 200

        @request.addfinalizer
        def _finished():
            collection.reload()
            ids = [service.id for service in new_services]
            delete_entities = [service for service in collection if service.id in ids]
            if len(delete_entities) != 0:
                collection.action.delete(*delete_entities)

        return new_services
    else:
        # create full-blown service using UI
        s_dialog = _dialog()
        s_catalogs = _service_catalogs(request, rest_api)
        return _services(request, rest_api, a_provider, s_dialog, s_catalogs)
Пример #4
0
 def services(self, request, rest_api_modscope, a_provider, dialog, service_catalogs):
     try:
         return _services(request, rest_api_modscope, a_provider, dialog, service_catalogs)
     except:
         pass
def services(request, rest_api, a_provider, dialog, service_catalogs):
    return _services(request, rest_api, a_provider, dialog, service_catalogs)
Пример #6
0
 def services(self, request, appliance, a_provider):
     return _services(request, appliance.rest_api, a_provider)
Пример #7
0
 def services(self, request, appliance, a_provider):
     return _services(request, appliance.rest_api, a_provider)