+
+ slice_request = {
+ 'type' : 'slice',
+ 'id' : None,
+ 'user_hrn' : user_hrn,
+ 'email' : user_email,
+ 'timestamp' : time.time(),
+ 'authority_hrn' : authority_hrn,
+ 'organization' : wsgi_request.POST.get('org_name', ''),
+ 'slice_name' : wsgi_request.POST.get('slice_name', ''),
+ 'exp_url' : wsgi_request.POST.get('exp_url', ''),
+ 'purpose' : wsgi_request.POST.get('purpose', ''),
+ 'current_site' : current_site
+ }
+
+ # create slice_hrn based on authority_hrn and slice_name
+ slice_name = slice_request['slice_name']
+ req_slice_hrn = authority_hrn + '.' + slice_name
+ # comparing requested slice_hrn with the existing slice_hrn
+ slice_query = Query().get('slice').select('slice_hrn','parent_authority').filter_by('parent_authority','==',authority_hrn)
+ slice_details_sfa = execute_admin_query(wsgi_request, slice_query)
+ for _slice in slice_details_sfa:
+ if _slice['slice_hrn'] == req_slice_hrn:
+ errors.append('Slice already exists. Please use a different slice name.')
+
+ exp_url = slice_request['exp_url']
+