Help us shape the future of Go! Take the 2026 Go Developer Survey

secgroups

package
v0.0.0-...-9ec2bbf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

README

Secgroups

This guide describes the public Go APIs and their contracts against the pinned Gophercloud and Python openstacksdk sources. Support decisions apply to each operation below.

See the support ledger for status definitions and shared limitations.

Operation contracts

gophercloud:compute/v2/secgroups.Create

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.Create

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.WithCreateOptions

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.WithCreateField

  • Create POSTs {"security_group":{...}} to os-security-groups, requires name and rejects a core-key collision before HTTP, decodes numeric or string group/rule IDs as strings and accepts only 200. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.Get

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.Get

  • Get GETs os-security-groups/{id}, decodes the group with rules, ip_range and peer group and accepts only 200. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.Update

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.Update

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.WithUpdateOptions

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.WithUpdateField

  • Update PUTs {"security_group":{...}} to os-security-groups/{id} sending an explicit empty pointer description and accepts only 200. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.Delete

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.Delete

  • Delete DELETEs os-security-groups/{id} and accepts only 202/204. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.List

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.List

  • List GETs os-security-groups as a single page and yields groups with numeric or string IDs as strings, reporting native page status errors. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.ListByServer

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.ListByServer

  • ListByServer GETs servers/{server}/os-security-groups as a single page. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.CreateRule

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.CreateRule

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.WithCreateRuleOptions

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.WithCreateRuleField

  • CreateRule POSTs {"security_group_rule":{...}} to os-security-group-rules always sending from/to ports (zero included), requires parent group and protocol plus at least one of CIDR or group_id before HTTP, decodes numeric or string rule/parent IDs and accepts only 200. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.DeleteRule

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.DeleteRule

  • DeleteRule DELETEs os-security-group-rules/{id} and accepts only 202/204. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.AddServer

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.AddServer

  • AddServer POSTs {"addSecurityGroup":{"name":...}} to servers/{server}/action and accepts only the native POST default 201/202. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.
gophercloud:compute/v2/secgroups.RemoveServer

Status: go_mapping.

Go API:

  • github.com/JSYoo5B/go-openstacksdk/compute/v2/secgroups.API.RemoveServer

  • RemoveServer POSTs {"removeSecurityGroup":{"name":...}} to servers/{server}/action and accepts only the native POST default 201/202. Tests: compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupRoutesBodiesAndDecode, compute/v2/secgroups/native_contracts_test.go:TestNativeSecurityGroupStatusesAndPreflight.

Python/Go differences:

  • This declaration maps the Gophercloud native compute/v2/secgroups proxy call only; the API was removed at Compute microversion 2.36 and Neutron security groups are reviewed separately.
  • The SDK adds only request.Wrap operation context (not on list streams) and the documented extension merge; native URL construction, OkCodes and decoding are unchanged.

References

Documentation

Overview

Code generated by sdkgen from Gophercloud v2.15.0; DO NOT EDIT.

Code generated by sdkgen from Gophercloud v2.15.0; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Resources *resource.Collection[SecurityGroup]
	// contains filtered or unexported fields
}

API owns typed operations and their shared resource policies.

func New

func New(client *gophercloud.ServiceClient) *API

func (*API) AddServer

func (a *API) AddServer(ctx context.Context, serverID string, groupName string) error

AddServer invokes the upstream API with library-owned builders and result handling.

func (*API) All

func (a *API) All(ctx context.Context, options ...resource.ListOption) ([]*SecurityGroup, error)

func (*API) Create

func (a *API) Create(ctx context.Context, opts CreateOpts, options ...CreateOption) (*SecurityGroup, error)

Create invokes the upstream API with library-owned builders and result handling.

func (*API) CreateRule

func (a *API) CreateRule(ctx context.Context, opts CreateRuleOpts, options ...CreateRuleOption) (*Rule, error)

CreateRule invokes the upstream API with library-owned builders and result handling.

func (*API) Delete

func (a *API) Delete(ctx context.Context, id string) error

Delete invokes the upstream API with library-owned builders and result handling.

func (*API) DeleteRule

func (a *API) DeleteRule(ctx context.Context, id string) error

DeleteRule invokes the upstream API with library-owned builders and result handling.

func (*API) Find

func (a *API) Find(ctx context.Context, ref resource.Ref, options ...resource.LookupOption) (*SecurityGroup, error)

func (*API) Get

func (a *API) Get(ctx context.Context, id string) (*SecurityGroup, error)

Get invokes the upstream API with library-owned builders and result handling.

func (*API) List

func (a *API) List(ctx context.Context) iter.Seq2[*SecurityGroup, error]

List invokes the upstream API with library-owned builders and result handling.

func (*API) ListByServer

func (a *API) ListByServer(ctx context.Context, serverID string) iter.Seq2[*SecurityGroup, error]

ListByServer invokes the upstream API with library-owned builders and result handling.

func (*API) RawClient

func (a *API) RawClient() *gophercloud.ServiceClient

func (*API) Remove

func (a *API) Remove(ctx context.Context, ref resource.Ref, options ...resource.LookupOption) error

func (*API) RemoveServer

func (a *API) RemoveServer(ctx context.Context, serverID string, groupName string) error

RemoveServer invokes the upstream API with library-owned builders and result handling.

func (*API) Update

func (a *API) Update(ctx context.Context, id string, opts UpdateOpts, options ...UpdateOption) (*SecurityGroup, error)

Update invokes the upstream API with library-owned builders and result handling.

func (*API) WaitFor

func (a *API) WaitFor(ctx context.Context, ref resource.Ref, status string, options ...resource.WaitOption) (*SecurityGroup, error)

func (*API) WaitForDeletion

func (a *API) WaitForDeletion(ctx context.Context, ref resource.Ref, options ...resource.WaitOption) error

type AddServerResult

type AddServerResult = upstream.AddServerResult

type CreateOption

type CreateOption = request.Option[CreateOpts]

func WithCreateField

func WithCreateField(key string, value any) CreateOption

func WithCreateOptions

func WithCreateOptions(value CreateOpts) CreateOption

type CreateOpts

type CreateOpts = upstream.CreateOpts

type CreateResult

type CreateResult = upstream.CreateResult

type CreateRuleOption

type CreateRuleOption = request.Option[CreateRuleOpts]

func WithCreateRuleField

func WithCreateRuleField(key string, value any) CreateRuleOption

func WithCreateRuleOptions

func WithCreateRuleOptions(value CreateRuleOpts) CreateRuleOption

type CreateRuleOpts

type CreateRuleOpts = upstream.CreateRuleOpts

type CreateRuleResult

type CreateRuleResult = upstream.CreateRuleResult

type DeleteResult

type DeleteResult = upstream.DeleteResult

type DeleteRuleResult

type DeleteRuleResult = upstream.DeleteRuleResult

type GetResult

type GetResult = upstream.GetResult

type Group

type Group = upstream.Group

type IPRange

type IPRange = upstream.IPRange

type RemoveServerResult

type RemoveServerResult = upstream.RemoveServerResult

type Rule

type Rule = upstream.Rule

type SecurityGroup

type SecurityGroup = upstream.SecurityGroup

type SecurityGroupPage

type SecurityGroupPage = upstream.SecurityGroupPage

type UpdateOption

type UpdateOption = request.Option[UpdateOpts]

func WithUpdateField

func WithUpdateField(key string, value any) UpdateOption

func WithUpdateOptions

func WithUpdateOptions(value UpdateOpts) UpdateOption

type UpdateOpts

type UpdateOpts = upstream.UpdateOpts

type UpdateResult

type UpdateResult = upstream.UpdateResult

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL