github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/apiserver/params/payloads_unit.go (about)

     1  // Copyright 2017 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package params
     5  
     6  // TrackPayloadArgs are the arguments for the
     7  // PayloadsHookContext.Track endpoint.
     8  type TrackPayloadArgs struct {
     9  	// Payloads is the list of Payloads to track
    10  	Payloads []Payload `json:"payloads"`
    11  }
    12  
    13  // LookUpPayloadArgs are the arguments for the LookUp endpoint.
    14  type LookUpPayloadArgs struct {
    15  	// Args is the list of arguments to pass to this function.
    16  	Args []LookUpPayloadArg `json:"args"`
    17  }
    18  
    19  // LookUpPayloadArg contains all the information necessary to identify
    20  // a payload.
    21  type LookUpPayloadArg struct {
    22  	// Name is the payload name.
    23  	Name string `json:"name"`
    24  
    25  	// ID uniquely identifies the payload for the given name.
    26  	ID string `json:"id"`
    27  }
    28  
    29  // SetPayloadStatusArgs are the arguments for the
    30  // PayloadsHookContext.SetStatus endpoint.
    31  type SetPayloadStatusArgs struct {
    32  	// Args is the list of arguments to pass to this function.
    33  	Args []SetPayloadStatusArg `json:"args"`
    34  }
    35  
    36  // SetPayloadStatusArg are the arguments for a single call to the
    37  // SetStatus endpoint.
    38  type SetPayloadStatusArg struct {
    39  	Entity
    40  
    41  	// Status is the new status of the payload.
    42  	Status string `json:"status"`
    43  }
    44  
    45  // PayloadResults is the result for a call that makes one or more
    46  // requests about payloads.
    47  type PayloadResults struct {
    48  	Results []PayloadResult `json:"results"`
    49  }
    50  
    51  // PayloadResult contains the result for a single call.
    52  type PayloadResult struct {
    53  	Entity
    54  
    55  	// Payload holds the details of the payload, if any.
    56  	Payload *Payload `json:"payload"`
    57  
    58  	// NotFound indicates that the payload was not found in state.
    59  	NotFound bool `json:"not-found"`
    60  
    61  	// Error is the error (if any) for the call referring to ID.
    62  	Error *Error `json:"error,omitempty"`
    63  }