cdni

package
v7.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	CapabilityQuery   = `SELECT id, type, ucdn FROM cdni_capabilities WHERE type = $1 AND ucdn = $2`
	AllFootprintQuery = `SELECT footprint_type, footprint_value::text[], capability_id FROM cdni_footprints`

	InsertCapabilityUpdateQuery     = `INSERT INTO cdni_capability_updates (ucdn, data, async_status_id, request_type, host) VALUES ($1, $2, $3, $4, $5)`
	SelectCapabilityUpdateQuery     = `SELECT ucdn, data, async_status_id, request_type, host FROM cdni_capability_updates WHERE id = $1`
	SelectAllCapabilityUpdatesQuery = `SELECT id, ucdn, data, request_type, host FROM cdni_capability_updates`

	DeleteCapabilityUpdateQuery               = `DELETE FROM cdni_capability_updates WHERE id = $1`
	UpdateLimitsByCapabilityAndLimitTypeQuery = `UPDATE cdni_limits SET maximum_hard = $1 WHERE capability_id = $2 AND limit_type = $3`
)
View Source
const (
	Egress         CapacityLimitType = "egress"
	Requests                         = "requests"
	StorageSize                      = "storage-size"
	StorageObjects                   = "storage-objects"
	Sessions                         = "sessions"
	CacheSize                        = "cache-size"
)
View Source
const (
	Ipv4Cidr    FootprintType = "ipv4cidr"
	Ipv6Cidr                  = "ipv6cidr"
	Asn                       = "asn"
	CountryCode               = "countrycode"
)

Variables

This section is empty.

Functions

func GetCapabilities

func GetCapabilities(w http.ResponseWriter, r *http.Request)

GetCapabilities returns the CDNi capability limits.

func GetRequests

func GetRequests(w http.ResponseWriter, r *http.Request)

GetRequests returns the CDNi configuration update requests.

func PutConfiguration

func PutConfiguration(w http.ResponseWriter, r *http.Request)

PutConfiguration adds the requested CDNi configuration update to the queue and adds an async status.

func PutConfigurationResponse

func PutConfigurationResponse(w http.ResponseWriter, r *http.Request)

PutConfigurationResponse approves or denies a CDNi configuration request and updates the configuration and async status appropriately.

func PutHostConfiguration

func PutHostConfiguration(w http.ResponseWriter, r *http.Request)

PutHostConfiguration adds the requested CDNi configuration update for a specific host to the queue and adds an async status.

Types

type Capabilities

type Capabilities struct {
	Capabilities []Capability `json:"capabilities"`
}

Capabilities contains an array of CDNi capabilities.

type Capability

type Capability struct {
	CapabilityType  SupportedCapabilities `json:"capability-type"`
	CapabilityValue interface{}           `json:"capability-value"`
	Footprints      []Footprint           `json:"footprints"`
}

Capability contains information about a CDNi capability.

type CapabilityQueryResponse

type CapabilityQueryResponse struct {
	Id   int    `json:"id" db:"id"`
	Type string `json:"type" db:"type"`
	UCdn string `json:"ucdn" db:"ucdn"`
}

CapabilityQueryResponse contains data about the capability query.

type CapacityCapabilityValue

type CapacityCapabilityValue struct {
	Limits []Limit `json:"limits"`
}

CapacityCapabilityValue contains the total and host capability limits.

type CapacityLimit

type CapacityLimit struct {
	LimitType  string      `json:"limit-type"`
	LimitValue int64       `json:"limit-value"`
	Footprints []Footprint `json:"footprints"`
}

CapacityLimit contains the limit information for a given footprint.

type CapacityLimitType

type CapacityLimitType string

CapacityLimitType is a string of the capacity limit type.

type CapacityRequestedLimits

type CapacityRequestedLimits struct {
	RequestedLimits []CapacityLimit `json:"requested-limits"`
}

CapacityRequestedLimits contains the requested capacity limits.

type ConfigurationUpdateRequest

type ConfigurationUpdateRequest struct {
	ID            int             `json:"id"`
	UCDN          string          `json:"ucdn"`
	Data          json.RawMessage `json:"data"`
	Host          string          `json:"host"`
	RequestType   string          `json:"requestType" db:"request_type"`
	AsyncStatusID int             `json:"asyncStatusId" db:"async_status_id"`
}

ConfigurationUpdateRequest contains information about a requested CDNi configuration update request.

type Footprint

type Footprint struct {
	FootprintType  FootprintType `json:"footprint-type" db:"footprint_type"`
	FootprintValue []string      `json:"footprint-value" db:"footprint_value"`
	CapabilityId   int           `json:"-"`
}

