gophercloud: github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups Index | Files

package secgroups

import "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/secgroups"

Index

Package Files

doc.go requests.go results.go urls.go

func AddServerToGroup Uses

func AddServerToGroup(client *gophercloud.ServiceClient, serverID, groupName string) gophercloud.ErrResult

AddServerToGroup will associate a server and a security group, enforcing the rules of the group on the server.

func Delete Uses

func Delete(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult

Delete will permanently delete a security group from the project.

func DeleteRule Uses

func DeleteRule(client *gophercloud.ServiceClient, id string) gophercloud.ErrResult

DeleteRule will permanently delete a rule from a security group.

func ExtractSecurityGroups Uses

func ExtractSecurityGroups(page pagination.Page) ([]SecurityGroup, error)

ExtractSecurityGroups returns a slice of SecurityGroups contained in a single page of results.

func List Uses

func List(client *gophercloud.ServiceClient) pagination.Pager

List will return a collection of all the security groups for a particular tenant.

func ListByServer Uses

func ListByServer(client *gophercloud.ServiceClient, serverID string) pagination.Pager

ListByServer will return a collection of all the security groups which are associated with a particular server.

func RemoveServerFromGroup Uses

func RemoveServerFromGroup(client *gophercloud.ServiceClient, serverID, groupName string) gophercloud.ErrResult

RemoveServerFromGroup will disassociate a server from a security group.

type CreateOpts Uses

type CreateOpts GroupOpts

CreateOpts is the struct responsible for creating a security group.

func (CreateOpts) ToSecGroupCreateMap Uses

func (opts CreateOpts) ToSecGroupCreateMap() (map[string]interface{}, error)

ToSecGroupCreateMap builds the create options into a serializable format.

type CreateOptsBuilder Uses

type CreateOptsBuilder interface {
    ToSecGroupCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder builds the create options into a serializable format.

type CreateResult Uses

type CreateResult struct {
    // contains filtered or unexported fields
}

CreateResult represents the result of a create operation.

func Create Uses

func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult

Create will create a new security group.

func (CreateResult) Extract Uses

func (r CreateResult) Extract() (*SecurityGroup, error)

Extract will extract a SecurityGroup struct from most responses.

type CreateRuleOpts Uses

type CreateRuleOpts struct {
    // Required - the ID of the group that this rule will be added to.
    ParentGroupID string `json:"parent_group_id"`

    // Required - the lower bound of the port range that will be opened.
    FromPort int `json:"from_port"`

    // Required - the upper bound of the port range that will be opened.
    ToPort int `json:"to_port"`

    // Required - the protocol type that will be allowed, e.g. TCP.
    IPProtocol string `json:"ip_protocol"`

    // ONLY required if FromGroupID is blank. This represents the IP range that
    // will be the source of network traffic to your security group. Use
    // 0.0.0.0/0 to allow all IP addresses.
    CIDR string `json:"cidr,omitempty"`

    // ONLY required if CIDR is blank. This value represents the ID of a group
    // that forwards traffic to the parent group. So, instead of accepting
    // network traffic from an entire IP range, you can instead refine the
    // inbound source by an existing security group.
    FromGroupID string `json:"group_id,omitempty"`
}

CreateRuleOpts represents the configuration for adding a new rule to an existing security group.

func (CreateRuleOpts) ToRuleCreateMap Uses

func (opts CreateRuleOpts) ToRuleCreateMap() (map[string]interface{}, error)

ToRuleCreateMap builds the create rule options into a serializable format.

type CreateRuleOptsBuilder Uses

type CreateRuleOptsBuilder interface {
    ToRuleCreateMap() (map[string]interface{}, error)
}

CreateRuleOptsBuilder builds the create rule options into a serializable format.

type CreateRuleResult Uses

type CreateRuleResult struct {
    gophercloud.Result
}

CreateRuleResult represents the result when adding rules to a security group.

func CreateRule Uses

func CreateRule(client *gophercloud.ServiceClient, opts CreateRuleOptsBuilder) CreateRuleResult

CreateRule will add a new rule to an existing security group (whose ID is specified in CreateRuleOpts). You have the option of controlling inbound traffic from either an IP range (CIDR) or from another security group.

func (CreateRuleResult) Extract Uses

func (r CreateRuleResult) Extract() (*Rule, error)

Extract will extract a Rule struct from a CreateRuleResult.

type GetResult Uses

type GetResult struct {
    // contains filtered or unexported fields
}

GetResult represents the result of a get operation.

func Get Uses

func Get(client *gophercloud.ServiceClient, id string) GetResult

Get will return details for a particular security group.

func (GetResult) Extract Uses

func (r GetResult) Extract() (*SecurityGroup, error)

Extract will extract a SecurityGroup struct from most responses.

type Group Uses

type Group struct {
    TenantID string `mapstructure:"tenant_id"`
    Name     string
}

Group represents a group.

type GroupOpts Uses

type GroupOpts struct {
    // Required - the name of your security group.
    Name string `json:"name"`

    // Required - the description of your security group.
    Description string `json:"description"`
}

GroupOpts is the underlying struct responsible for creating or updating security groups. It therefore represents the mutable attributes of a security group.

type IPRange Uses

type IPRange struct {
    CIDR string
}

IPRange represents the IP range whose traffic will be accepted by the security group.

type Rule Uses

type Rule struct {
    // The unique ID. If Neutron is installed, this ID will be
    // represented as a string UUID; if Neutron is not installed, it will be a
    // numeric ID. For the sake of consistency, we always cast it to a string.
    ID  string

    // The lower bound of the port range which this security group should open up
    FromPort int `mapstructure:"from_port"`

    // The upper bound of the port range which this security group should open up
    ToPort int `mapstructure:"to_port"`

    // The IP protocol (e.g. TCP) which the security group accepts
    IPProtocol string `mapstructure:"ip_protocol"`

    // The CIDR IP range whose traffic can be received
    IPRange IPRange `mapstructure:"ip_range"`

    // The security group ID to which this rule belongs
    ParentGroupID string `mapstructure:"parent_group_id"`

    // Not documented.
    Group Group
}

Rule represents a security group rule, a policy which determines how a security group operates and what inbound traffic it allows in.

type SecurityGroup Uses

type SecurityGroup struct {
    // The unique ID of the group. If Neutron is installed, this ID will be
    // represented as a string UUID; if Neutron is not installed, it will be a
    // numeric ID. For the sake of consistency, we always cast it to a string.
    ID  string

    // The human-readable name of the group, which needs to be unique.
    Name string

    // The human-readable description of the group.
    Description string

    // The rules which determine how this security group operates.
    Rules []Rule

    // The ID of the tenant to which this security group belongs.
    TenantID string `mapstructure:"tenant_id"`
}

SecurityGroup represents a security group.

type SecurityGroupPage Uses

type SecurityGroupPage struct {
    pagination.SinglePageBase
}

SecurityGroupPage is a single page of a SecurityGroup collection.

func (SecurityGroupPage) IsEmpty Uses

func (page SecurityGroupPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a page of Security Groups contains any results.

type UpdateOpts Uses

type UpdateOpts GroupOpts

UpdateOpts is the struct responsible for updating an existing security group.

func (UpdateOpts) ToSecGroupUpdateMap Uses

func (opts UpdateOpts) ToSecGroupUpdateMap() (map[string]interface{}, error)

ToSecGroupUpdateMap builds the update options into a serializable format.

type UpdateOptsBuilder Uses

type UpdateOptsBuilder interface {
    ToSecGroupUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder builds the update options into a serializable format.

type UpdateResult Uses

type UpdateResult struct {
    // contains filtered or unexported fields
}

UpdateResult represents the result of an update operation.

func Update Uses

func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult

Update will modify the mutable properties of a security group, notably its name and description.

func (UpdateResult) Extract Uses

func (r UpdateResult) Extract() (*SecurityGroup, error)

Extract will extract a SecurityGroup struct from most responses.

Package secgroups imports 5 packages (graph) and is imported by 36 packages. Updated 2016-07-23. Refresh now. Tools for package owners.