cisv1

package
v0.0.0-...-5c5b994 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 40

Documentation

Index

Constants

View Source
const ErrCodeAPICreation = "APICreationError"

ErrCodeAPICreation ...

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionResponse

type ActionResponse struct {
	ContentType string `json:"content_type,omitempty"`
	Body        string `json:"body,omitempty"`
}

ActionResponse ...

type CheckRegion

type CheckRegion struct {
	Region string `json:"0"`
}

type CisServiceAPI

type CisServiceAPI interface {
	Zones() Zones
	Monitors() Monitors
	Pools() Pools
	Glbs() Glbs
	Settings() Settings
	Ips() Ips
	Dns() Dns
	Firewall() Firewall
	RateLimit() RateLimit
}

CisServiceAPI is the Cloud Internet Services API ...

func New

func New(sess *session.Session) (CisServiceAPI, error)

New ...

type Configuration

type Configuration struct {
	Target string `json:"target,omitempty"`
	Value  string `json:"value,omitempty"`
}

Configuration ...

type Dns

type Dns interface {
	ListDns(cisId string, zoneId string) ([]DnsRecord, error)
	GetDns(cisId string, zoneId string, dnsId string) (*DnsRecord, error)
	CreateDns(cisId string, zoneId string, dnsBody DnsBody) (*DnsRecord, error)
	DeleteDns(cisId string, zoneId string, dnsId string) error
	UpdateDns(cisId string, zoneId string, dnsId string, dnsBody DnsBody) (*DnsRecord, error)
}

type DnsBody

type DnsBody struct {
	Name     string      `json:"name,omitempty"`
	DnsType  string      `json:"type"`
	Content  string      `json:"content,omitempty"`
	Priority int         `json:"priority,omitempty"`
	Data     interface{} `json:"data,omitempty"`
	Proxied  bool        `json:"proxied,omitempty"`
	Ttl      int         `json:"ttl,omitempty"`
}

type DnsRecord

type DnsRecord struct {
	Id         string      `json:"id"`
	Name       string      `json:"name,omitempty"`
	DnsType    string      `json:"type"`
	Content    string      `json:"content"`
	ZoneId     string      `json:"zone_id"`
	ZoneName   string      `json:"zone_name"`
	CreatedOn  *time.Time  `json:"created_on,omitempty"`
	ModifiedOn *time.Time  `json:"modified_on,omitempty"`
	Proxiable  bool        `json:"proxiable"`
	Proxied    bool        `json:"proxied"`
	Ttl        int         `json:"ttl"`
	Priority   int         `json:"priority,omitempty"`
	Data       interface{} `json:"data,omitempty"`
}

type DnsResult

type DnsResult struct {
	Dns      DnsRecord `json:"result"`
	Success  bool      `json:"success"`
	Errors   []Error   `json:"errors"`
	Messages []string  `json:"messages"`
}

type DnsResults

type DnsResults struct {
	DnsList     []DnsRecord  `json:"result"`
	ResultsInfo ResultsCount `json:"result_info"`
	Success     bool         `json:"success"`
	Errors      []Error      `json:"errors"`
}

type Error

type Error struct {
	Code int    `json:"code"`
	Msg  string `json:"message"`
}

type Firewall

type Firewall interface {
	ListFirewall(cisID string, zoneID string, firewallType string) ([]FirewallRecord, error)
	GetFirewall(cisID string, zoneID string, firewallType string, firewallID string) (*FirewallRecord, error)
	CreateFirewall(cisID string, zoneID string, firewallType string, firewallBody FirewallBody) (*FirewallRecord, error)
	DeleteFirewall(cisID string, zoneID string, firewallType string, firewallID string) error
	UpdateFirewall(cisID string, zoneID string, firewallType string, firewallID string, firewallBody FirewallBody) (*FirewallRecord, error)
}

Firewall ...

type FirewallBody

