Documentation ¶
Index ¶
- func Delete(c *golangsdk.ServiceClient, securityGroupId string) *golangsdk.ErrResult
- func IDFromName(client *golangsdk.ServiceClient, name string) (string, error)
- type CreateOpts
- type ListOpts
- type SecurityGroup
- func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*SecurityGroup, error)
- func ExtractSecurityGroups(r pagination.Page) ([]SecurityGroup, error)
- func Get(c *golangsdk.ServiceClient, securityGroupId string) (*SecurityGroup, error)
- func List(c *golangsdk.ServiceClient, opts ListOpts) ([]SecurityGroup, error)
- func Update(c *golangsdk.ServiceClient, securityGroupId string, opts UpdateOpts) (*SecurityGroup, error)
- type SecurityGroupPage
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(c *golangsdk.ServiceClient, securityGroupId string) *golangsdk.ErrResult
Delete is a method to delete an existing security group.
func IDFromName ¶
func IDFromName(client *golangsdk.ServiceClient, name string) (string, error)
IDFromName is a convenience function that returns a securtiy group's ID, given its name.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Specifies the security group name. The value can contain 1 to 64 characters, including letters, digits, // underscores (_), hyphens (-), and periods (.). Name string `json:"name" required:"true"` // Specifies the resource ID of the VPC to which the security group belongs. // Note: This parameter has been discarded, it is not recommended to use it. VpcId string `json:"vpc_id,omitempty"` // Enterprise project ID. The default value is 0. EnterpriseProjectId string `json:"enterprise_project_id,omitempty"` }
CreateOpts is a struct which will be used to create a new security group.
type ListOpts ¶
type ListOpts struct { // Specifies the number of records that will be returned on each page. The value is from 0 to intmax. // limit can be used together with marker. For details, see the parameter description of marker. Limit int `q:"limit"` // Specifies a resource ID for pagination query, indicating that the query starts from the next record of the // specified resource ID. This parameter can work together with the parameter limit. // If parameters marker and limit are not passed, all resource records will be returned. // If the parameter marker is not passed and the value of parameter limit is set to 10, the first 10 resource // records will be returned. // If the value of the parameter marker is set to the resource ID of the 10th record and the value of parameter // limit is set to 10, the 11th to 20th resource records will be returned. // If the value of the parameter marker is set to the resource ID of the 10th record and the parameter limit is // not passed, resource records starting from the 11th records (including 11th) will be returned. Marker string `q:"marker"` // Security group ID. You can use this field to filter security groups precisely, supporting multiple IDs. ID string `q:"id"` // Security group name. You can use this field to accurately filter security groups that meet the conditions, and // support incoming multiple name filters. Name string `q:"name"` // Security group description. You can use this field to filter security groups precisely, and support multiple // descriptions for filtering. Description string `q:"description"` // Enterprise project ID. Maximum length 36 bytes, UUID format with "-" hyphen, or string "0" (default). // If the enterprise project sub-account needs to query all security groups under the enterprise project, please // input 'all_granted_eps'. EnterpriseProjectId string `q:"enterprise_project_id"` }
ListOpts allows to filter list data using given parameters.
type SecurityGroup ¶
type SecurityGroup struct { // Specifies the security group name. Name string `json:"name"` // Provides supplementary information about the security group. Description string `json:"description"` // Specifies the security group ID, which uniquely identifies the security group. ID string `json:"id"` // Specifies the resource ID of the VPC to which the security group belongs. // Note: This parameter has been discarded, it is not recommended to use it. VpcId string `json:"vpc_id"` // Enterprise project ID, the default value is 0. EnterpriseProjectId string `json:"enterprise_project_id"` // Specifies the default security group rules, which ensure that resources in the security group can communicate // with one another. SecurityGroupRules []rules.SecurityGroupRule `json:"security_group_rules"` // ID of the project to which the security group rule belongs. ProjectId string `json:"project_id"` // Security group creation time, in UTC format: yyyy-MM-ddTHH:mm:ss. CreatedAt string `json:"created_at"` // Security group rule udpate time, in UTC format: yyyy-MM-ddTHH:mm:ss. UpdatedAt string `json:"updated_at"` }
SecurityGroup is a struct that represents the detail of the security group.
func Create ¶
func Create(c *golangsdk.ServiceClient, opts CreateOpts) (*SecurityGroup, error)
Create is a method to create a new security group.
func ExtractSecurityGroups ¶
func ExtractSecurityGroups(r pagination.Page) ([]SecurityGroup, error)
ExtractSecurityGroups is a method to extract the list of security group details.
func Get ¶
func Get(c *golangsdk.ServiceClient, securityGroupId string) (*SecurityGroup, error)
Get is a method to obtain the security group detail.
func List ¶
func List(c *golangsdk.ServiceClient, opts ListOpts) ([]SecurityGroup, error)
List is a method to obtain the list of the security groups.
func Update ¶
func Update(c *golangsdk.ServiceClient, securityGroupId string, opts UpdateOpts) (*SecurityGroup, error)
Update is a method to update an existing security group.
type SecurityGroupPage ¶
type SecurityGroupPage struct {
pagination.MarkerPageBase
}
func (SecurityGroupPage) IsEmpty ¶
func (p SecurityGroupPage) IsEmpty() (bool, error)
IsEmpty method checks whether the current security group page is empty.
func (SecurityGroupPage) LastMarker ¶
func (p SecurityGroupPage) LastMarker() (string, error)
LastMarker method returns the last security group ID in a security group page.
type UpdateOpts ¶
type UpdateOpts struct { // Specifies the security group name. The value can contain 1 to 64 characters, including letters, digits, // underscores (_), hyphens (-), and periods (.). Name string `json:"name,omitempty"` // Specifies the description of the security group. // The angle brackets (< and >) are not allowed for the description. Description *string `json:"description,omitempty"` }
UpdateOpts is a struct which will be used to update the existing security group using given parameters.