def create_usage_plan(name, description=None, throttle=None, quota=None, region=None, key=None, keyid=None, profile=None):
 try:
  _validate_throttle(throttle)
  _validate_quota(quota)
  values = dict(name=name)
  if description:
   values['description'] = description
  if throttle:
   values['throttle'] = throttle
  if quota:
   values['quota'] = quota
  conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
  res = conn.create_usage_plan(**values)
  return {'created': True, 'result': res}
 except ClientError as e:
  return {'error': salt.utils.boto3.get_error(e)}
 except (TypeError, ValueError) as e:
  return {'error': '{0}'.format(e)}

def create_usage_plan ( name , description = None , throttle = None , quota = None , region = None , key = None , keyid = None , profile = None ) : try : _validate_throttle ( throttle ) _validate_quota ( quota ) values = dict ( name = name ) if description : values [ 'description' ] = description if throttle : values [ 'throttle' ] = throttle if quota : values [ 'quota' ] = quota conn = _get_conn ( region = region , key = key , keyid = keyid , profile = profile ) res = conn . create_usage_plan ( ** values ) return { 'created' : True , 'result' : res } except ClientError as e : return { 'error' : salt . utils . boto3 . get_error ( e ) } except ( TypeError , ValueError ) as e : return { 'error' : '{0}' . format ( e ) }
creates a new usage plan with throttling and quotas optionally applied .