diff options
Diffstat (limited to 'onap-client/onap_client/so/service_instance.py')
-rw-r--r-- | onap-client/onap_client/so/service_instance.py | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/onap-client/onap_client/so/service_instance.py b/onap-client/onap_client/so/service_instance.py index 6398ac8..10271fa 100644 --- a/onap-client/onap_client/so/service_instance.py +++ b/onap-client/onap_client/so/service_instance.py @@ -74,43 +74,15 @@ class ServiceInstance(Resource): "owning_entity_name": {"type": str, "required": True}, } - def __init__( - self, - service_instance_name, - requestor_id, - model_name, - model_version, - tenant_name, - cloud_owner, - cloud_region, - api_type, - service_type, - customer_name, - project_name, - owning_entity_name, - ): - self.oc = Client() - - instance_input = {} - - tenant_id = get_tenant_id(cloud_region, cloud_owner, tenant_name) - - instance_input["service_instance_name"] = service_instance_name - instance_input["requestor_id"] = requestor_id - instance_input["model_name"] = model_name - instance_input["model_version"] = model_version + def _create(self, instance_input): + tenant_id = get_tenant_id( + instance_input.get("cloud_region"), + instance_input.get("cloud_owner"), + instance_input.get("tenant_name") + ) instance_input["tenant_id"] = tenant_id - instance_input["cloud_owner"] = cloud_owner - instance_input["cloud_region"] = cloud_region - instance_input["api_type"] = api_type - instance_input["service_type"] = service_type - instance_input["customer_id"] = customer_name - instance_input["project_name"] = project_name - instance_input["owning_entity_name"] = owning_entity_name - - super().__init__(instance_input) + instance_input["customer_id"] = instance_input.get("customer_name") - def _create(self, instance_input): service_model = self.oc.sdc.service.get_sdc_service( catalog_service_id=sdc.service.get_service_id( instance_input.get("model_name") @@ -128,12 +100,6 @@ class ServiceInstance(Resource): return create_service_instance(instance_input) - def _post_create(self): - pass - - def _submit(self): - pass - @utility def get_service_instance(instance_name): |