v3

package
v7.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Overview

Package v3 provides access to the Akamai Cloudlets V3 APIs

Index

Constants

View Source
const (
	// Range represents range option
	Range ObjectMatchValueRangeType = "range"
	// Simple represents simple option
	Simple ObjectMatchValueSimpleType = "simple"
	// Object represents object option
	Object ObjectMatchValueObjectType = "object"
)
View Source
const (
	// PolicyTypeShared represents policy of type SHARED
	PolicyTypeShared = PolicyType("SHARED")
	// CloudletTypeAP represents cloudlet of type AP
	CloudletTypeAP = CloudletType("AP")
	// CloudletTypeAS represents cloudlet of type AS
	CloudletTypeAS = CloudletType("AS")
	// CloudletTypeCD represents cloudlet of type CD
	CloudletTypeCD = CloudletType("CD")
	// CloudletTypeER represents cloudlet of type ER
	CloudletTypeER = CloudletType("ER")
	// CloudletTypeFR represents cloudlet of type FR
	CloudletTypeFR = CloudletType("FR")
	// CloudletTypeIG represents cloudlet of type IG
	CloudletTypeIG = CloudletType("IG")
)

Variables

View Source
var (
	// ErrUnmarshallMatchCriteriaAP is returned when unmarshalling of MatchCriteriaAP fails
	ErrUnmarshallMatchCriteriaAP = errors.New("unmarshalling MatchCriteriaAP")
	// ErrUnmarshallMatchCriteriaAS is returned when unmarshalling of MatchCriteriaAS fails
	ErrUnmarshallMatchCriteriaAS = errors.New("unmarshalling MatchCriteriaAS")
	// ErrUnmarshallMatchCriteriaPR is returned when unmarshalling of MatchCriteriaPR fails
	ErrUnmarshallMatchCriteriaPR = errors.New("unmarshalling MatchCriteriaPR")
	// ErrUnmarshallMatchCriteriaER is returned when unmarshalling of MatchCriteriaER fails
	ErrUnmarshallMatchCriteriaER = errors.New("unmarshalling MatchCriteriaER")
	// ErrUnmarshallMatchCriteriaFR is returned when unmarshalling of MatchCriteriaFR fails
	ErrUnmarshallMatchCriteriaFR = errors.New("unmarshalling MatchCriteriaFR")
	// ErrUnmarshallMatchCriteriaRC is returned when unmarshalling of MatchCriteriaRC fails
	ErrUnmarshallMatchCriteriaRC = errors.New("unmarshalling MatchCriteriaRC")
	// ErrUnmarshallMatchCriteriaVP is returned when unmarshalling of MatchCriteriaVP fails
	ErrUnmarshallMatchCriteriaVP = errors.New("unmarshalling MatchCriteriaVP")
	// ErrUnmarshallMatchRules is returned when unmarshalling of MatchRules fails
	ErrUnmarshallMatchRules = errors.New("unmarshalling MatchRules")
)
View Source
var (
	// ErrListPolicies is returned when ListPolicies fails
	ErrListPolicies = errors.New("list shared policies")
	// ErrCreatePolicy is returned when CreatePolicy fails
	ErrCreatePolicy = errors.New("create shared policy")
	// ErrDeletePolicy is returned when DeletePolicy fails
	ErrDeletePolicy = errors.New("delete shared policy")
	// ErrGetPolicy is returned when GetPolicy fails
	ErrGetPolicy = errors.New("get shared policy")
	// ErrUpdatePolicy is returned when UpdatePolicy fails
	ErrUpdatePolicy = errors.New("update shared policy")
	// ErrClonePolicy is returned when ClonePolicy fails
	ErrClonePolicy = errors.New("clone policy")
)
View Source
var (
	// ErrListPolicyActivations is returned when ListPolicyActivations fails.
	ErrListPolicyActivations = errors.New("list policy activations")
	// ErrActivatePolicy is returned when ActivatePolicy fails.
	ErrActivatePolicy = errors.New("activate policy")
	// ErrDeactivatePolicy is returned when DeactivatePolicy fails.
	ErrDeactivatePolicy = errors.New("deactivate policy")
	// ErrGetPolicyActivation is returned when GetPolicyActivation fails.
	ErrGetPolicyActivation = errors.New("get policy activation")
)
View Source
var (
	// ErrListPolicyVersions is returned when ListPolicyVersions fails
	ErrListPolicyVersions = errors.New("list policy versions")
	// ErrGetPolicyVersion is returned when GetPolicyVersion fails
	ErrGetPolicyVersion = errors.New("get policy versions")
	// ErrCreatePolicyVersion is returned when CreatePolicyVersion fails
	ErrCreatePolicyVersion = errors.New("create policy versions")
	// ErrDeletePolicyVersion is returned when DeletePolicyVersion fails
	ErrDeletePolicyVersion = errors.New("delete policy versions")
	// ErrUpdatePolicyVersion is returned when UpdatePolicyVersion fails
	ErrUpdatePolicyVersion = errors.New("update policy versions")
)
View Source
var (
	// ErrListActivePolicyProperties is returned when ListActivePolicyProperties fails.
	ErrListActivePolicyProperties = errors.New("list active policy properties")
)
View Source
var (
	// ErrListCloudlets is returned when ListCloudlets fails
	ErrListCloudlets = errors.New("list cloudlets")
)
View Source
var ErrPolicyNotFound = errors.New("policy not found")

ErrPolicyNotFound is returned when policy was not found