type FirewallBody struct {
	Description    string          `json:"description,omitempty"`
	Urls           []string        `json:"urls,omitempty"`
	Configurations []Configuration `json:"configurations,omitempty"`
	Paused         bool            `json:"paused,omitempty"`
	Mode           string          `json:"mode,omitempty"`
	Notes          string          `json:"notes,omitempty"`
	Configuration  *Configuration  `json:"configuration,omitempty"`
	Priority       int             `json:"priority,omitempty"`
}

FirewallBody ...

type FirewallRecord

type FirewallRecord struct {
	ID             string          `json:"id"`
	Description    string          `json:"description,omitempty"`
	Urls           []string        `json:"urls,omitempty"`
	Configurations []Configuration `json:"configurations,omitempty"`
	Paused         bool            `json:"paused,omitempty"`
	CreatedOn      *time.Time      `json:"created_on,omitempty"`
	ModifiedOn     *time.Time      `json:"modified_on,omitempty"`
	Mode           string          `json:"mode,omitempty"`
	Notes          string          `json:"notes,omitempty"`
	Configuration  *Configuration  `json:"configuration,omitempty"`
	Priority       int             `json:"priority,omitempty"`
}

FirewallRecord ...

type FirewallResult

type FirewallResult struct {
	Firewall FirewallRecord `json:"result"`
	Success  bool           `json:"success"`
	Errors   []Error        `json:"errors"`
	Messages []string       `json:"messages"`
}

FirewallResult ...

type FirewallResults

type FirewallResults struct {
	FirewallList []FirewallRecord `json:"result"`
	ResultsInfo  ResultsCount     `json:"result_info"`
	Success      bool             `json:"success"`
	Errors       []Error          `json:"errors"`
}

FirewallResults ...

type GenericPaginatedResourcesHandler

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

func NewDNSPaginatedResources

func NewDNSPaginatedResources(resource interface{}) GenericPaginatedResourcesHandler

func (GenericPaginatedResourcesHandler) Resources

func (pr GenericPaginatedResourcesHandler) Resources(bytes []byte, curURL string) ([]interface{}, string, error)

type Glb

type Glb struct {
	Id              string              `json:"id"`
	Name            string              `json:"name"`
	Desc            string              `json:"description"`
	FallbackPool    string              `json:"fallback_pool"`
	DefaultPools    []string            `json:"default_pools"`
	Ttl             int                 `json:"ttl"`
	Proxied         bool                `json:"proxied"`
	CreatedOn       *time.Time          `json:"created_on,omitempty"`
	ModifiedOn      *time.Time          `json:"modified_on,omitempty"`
	SessionAffinity string              `json:"session_affinity"`
	Enabled         bool                `json:"enabled,omitempty"`
	RegionPools     map[string][]string `json:"region_pools,omitempty"`
	PopPools        map[string][]string `json:"pop_pools,omitempty"`
}

type GlbBody

type GlbBody struct {
	Desc            string              `json:"description,omitempty"`
	Proxied         bool                `json:"proxied,omitempty"`
	Name            string              `json:"name"`
	FallbackPool    string              `json:"fallback_pool"`
	DefaultPools    []string            `json:"default_pools"`
	SessionAffinity string              `json:"session_affinity,omitempty"`
	Ttl             int                 `json:"ttl,omitempty"`
	Enabled         bool                `json:"enabled,omitempty"`
	RegionPools     map[string][]string `json:"region_pools,omitempty"`
	PopPools        map[string][]string `json:"pop_pools,omitempty"`
}

type GlbDelete

type GlbDelete struct {
	Result struct {
		GlbId string
	} `json:"result"`
	Success  bool     `json:"success"`
	Errors   []Error  `json:"errors"`
	Messages []string `json:"messages"`
}

type GlbResult

type GlbResult struct {
	Glb      Glb      `json:"result"`
	Success  bool     `json:"success"`
	Errors   []Error  `json:"errors"`
	Messages []string `json:"messages"`
}

type GlbResults

