Documentation ¶
Overview ¶
Package load_balancer_syslog_servers contains functionality for working with ECL Load Balancer Syslog Server resources.
Example to List Load Balancer Syslog Servers
listOpts := load_balancer_syslog_servers.ListOpts{ Status: "ACTIVE", } allPages, err := load_balancer_syslog_servers.List(networkClient, listOpts).AllPages() if err != nil { panic(err) } allLoadBalancerSyslogServers, err := load_balancer_syslog_servers.ExtractLoadBalancerSyslogServers(allPages) if err != nil { panic(err) } for _, loadBalancerSyslogServer := range allLoadBalancerSyslogServers { fmt.Printf("%+v\n", loadBalancerSyslogServer) }
Example to Show Load Balancer Syslog Server
loadBalancerSyslogServerID := "9ab7ab3c-38a6-417c-926b-93772c4eb2f9" loadBalancerSyslogServer, err := load_balancer_syslog_servers.Get(networkClient, loadBalancerSyslogServerID).Extract() if err != nil { panic(err) } fmt.Printf("%+v\n", loadBalancerSyslogServer)
Example to Create a Load Balancer Syslog Server
priority := 20 createOpts := load_balancer_syslog_servers.CreateOpts{ AclLogging: "DISABLED", AppflowLogging: "DISABLED", DateFormat: "MMDDYYYY", Description: "test", IPAddress: "120.120.120.30", LoadBalancerID: "4f6ebc24-f768-485b-99ef-f308063d0209", LogFacility: "LOCAL3", LogLevel: "DEBUG", Name: "first_syslog_server", PortNumber: 514, Priority: &priority, TcpLogging: "ALL", TenantID: "b58531f716614e82a9bf001571c8bb15", TimeZone: "LOCAL_TIME", TransportType: "UDP", UserConfigurableLogMessages: "NO", } loadBalancerSyslogServer, err := load_balancer_syslog_servers.Create(networkClient, createOpts).Extract() if err != nil { panic(err) }
Example to Update a Load Balancer Syslog Server
loadBalancerSyslogServerID := "9ab7ab3c-38a6-417c-926b-93772c4eb2f9" description := "new_description" updateOpts := load_balancer_syslog_servers.UpdateOpts{ Description: &description, } loadBalancerSyslogServer, err := load_balancer_syslog_servers.Update(networkClient, loadBalancerSyslogServerID, updateOpts).Extract() if err != nil { panic(err) }
Example to Delete a Load Balancer Syslog Server
loadBalancerSyslogServerID := "13762eaf-9564-4c94-a106-98ece9fa189e" err := load_balancer_syslog_servers.Delete(networkClient, loadBalancerSyslogServerID).ExtractErr() if err != nil { panic(err) }
Index ¶
- func IDFromName(client *eclcloud.ServiceClient, name string) (string, error)
- func List(c *eclcloud.ServiceClient, opts ListOpts) pagination.Pager
- type CreateOpts
- type CreateResult
- type DeleteResult
- type GetResult
- type ListOpts
- type LoadBalancerSyslogServer
- type LoadBalancerSyslogServerPage
- type UpdateOpts
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IDFromName ¶
IDFromName is a convenience function that returns a Load Balancer Syslog Server's ID, given its name.
func List ¶
func List(c *eclcloud.ServiceClient, opts ListOpts) pagination.Pager
List returns a Pager which allows you to iterate over a collection of Load Balancer Syslog Servers. It accepts a ListOpts struct, which allows you to filter and sort the returned collection for greater efficiency.
Default policy settings return only those Load Balancer Syslog Servers that are owned by the tenant who submits the request, unless the request is submitted by a user with administrative rights.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // should syslog record acl info AclLogging string `json:"acl_logging,omitempty"` // should syslog record appflow info AppflowLogging string `json:"appflow_logging,omitempty"` // date format utilized by syslog DateFormat string `json:"date_format,omitempty"` // Description is description Description string `json:"description,omitempty"` // Ip address of syslog server IPAddress string `json:"ip_address" required:"true"` // The ID of load_balancer this load_balancer_syslog_server belongs to. LoadBalancerID string `json:"load_balancer_id" required:"true"` // Log facility for syslog LogFacility string `json:"log_facility,omitempty"` // Log level for syslog LogLevel string `json:"log_level,omitempty"` // Name is a human-readable name of the Load Balancer Syslog Server. Name string `json:"name" required:"true"` // Port number of syslog server PortNumber int `json:"port_number,omitempty"` // priority (0-255) Priority *int `json:"priority,omitempty"` // should syslog record tcp protocol info TcpLogging string `json:"tcp_logging,omitempty"` // The UUID of the project who owns the Load Balancer Syslog Server. Only administrative users // can specify a project UUID other than their own. TenantID string `json:"tenant_id,omitempty"` // time zone utilized by syslog TimeZone string `json:"time_zone,omitempty"` // protocol for syslog transport TransportType string `json:"transport_type,omitempty"` // can user configure log messages UserConfigurableLogMessages string `json:"user_configurable_log_messages,omitempty"` }
CreateOpts represents the attributes used when creating a new Load Balancer Syslog Server.
func (CreateOpts) ToLoadBalancerSyslogServerCreateMap ¶
func (opts CreateOpts) ToLoadBalancerSyslogServerCreateMap() (map[string]interface{}, error)
ToLoadBalancerSyslogServerCreateMap builds a request body from CreateOpts.
type CreateResult ¶
type CreateResult struct {
// contains filtered or unexported fields
}
CreateResult represents the result of a create operation. Call its Extract method to interpret it as a Load Balancer Syslog Server.
func Create ¶
func Create(c *eclcloud.ServiceClient, opts CreateOpts) (r CreateResult)
Create accepts a CreateOpts struct and creates a new Load Balancer Syslog Server using the values provided. You must remember to provide a valid LoadBalancerPlanID.
func (CreateResult) Extract ¶
func (r CreateResult) Extract() (*LoadBalancerSyslogServer, error)
Extract is a function that accepts a result and extracts a Load Balancer Syslog Server resource.
type DeleteResult ¶
type DeleteResult struct {
eclcloud.ErrResult
}
DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.
func Delete ¶
func Delete(c *eclcloud.ServiceClient, id string) (r DeleteResult)
Delete accepts a unique ID and deletes the Load Balancer Syslog Server associated with it.
type GetResult ¶
type GetResult struct {
// contains filtered or unexported fields
}
GetResult represents the result of a get operation. Call its Extract method to interpret it as a Load Balancer Syslog Server.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*LoadBalancerSyslogServer, error)
Extract is a function that accepts a result and extracts a Load Balancer Syslog Server resource.
type ListOpts ¶
type ListOpts struct { Description string `q:"description"` ID string `q:"id"` IPAddress string `q:"ip_address"` LoadBalancerID string `q:"load_balancer_id"` LogFacility string `q:"log_facility"` LogLevel string `q:"log_level"` Name string `q:"name"` PortNumber int `q:"port_number"` Status string `q:"status"` TransportType string `q:"transport_type"` }
ListOpts allows the filtering and sorting of paginated collections through the API. Filtering is achieved by passing in struct field values that map to the Load Balancer Syslog Server attributes you want to see returned. SortKey allows you to sort by a particular Load Balancer Syslog Server attribute. SortDir sets the direction, and is either `asc' or `desc'. Marker and Limit are used for pagination.
func (ListOpts) ToLoadBalancerSyslogServersListQuery ¶
ToLoadBalancerSyslogServersListQuery formats a ListOpts into a query string.
type LoadBalancerSyslogServer ¶
type LoadBalancerSyslogServer struct { // should syslog record acl info AclLogging string `json:"acl_logging"` // should syslog record appflow info AppflowLogging string `json:"appflow_logging"` // date format utilized by syslog DateFormat string `json:"date_format"` // Description is description Description string `json:"description"` // UUID representing the Load Balancer Syslog Server. ID string `json:"id"` // Ip address of syslog server IPAddress string `json:"ip_address"` // The ID of load_balancer this load_balancer_syslog_server belongs to. LoadBalancerID string `json:"load_balancer_id"` // Log facility for syslog LogFacility string `json:"log_facility"` // Log level for syslog LogLevel string `json:"log_level"` // Name of the syslog resource Name string `json:"name"` // Port number of syslog server PortNumber int `json:"port_number"` // priority (0-255) Priority int `json:"priority"` // Load balancer syslog server status Status string `json:"status"` // should syslog record tcp protocol info TcpLogging string `json:"tcp_logging"` // TenantID is the project owner of the Load Balancer Syslog Server. TenantID string `json:"tenant_id"` // time zone utilized by syslog TimeZone string `json:"time_zone"` // protocol for syslog transport TransportType string `json:"transport_type"` // can user configure log messages UserConfigurableLogMessages string `json:"user_configurable_log_messages"` }
LoadBalancerSyslogServer represents a Load Balancer Syslog Server. See package documentation for a top-level description of what this is.
func ExtractLoadBalancerSyslogServers ¶
func ExtractLoadBalancerSyslogServers(r pagination.Page) ([]LoadBalancerSyslogServer, error)
ExtractLoadBalancerSyslogServers accepts a Page struct, specifically a LoadBalancerSyslogServerPage struct, and extracts the elements into a slice of Load Balancer Syslog Server structs. In other words, a generic collection is mapped into a relevant slice.
type LoadBalancerSyslogServerPage ¶
type LoadBalancerSyslogServerPage struct {
pagination.LinkedPageBase
}
LoadBalancerSyslogServerPage is the page returned by a pager when traversing over a collection of load balancer Syslog Servers.
func (LoadBalancerSyslogServerPage) IsEmpty ¶
func (r LoadBalancerSyslogServerPage) IsEmpty() (bool, error)
IsEmpty checks whether a LoadBalancerSyslogServerPage struct is empty.
type UpdateOpts ¶
type UpdateOpts struct { // should syslog record acl info AclLogging string `json:"acl_logging,omitempty"` // should syslog record appflow info AppflowLogging string `json:"appflow_logging,omitempty"` // date format utilized by syslog DateFormat string `json:"date_format,omitempty"` // Description is description Description *string `json:"description,omitempty"` // Log facility for syslog LogFacility string `json:"log_facility,omitempty"` // Log level for syslog LogLevel string `json:"log_level,omitempty"` // priority (0-255) Priority *int `json:"priority,omitempty"` // should syslog record tcp protocol info TcpLogging string `json:"tcp_logging,omitempty"` // time zone utilized by syslog TimeZone string `json:"time_zone,omitempty"` // can user configure log messages UserConfigurableLogMessages string `json:"user_configurable_log_messages,omitempty"` }
UpdateOpts represents the attributes used when updating an existing Load Balancer Syslog Server.
func (UpdateOpts) ToLoadBalancerSyslogServerUpdateMap ¶
func (opts UpdateOpts) ToLoadBalancerSyslogServerUpdateMap() (map[string]interface{}, error)
ToLoadBalancerSyslogServerUpdateMap builds a request body from UpdateOpts.
type UpdateResult ¶
type UpdateResult struct {
// contains filtered or unexported fields
}
UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Load Balancer Syslog Server.
func Update ¶
func Update(c *eclcloud.ServiceClient, id string, opts UpdateOpts) (r UpdateResult)
Update accepts a UpdateOpts struct and updates an existing Load Balancer Syslog Server using the values provided.
func (UpdateResult) Extract ¶
func (r UpdateResult) Extract() (*LoadBalancerSyslogServer, error)
Extract is a function that accepts a result and extracts a Load Balancer Syslog Server resource.