View Source
var (
	// ErrStructValidation is returned when given struct validation failed.
	ErrStructValidation = errors.New("struct validation")
)

Functions

This section is empty.

Types

type ActivatePolicyRequest

type ActivatePolicyRequest struct {
	PolicyID      int64
	Network       Network
	PolicyVersion int64
}

ActivatePolicyRequest contains request parameters for ActivatePolicy.

func (ActivatePolicyRequest) Validate

func (r ActivatePolicyRequest) Validate() error

Validate validates ActivatePolicyRequest.

type ActivationInfo

type ActivationInfo struct {
	Effective *PolicyActivation `json:"effective"`
	Latest    *PolicyActivation `json:"latest"`
}

ActivationInfo contains information about effective and latest activations

type ActivationStatus

type ActivationStatus string

ActivationStatus represents information about policy activation status.

const (
	// ActivationStatusInProgress informs that activation is in progress.
	ActivationStatusInProgress ActivationStatus = "IN_PROGRESS"
	// ActivationStatusSuccess informs that activation succeeded.
	ActivationStatusSuccess ActivationStatus = "SUCCESS"
	// ActivationStatusFailed informs that activation failed.
	ActivationStatusFailed ActivationStatus = "FAILED"
)

type AllowDeny

type AllowDeny string

AllowDeny enum type

const (
	// Allow represents allow option
	Allow AllowDeny = "allow"
	// Deny represents deny option
	Deny AllowDeny = "deny"
	// DenyBranded represents denybranded option
	DenyBranded AllowDeny = "denybranded"
)

type CheckIPs

type CheckIPs string

CheckIPs enum type

const (
	// CheckIPsConnectingIP represents connecting ip option
	CheckIPsConnectingIP CheckIPs = "CONNECTING_IP"
	// CheckIPsXFFHeaders represents xff headers option
	CheckIPsXFFHeaders CheckIPs = "XFF_HEADERS"
	// CheckIPsConnectingIPXFFHeaders represents connecting ip + xff headers option
	CheckIPsConnectingIPXFFHeaders CheckIPs = "CONNECTING_IP XFF_HEADERS"
)

type ClientFunc

type ClientFunc func(sess session.Session, opts ...Option) Cloudlets

ClientFunc is a Cloudlets client new method, this can be used for mocking.

type ClonePolicyBodyParams

type ClonePolicyBodyParams struct {
	AdditionalVersions []int64 `json:"additionalVersions,omitempty"`
	GroupID            int64   `json:"groupId,omitempty"`
	NewName            string  `json:"newName"`
}

ClonePolicyBodyParams contains request body parameters used in ClonePolicy operation GroupID is required only when cloning v2

func (ClonePolicyBodyParams) Validate

func (b ClonePolicyBodyParams) Validate() error

Validate validates ClonePolicyBodyParams

type ClonePolicyRequest

type ClonePolicyRequest struct {
	PolicyID   int64
	BodyParams ClonePolicyBodyParams
}

ClonePolicyRequest contains request parameters for ClonePolicy

func (ClonePolicyRequest) Validate

func (r ClonePolicyRequest) Validate() error

Validate validates ClonePolicyRequest

type CloudletType

type CloudletType string

CloudletType represents the type of the cloudlet

type Cloudlets

type Cloudlets interface {
	// ListCloudlets returns details of Cloudlets that you can create a shared policy for, including a Cloudlet name and Cloudlet type
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/get-cloudlets
	ListCloudlets(context.Context) ([]ListCloudletsItem, error)

	// ListPolicies returns shared policies that are available within your group
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/get-policies
	ListPolicies(context.Context, ListPoliciesRequest) (*ListPoliciesResponse, error)

	// CreatePolicy creates a shared policy for a specific Cloudlet type
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/post-policy
	CreatePolicy(context.Context, CreatePolicyRequest) (*Policy, error)

	// DeletePolicy deletes an existing Cloudlets policy
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/delete-policy
	DeletePolicy(context.Context, DeletePolicyRequest) error

	// GetPolicy returns information about a shared policy, including its activation status on the staging and production networks
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/get-policy
	GetPolicy(context.Context, GetPolicyRequest) (*Policy, error)

	// UpdatePolicy updates an existing policy
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/put-policy
	UpdatePolicy(context.Context, UpdatePolicyRequest) (*Policy, error)

	// ClonePolicy clones the staging, production, and last modified versions of a non-shared (API v2) or shared policy into a new shared policy
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/post-policy-clone
	ClonePolicy(context.Context, ClonePolicyRequest) (*Policy, error)

	// ListActivePolicyProperties returns all active properties that are assigned to the policy
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/get-policy-properties
	ListActivePolicyProperties(context.Context, ListActivePolicyPropertiesRequest) (*ListActivePolicyPropertiesResponse, error)

	// ListPolicyVersions lists policy versions by policyID.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/get-policy-versions
	ListPolicyVersions(context.Context, ListPolicyVersionsRequest) (*ListPolicyVersions, error)

	// GetPolicyVersion gets policy version by policyID and version.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/get-policy-version
	GetPolicyVersion(context.Context, GetPolicyVersionRequest) (*PolicyVersion, error)

	// CreatePolicyVersion creates policy version.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/post-policy-version
	CreatePolicyVersion(context.Context, CreatePolicyVersionRequest) (*PolicyVersion, error)

	// DeletePolicyVersion deletes policy version.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/delete-policy-version
	DeletePolicyVersion(context.Context, DeletePolicyVersionRequest) error

	// UpdatePolicyVersion updates policy version.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/put-policy-version
	UpdatePolicyVersion(context.Context, UpdatePolicyVersionRequest) (*PolicyVersion, error)

	// ListPolicyActivations returns the complete activation history for the selected policy in a reverse chronological order.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/get-policy-activations
	ListPolicyActivations(context.Context, ListPolicyActivationsRequest) (*PolicyActivations, error)

	// ActivatePolicy initiates the activation of the selected cloudlet policy version.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/post-policy-activations
	ActivatePolicy(context.Context, ActivatePolicyRequest) (*PolicyActivation, error)

	// DeactivatePolicy initiates the deactivation of the selected cloudlet policy version.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/post-policy-activations
	DeactivatePolicy(context.Context, DeactivatePolicyRequest) (*PolicyActivation, error)

	// GetPolicyActivation activates the selected cloudlet policy version.
	//
	// See: https://techdocs.akamai.com/cloudlets/reference/get-policy-activation
	GetPolicyActivation(context.Context, GetPolicyActivationRequest) (*PolicyActivation, error)
}

