luci: go.chromium.org/luci/gce/appengine/model Index | Files

package model

import "go.chromium.org/luci/gce/appengine/model"

Package model contains datastore model definitions.

Index

Package Files

model.go

Constants

const ConfigKind = "Config"

ConfigKind is a config entity's kind in the datastore.

const ProjectKind = "Project"

ProjectKind is a project entity's kind in the datastore.

const VMKind = "VM"

VMKind is a VM entity's kind in the datastore.

type Config Uses

type Config struct {

    // ID is the unique identifier for this config.
    ID  string `gae:"$id"`
    // Config is the config.Config representation of this entity.
    // Indexing is not useful here since this field contains textproto.
    // Additionally, indexed string fields are limited to 1500 bytes.
    // https://cloud.google.com/datastore/docs/concepts/limits.
    // noindex is not respected here. See config.Config.ToProperty.
    Config config.Config `gae:"config,noindex"`
    // contains filtered or unexported fields
}

Config is a root entity representing a config for one type of VMs. VM entities should be created for each config entity.

type NetworkInterface Uses

type NetworkInterface struct {
    // ExternalIP is an external network address assigned to a GCE instance.
    // GCE currently supports at most one external IP address per network
    // interface.
    ExternalIP string
    // Internal is an internal network address assigned to a GCE instance.
    InternalIP string
}

NetworkInterface is a network interface attached to a GCE instance.

type Project Uses

type Project struct {

    // ID is the unique identifier for this project.
    ID  string `gae:"$id"`
    // Config is the projects.Config representation of this entity.
    // noindex is not respected here. See projects.Config.ToProperty.
    Config projects.Config `gae:"config,noindex"`
    // contains filtered or unexported fields
}

Project is a root entity representing a GCP project. GCE quota utilization is reported for each metric in each region.

type VM Uses

type VM struct {

    // ID is the unique identifier for this VM.
    ID  string `gae:"$id"`
    // Attributes is the config.VM describing the GCE instance to create.
    // Indexing is not useful here since this field contains textproto.
    // noindex is not respected here. See config.VM.ToProperty.
    Attributes config.VM `gae:"attributes,noindex"`
    // AttributesIndexed is a slice of strings in "key:value" form where the key is
    // the path to a field in Attributes and the value is its associated value.
    // Allows fields from Attributes to be indexed.
    AttributesIndexed []string `gae:"attributes_indexed"`
    // Config is the ID of the config this VM was created from.
    Config string `gae:"config"`
    // Connected is the Unix time when the GCE instance connected to Swarming.
    Connected int64 `gae:"connected"`
    // Created is the Unix time when the GCE instance was created.
    Created int64 `gae:"created"`
    // Drained indicates whether or not this VM is drained.
    // A GCE instance should not be created for a drained VM.
    // Any existing GCE instance should be deleted regardless of deadline.
    Drained bool `gae:"drained"`
    // Hostname is the short hostname of the GCE instance to create.
    Hostname string `gae:"hostname"`
    // Image is the source image for the boot disk of the GCE instance.
    Image string `gae:"image"`
    // Index is this VM's number with respect to its config.
    Index int32 `gae:"index"`
    // Lifetime is the number of seconds the GCE instance should live for.
    Lifetime int64 `gae:"lifetime"`
    // NetworkInterfaces is a slice of network interfaces attached to this created
    // GCE instance. Empty if the instance is not yet created.
    NetworkInterfaces []NetworkInterface `gae:"network_interfaces"`
    // Prefix is the prefix to use when naming the GCE instance.
    Prefix string `gae:"prefix"`
    // Revision is the config revision this VM was created from.
    Revision string `gae:"revision"`
    // Swarming is hostname of the Swarming server the GCE instance connects to.
    Swarming string `gae:"swarming"`
    // Timeout is the number of seconds the GCE instance has to connect to Swarming.
    Timeout int64 `gae:"timeout"`
    // URL is the URL of the created GCE instance.
    URL string `gae:"url"`
    // contains filtered or unexported fields
}

VM is a root entity representing a configured VM. GCE instances should be created for each VM entity.

func (*VM) GetInstance Uses

func (vm *VM) GetInstance() *compute.Instance

GetInstance returns a *compute.Instance representation of this VM.

func (*VM) IndexAttributes Uses

func (vm *VM) IndexAttributes()

IndexAttributes sets indexable fields of vm.Attributes in AttributesIndexed.

Package model imports 6 packages (graph) and is imported by 3 packages. Updated 2019-05-23. Refresh now. Tools for package owners.