resources

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceStatusActive    string = "active"
	ResourceStatusProcessed string = "processed"
	ResourceStatusSuspended string = "suspended"
)

Variables

This section is empty.

Functions

func ResourceACLPolicyTypeValues

func ResourceACLPolicyTypeValues() []string

ResourceACLPolicyTypeValues returns list of all possible values for a ResourceACLPolicyType enumeration.

func ResourceAllowedHttpMethodValues

func ResourceAllowedHttpMethodValues() []string

ResourceAllowedHttpMethodValues returns list of all possible values for a ResourceAllowedHttpMethod enumeration.

func ResourceOriginProtocolValues

func ResourceOriginProtocolValues() []string

ResourceOriginProtocolValues returns list of all possible values for a ResourceOriginProtocol enumeration.

Types

type CreateOpts

type CreateOpts struct {
	Active             bool                   `json:"active"`
	CNAME              string                 `json:"cname"`
	Enabled            *bool                  `json:"enabled,omitempty"`
	LogTarget          string                 `json:"logTarget,omitempty"`
	Options            *ResourceOptions       `json:"options,omitempty"`
	Origin             string                 `json:"origin,omitempty"`
	OriginGroup        int                    `json:"originGroup,omitempty"`
	OriginProtocol     ResourceOriginProtocol `json:"originProtocol,omitempty"`
	SecondaryHostnames []string               `json:"secondaryHostnames"`
	SSLAutomated       bool                   `json:"ssl_automated,omitempty"`
	SSLData            int                    `json:"sslData,omitempty"`
	SSLEnabled         bool                   `json:"sslEnabled,omitempty"`
}

CreateOpts specifies attributes used to create a CDN resource.

func (CreateOpts) Map

func (opts CreateOpts) Map() (map[string]interface{}, error)

Map builds a request body from a CreateOpts structure.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	Map() (map[string]interface{}, error)
}

type CreateResult

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

CreateResult is the result of a create request. Call its Extract method to interpret a result as a Resource.

func Create

func Create(client *gophercloud.ServiceClient, projectID string, opts CreateOptsBuilder) (r CreateResult)

Create implements a resource create request.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Resource, error)

Extract interprets any resource result as a Resource, if possible.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult is the result of a delete request. Call its ExtractErr method to determine if a request succeeded or failed.

func Delete

func Delete(client *gophercloud.ServiceClient, projectID string, id int) (r DeleteResult)

Delete implements a resource delete request.

type GetResult

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

GetResult is the result of a get request. Call its Extract method to interpret a result as a Resource.

func Get

func Get(client *gophercloud.ServiceClient, projectID string, id int) (r GetResult)

Get returns information about a resource, given its ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Resource, error)

Extract interprets any resource result as a Resource, if possible.

type GetShieldingResult

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

GetShieldingResult is the result of a get request. Call its Extract method to interpret a result as a ResourceShielding.

func GetShielding

func GetShielding(client *gophercloud.ServiceClient, projectID string, id int) (r GetShieldingResult)

GetShielding returns information about origin shielding options applied to the resource.

func (GetShieldingResult) Extract

func (r GetShieldingResult) Extract() (*ResourceShielding, error)

Extract interprets any resource shielding result as a ResourceShielding, if possible.

type IssueLetsEncryptResult

type IssueLetsEncryptResult struct {
	gophercloud.ErrResult
}

IssueLetsEncryptResult is the result of a request to issue Let's Encrypt certificate. Call its ExtractErr method to determine if a request succeeded or failed.

func IssueLetsEncrypt

func IssueLetsEncrypt(client *gophercloud.ServiceClient, projectID string, resourceID int) (r IssueLetsEncryptResult)

IssueLetsEncrypt implements a request to issue a Let's Encrypt certificate.

type PrefetchContentOpts

type PrefetchContentOpts struct {
	Paths []string `json:"paths"`
}

PrefetchContentOpts specifies attributes used to prefetch content for a CDN resource.

func (PrefetchContentOpts) Map

func (opts PrefetchContentOpts) Map() (map[string]interface{}, error)

Map builds a request body from a PrefetchContentOpts structure.

type PrefetchContentOptsBuilder

type PrefetchContentOptsBuilder interface {
	Map() (map[string]interface{}, error)
}

type PrefetchContentResult

type PrefetchContentResult struct {
	gophercloud.ErrResult
}

PrefetchContentResult is the result of a request to prefetch content for a CDN resource. Call its ExtractErr method to determine if a request succeeded or failed.

func PrefetchContent

func PrefetchContent(client *gophercloud.ServiceClient, projectID string, resourceID int, opts PrefetchContentOptsBuilder) (r PrefetchContentResult)

PrefetchContent implements a request to prefetch content for a CDN resource.

type Resource