Cloudlets is the api interface for cloudlets.

func Client

func Client(sess session.Session, opts ...Option) Cloudlets

Client returns a new cloudlets Client instance with the specified controller.

type CreatePolicyRequest

type CreatePolicyRequest struct {
	CloudletType CloudletType `json:"cloudletType"`
	Description  *string      `json:"description,omitempty"`
	GroupID      int64        `json:"groupId"`
	Name         string       `json:"name"`
	PolicyType   PolicyType   `json:"policyType,omitempty"`
}

CreatePolicyRequest contains request parameters for CreatePolicy

func (CreatePolicyRequest) Validate

func (r CreatePolicyRequest) Validate() error

Validate validates CreatePolicyRequest

type CreatePolicyVersion

type CreatePolicyVersion struct {
	Description *string    `json:"description,omitempty"`
	MatchRules  MatchRules `json:"matchRules"`
}

CreatePolicyVersion describes the body of the create policy request

type CreatePolicyVersionRequest

type CreatePolicyVersionRequest struct {
	CreatePolicyVersion
	PolicyID int64
}

CreatePolicyVersionRequest describes the body of the create policy request

func (CreatePolicyVersionRequest) Validate

func (c CreatePolicyVersionRequest) Validate() error

Validate validates CreatePolicyVersionRequest

type CurrentActivations

type CurrentActivations struct {
	Production ActivationInfo `json:"production"`
	Staging    ActivationInfo `json:"staging"`
}

CurrentActivations contains information about the active policy version that's currently in use and the status of the most recent activation or deactivation operation on the policy's versions for the production and staging networks

type DeactivatePolicyRequest

type DeactivatePolicyRequest struct {
	PolicyID      int64
	Network       Network
	PolicyVersion int64
}

DeactivatePolicyRequest contains request parameters for DeactivatePolicy.

func (DeactivatePolicyRequest) Validate

func (r DeactivatePolicyRequest) Validate() error

Validate validates DeactivatePolicyRequest.

type DeletePolicyRequest

type DeletePolicyRequest struct {
	PolicyID int64
}

DeletePolicyRequest contains request parameters for DeletePolicy

func (DeletePolicyRequest) Validate

func (r DeletePolicyRequest) Validate() error

Validate validates DeletePolicyRequest

type DeletePolicyVersionRequest

type DeletePolicyVersionRequest struct {
	PolicyID      int64
	PolicyVersion int64
}

DeletePolicyVersionRequest describes the parameters of the delete policy version request

func (DeletePolicyVersionRequest) Validate

func (c DeletePolicyVersionRequest) Validate() error

Validate validates DeletePolicyVersionRequest

type Error

type Error struct {
	Type        string          `json:"type,omitempty"`
	Title       string          `json:"title,omitempty"`
	Instance    string          `json:"instance,omitempty"`
	Status      int             `json:"status,omitempty"`
	Errors      json.RawMessage `json:"errors,omitempty"`
	Detail      string          `json:"detail"`
	RequestID   string          `json:"requestId,omitempty"`
	RequestTime string          `json:"requestTime,omitempty"`
	ClientIP    string          `json:"clientIp,omitempty"`
	ServerIP    string          `json:"serverIp,omitempty"`
	Method      string          `json:"method,omitempty"`
}

Error is a cloudlets error interface.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Is

func (e *Error) Is(target error) bool

Is handles error comparisons.

type ForwardSettingsAS

type ForwardSettingsAS struct {
	PathAndQS              string `json:"pathAndQS,omitempty"`
	UseIncomingQueryString bool   `json:"useIncomingQueryString,omitempty"`
	OriginID               string `json:"originId,omitempty"`
}

ForwardSettingsAS represents forward settings for an Application Segmentation (AS)

type ForwardSettingsFR

type ForwardSettingsFR struct {
	PathAndQS              string `json:"pathAndQS,omitempty"`
	UseIncomingQueryString bool   `json:"useIncomingQueryString,omitempty"`
	OriginID               string `json:"originId,omitempty"`
}

ForwardSettingsFR represents forward settings for a Forward Rewrite (FR)

type ForwardSettingsPR

type ForwardSettingsPR struct {
	OriginID string `json:"originId"`
	Percent  int    `json:"percent"`
}

ForwardSettingsPR represents forward settings for a Phased Release (PR aka CD)

type GetPolicyActivationRequest

type GetPolicyActivationRequest struct {
	PolicyID     int64
	ActivationID int64
}

GetPolicyActivationRequest contains request parameters for GetPolicyActivation.

func (GetPolicyActivationRequest) Validate

func (r GetPolicyActivationRequest) Validate() error

Validate validates GetPolicyActivationRequest.

type GetPolicyRequest

type GetPolicyRequest struct {
	PolicyID int64
}

GetPolicyRequest contains request parameters for GetPolicy

func (GetPolicyRequest) Validate

func (r GetPolicyRequest) Validate() error

Validate validates GetPolicyRequest

type GetPolicyVersionRequest

type GetPolicyVersionRequest struct {
	PolicyID      int64
	PolicyVersion int64
}

GetPolicyVersionRequest describes the parameters needed to get policy version

type Link struct {
	Href string `json:"href"`
	Rel  string `json:"rel"`
}

Link represents hypermedia link to help navigate through the result set.

type ListActivePolicyPropertiesRequest

type ListActivePolicyPropertiesRequest struct {
	PolicyID int64
	Page     int
	Size     int
}

ListActivePolicyPropertiesRequest contains request parameters for ListActivePolicyProperties

func (ListActivePolicyPropertiesRequest) Validate

Validate validates ListActivePolicyPropertiesRequest.

type ListActivePolicyPropertiesResponse

type ListActivePolicyPropertiesResponse struct {
	Page             Page                       `json:"page"`
	PolicyProperties []ListPolicyPropertiesItem `json:"content"`
	Links            []Link                     `json:"links"`
}

ListActivePolicyPropertiesResponse contains the response data from ListActivePolicyProperties operation.

type ListCloudletsItem

type ListCloudletsItem struct {
	CloudletName string       `json:"cloudletName"`
	CloudletType CloudletType `json:"cloudletType"`
}

ListCloudletsItem contains the response data from ListCloudlets operation

type ListPoliciesRequest

type ListPoliciesRequest struct {
	Page int
	Size int
}

ListPoliciesRequest contains request parameters for ListPolicies

func (ListPoliciesRequest) Validate

func (r ListPoliciesRequest) Validate() error

Validate validates ListPoliciesRequest

type ListPoliciesResponse

type ListPoliciesResponse struct {
	Content []Policy `json:"content"`
	Links   []Link   `json:"links"`
	Page    Page     `json:"page"`
}

ListPoliciesResponse contains the response data from ListPolicies operation

type ListPolicyActivationsRequest

type ListPolicyActivationsRequest struct {
	PolicyID int64
	Page     int
	Size     int
}

ListPolicyActivationsRequest contains request parameters for ListPolicyActivations.

func (ListPolicyActivationsRequest) Validate

func (r ListPolicyActivationsRequest) Validate() error

Validate validates ListPolicyActivationsRequest.

type ListPolicyPropertiesItem

type ListPolicyPropertiesItem struct {
	GroupID       int64   `json:"groupId"`
	ID            int64   `json:"id"`
	Name          string  `json:"name"`
	Network       Network `json:"network"`
	PolicyVersion int64   `json:"version"`
}

ListPolicyPropertiesItem represents associated active properties information.

type ListPolicyVersions

type ListPolicyVersions struct {
	PolicyVersions []ListPolicyVersionsItem `json:"content"`
	Links          []Link                   `json:"links"`
	Page           Page                     `json:"page"`
}

ListPolicyVersions is response returned by ListPolicyVersions

type ListPolicyVersionsItem

type ListPolicyVersionsItem struct {
	CreatedBy     string     `json:"createdBy"`
	CreatedDate   time.Time  `json:"createdDate"`
	Description   *string    `json:"description"`
	ID            int64      `json:"id"`
	Immutable     bool       `json:"immutable"`
	Links         []Link     `json:"links"`
	ModifiedBy    string     `json:"modifiedBy"`
	ModifiedDate  *time.Time `json:"modifiedDate,omitempty"`
	PolicyID      int64      `json:"policyId"`
	PolicyVersion int64      `json:"version"`
}

ListPolicyVersionsItem is a content struct of ListPolicyVersion response

type ListPolicyVersionsRequest

type ListPolicyVersionsRequest struct {
	PolicyID int64
	Page     int
	Size     int
}

ListPolicyVersionsRequest describes the parameters needed to list policy versions

func (ListPolicyVersionsRequest) Validate

func (c ListPolicyVersionsRequest) Validate() error

Validate validates ListPolicyVersionsRequest

type MatchCriteria

type MatchCriteria struct {
	MatchType        string        `json:"matchType,omitempty"`
	MatchValue       string        `json:"matchValue,omitempty"`
	MatchOperator    MatchOperator `json:"matchOperator,omitempty"`
	CaseSensitive    bool          `json:"caseSensitive"`
	Negate           bool          `json:"negate"`
	CheckIPs         CheckIPs      `json:"checkIPs,omitempty"`
	ObjectMatchValue interface{}   `json:"objectMatchValue,omitempty"`
}

MatchCriteria represents a match criteria resource for match rule for cloudlet

type MatchCriteriaAP

type MatchCriteriaAP MatchCriteria

MatchCriteriaAP represents a match criteria resource for match rule for cloudlet API Prioritization (AP) ObjectMatchValue can contain ObjectMatchValueObject or ObjectMatchValueSimple

func (*MatchCriteriaAP) UnmarshalJSON

func (m *MatchCriteriaAP) UnmarshalJSON(b []byte) error

UnmarshalJSON helps to un-marshall field ObjectMatchValue of MatchCriteriaAP as proper instance of *ObjectMatchValueObject or *ObjectMatchValueSimple

