def create_api(name, description, cloneFrom=None, region=None, key=None, keyid=None, profile=None):
 try:
  conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
  if cloneFrom:
   api = conn.create_rest_api(name=name, description=description, cloneFrom=cloneFrom)
  else:
   api = conn.create_rest_api(name=name, description=description)
  api = _convert_datetime_str(api)
  return ({'created': True, 'restapi': api} if api else {'created': False})
 except ClientError as e:
  return {'created': False, 'error': salt.utils.boto3.get_error(e)}

def create_api ( name , description , cloneFrom = None , region = None , key = None , keyid = None , profile = None ) : try : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) if cloneFrom : api = conn . create_rest_api ( name = name , description = description , cloneFrom = cloneFrom ) else : api = conn . create_rest_api ( name = name , description = description ) api = _convert_datetime_str ( api ) return ( { 'created' : True , 'restapi' : api } if api else { 'created' : False } ) except ClientError as e : return { 'created' : False , 'error' : salt . utils . boto3 . get_error ( e ) }
create a new rest api service with the given name returns {created: true} if the rest api was created and returns {created: false} if the rest api was not created .