type Resource struct {
	Active             bool                   `json:"active"`
	Client             int                    `json:"client"`
	CNAME              string                 `json:"cname"`
	CompanyName        string                 `json:"companyName"`
	Created            string                 `json:"created"`
	Deleted            bool                   `json:"deleted"`
	Enabled            bool                   `json:"enabled"`
	ID                 int                    `json:"id"`
	Options            ResourceOptions        `json:"options"`
	OriginGroup        int                    `json:"originGroup"`
	OriginGroupName    string                 `json:"originGroup_name"`
	OriginProtocol     ResourceOriginProtocol `json:"originProtocol"`
	PresetApplied      bool                   `json:"preset_applied"`
	ProxySSLEnabled    bool                   `json:"proxy_ssl_enabled"`
	SecondaryHostnames []string               `json:"secondaryHostnames"`
	Shielded           bool                   `json:"shielded"`
	SSLData            int                    `json:"sslData"`
	SSLEnabled         bool                   `json:"sslEnabled"`
	SSLAutomated       bool                   `json:"ssl_automated"`
	Status             string                 `json:"status"`
	Updated            string                 `json:"updated"`
	VPEnabled          bool                   `json:"vp_enabled"`
}

Resource represents a CDN resource.

type ResourceACLPolicyType

type ResourceACLPolicyType string
const (
	ResourceACLPolicyTypeAllow ResourceACLPolicyType = "allow"
	ResourceACLPolicyTypeDeny  ResourceACLPolicyType = "deny"
)

type ResourceAllowedHttpMethod

type ResourceAllowedHttpMethod string

ResourceAllowedHttpMethod allowed HTTP method

const (
	ResourceAllowedHttpMethodGet     ResourceAllowedHttpMethod = "GET"
	ResourceAllowedHttpMethodPost    ResourceAllowedHttpMethod = "POST"
	ResourceAllowedHttpMethodHead    ResourceAllowedHttpMethod = "HEAD"
	ResourceAllowedHttpMethodOptions ResourceAllowedHttpMethod = "OPTIONS"
	ResourceAllowedHttpMethodPut     ResourceAllowedHttpMethod = "PUT"
	ResourceAllowedHttpMethodPatch   ResourceAllowedHttpMethod = "PATCH"
	ResourceAllowedHttpMethodDelete  ResourceAllowedHttpMethod = "DELETE"
)

type ResourceOptions

type ResourceOptions struct {
	AllowedHttpMethods   *ResourceOptionsAllowedHttpMethodsOption `json:"allowedHttpMethods,omitempty"`
	BrotliCompression    *ResourceOptionsStringListOption         `json:"brotli_compression,omitempty"`
	BrowserCacheSettings *ResourceOptionsStringOption             `json:"browser_cache_settings,omitempty"`
	CORS                 *ResourceOptionsStringListOption         `json:"cors,omitempty"`
	EdgeCacheSettings    *ResourceOptionsEdgeCacheSettingsOption  `json:"edge_cache_settings,omitempty"`
	FetchCompressed      *ResourceOptionsBoolOption               `json:"fetch_compressed,omitempty"`
	ForceReturn          *ResourceOptionsForceReturnOption        `json:"force_return,omitempty"`
	ForwardHostHeader    *ResourceOptionsBoolOption               `json:"forward_host_header,omitempty"`
	GzipOn               *ResourceOptionsBoolOption               `json:"gzipOn,omitempty"`
	HostHeader           *ResourceOptionsStringOption             `json:"hostHeader,omitempty"`
	IgnoreQueryString    *ResourceOptionsBoolOption               `json:"ignoreQueryString,omitempty"`
	IgnoreCookie         *ResourceOptionsBoolOption               `json:"ignore_cookie,omitempty"`
	QueryParamsBlacklist *ResourceOptionsStringListOption         `json:"query_params_blacklist,omitempty"`
	QueryParamsWhitelist *ResourceOptionsStringListOption         `json:"query_params_whitelist,omitempty"`
	CountryACL           *ResourceOptionsACLOption                `json:"country_acl,omitempty"`
	ReferrerACL          *ResourceOptionsACLOption                `json:"referrer_acl,omitempty"`
	IpAddressACL         *ResourceOptionsACLOption                `json:"ip_address_acl,omitempty"`
	UserAgentACL         *ResourceOptionsACLOption                `json:"user_agent_acl,omitempty"`
	Slice                *ResourceOptionsBoolOption               `json:"slice,omitempty"`
	Stale                *ResourceOptionsStringListOption         `json:"stale,omitempty"`
	StaticHeaders        *ResourceOptionsStringMapOption          `json:"staticHeaders,omitempty"`
	StaticRequestHeaders *ResourceOptionsStringMapOption          `json:"staticRequestHeaders,omitempty"`
	Websockets           *ResourceOptionsBoolOption               `json:"websockets,omitempty"`
}

type ResourceOptionsACLOption