func (MatchCriteriaAP) Validate

func (m MatchCriteriaAP) Validate() error

Validate validates MatchCriteriaAP

type MatchCriteriaAS

type MatchCriteriaAS MatchCriteria

MatchCriteriaAS represents a match criteria resource for match rule for cloudlet Application Segmentation (AS) ObjectMatchValue can contain ObjectMatchValueObject or ObjectMatchValueSimple or ObjectMatchValueRange

func (*MatchCriteriaAS) UnmarshalJSON

func (m *MatchCriteriaAS) UnmarshalJSON(b []byte) error

UnmarshalJSON helps to un-marshall field ObjectMatchValue of MatchCriteriaAS as proper instance of *ObjectMatchValueObject or *ObjectMatchValueSimple or *ObjectMatchValueRange

func (MatchCriteriaAS) Validate

func (m MatchCriteriaAS) Validate() error

Validate validates MatchCriteriaAS

type MatchCriteriaER

type MatchCriteriaER MatchCriteria

MatchCriteriaER represents a match criteria resource for match rule for cloudlet Edge Redirector (ER) ObjectMatchValue can contain ObjectMatchValueObject or ObjectMatchValueSimple

func (*MatchCriteriaER) UnmarshalJSON

func (m *MatchCriteriaER) UnmarshalJSON(b []byte) error

UnmarshalJSON helps to un-marshall field ObjectMatchValue of MatchCriteriaER as proper instance of *ObjectMatchValueObject or *ObjectMatchValueSimple

func (MatchCriteriaER) Validate

func (m MatchCriteriaER) Validate() error

Validate validates MatchCriteriaER

type MatchCriteriaFR

type MatchCriteriaFR MatchCriteria

MatchCriteriaFR represents a match criteria resource for match rule for cloudlet Forward Rewrite (FR) ObjectMatchValue can contain ObjectMatchValueObject or ObjectMatchValueSimple

func (*MatchCriteriaFR) UnmarshalJSON

func (m *MatchCriteriaFR) UnmarshalJSON(b []byte) error

UnmarshalJSON helps to un-marshall field ObjectMatchValue of MatchCriteriaFR as proper instance of *ObjectMatchValueObject or *ObjectMatchValueSimple

func (MatchCriteriaFR) Validate

func (m MatchCriteriaFR) Validate() error

Validate validates MatchCriteriaFR

type MatchCriteriaPR

type MatchCriteriaPR MatchCriteria

MatchCriteriaPR represents a match criteria resource for match rule for cloudlet Phased Release (PR aka CD) ObjectMatchValue can contain ObjectMatchValueObject or ObjectMatchValueSimple

func (*MatchCriteriaPR) UnmarshalJSON

func (m *MatchCriteriaPR) UnmarshalJSON(b []byte) error

UnmarshalJSON helps to un-marshall field ObjectMatchValue of MatchCriteriaPR as proper instance of *ObjectMatchValueObject or *ObjectMatchValueSimple

func (MatchCriteriaPR) Validate

func (m MatchCriteriaPR) Validate() error

Validate validates MatchCriteriaPR

type MatchCriteriaRC

type MatchCriteriaRC MatchCriteria

MatchCriteriaRC represents a match criteria resource for match rule for cloudlet Request Control (RC aka IG) ObjectMatchValue can contain ObjectMatchValueObject or ObjectMatchValueSimple

func (*MatchCriteriaRC) UnmarshalJSON

func (m *MatchCriteriaRC) UnmarshalJSON(b []byte) error

UnmarshalJSON helps to un-marshall field ObjectMatchValue of MatchCriteriaRC as proper instance of *ObjectMatchValueObject or *ObjectMatchValueSimple

func (MatchCriteriaRC) Validate

func (m MatchCriteriaRC) Validate() error

Validate validates MatchCriteriaRC

type MatchOperator

type MatchOperator string

MatchOperator enum type

const (
	// MatchOperatorContains represents contains operator
	MatchOperatorContains MatchOperator = "contains"
	// MatchOperatorExists represents exists operator
	MatchOperatorExists MatchOperator = "exists"
	// MatchOperatorEquals represents equals operator
	MatchOperatorEquals MatchOperator = "equals"
)

type MatchRule

type MatchRule interface {
	Validate() error
	// contains filtered or unexported methods
}

MatchRule is base interface for MatchRuleXX

type MatchRuleAP

type MatchRuleAP struct {
	Name               string            `json:"name,omitempty"`
	Type               MatchRuleType     `json:"type,omitempty"`
	Start              int64             `json:"start,omitempty"`
	End                int64             `json:"end,omitempty"`
	ID                 int64             `json:"id,omitempty"`
	Matches            []MatchCriteriaAP `json:"matches,omitempty"`
	MatchURL           string            `json:"matchURL,omitempty"`
	PassThroughPercent *float64          `json:"passThroughPercent"`
	Disabled           bool              `json:"disabled,omitempty"`
}

MatchRuleAP represents an API Prioritization (AP) match rule resource for create or update

func (MatchRuleAP) Validate

func (m MatchRuleAP) Validate() error

Validate validates MatchRuleAP

type MatchRuleAS

type MatchRuleAS struct {
	Name            string            `json:"name,omitempty"`
	Type            MatchRuleType     `json:"type,omitempty"`
	Start           int64             `json:"start,omitempty"`
	End             int64             `json:"end,omitempty"`
	ID              int64             `json:"id,omitempty"`
	Matches         []MatchCriteriaAS `json:"matches,omitempty"`
	MatchURL        string            `json:"matchURL,omitempty"`
	ForwardSettings ForwardSettingsAS `json:"forwardSettings"`
	Disabled        bool              `json:"disabled,omitempty"`
}

MatchRuleAS represents an Application Segmentation (AS) match rule resource for create or update resource

func (MatchRuleAS) Validate

func (m MatchRuleAS) Validate() error

Validate validates MatchRuleAS

type MatchRuleER

type MatchRuleER struct {
	Name                     string            `json:"name,omitempty"`
	Type                     MatchRuleType     `json:"type,omitempty"`
	Start                    int64             `json:"start,omitempty"`
	End                      int64             `json:"end,omitempty"`
	ID                       int64             `json:"id,omitempty"`
	Matches                  []MatchCriteriaER `json:"matches,omitempty"`
	MatchesAlways            bool              `json:"matchesAlways,omitempty"`
	UseRelativeURL           string            `json:"useRelativeUrl,omitempty"`
	StatusCode               int               `json:"statusCode"`
	RedirectURL              string            `json:"redirectURL"`
	MatchURL                 string            `json:"matchURL,omitempty"`
	UseIncomingQueryString   bool              `json:"useIncomingQueryString"`
	UseIncomingSchemeAndHost bool              `json:"useIncomingSchemeAndHost"`
	Disabled                 bool              `json:"disabled,omitempty"`
}

MatchRuleER represents an Edge Redirector (ER) match rule resource for create or update resource

func (MatchRuleER) Validate

func (m MatchRuleER) Validate() error

Validate validates MatchRuleER

type MatchRuleFR

type MatchRuleFR struct {
	Name            string            `json:"name,omitempty"`
	Type            MatchRuleType     `json:"type,omitempty"`
	Start           int64             `json:"start,omitempty"`
	End             int64             `json:"end,omitempty"`
	ID              int64             `json:"id,omitempty"`
	Matches         []MatchCriteriaFR `json:"matches,omitempty"`
	MatchURL        string            `json:"matchURL,omitempty"`
	ForwardSettings ForwardSettingsFR `json:"forwardSettings"`
	Disabled        bool              `json:"disabled,omitempty"`
}

MatchRuleFR represents a Forward Rewrite (FR) match rule resource for create or update resource

func (MatchRuleFR) Validate

func (m MatchRuleFR) Validate() error

Validate validates MatchRuleFR

type MatchRuleFormat

type MatchRuleFormat string

MatchRuleFormat enum type

const (
	// MatchRuleFormat10 represents default match rule format
	MatchRuleFormat10 MatchRuleFormat = "1.0"
)

type MatchRulePR

type MatchRulePR struct {
	Name            string            `json:"name,omitempty"`
	Type            MatchRuleType     `json:"type,omitempty"`
	Start           int64             `json:"start,omitempty"`
	End             int64             `json:"end,omitempty"`
	ID              int64             `json:"id,omitempty"`
	Matches         []MatchCriteriaPR `json:"matches,omitempty"`
	MatchURL        string            `json:"matchURL,omitempty"`
	ForwardSettings ForwardSettingsPR `json:"forwardSettings"`
	Disabled        bool              `json:"disabled,omitempty"`
	MatchesAlways   bool              `json:"matchesAlways,omitempty"`
}

MatchRulePR represents a Phased Release (PR aka CD) match rule resource for create or update resource

func (MatchRulePR) Validate

func (m MatchRulePR) Validate() error

Validate validates MatchRulePR

type MatchRuleRC

type MatchRuleRC struct {
	Name          string            `json:"name,omitempty"`
	Type          MatchRuleType     `json:"type,omitempty"`
	Start         int64             `json:"start,omitempty"`
	End           int64             `json:"end,omitempty"`
	ID            int64             `json:"id,omitempty"`
	Matches       []MatchCriteriaRC `json:"matches,omitempty"`
	MatchesAlways bool              `json:"matchesAlways,omitempty"`
	AllowDeny     AllowDeny         `json:"allowDeny"`
	Disabled      bool              `json:"disabled,omitempty"`
}

MatchRuleRC represents a Request Control (RC aka IG) match rule resource for create or update resource

func (MatchRuleRC) Validate

func (m MatchRuleRC) Validate() error

Validate validates MatchRuleRC

type MatchRuleType

type MatchRuleType string

MatchRuleType enum type

const (
	// MatchRuleTypeAP represents rule type for API Prioritization (AP) cloudlets
	MatchRuleTypeAP MatchRuleType = "apMatchRule"
	// MatchRuleTypeAS represents rule type for Application Segmentation (AS) cloudlets
	MatchRuleTypeAS MatchRuleType = "asMatchRule"
	// MatchRuleTypePR represents rule type for Phased Release (PR aka CD) cloudlets
	MatchRuleTypePR MatchRuleType = "cdMatchRule"
	// MatchRuleTypeER represents rule type for Edge Redirector (ER) cloudlets
	MatchRuleTypeER MatchRuleType = "erMatchRule"
	// MatchRuleTypeFR represents rule type for Forward Rewrite (FR) cloudlets
	MatchRuleTypeFR MatchRuleType = "frMatchRule"
	// MatchRuleTypeRC represents rule type for Request Control (RC aka IG) cloudlets
	MatchRuleTypeRC MatchRuleType = "igMatchRule"
	// MatchRuleTypeVP represents rule type for Visitor Prioritization (VP) cloudlets
	MatchRuleTypeVP MatchRuleType = "vpMatchRule"
)

