pdclient

package
v0.0.152 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2016 License: GPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrInvalidDispenserResponse - error for invalid statscode response on
	//dispenser call
	ErrInvalidDispenserResponse = errors.New("invalid dispenser response statuscode")

	//ErrInvalidInnKeeperData - error for invalid data object response from innkeeper
	ErrInvalidInnKeeperData = errors.New("invalid innkeeper data object")

	//ProvisionHostInformationFieldname - map key name for provision host info in MetaData
	//of TaskResponse
	ProvisionHostInformationFieldname = "phinfo"
)

Functions

func GetRequestIDFromTaskResponse added in v0.0.141

func GetRequestIDFromTaskResponse(taskResponse TaskResponse) (requestID string, err error)

GetRequestIDFromTaskResponse - a function to get a request id from a taskresponse object

Types

type LeaseRequestBody

type LeaseRequestBody struct {
	LeaseID              string                 `json:"lease_id"`
	InventoryID          string                 `json:"inventory_id"`
	Username             string                 `json:"username"`
	Sku                  string                 `json:"sku"`
	LeaseDuration        int64                  `json:"lease_duration"`
	LeaseEndDate         int64                  `json:"lease_end_date"`
	LeaseStartDate       int64                  `json:"lease_start_date"`
	LeaseProcurementMeta map[string]interface{} `json:"procurement_meta"`
}

LeaseRequestBody - request lease body object structure

type PDClient

type PDClient struct {
	APIKey string

	URL string
	// contains filtered or unexported fields
}

PDClient - dispenser client object

func NewClient

func NewClient(apiKey string, url string, client clientDoer) *PDClient

NewClient - constructor for a new dispenser client

func (*PDClient) DeleteLease added in v0.0.143

func (s *PDClient) DeleteLease(leaseID, inventoryID, skuID string, metadata map[string]interface{}) (res *http.Response, err error)

DeleteLease -- allows a client user to make a DELETE lease call to dispenser

func (*PDClient) GetTask added in v0.0.124

func (s *PDClient) GetTask(taskID string) (task TaskResponse, res *http.Response, err error)

GetTask - wrapper to rest call to GET task from dispenser

func (*PDClient) PostLease

func (s *PDClient) PostLease(leaseID, inventoryID, skuID string, leaseDaysDuration int64) (leaseCreateResponse TaskResponse, res *http.Response, err error)

PostLease -- allows a client user to post a lease to dispenser

type ProvisionHostData added in v0.0.141

type ProvisionHostData struct {
	RequestID string `json:"requestid"`
}

ProvisionHostData -

type ProvisionHostInfo added in v0.0.141

type ProvisionHostInfo struct {
	Data []ProvisionHostData `json:"data"`
}

ProvisionHostInfo -

type TaskResponse added in v0.0.124

type TaskResponse struct {
	ID         string                 `json:"ID"`
	Timestamp  int64                  `json:"Timestamp"`
	Expires    int64                  `json:"Expires"`
	Status     string                 `json:"Status"`
	Profile    string                 `json:"Profile"`
	CallerName string                 `json:"CallerName"`
	MetaData   map[string]interface{} `json:"MetaData"`
}

TaskResponse - a response object for a get task call

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL