Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OldAddress27 ¶
type OldAddress27 struct { Value string `bson:"value"` AddressType string `bson:"addresstype"` Scope string `bson:"networkscope,omitempty"` Origin string `bson:"origin,omitempty"` SpaceName string `bson:"spacename,omitempty"` SpaceID string `bson:"spaceid,omitempty"` }
OldAddress27 represents the address stored prior to version 2.7 in the collections: machines, cloudservices and cloudcontainers. Note that we can reuse this type for the new form because:
- `omitempty` on SpaceName means we can set it as "" to remove.
- The bson field `spaceid` is the same for the old SpaceProviderId. and the new SpaceID.
func (OldAddress27) Upgrade ¶
func (a OldAddress27) Upgrade(lookup network.SpaceInfos) (OldAddress27, error)
Upgrade accepts an address and a name-to-ID space lookup and returns a new address representation based on whether space name/ID are populated. An error is returned if the address has a non-empty space name that we cannot map to an ID.
type OldPortRangeDoc28 ¶
type OldPortRangeDoc28 struct { UnitName string `bson:"unitname"` FromPort int `bson:"fromport"` ToPort int `bson:"toport"` Protocol string `bson:"protocol"` }
OldPortsDoc28 represents a port range entry document prior to the 2.9 schema changes.
type OldPortsDoc28 ¶
type OldPortsDoc28 struct { DocID string `bson:"_id"` ModelUUID string `bson:"model-uuid"` MachineID string `bson:"machine-id"` SubnetID string `bson:"subnet-id"` Ports []OldPortRangeDoc28 `bson:"ports"` TxnRevno int64 `bson:"txn-revno"` }
OldPortsDoc28 represents a ports document prior to the 2.9 schema changes.
Click to show internal directories.
Click to hide internal directories.