type ResourceOptionsACLOption struct {
	Enabled        bool                  `json:"enabled"`
	ExceptedValues []string              `json:"excepted_values"`
	PolicyType     ResourceACLPolicyType `json:"policy_type"`
}

type ResourceOptionsAllowedHttpMethodsOption

type ResourceOptionsAllowedHttpMethodsOption struct {
	Enabled bool                        `json:"enabled"`
	Value   []ResourceAllowedHttpMethod `json:"value"`
}

type ResourceOptionsBoolOption

type ResourceOptionsBoolOption struct {
	Enabled bool `json:"enabled"`
	Value   bool `json:"value"`
}

type ResourceOptionsEdgeCacheSettingsOption

type ResourceOptionsEdgeCacheSettingsOption struct {
	CustomValues *map[string]string `json:"custom_values,omitempty"`
	Default      string             `json:"default,omitempty"`
	Enabled      bool               `json:"enabled"`
	Value        string             `json:"value,omitempty"`
}

type ResourceOptionsForceReturnOption

type ResourceOptionsForceReturnOption struct {
	Body    string `json:"body,omitempty"`
	Code    int    `json:"code,omitempty"`
	Enabled bool   `json:"enabled"`
}

type ResourceOptionsStringListOption

type ResourceOptionsStringListOption struct {
	Enabled bool     `json:"enabled"`
	Value   []string `json:"value"`
}

type ResourceOptionsStringMapOption

type ResourceOptionsStringMapOption struct {
	Enabled bool              `json:"enabled"`
	Value   map[string]string `json:"value"`
}

type ResourceOptionsStringOption

type ResourceOptionsStringOption struct {
	Enabled bool   `json:"enabled"`
	Value   string `json:"value"`
}

type ResourceOriginProtocol

type ResourceOriginProtocol string

ResourceOriginProtocol origin interaction protocol

const (
	ResourceOriginProtocolHTTP  ResourceOriginProtocol = "HTTP"
	ResourceOriginProtocolHTTPS ResourceOriginProtocol = "HTTPS"
	ResourceOriginProtocolMATCH ResourceOriginProtocol = "MATCH"
)

type ResourceShielding

type ResourceShielding struct {
	ShieldingPop *int `json:"shielding_pop"`
}

ResourceShielding represents origin shielding options applied to the resource.

type ResourceStatus

type ResourceStatus string

ResourceStatus CDN resource status

type UpdateOpts

type UpdateOpts struct {
	Active             *bool                  `json:"active,omitempty"`
	Enabled            *bool                  `json:"enabled,omitempty"`
	LogTarget          string                 `json:"logTarget,omitempty"`
	Options            *ResourceOptions       `json:"options,omitempty"`
	Origin             string                 `json:"origin,omitempty"`
	OriginGroup        int                    `json:"originGroup,omitempty"`
	OriginProtocol     ResourceOriginProtocol `json:"originProtocol,omitempty"`
	SecondaryHostnames []string               `json:"secondaryHostnames"`
	SSLAutomated       *bool                  `json:"ssl_automated,omitempty"`
	SSLData            int                    `json:"sslData,omitempty"`
	SSLEnabled         *bool                  `json:"sslEnabled,omitempty"`
}

UpdateOpts specifies attributes used to update a CDN resource.

func (UpdateOpts) Map

func (opts UpdateOpts) Map() (map[string]interface{}, error)

Map builds a request body from a UpdateOpts structure.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	Map() (map[string]interface{}, error)
}

type UpdateResult

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

UpdateResult is the result of a delete request. Call its Extract method to interpret a result as a Resource.

func Update

func Update(client *gophercloud.ServiceClient, projectID string, id int, opts UpdateOptsBuilder) (r UpdateResult)

Update implements a resource update request.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Resource, error)

Extract interprets any resource result as a Resource, if possible.

type UpdateShieldingOpts

type UpdateShieldingOpts struct {
	ShieldingPop *int `json:"shielding_pop"`
}

UpdateShieldingOpts specifies attributes used to update origin shielding settings.

func (UpdateShieldingOpts) Map

func (opts UpdateShieldingOpts) Map() (map[string]interface{}, error)

Map builds a request body from a UpdateShieldingOpts structure.

type UpdateShieldingOptsBuilder

type UpdateShieldingOptsBuilder interface {
	Map() (map[string]interface{}, error)
}

type UpdateShieldingResult

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

UpdateShieldingResult is the result of a request to update origin shielding settings. Call its Extract method to interpret a result as a ResourceShielding.

func UpdateShielding

func UpdateShielding(client *gophercloud.ServiceClient, projectID string, resourceID int, opts UpdateShieldingOptsBuilder) (r UpdateShieldingResult)

UpdateShielding implements a request to update origin shielding settings.

func (UpdateShieldingResult) Extract

func (r UpdateShieldingResult) Extract() (*ResourceShielding, error)

Extract interprets any resource shielding result as a ResourceShielding, if possible.

Jump to

Keyboard shortcuts

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