type GlbResults struct {
	GlbList     []Glb        `json:"result"`
	ResultsInfo ResultsCount `json:"result_info"`
	Success     bool         `json:"success"`
	Errors      []Error      `json:"errors"`
}

type Glbs

type Glbs interface {
	ListGlbs(cisId string, zoneId string) ([]Glb, error)
	GetGlb(cisId string, zoneId string, glbId string) (*Glb, error)
	CreateGlb(cisId string, zoneId string, glbBody GlbBody) (*Glb, error)
	DeleteGlb(cisId string, zoneId string, glbId string) error
	UpdateGlb(cisId string, zoneId string, glbId string, glbBody GlbBody) (*Glb, error)
}

type Ips

type Ips interface {
	ListIps() (*IpsList, error)
}

type IpsList

type IpsList struct {
	Ipv4 []string `json:"ipv4_cidrs"`
	Ipv6 []string `json:"ipv6_cidrs"`
}

type IpsResults

type IpsResults struct {
	IpList      IpsList      `json:"result"`
	ResultsInfo ResultsCount `json:"result_info"`
	Success     bool         `json:"success"`
	Errors      []Error      `json:"errors"`
}

type MatchRequest

type MatchRequest struct {
	Methods []string `json:"methods,omitempty"`
	Schemes []string `json:"schemes,omitempty"`
	URL     string   `json:"url,omitempty"`
}

MatchRequest ...

type MatchResponse

type MatchResponse struct {
	Statuses      []int                 `json:"status,omitempty"`
	OriginTraffic *bool                 `json:"origin_traffic,omitempty"` // api defaults to true so we need an explicit empty value
	Headers       []MatchResponseHeader `json:"headers,omitempty"`
}

MatchResponse ...

type MatchResponseHeader

type MatchResponseHeader struct {
	Name  string `json:"name,omitempty"`
	Op    string `json:"op,omitempty"`
	Value string `json:"value,omitempty"`
}

MatchResponseHeader ...

type Monitor

type Monitor struct {
	Id              string `json:"id"`
	Path            string `json:"path,omitempty"`
	Description     string `json:"description"`
	ExpBody         string `json:"expected_body,omitempty"`
	ExpCodes        string `json:"expected_codes,omitempty"`
	MonType         string `json:"type,omitempty"`
	Method          string `json:"method,omitempty"`
	Timeout         int    `json:"timeout,omitempty"`
	Retries         int    `json:"retries,omitempty"`
	Interval        int    `json:"interval,omitempty"`
	FollowRedirects bool   `json:"follow_redirects,omitempty"`
	AllowInsecure   bool   `json:"allow_insecure,omitempty"`
	Port            int    `json:"port,omitempty"`
}

type MonitorBody

type MonitorBody struct {
	Description     string `json:"description"`
	ExpCodes        string `json:"expected_codes,omitempty"`
	ExpBody         string `json:"expected_body,omitempty"`
	Path            string `json:"path,omitempty"`
	MonType         string `json:"type,omitempty"`
	Method          string `json:"method,omitempty"`
	Timeout         int    `json:"timeout,omitempty"`
	Retries         int    `json:"retries,omitempty"`
	Interval        int    `json:"interval,omitempty"`
	FollowRedirects bool   `json:"follow_redirects,omitempty"`
	AllowInsecure   bool   `json:"allow_insecure,omitempty"`
	Port            int    `json:"port,omitempty"`
}

type MonitorDelete

type MonitorDelete struct {
	Result struct {
		MonitorId string
	} `json:"result"`
	Success  bool     `json:"success"`
	Errors   []Error  `json:"errors"`
	Messages []string `json:"messages"`
}

type MonitorResult

type MonitorResult struct {
	Monitor  Monitor  `json:"result"`
	Success  bool     `json:"success"`
	Errors   []Error  `json:"errors"`
	Messages []string `json:"messages"`
}

type MonitorResults

