github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/api/base/types.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package base
     5  
     6  import (
     7  	"time"
     8  
     9  	"github.com/juju/juju/instance"
    10  	"github.com/juju/juju/status"
    11  )
    12  
    13  // UserModel holds information about a model and the last
    14  // time the model was accessed for a particular user. This is a client
    15  // side structure that translates the owner tag into a user facing string.
    16  type UserModel struct {
    17  	Name           string
    18  	UUID           string
    19  	Owner          string
    20  	LastConnection *time.Time
    21  }
    22  
    23  // ModelStatus holds information about the status of a juju model.
    24  type ModelStatus struct {
    25  	UUID               string
    26  	Life               string
    27  	Owner              string
    28  	TotalMachineCount  int
    29  	CoreCount          int
    30  	HostedMachineCount int
    31  	ServiceCount       int
    32  	Machines           []Machine
    33  }
    34  
    35  // Machine holds information about a machine in a juju model.
    36  type Machine struct {
    37  	Id         string
    38  	InstanceId string
    39  	HasVote    bool
    40  	WantsVote  bool
    41  	Status     string
    42  	Hardware   *instance.HardwareCharacteristics
    43  }
    44  
    45  // ModelInfo holds information about a model.
    46  type ModelInfo struct {
    47  	Name            string
    48  	UUID            string
    49  	ControllerUUID  string
    50  	ProviderType    string
    51  	DefaultSeries   string
    52  	Cloud           string
    53  	CloudRegion     string
    54  	CloudCredential string
    55  	Owner           string
    56  	Life            string
    57  	Status          Status
    58  	Users           []UserInfo
    59  	Machines        []Machine
    60  }
    61  
    62  // Status represents the status of a machine, application, or unit.
    63  type Status struct {
    64  	Status status.Status
    65  	Info   string
    66  	Data   map[string]interface{}
    67  	Since  *time.Time
    68  }
    69  
    70  // UserInfo holds information about a user in a juju model.
    71  type UserInfo struct {
    72  	UserName       string
    73  	DisplayName    string
    74  	LastConnection *time.Time
    75  	Access         string
    76  }