Documentation ¶
Overview ¶
Package cloudwrapper provides access to the Akamai Cloud Wrapper API
Index ¶
- Constants
- Variables
- type ActivateConfigurationRequest
- type BOCC
- type Behavior
- type CDN
- type CDNAuthKey
- type CDNProvider
- type Capacities
- type Capacity
- type CapacityType
- type Child
- type CloudWrapper
- type ConfigLocationReq
- type ConfigLocationResp
- type Configuration
- type Configurations
- type CreateConfigurationBody
- type CreateConfigurationRequest
- type DataStreams
- type DeleteConfigurationRequest
- type Error
- type ErrorItem
- type ForwardType
- type GetConfigurationRequest
- type ListAuthKeysRequest
- type ListAuthKeysResponse
- type ListCDNProvidersResponse
- type ListCapacitiesRequest
- type ListCapacitiesResponse
- type ListConfigurationsResponse
- type ListLocationResponse
- type ListOriginsRequest
- type ListOriginsResponse
- type ListPropertiesRequest
- type ListPropertiesResponse
- type Location
- type LocationCapacity
- type Locations
- type Mock
- func (m *Mock) ActivateConfiguration(ctx context.Context, r ActivateConfigurationRequest) error
- func (m *Mock) CreateConfiguration(ctx context.Context, r CreateConfigurationRequest) (*Configuration, error)
- func (m *Mock) DeleteConfiguration(ctx context.Context, r DeleteConfigurationRequest) error
- func (m *Mock) GetConfiguration(ctx context.Context, r GetConfigurationRequest) (*Configuration, error)
- func (m *Mock) ListAuthKeys(ctx context.Context, req ListAuthKeysRequest) (*ListAuthKeysResponse, error)
- func (m *Mock) ListCDNProviders(ctx context.Context) (*ListCDNProvidersResponse, error)
- func (m *Mock) ListCapacities(ctx context.Context, req ListCapacitiesRequest) (*ListCapacitiesResponse, error)
- func (m *Mock) ListConfigurations(ctx context.Context) (*ListConfigurationsResponse, error)
- func (m *Mock) ListLocations(ctx context.Context) (*ListLocationResponse, error)
- func (m *Mock) ListOrigins(ctx context.Context, r ListOriginsRequest) (*ListOriginsResponse, error)
- func (m *Mock) ListProperties(ctx context.Context, r ListPropertiesRequest) (*ListPropertiesResponse, error)
- func (m *Mock) UpdateConfiguration(ctx context.Context, r UpdateConfigurationRequest) (*Configuration, error)
- type MultiCDN
- type MultiCDNAuthKey
- type MultiCDNSettings
- type Option
- type Origin
- type OriginType
- type Properties
- type Property
- type PropertyType
- type RequestType
- type SamplingFrequency
- type StatusType
- type TrafficTypeItem
- type Unit
- type UpdateConfigurationBody
- type UpdateConfigurationRequest
Constants ¶
const ( // SamplingFrequencyZero represents SamplingFrequency value of 'ZERO' SamplingFrequencyZero SamplingFrequency = "ZERO" // SamplingFrequencyOneTenth represents SamplingFrequency value of 'ONE_TENTH' SamplingFrequencyOneTenth SamplingFrequency = "ONE_TENTH" // ForwardTypeOriginOnly represents ForwardType value of 'ORIGIN_ONLY' ForwardTypeOriginOnly ForwardType = "ORIGIN_ONLY" // ForwardTypeMidgressOnly represents ForwardType value of 'MIDGRESS_ONLY' ForwardTypeMidgressOnly ForwardType = "MIDGRESS_ONLY" // ForwardTypeOriginAndMidgress represents ForwardType value of 'ORIGIN_AND_MIDGRESS' ForwardTypeOriginAndMidgress ForwardType = "ORIGIN_AND_MIDGRESS" // RequestTypeEdgeOnly represents RequestType value of 'EDGE_ONLY' RequestTypeEdgeOnly RequestType = "EDGE_ONLY" // RequestTypeEdgeAndMidgress represents RequestType value of 'EDGE_AND_MIDGRESS' RequestTypeEdgeAndMidgress RequestType = "EDGE_AND_MIDGRESS" // StatusActive represents Status value of 'ACTIVE' StatusActive StatusType = "ACTIVE" // StatusSaved represents Status value of 'SAVED' StatusSaved StatusType = "SAVED" // StatusInProgress represents Status value of 'IN_PROGRESS' StatusInProgress StatusType = "IN_PROGRESS" // StatusDeleteInProgress represents Status value of 'DELETE_IN_PROGRESS' StatusDeleteInProgress StatusType = "DELETE_IN_PROGRESS" // StatusFailed represents Status value of 'FAILED' StatusFailed StatusType = "FAILED" )
const ( // PropertyTypeWeb is the web type of the property PropertyTypeWeb PropertyType = "WEB" // PropertyTypeMedia is the media type of the property PropertyTypeMedia PropertyType = "MEDIA" // OriginTypeCustomer is the customer type of the origin OriginTypeCustomer OriginType = "CUSTOMER" // OriginTypeNetStorage is the net storage type of the origin OriginTypeNetStorage OriginType = "NET_STORAGE" )
Variables ¶
var ( // ErrGetConfiguration is returned when GetConfiguration fails ErrGetConfiguration = errors.New("get configuration") // ErrListConfigurations is returned when ListConfigurations fails ErrListConfigurations = errors.New("list configurations") // ErrCreateConfiguration is returned when CreateConfiguration fails ErrCreateConfiguration = errors.New("create configuration") // ErrUpdateConfiguration is returned when UpdateConfiguration fails ErrUpdateConfiguration = errors.New("update configuration") // ErrDeleteConfiguration is returned when DeleteConfiguration fails ErrDeleteConfiguration = errors.New("delete configuration") // ErrActivateConfiguration is returned when ActivateConfiguration fails ErrActivateConfiguration = errors.New("activate configuration") )
var ( // ErrConfigurationNotFound is returned when configuration was not found ErrConfigurationNotFound = errors.New("configuration not found") // ErrDeletionNotAllowed is returned when user has insufficient permissions to delete configuration ErrDeletionNotAllowed = errors.New("deletion not allowed") )
var ( // ErrListAuthKeys is returned in case an error occurs on ListAuthKeys operation ErrListAuthKeys = errors.New("list auth keys") // ErrListCDNProviders is returned in case an error occurs on ListCDNProviders operation ErrListCDNProviders = errors.New("list CDN providers") )
var ( // ErrListProperties is returned when ListProperties fails ErrListProperties = errors.New("list properties") // ErrListOrigins is returned when ListOrigins fails ErrListOrigins = errors.New("list origins") )
var ( // ErrListCapacities is returned in case an error occurs on ListCapacities operation ErrListCapacities = errors.New("list capacities") )
var ( // ErrListLocations is returned when ListLocations fails ErrListLocations = errors.New("list locations") )
var ( // ErrStructValidation is returned when given struct validation failed ErrStructValidation = errors.New("struct validation") )
Functions ¶
This section is empty.
Types ¶
type ActivateConfigurationRequest ¶
type ActivateConfigurationRequest struct {
ConfigurationIDs []int `json:"configurationIds"`
}
ActivateConfigurationRequest holds parameters for ActivateConfiguration
func (ActivateConfigurationRequest) Validate ¶
func (r ActivateConfigurationRequest) Validate() error
Validate validates ActivateConfigurationRequest
type BOCC ¶
type BOCC struct { ConditionalSamplingFrequency SamplingFrequency `json:"conditionalSamplingFrequency,omitempty"` Enabled bool `json:"enabled"` ForwardType ForwardType `json:"forwardType,omitempty"` RequestType RequestType `json:"requestType,omitempty"` SamplingFrequency SamplingFrequency `json:"samplingFrequency,omitempty"` }
BOCC represents diagnostic data beacon details
type Behavior ¶
type Behavior struct { Hostname string `json:"hostname"` OriginType OriginType `json:"originType"` }
Behavior contains behavior information
type CDN ¶
type CDN struct { CDNAuthKeys []CDNAuthKey `json:"cdnAuthKeys,omitempty"` CDNCode string `json:"cdnCode"` Enabled bool `json:"enabled"` HTTPSOnly bool `json:"httpsOnly,omitempty"` IPACLCIDRs []string `json:"ipAclCidrs,omitempty"` }
CDN represents a CDN added for the configuration
type CDNAuthKey ¶
type CDNAuthKey struct { AuthKeyName string `json:"authKeyName"` ExpiryDate string `json:"expiryDate,omitempty"` HeaderName string `json:"headerName,omitempty"` Secret string `json:"secret,omitempty"` }
CDNAuthKey represents auth key configured for the CDN
type CDNProvider ¶
CDNProvider contains CDN provider information
type Capacities ¶
type Capacities interface { // ListCapacities fetches capacities available for a given contractId. // If no contract id is provided, lists all available capacity locations // // See: https://techdocs.akamai.com/cloud-wrapper/reference/get-capacity-inventory ListCapacities(context.Context, ListCapacitiesRequest) (*ListCapacitiesResponse, error) }
Capacities is a Cloud Wrapper API interface.
type CapacityType ¶
type CapacityType string
CapacityType is a type of the properties, this capacity is related to
const ( // CapacityTypeMedia type CapacityTypeMedia CapacityType = "MEDIA" // CapacityTypeWebStandardTLS type CapacityTypeWebStandardTLS CapacityType = "WEB_STANDARD_TLS" // CapacityTypeWebEnhancedTLS type CapacityTypeWebEnhancedTLS CapacityType = "WEB_ENHANCED_TLS" )
type CloudWrapper ¶
type CloudWrapper interface { Capacities Configurations Locations MultiCDN Properties }
CloudWrapper is the api interface for Cloud Wrapper
type ConfigLocationReq ¶
type ConfigLocationReq struct { Comments string `json:"comments"` TrafficTypeID int `json:"trafficTypeId"` Capacity Capacity `json:"capacity"` }
ConfigLocationReq represents location to be configured for the configuration
func (ConfigLocationReq) Validate ¶
func (c ConfigLocationReq) Validate() error
Validate validates ConfigurationLocation
type ConfigLocationResp ¶
type ConfigLocationResp struct { Comments string `json:"comments"` TrafficTypeID int `json:"trafficTypeId"` Capacity Capacity `json:"capacity"` MapName string `json:"mapName"` }
ConfigLocationResp represents location to be configured for the configuration
type Configuration ¶
type Configuration struct { CapacityAlertsThreshold *int `json:"capacityAlertsThreshold"` Comments string `json:"comments"` ContractID string `json:"contractId"` ConfigID int64 `json:"configId"` Locations []ConfigLocationResp `json:"locations"` MultiCDNSettings *MultiCDNSettings `json:"multiCdnSettings"` Status StatusType `json:"status"` ConfigName string `json:"configName"` LastUpdatedBy string `json:"lastUpdatedBy"` LastUpdatedDate string `json:"lastUpdatedDate"` LastActivatedBy *string `json:"lastActivatedBy"` LastActivatedDate *string `json:"lastActivatedDate"` NotificationEmails []string `json:"notificationEmails"` PropertyIDs []string `json:"propertyIds"` RetainIdleObjects bool `json:"retainIdleObjects"` }
Configuration represents CloudWrapper configuration
type Configurations ¶
type Configurations interface { // GetConfiguration gets a specific Cloud Wrapper configuration // // See: https://techdocs.akamai.com/cloud-wrapper/reference/get-configuration GetConfiguration(context.Context, GetConfigurationRequest) (*Configuration, error) // ListConfigurations lists all Cloud Wrapper configurations on your contract // // See: https://techdocs.akamai.com/cloud-wrapper/reference/get-configurations ListConfigurations(context.Context) (*ListConfigurationsResponse, error) // CreateConfiguration creates a Cloud Wrapper configuration // // See: https://techdocs.akamai.com/cloud-wrapper/reference/post-configuration CreateConfiguration(context.Context, CreateConfigurationRequest) (*Configuration, error) // UpdateConfiguration updates a saved or inactive configuration // // See: https://techdocs.akamai.com/cloud-wrapper/reference/put-configuration UpdateConfiguration(context.Context, UpdateConfigurationRequest) (*Configuration, error) // DeleteConfiguration deletes configuration // // See: https://techdocs.akamai.com/cloud-wrapper/reference/delete-configuration DeleteConfiguration(context.Context, DeleteConfigurationRequest) error // ActivateConfiguration activates a Cloud Wrapper configuration // // See: https://techdocs.akamai.com/cloud-wrapper/reference/post-configuration-activations ActivateConfiguration(context.Context, ActivateConfigurationRequest) error }
Configurations is a CloudWrapper configurations API interface
type CreateConfigurationBody ¶
type CreateConfigurationBody struct { CapacityAlertsThreshold *int `json:"capacityAlertsThreshold,omitempty"` Comments string `json:"comments"` ContractID string `json:"contractId"` Locations []ConfigLocationReq `json:"locations"` MultiCDNSettings *MultiCDNSettings `json:"multiCdnSettings,omitempty"` ConfigName string `json:"configName"` NotificationEmails []string `json:"notificationEmails,omitempty"` PropertyIDs []string `json:"propertyIds"` RetainIdleObjects bool `json:"retainIdleObjects,omitempty"` }
CreateConfigurationBody holds request body parameters for CreateConfiguration
func (CreateConfigurationBody) Validate ¶
func (b CreateConfigurationBody) Validate() error
Validate validates CreateConfigurationBody
type CreateConfigurationRequest ¶
type CreateConfigurationRequest struct { Activate bool Body CreateConfigurationBody }
CreateConfigurationRequest holds parameters for CreateConfiguration
func (CreateConfigurationRequest) Validate ¶
func (r CreateConfigurationRequest) Validate() error
Validate validates CreateConfigurationRequest
type DataStreams ¶
type DataStreams struct { DataStreamIDs []int64 `json:"dataStreamIds,omitempty"` Enabled bool `json:"enabled"` SamplingRate *int `json:"samplingRate,omitempty"` }
DataStreams represents data streams details
type DeleteConfigurationRequest ¶
type DeleteConfigurationRequest struct {
ConfigID int64
}
DeleteConfigurationRequest holds parameters for DeleteConfiguration
func (DeleteConfigurationRequest) Validate ¶
func (r DeleteConfigurationRequest) Validate() error
Validate validates DeleteConfigurationRequest
type Error ¶
type Error struct { Type string `json:"type,omitempty"` Title string `json:"title,omitempty"` Instance string `json:"instance"` Status int `json:"status"` Detail string `json:"detail"` Errors []ErrorItem `json:"errors"` Method string `json:"method"` ServerIP string `json:"serverIp"` ClientIP string `json:"clientIp"` RequestID string `json:"requestId"` RequestTime string `json:"requestTime"` }
Error is a cloudwrapper error implementation For details on possible error types, refer to: https://techdocs.akamai.com/cloud-wrapper/reference/errors
type ErrorItem ¶
type ErrorItem struct { Type string `json:"type"` Title string `json:"title"` Detail string `json:"detail"` IllegalValue any `json:"illegalValue"` IllegalParameter string `json:"illegalParameter"` }
ErrorItem is a cloud wrapper error's item
type GetConfigurationRequest ¶
type GetConfigurationRequest struct {
ConfigID int64
}
GetConfigurationRequest holds parameters for GetConfiguration
func (GetConfigurationRequest) Validate ¶
func (r GetConfigurationRequest) Validate() error
Validate validates GetConfigurationRequest
type ListAuthKeysRequest ¶
ListAuthKeysRequest is a request struct
func (ListAuthKeysRequest) Validate ¶
func (r ListAuthKeysRequest) Validate() error
Validate validates ListAuthKeysRequest
type ListAuthKeysResponse ¶
type ListAuthKeysResponse struct {
CDNAuthKeys []MultiCDNAuthKey `json:"cdnAuthKeys"`
}
ListAuthKeysResponse contains response list of CDN auth keys
type ListCDNProvidersResponse ¶
type ListCDNProvidersResponse struct {
CDNProviders []CDNProvider `json:"cdnProviders"`
}
ListCDNProvidersResponse contains response list of CDN providers
type ListCapacitiesRequest ¶
type ListCapacitiesRequest struct {
ContractIDs []string
}
ListCapacitiesRequest is a request struct
type ListCapacitiesResponse ¶
type ListCapacitiesResponse struct {
Capacities []LocationCapacity `json:"capacities"`
}
ListCapacitiesResponse contains response list of location capacities
type ListConfigurationsResponse ¶
type ListConfigurationsResponse struct {
Configurations []Configuration `json:"configurations"`
}
ListConfigurationsResponse contains response from ListConfigurations
type ListLocationResponse ¶
type ListLocationResponse struct {
Locations []Location `json:"locations"`
}
ListLocationResponse represents a response object returned by ListLocations
type ListOriginsRequest ¶
ListOriginsRequest holds parameters for ListOrigins
func (ListOriginsRequest) Validate ¶
func (r ListOriginsRequest) Validate() error
Validate validates ListOriginsRequest
type ListOriginsResponse ¶
type ListOriginsResponse struct { Children []Child `json:"children"` Default []Behavior `json:"default"` }
ListOriginsResponse contains response from ListOrigins
type ListPropertiesRequest ¶
ListPropertiesRequest holds parameters for ListProperties
type ListPropertiesResponse ¶
type ListPropertiesResponse struct {
Properties []Property `json:"properties"`
}
ListPropertiesResponse contains response from ListProperties
type Location ¶
type Location struct { LocationID int `json:"locationId"` LocationName string `json:"locationName"` MultiCDNLocationID string `json:"multiCdnLocationId"` TrafficTypes []TrafficTypeItem `json:"trafficTypes"` }
Location represents a Location object
type LocationCapacity ¶
type LocationCapacity struct { LocationID int `json:"locationId"` LocationName string `json:"locationName"` ContractID string `json:"contractId"` Type CapacityType `json:"type"` ApprovedCapacity Capacity `json:"approvedCapacity"` AssignedCapacity Capacity `json:"assignedCapacity"` UnassignedCapacity Capacity `json:"unassignedCapacity"` }
LocationCapacity contains location capacity information
type Locations ¶
type Locations interface { // ListLocations returns a list of locations available to distribute Cloud Wrapper capacity // // See: https://techdocs.akamai.com/cloud-wrapper/reference/get-locations ListLocations(context.Context) (*ListLocationResponse, error) }
Locations is the cloudwrapper location API interface
type Mock ¶
func (*Mock) ActivateConfiguration ¶
func (m *Mock) ActivateConfiguration(ctx context.Context, r ActivateConfigurationRequest) error
func (*Mock) CreateConfiguration ¶
func (m *Mock) CreateConfiguration(ctx context.Context, r CreateConfigurationRequest) (*Configuration, error)
func (*Mock) DeleteConfiguration ¶
func (m *Mock) DeleteConfiguration(ctx context.Context, r DeleteConfigurationRequest) error
func (*Mock) GetConfiguration ¶
func (m *Mock) GetConfiguration(ctx context.Context, r GetConfigurationRequest) (*Configuration, error)
func (*Mock) ListAuthKeys ¶
func (m *Mock) ListAuthKeys(ctx context.Context, req ListAuthKeysRequest) (*ListAuthKeysResponse, error)
func (*Mock) ListCDNProviders ¶
func (m *Mock) ListCDNProviders(ctx context.Context) (*ListCDNProvidersResponse, error)
func (*Mock) ListCapacities ¶
func (m *Mock) ListCapacities(ctx context.Context, req ListCapacitiesRequest) (*ListCapacitiesResponse, error)
func (*Mock) ListConfigurations ¶
func (m *Mock) ListConfigurations(ctx context.Context) (*ListConfigurationsResponse, error)
func (*Mock) ListLocations ¶
func (m *Mock) ListLocations(ctx context.Context) (*ListLocationResponse, error)
func (*Mock) ListOrigins ¶
func (m *Mock) ListOrigins(ctx context.Context, r ListOriginsRequest) (*ListOriginsResponse, error)
func (*Mock) ListProperties ¶
func (m *Mock) ListProperties(ctx context.Context, r ListPropertiesRequest) (*ListPropertiesResponse, error)
func (*Mock) UpdateConfiguration ¶
func (m *Mock) UpdateConfiguration(ctx context.Context, r UpdateConfigurationRequest) (*Configuration, error)
type MultiCDN ¶
type MultiCDN interface { // ListAuthKeys lists the cdnAuthKeys for a specified contractId and cdnCode // // See: https://techdocs.akamai.com/cloud-wrapper/reference/get-auth-keys ListAuthKeys(context.Context, ListAuthKeysRequest) (*ListAuthKeysResponse, error) // ListCDNProviders lists CDN providers // // See: https://techdocs.akamai.com/cloud-wrapper/reference/get-providers ListCDNProviders(context.Context) (*ListCDNProvidersResponse, error) }
MultiCDN is the cloudwrapper Multi-CDN API interface
type MultiCDNAuthKey ¶
type MultiCDNAuthKey struct { AuthKeyName string `json:"authKeyName"` ExpiryDate string `json:"expiryDate"` HeaderName string `json:"headerName"` }
MultiCDNAuthKey contains CDN auth key information
type MultiCDNSettings ¶
type MultiCDNSettings struct { BOCC *BOCC `json:"bocc"` CDNs []CDN `json:"cdns"` DataStreams *DataStreams `json:"dataStreams"` EnableSoftAlerts bool `json:"enableSoftAlerts,omitempty"` Origins []Origin `json:"origins"` }
MultiCDNSettings represents details about Multi CDN Settings
func (MultiCDNSettings) Validate ¶
func (m MultiCDNSettings) Validate() error
Validate validates MultiCDNSettings
type Origin ¶
type Origin struct { Hostname string `json:"hostname"` OriginID string `json:"originId"` PropertyID int `json:"propertyId"` }
Origin represents origin corresponding to the properties selected in the configuration
type Properties ¶
type Properties interface { // ListProperties lists unused properties // // See: https://techdocs.akamai.com/cloud-wrapper/reference/get-properties ListProperties(context.Context, ListPropertiesRequest) (*ListPropertiesResponse, error) // ListOrigins lists property origins // // See: https://techdocs.akamai.com/cloud-wrapper/reference/get-origins ListOrigins(context.Context, ListOriginsRequest) (*ListOriginsResponse, error) }
Properties is a CloudWrapper properties API interface
type Property ¶
type Property struct { GroupID int64 `json:"groupId"` ContractID string `json:"contractId"` PropertyID int64 `json:"propertyId"` PropertyName string `json:"propertyName"` Type PropertyType `json:"type"` }
Property represents property object
type SamplingFrequency ¶
type SamplingFrequency string
SamplingFrequency is a type of sampling frequency. Either 'ZERO' or 'ONE_TENTH'
type TrafficTypeItem ¶
type TrafficTypeItem struct { TrafficTypeID int `json:"trafficTypeId"` TrafficType string `json:"trafficType"` MapName string `json:"mapName"` }
TrafficTypeItem represents a TrafficType object for the location
type UpdateConfigurationBody ¶
type UpdateConfigurationBody struct { CapacityAlertsThreshold *int `json:"capacityAlertsThreshold,omitempty"` Comments string `json:"comments"` Locations []ConfigLocationReq `json:"locations"` MultiCDNSettings *MultiCDNSettings `json:"multiCdnSettings,omitempty"` NotificationEmails []string `json:"notificationEmails,omitempty"` PropertyIDs []string `json:"propertyIds"` RetainIdleObjects bool `json:"retainIdleObjects,omitempty"` }
UpdateConfigurationBody holds request body parameters for UpdateConfiguration
func (UpdateConfigurationBody) Validate ¶
func (b UpdateConfigurationBody) Validate() error
Validate validates UpdateConfigurationBody
type UpdateConfigurationRequest ¶
type UpdateConfigurationRequest struct { ConfigID int64 Activate bool Body UpdateConfigurationBody }
UpdateConfigurationRequest holds parameters for UpdateConfiguration
func (UpdateConfigurationRequest) Validate ¶
func (r UpdateConfigurationRequest) Validate() error
Validate validates UpdateConfigurationRequest