github.com/go-chef/chef@v0.30.1/updated_since.go (about)

     1  package chef
     2  
     3  import (
     4  	"errors"
     5  	"strconv"
     6  )
     7  
     8  type UpdatedSinceService struct {
     9  	client *Client
    10  }
    11  
    12  // UpdatedSince represents the body of the returned information.
    13  type UpdatedSince struct {
    14  	Action string
    15  	Id     int64
    16  	Path   string
    17  }
    18  
    19  // Since gets available cookbook version information.
    20  //
    21  // https://docs.chef.io/api_chef_server/#updated_since
    22  // This end point has long since been deprecated and is no longer available
    23  // Calls will always return 404 not found errors
    24  func (e UpdatedSinceService) Get(sequenceId int64) (updated []UpdatedSince, err error) {
    25  	url := "updated_since?seq=" + strconv.FormatInt(sequenceId, 10)
    26  	err = e.client.magicRequestDecoder("GET", url, nil, &updated)
    27  	if err != nil {
    28  		err = errors.New("Update_since is a deprecated endpoint and always returns 404.")
    29  	}
    30  	return
    31  }