cisv1

package
v0.0.0-...-8be0c7b Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ErrCodeAPICreation = "APICreationError"

ErrCodeAPICreation ...

Variables

This section is empty.

Functions

This section is empty.

Types

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
}

CisServiceAPI is the Cloud Internet Services API ...

func New

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

New ...

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
}

type DnsBody

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

type DnsRecord

type DnsRecord struct {
	Id         string      `json:"id"`
	Name       string      `json:"name"`
	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"`
	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 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"`
}

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"`
}

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
}

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 Monitor

type Monitor struct {
	Id          string `json:"id"`
	Path        string `json:"path"`
	Description string `json:"description"`
	ExpBody     string `json:"expected_body"`
	ExpCodes    string `json:"expected_codes"`
	// Headers omitted future enhancement
	MonType         string `json:"type"`
	Method          string `json:"method"`
	Timeout         int    `json:"timeout"`
	Retries         int    `json:"retries"`
	Interval        int    `json:"interval"`
	FollowRedirects bool   `json:"follow_redirects"`
	AllowInsecure   bool   `json:"allow_insecure"`
}

type MonitorBody

type MonitorBody struct {
	ExpCodes string `json:"expected_codes"`
	ExpBody  string `json:"expected_body"`
	Path     string `json:"path"`
	// Headers ommited TBC
	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"`
}

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
}

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"`
}

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"`
	Healthy      bool     `json:"healthy"`
	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
}

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