github.com/makyo/juju@v0.0.0-20160425123129-2608902037e9/payload/api/private/data.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package private
     5  
     6  // TODO(ericsnow) Eliminate the params import if possible.
     7  
     8  import (
     9  	"github.com/juju/juju/apiserver/params"
    10  	"github.com/juju/juju/payload/api"
    11  )
    12  
    13  // TrackArgs are the arguments for the Track endpoint.
    14  type TrackArgs struct {
    15  	// Payloads is the list of Payloads to track
    16  	Payloads []api.Payload
    17  }
    18  
    19  // List uses params.Entities.
    20  
    21  // LookUpArgs are the arguments for the LookUp endpoint.
    22  type LookUpArgs struct {
    23  	// Args is the list of arguments to pass to this function.
    24  	Args []LookUpArg
    25  }
    26  
    27  // LookUpArg contains all the information necessary to identify a payload.
    28  type LookUpArg struct {
    29  	// Name is the payload name.
    30  	Name string
    31  	// ID uniquely identifies the payload for the given name.
    32  	ID string
    33  }
    34  
    35  // SetStatusArgs are the arguments for the SetStatus endpoint.
    36  type SetStatusArgs struct {
    37  	// Args is the list of arguments to pass to this function.
    38  	Args []SetStatusArg
    39  }
    40  
    41  // SetStatusArg are the arguments for a single call to the
    42  // SetStatus endpoint.
    43  type SetStatusArg struct {
    44  	params.Entity
    45  	// Status is the new status of the payload.
    46  	Status string
    47  }
    48  
    49  // Untrack uses params.Entities.
    50  
    51  // PayloadResults is the result for a call that makes one or more requests
    52  // about payloads.
    53  type PayloadResults struct {
    54  	Results []PayloadResult
    55  }
    56  
    57  // TODO(ericsnow) Eliminate the NotFound field?
    58  
    59  // PayloadResult contains the result for a single call.
    60  type PayloadResult struct {
    61  	params.Entity
    62  	// Payload holds the details of the payload, if any.
    63  	Payload *api.Payload
    64  	// NotFound indicates that the payload was not found in state.
    65  	NotFound bool
    66  	// Error is the error (if any) for the call referring to ID.
    67  	Error *params.Error
    68  }