def delete_api_resources(restApiId, path, region=None, key=None, keyid=None, profile=None):
 if (path == '/'):
  return {'deleted': False, 'error': 'use delete_api to remove the root resource'}
 try:
  conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
  r = describe_api_resource(restApiId, path, region=region, key=key, keyid=keyid, profile=profile)
  resource = r.get('resource')
  if resource:
   conn.delete_resource(restApiId=restApiId, resourceId=resource['id'])
   return {'deleted': True}
  else:
   return {'deleted': False, 'error': 'no resource found by {0}'.format(path)}
 except ClientError as e:
  return {'created': False, 'error': salt.utils.boto3.get_error(e)}

def delete_api_resources ( restApiId , path , region = None , key = None , keyid = None , profile = None ) : if ( path == '/' ) : return { 'deleted' : False , 'error' : 'use delete_api to remove the root resource' } try : conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) r = describe_api_resource ( restApiId , path , region = region , key = key , keyid = keyid , profile = profile ) resource = r . get ( 'resource' ) if resource : conn . delete_resource ( restApiId = restApiId , resourceId = resource [ 'id' ] ) return { 'deleted' : True } else : return { 'deleted' : False , 'error' : 'no resource found by {0}' . format ( path ) } except ClientError as e : return { 'created' : False , 'error' : salt . utils . boto3 . get_error ( e ) }
given restapiid and an absolute resource path .