Example #1
0
 def get_details(self, source):
     details = {
         'scope_uuid': source.uuid.hex,
     }
     service_provider_info = marketplace_utils.get_service_provider_info(source)
     details.update(service_provider_info)
     return details
Example #2
0
 def get_details(self, source):
     details = {
         'cpu': source.cores,
         'ram': source.ram,
         'disk': source.total_disk,
     }
     service_provider_info = marketplace_utils.get_service_provider_info(source)
     details.update(service_provider_info)
     return details
Example #3
0
 def get_details(self, source):
     details = {
         'cpu_usage': source.cpu_usage,
         'gpu_usage': source.gpu_usage,
         'ram_usage': source.ram_usage,
         'deposit_usage': source.deposit_usage,
     }
     service_provider_info = marketplace_utils.get_service_provider_info(
         source)
     details.update(service_provider_info)
     return details
Example #4
0
 def get_details(self, source):
     offering = source
     details = {
         'offering_type': offering.type,
         'offering_name': offering.name,
         'offering_uuid': offering.uuid.hex,
         'plan_name': offering.plan.name if offering.plan else '',
     }
     service_provider_info = marketplace_utils.get_service_provider_info(source)
     details.update(service_provider_info)
     return details
 def get_details(self, source):
     offering = source
     details = {
         'name': self.get_name(offering),
         'offering_type': offering.type,
         'offering_name': offering.name,
         'offering_uuid': offering.uuid.hex,
     }
     service_provider_info = marketplace_utils.get_service_provider_info(
         source)
     details.update(service_provider_info)
     return details
Example #6
0
 def get_details(self, source):
     package = source
     details = {
         'name': utils.get_invoice_item_name(package),
         'tenant_name': package.tenant.name,
         'tenant_uuid': package.tenant.uuid.hex,
         'template_name': package.template.name,
         'template_uuid': package.template.uuid.hex,
         'template_category': package.template.get_category_display(),
     }
     service_provider_info = marketplace_utils.get_service_provider_info(source)
     details.update(service_provider_info)
     return details
Example #7
0
    def get_details(self, source):
        offering = source

        try:
            resource = marketplace_models.Resource.objects.get(scope=source)
            details = marketplace_utils.get_offering_details(resource.offering)
        except (ObjectDoesNotExist, MultipleObjectsReturned):
            details = {}

        service_provider_info = marketplace_utils.get_service_provider_info(offering)
        details.update(service_provider_info)
        details['plan_name'] = offering.plan.name if offering.plan else ''
        return details