github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/api/statushistory/pruner.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package statushistory
     5  
     6  import (
     7  	"github.com/juju/juju/api/base"
     8  	"github.com/juju/juju/apiserver/params"
     9  )
    10  
    11  const apiName = "StatusHistory"
    12  
    13  // Facade allows calls to "StatusHistory" endpoints
    14  type Facade struct {
    15  	facade base.FacadeCaller
    16  }
    17  
    18  // NewFacade returns a status "StatusHistory" Facade.
    19  func NewFacade(caller base.APICaller) *Facade {
    20  	facadeCaller := base.NewFacadeCaller(caller, apiName)
    21  	return &Facade{facadeCaller}
    22  }
    23  
    24  // Prune calls "StatusHistory.Prune"
    25  func (s *Facade) Prune(maxLogsPerEntity int) error {
    26  	p := params.StatusHistoryPruneArgs{
    27  		MaxLogsPerEntity: maxLogsPerEntity,
    28  	}
    29  	return s.facade.FacadeCall("Prune", p, nil)
    30  }