Skip to content

Commit 600ecd3

Browse files
authored
Merge pull request gophercloud#3403 from kayrus/subnet-segment-id
neutron: add segment_id support to subnets
2 parents 80b8a4f + af9aab7 commit 600ecd3

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

openstack/networking/v2/subnets/requests.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ type ListOpts struct {
4343
NotTags string `q:"not-tags"`
4444
NotTagsAny string `q:"not-tags-any"`
4545
RevisionNumber *int `q:"revision_number"`
46+
SegmentID string `q:"segment_id"`
4647
}
4748

4849
// ToSubnetListQuery formats a ListOpts into a query string.
@@ -147,6 +148,10 @@ type CreateOpts struct {
147148
// Prefixlen is used when user creates a subnet from the subnetpool. It will
148149
// overwrite the "default_prefixlen" value of the referenced subnetpool.
149150
Prefixlen int `json:"prefixlen,omitempty"`
151+
152+
// SegmentID is a network segment the subnet is associated with. It is
153+
// available when segment extension is enabled.
154+
SegmentID string `json:"segment_id,omitempty"`
150155
}
151156

152157
// ToSubnetCreateMap builds a request body from CreateOpts.
@@ -219,6 +224,10 @@ type UpdateOpts struct {
219224
// will set revision_number=%s. If the revision number does not match, the
220225
// update will fail.
221226
RevisionNumber *int `json:"-" h:"If-Match"`
227+
228+
// SegmentID is a network segment the subnet is associated with. It is
229+
// available when segment extension is enabled.
230+
SegmentID *string `json:"segment_id,omitempty"`
222231
}
223232

224233
// ToSubnetUpdateMap builds a request body from UpdateOpts.

openstack/networking/v2/subnets/results.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ type Subnet struct {
124124
// RevisionNumber optionally set via extensions/standard-attr-revisions
125125
RevisionNumber int `json:"revision_number"`
126126

127+
// SegmentID of a network segment the subnet is associated with. It is
128+
// available when segment extension is enabled.
129+
SegmentID string `json:"segment_id"`
130+
127131
// Timestamp when the subnet was created
128132
CreatedAt time.Time `json:"created_at"`
129133

0 commit comments

Comments
 (0)