type MatchRules

type MatchRules []MatchRule

MatchRules is an array of *MatchRuleXX depending on the cloudletId (9 or 0) of the policy

func (*MatchRules) UnmarshalJSON

func (m *MatchRules) UnmarshalJSON(b []byte) error

UnmarshalJSON helps to un-marshall items of MatchRules array as proper instances of or *MatchRuleER

func (MatchRules) Validate

func (m MatchRules) Validate() error

Validate validates MatchRules

type MatchRulesWarning

type MatchRulesWarning struct {
	Detail      string `json:"detail"`
	JSONPointer string `json:"jsonPointer,omitempty"`
	Title       string `json:"title"`
	Type        string `json:"type"`
}

MatchRulesWarning describes the warnings struct

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) ActivatePolicy

func (m *Mock) ActivatePolicy(ctx context.Context, req ActivatePolicyRequest) (*PolicyActivation, error)

func (*Mock) ClonePolicy

func (m *Mock) ClonePolicy(ctx context.Context, req ClonePolicyRequest) (*Policy, error)

func (*Mock) CreatePolicy

func (m *Mock) CreatePolicy(ctx context.Context, req CreatePolicyRequest) (*Policy, error)

func (*Mock) CreatePolicyVersion

func (m *Mock) CreatePolicyVersion(ctx context.Context, req CreatePolicyVersionRequest) (*PolicyVersion, error)

func (*Mock) DeactivatePolicy

func (m *Mock) DeactivatePolicy(ctx context.Context, req DeactivatePolicyRequest) (*PolicyActivation, error)

func (*Mock) DeletePolicy

func (m *Mock) DeletePolicy(ctx context.Context, req DeletePolicyRequest) error

func (*Mock) DeletePolicyVersion

func (m *Mock) DeletePolicyVersion(ctx context.Context, req DeletePolicyVersionRequest) error

func (*Mock) GetPolicy

func (m *Mock) GetPolicy(ctx context.Context, req GetPolicyRequest) (*Policy, error)

func (*Mock) GetPolicyActivation

func (m *Mock) GetPolicyActivation(ctx context.Context, req GetPolicyActivationRequest) (*PolicyActivation, error)

func (*Mock) GetPolicyVersion

func (m *Mock) GetPolicyVersion(ctx context.Context, req GetPolicyVersionRequest) (*PolicyVersion, error)

func (*Mock) ListCloudlets

func (m *Mock) ListCloudlets(ctx context.Context) ([]ListCloudletsItem, error)

func (*Mock) ListPolicies

func (m *Mock) ListPolicies(ctx context.Context, req ListPoliciesRequest) (*ListPoliciesResponse, error)

func (*Mock) ListPolicyActivations

func (m *Mock) ListPolicyActivations(ctx context.Context, req ListPolicyActivationsRequest) (*PolicyActivations, error)

func (*Mock) ListPolicyVersions

func (m *Mock) ListPolicyVersions(ctx context.Context, req ListPolicyVersionsRequest) (*ListPolicyVersions, error)

func (*Mock) UpdatePolicy

func (m *Mock) UpdatePolicy(ctx context.Context, req UpdatePolicyRequest) (*Policy, error)

func (*Mock) UpdatePolicyVersion

func (m *Mock) UpdatePolicyVersion(ctx context.Context, req UpdatePolicyVersionRequest) (*PolicyVersion, error)

type Network

type Network string

Network represents network on which policy version or property can be activated on.

const (
	// StagingNetwork represents staging network.
	StagingNetwork Network = "STAGING"
	// ProductionNetwork represents production network.
	ProductionNetwork Network = "PRODUCTION"
)

type ObjectMatchValueObject

type ObjectMatchValueObject struct {
	Name              string                     `json:"name"`
	Type              ObjectMatchValueObjectType `json:"type"`
	NameCaseSensitive bool                       `json:"nameCaseSensitive"`
	NameHasWildcard   bool                       `json:"nameHasWildcard"`
	Options           *Options                   `json:"options,omitempty"`
}

ObjectMatchValueObject represents an object match value resource for match criteria of type object

func (ObjectMatchValueObject) Validate

func (o ObjectMatchValueObject) Validate() error

Validate validates ObjectMatchValueObject

type ObjectMatchValueObjectType

type ObjectMatchValueObjectType string

ObjectMatchValueObjectType enum type

type ObjectMatchValueRange

type ObjectMatchValueRange struct {
	Type  ObjectMatchValueRangeType `json:"type"`
	Value []int64                   `json:"value,omitempty"`
}

ObjectMatchValueRange represents an object match value resource for match criteria of type range

func (ObjectMatchValueRange) Validate

func (o ObjectMatchValueRange) Validate() error

Validate validates ObjectMatchValueRange

type ObjectMatchValueRangeType

type ObjectMatchValueRangeType string

ObjectMatchValueRangeType enum type

type ObjectMatchValueSimple

type ObjectMatchValueSimple struct {
	Type  ObjectMatchValueSimpleType `json:"type"`
	Value []string                   `json:"value,omitempty"`
}

ObjectMatchValueSimple represents an object match value resource for match criteria of type simple

func (ObjectMatchValueSimple) Validate

func (o ObjectMatchValueSimple) Validate() error

Validate validates ObjectMatchValueSimple

type ObjectMatchValueSimpleType

type ObjectMatchValueSimpleType string