type MonitorResults struct {
	MonitorList []Monitor    `json:"result"`
	ResultsInfo ResultsCount `json:"result_info"`
	Success     bool         `json:"success"`
	Errors      []Error      `json:"errors"`
}

type Monitors

type Monitors interface {
	ListMonitors(cisId string) ([]Monitor, error)
	GetMonitor(cisId string, monitorId string) (*Monitor, error)
	CreateMonitor(cisId string, monitorBody MonitorBody) (*Monitor, error)
	DeleteMonitor(cisId string, monitorId string) error
	UpdateMonitor(cisId string, monitorId string, monitorBody MonitorBody) (*Monitor, error)
}

type NameServer

type NameServer struct {
	NameS int64 `json:"0"`
}

type Origin

type Origin struct {
	Name    string `json:"name"`
	Address string `json:"address"`
	Enabled bool   `json:"enabled"`
	Weight  int    `json:"weight"`
	Healthy bool   `json:"healthy"`
}

type Pool

type Pool struct {
	Id           string   `json:"id"`
	Description  string   `json:"description"`
	Name         string   `json:"name"`
	CheckRegions []string `json:"check_regions"`
	Enabled      bool     `json:"enabled"`
	MinOrigins   int      `json:"minimum_origins"`
	Monitor      string   `json:"monitor"`
	NotEmail     string   `json:"notification_email"`
	Origins      []Origin `json:"origins"`
	Health       string   `json:"health"`
	CreatedOn    string   `json:"created_on"`
	ModifiedOn   string   `json:"modified_on"`
}

type PoolBody

type PoolBody struct {
	Name         string   `json:"name"`
	Description  string   `json:"description,omitempty"`
	Origins      []Origin `json:"origins"`
	CheckRegions []string `json:"check_regions"`
	Enabled      bool     `json:"enabled"`
	MinOrigins   int      `json:"minimum_origins,omitempty"`
	Monitor      string   `json:"monitor,omitempty"`
	NotEmail     string   `json:"notification_email,omitempty"`
}

type PoolDelete

type PoolDelete struct {
	Result struct {
		PoolId string
	} `json:"result"`
	Success  bool     `json:"success"`
	Errors   []Error  `json:"errors"`
	Messages []string `json:"messages"`
}

type PoolResult

type PoolResult struct {
	Pool     Pool     `json:"result"`
	Success  bool     `json:"success"`
	Errors   []Error  `json:"errors"`
	Messages []string `json:"messages"`
}

type PoolResults

type PoolResults struct {
	PoolList    []Pool       `json:"result"`
	ResultsInfo ResultsCount `json:"result_info"`
	Success     bool         `json:"success"`
	Errors      []Error      `json:"errors"`
}

type Pools

type Pools interface {
	ListPools(cisId string) ([]Pool, error)
	GetPool(cisId string, poolId string) (*Pool, error)
	CreatePool(cisId string, poolBody PoolBody) (*Pool, error)
	DeletePool(cisId string, poolId string) error
	UpdatePool(cisId string, poolId string, poolBody PoolBody) (*Pool, error)
}

type RateLimit

type RateLimit interface {
	ListRateLimit(cisID string, zoneID string) ([]RateLimitRecord, error)
	GetRateLimit(cisID string, zoneID string, rateLimitID string) (*RateLimitRecord, error)
	CreateRateLimit(cisID string, zoneID string, rateLimitBody RateLimitRecord) (*RateLimitRecord, error)
	DeleteRateLimit(cisID string, zoneID string, rateLimitID string) error
	UpdateRateLimit(cisID string, zoneID string, rateLimitID string, rateLimitBody RateLimitRecord) (*RateLimitRecord, error)
}

RateLimit ...

type RateLimitAction

type RateLimitAction struct {
	Mode     string          `json:"mode"`
	Timeout  int             `json:"timeout,omitempty"`
	Response *ActionResponse `json:"response,omitempty"`
}

RateLimitAction ...

