-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathreference.go
45 lines (39 loc) · 1.19 KB
/
reference.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
//
package contrail
// LinkAttribute is an attribute on a link between two objects.
type LinkAttribute interface {
}
// A Reference represents a link (and optional associated metadata) between
// two objects.
type Reference struct {
To []string `json:"to,omitempty"`
Uuid string `json:"uuid,omitempty"`
Href string `json:"href,omitempty"`
Attr LinkAttribute `json:"attr,omitempty"`
}
// ReferenceList is a slice (list) of references
type ReferenceList []Reference
// A ReferencePair is the data used to add a reference.
type ReferencePair struct {
Object IObject
Attribute LinkAttribute
}
// ReferenceUpdateMsg is the data type used by POST requests to http://server:port/ref-update
type ReferenceUpdateMsg struct {
// object typename
Type string `json:"type"`
// object uuid
Uuid string `json:"uuid"`
// object field (without the trailing _refs and tr/_/-/)
RefType string `json:"ref-type"`
// reference uuid
RefUuid string `json:"ref-uuid"`
// reference fqn
RefFQName []string `json:"ref-fq-name"`
// ADD, DELETE
Operation string `json:"operation"`
// Attribute
Attr LinkAttribute `json:"attr"`
}