Footprint contains the information for a footprint.

type FootprintType

type FootprintType string

FootprintType is a string of the footprint type.

type GenericHostMetadata

type GenericHostMetadata struct {
	Host         string           `json:"host"`
	HostMetadata HostMetadataList `json:"host-metadata"`
}

GenericHostMetadata contains the generic CDNi metadata for a requested update to a specific host.

type GenericMetadata

type GenericMetadata struct {
	Type  SupportedGenericMetadataType `json:"generic-metadata-type"`
	Value json.RawMessage              `json:"generic-metadata-value"`
}

GenericMetadata contains generic CDNi metadata.

type GenericRequestMetadata

type GenericRequestMetadata struct {
	Type     string          `json:"type"`
	Metadata json.RawMessage `json:"metadata"`
	Host     string          `json:"host,omitempty"`
}

GenericRequestMetadata contains the generic CDNi metadata for a requested update.

type HostMetadataList

type HostMetadataList struct {
	Metadata json.RawMessage `json:"metadata"`
}

HostMetadataList contains CDNi metadata for a specific host.

type Limit

type Limit struct {
	Id              string            `json:"id"`
	Scope           *LimitScope       `json:"scope,omitempty"`
	LimitType       CapacityLimitType `json:"limit-type"`
	MaximumHard     int64             `json:"maximum-hard"`
	MaximumSoft     int64             `json:"maximum-soft"`
	TelemetrySource TelemetrySource   `json:"telemetry-source"`
}

Limit contains the information for a capacity limit.

type LimitScope

type LimitScope struct {
	ScopeType  *string  `json:"type" db:"scope_type"`
	ScopeValue []string `json:"value" db:"scope_value"`
}

LimitScope contains information for a specific limit.

type LimitsQueryResponse

type LimitsQueryResponse struct {
	Scope          *LimitScope `json:"scope,omitempty"`
	LimitId        string      `json:"limitId" db:"limit_id"`
	LimitType      string      `json:"limitType" db:"limit_type"`
	MaximumHard    int64       `json:"maximum_hard" db:"maximum_hard"`
	MaximumSoft    int64       `json:"maximum_soft" db:"maximum_soft"`
	TelemetryId    string      `json:"telemetry_id" db:"telemetry_id"`
	TelemetryMetic string      `json:"telemetry_metric" db:"telemetry_metric"`
	UCdn           string      `json:"ucdn" db:"ucdn"`
	Id             string      `json:"id" db:"id"`
	Type           string      `json:"type" db:"type"`
	Name           string      `json:"name" db:"name"`
	CapabilityId   int         `json:"-"`
}

LimitsQueryResponse contains information about the limits query.

type Metric

type Metric struct {
	Name            string `json:"name"`
	TimeGranularity int    `json:"time-granularity"`
	DataPercentile  int    `json:"data-percentile"`
	Latency         int    `json:"latency"`
	TelemetryId     string `json:"-"`
}

Metric contains the metric information for a telemetry metric.

type SupportedCapabilities

type SupportedCapabilities string

SupportedCapabilities is a string of the supported capabilities.

const (
	FciTelemetry      SupportedCapabilities = "FCI.Telemetry"
	FciCapacityLimits                       = "FCI.CapacityLimits"
)

type SupportedGenericMetadataType

type SupportedGenericMetadataType string

SupportedGenericMetadataType is a string of the supported metadata type.

const (
	MiRequestedCapacityLimits SupportedGenericMetadataType = "MI.RequestedCapacityLimits"
)

type Telemetry

type Telemetry struct {
	Id            string                 `json:"id"`
	Type          TelemetrySourceType    `json:"type"`
	CapabilityId  int                    `json:"-"`
	Metrics       []Metric               `json:"metrics"`
	Configuration TelemetryConfiguration `json:"configuration"`
}

Telemetry contains the information for a telemetry metric.

type TelemetryCapabilityValue

type TelemetryCapabilityValue struct {
	Sources []Telemetry `json:"sources"`
}

TelemetryCapabilityValue contains an array of telemetry sources.

type TelemetryConfiguration

type TelemetryConfiguration struct {
	Url string `json:"url"`
}

type TelemetrySource

type TelemetrySource struct {
	Id     string `json:"id"`
	Metric string `json:"metric"`
}

TelemetrySource contains the information for a telemetry source.

type TelemetrySourceType

type TelemetrySourceType string

TelemetrySourceType is a string of the telemetry source type. Right now only "generic" is supported.

const (
	Generic TelemetrySourceType = "generic"
)

Jump to

Keyboard shortcuts

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