ObjectMatchValueSimpleType enum type

type Option

type Option func(*cloudlets)

Option defines a Cloudlets option.

type Options

type Options struct {
	Value              []string `json:"value,omitempty"`
	ValueHasWildcard   bool     `json:"valueHasWildcard,omitempty"`
	ValueCaseSensitive bool     `json:"valueCaseSensitive,omitempty"`
	ValueEscaped       bool     `json:"valueEscaped,omitempty"`
}

Options represents an option resource for ObjectMatchValueObject

type Page

type Page struct {
	Number        int `json:"number"`
	Size          int `json:"size"`
	TotalElements int `json:"totalElements"`
	TotalPages    int `json:"totalPages"`
}

Page contains informational data about pagination.

type Policy

type Policy struct {
	CloudletType       CloudletType       `json:"cloudletType"`
	CreatedBy          string             `json:"createdBy"`
	CreatedDate        time.Time          `json:"createdDate"`
	CurrentActivations CurrentActivations `json:"currentActivations"`
	Description        *string            `json:"description"`
	GroupID            int64              `json:"groupId"`
	ID                 int64              `json:"id"`
	Links              []Link             `json:"links"`
	ModifiedBy         string             `json:"modifiedBy"`
	ModifiedDate       *time.Time         `json:"modifiedDate,omitempty"`
	Name               string             `json:"name"`
	PolicyType         PolicyType         `json:"policyType"`
}

Policy contains information about shared policy

type PolicyActivation

type PolicyActivation struct {
	CreatedBy            string                    `json:"createdBy"`
	CreatedDate          time.Time                 `json:"createdDate"`
	FinishDate           *time.Time                `json:"finishDate"`
	ID                   int64                     `json:"id"`
	Network              Network                   `json:"network"`
	Operation            PolicyActivationOperation `json:"operation"`
	PolicyID             int64                     `json:"policyId"`
	Status               ActivationStatus          `json:"status"`
	PolicyVersion        int64                     `json:"policyVersion"`
	PolicyVersionDeleted bool                      `json:"policyVersionDeleted"`
	Links                []Link                    `json:"links"`
}

PolicyActivation represents a single policy activation.

type PolicyActivationOperation

type PolicyActivationOperation string

PolicyActivationOperation is an enum for policy activation operation

const (
	// OperationActivation represents an operation used for activating a policy
	OperationActivation PolicyActivationOperation = "ACTIVATION"
	// OperationDeactivation represents an operation used for deactivating a policy
	OperationDeactivation PolicyActivationOperation = "DEACTIVATION"
)

type PolicyActivations

type PolicyActivations struct {
	Page              Page               `json:"page"`
	PolicyActivations []PolicyActivation `json:"content"`
	Links             []Link             `json:"links"`
}

PolicyActivations represents the response data from ListPolicyActivations.

type PolicyType

type PolicyType string

PolicyType represents the type of the policy

type PolicyVersion

type PolicyVersion struct {
	CreatedBy          string              `json:"createdBy"`
	CreatedDate        time.Time           `json:"createdDate"`
	Description        *string             `json:"description"`
	ID                 int64               `json:"id"`
	Immutable          bool                `json:"immutable"`
	MatchRules         MatchRules          `json:"matchRules"`
	MatchRulesWarnings []MatchRulesWarning `json:"matchRulesWarnings"`
	ModifiedBy         string              `json:"modifiedBy"`
	ModifiedDate       *time.Time          `json:"modifiedDate,omitempty"`
	PolicyID           int64               `json:"policyId"`
	PolicyVersion      int64               `json:"version"`
}

PolicyVersion is response returned by GetPolicyVersion, CreatePolicyVersion or UpdatePolicyVersion

type UpdatePolicyBodyParams

type UpdatePolicyBodyParams struct {
	GroupID     int64   `json:"groupId"`
	Description *string `json:"description,omitempty"`
}

UpdatePolicyBodyParams contains request body parameters used in UpdatePolicy operation

func (UpdatePolicyBodyParams) Validate

func (b UpdatePolicyBodyParams) Validate() error

Validate validates UpdatePolicyBodyParams

type UpdatePolicyRequest

type UpdatePolicyRequest struct {
	PolicyID   int64
	BodyParams UpdatePolicyBodyParams
}

UpdatePolicyRequest contains request parameters for UpdatePolicy

func (UpdatePolicyRequest) Validate

func (r UpdatePolicyRequest) Validate() error

Validate validates UpdatePolicyRequest

type UpdatePolicyVersion

type UpdatePolicyVersion struct {
	Description *string    `json:"description,omitempty"`
	MatchRules  MatchRules `json:"matchRules"`
}

UpdatePolicyVersion describes the body of the update policy version request

type UpdatePolicyVersionRequest

type UpdatePolicyVersionRequest struct {
	UpdatePolicyVersion
	PolicyID      int64
	PolicyVersion int64
}

UpdatePolicyVersionRequest describes the parameters of the update policy version request

func (UpdatePolicyVersionRequest) Validate

func (c UpdatePolicyVersionRequest) Validate() error

Validate validates UpdatePolicyVersionRequest

type Warning

type Warning struct {
	Detail      string `json:"detail,omitempty"`
	JSONPointer string `json:"jsonPointer,omitempty"`
	Status      int    `json:"status,omitempty"`
	Title       string `json:"title,omitempty"`
	Type        string `json:"type,omitempty"`
}

Warning represents warning information regarding the policy version and loadbalancer version request

Jump to

Keyboard shortcuts

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