type RateLimitByPass

type RateLimitByPass struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

RateLimitByPass ...

type RateLimitCorrelate

type RateLimitCorrelate struct {
	By string `json:"by"`
}

RateLimitCorrelate ...

type RateLimitMatch

type RateLimitMatch struct {
	Request  MatchRequest  `json:"request"`
	Response MatchResponse `json:"response"`
}

RateLimitMatch ...

type RateLimitRecord

type RateLimitRecord struct {
	ID          string              `json:"id,omitempty"`
	Disabled    bool                `json:"disabled,omitempty"`
	Description string              `json:"description,omitempty"`
	Bypass      []RateLimitByPass   `json:"bypass,omitempty"`
	Threshold   int                 `json:"threshold"`
	Period      int                 `json:"period"`
	Correlate   *RateLimitCorrelate `json:"correlate,omitempty"`
	Action      RateLimitAction     `json:"action"`
	Match       RateLimitMatch      `json:"match"`
}

RateLimitRecord is a policy than can be applied to limit traffic within a customer domain

type RateLimitResult

type RateLimitResult struct {
	RateLimit RateLimitRecord `json:"result"`
	Success   bool            `json:"success"`
	Errors    []Error         `json:"errors"`
	Messages  []string        `json:"messages"`
}

RateLimitResult ...

type RateLimitResults

type RateLimitResults struct {
	RateLimitList []RateLimitRecord `json:"result"`
	ResultsInfo   ResultsCount      `json:"result_info"`
	Success       bool              `json:"success"`
	Errors        []Error           `json:"errors"`
}

RateLimitResults ...

type ResultsCount

type ResultsCount struct {
	Count int `json:"count"`
}

type Settings

type Settings interface {
	GetSetting(cisId string, zoneId string, setting string) (*SettingsResObj, error)
	UpdateSetting(cisId string, zoneId string, setting string, settingsBody SettingsBody) (*SettingsResObj, error)
}

type SettingsBody

type SettingsBody struct {
	Value string `json:"value"`
}

type SettingsResObj

type SettingsResObj struct {
	Id                string `json:"id"`
	Value             string `json:"value"`
	Editable          bool   `json:"editable"`
	ModifiedDate      string `json:"modified_on"`
	CertificateStatus string `json:"certificate_status"`
}

type SettingsResult

type SettingsResult struct {
	Result   SettingsResObj `json:"result"`
	Success  bool           `json:"success"`
	Errors   []Error        `json:"errors"`
	Messages []string       `json:"messages"`
}

type Zone

type Zone struct {
	Id                 string   `json:"id"`
	Name               string   `json:"name"`
	Status             string   `json:"status"`
	Paused             bool     `json:"paused"`
	NameServers        []string `json:"name_servers"`
	OriginalNameServer []string `json:"original_name_servers"`
}

type ZoneBody

type ZoneBody struct {
	Name string `json:"name"`
}

type ZoneDelete

type ZoneDelete struct {
	Result struct {
		ZoneId string
	} `json:"result"`
	Success  bool     `json:"success"`
	Errors   []Error  `json:"errors"`
	Messages []string `json:"messages"`
}

type ZoneResult

type ZoneResult struct {
	Zone     Zone     `json:"result"`
	Success  bool     `json:"success"`
	Errors   []Error  `json:"errors"`
	Messages []string `json:"messages"`
}

type ZoneResults

type ZoneResults struct {
	ZoneList    []Zone       `json:"result"`
	ResultsInfo ResultsCount `json:"result_info"`
	Success     bool         `json:"success"`
	Errors      []Error      `json:"errors"`
}

type Zones

type Zones interface {
	ListZones(cisId string) ([]Zone, error)
	GetZone(cisId string, zoneId string) (*Zone, error)
	CreateZone(cisId string, zoneBody ZoneBody) (*Zone, error)
	DeleteZone(cisId string, zoneId string) error
}

Jump to

Keyboard shortcuts

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