gobizfly

package
v0.0.0-...-ae22146 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

README

bizfly-client-go

Example

package main

import (
	"context"
	"log"
	"time"

	gobizfly "github.com/bizflycloud/bizfly-client-go"
)

const (
	host     = "https://manage.bizflycloud.vn"
	username = "cuonglm@vccloud.vn"
	password = "foobar"
)

func main() {
	client, err := gobizfly.NewClient(
		gobizfly.WithAPIUrl(host),
		gobizfly.WithTenantName(username),
	)
	if err != nil {
		log.Fatal(err)
	}

	ctx, cancelFunc := context.WithTimeout(context.Background(), time.Second*10)
	defer cancelFunc()
	tok, err := client.Token.Create(ctx, &gobizfly.TokenCreateRequest{Username: username, Password: password})
	if err != nil {
		log.Fatal(err)
	}
	client.SetKeystoneToken(tok.KeystoneToken)

	lbs, err := client.LoadBalancer.List(ctx, &gobizfly.ListOptions{})
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("%#v\n", lbs)
}

For other usages, see test files.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound for resource not found status
	ErrNotFound = errors.New("Resource not found")
	// ErrPermissionDenied for permission denied
	ErrPermissionDenied = errors.New("You are not allowed to do this action")
	// ErrCommon for common error
	ErrCommon = errors.New("Error")
)

Functions

func SliceContains

func SliceContains(slice interface{}, val interface{}) (int, bool)

SliceContains - Check data in slice

Types

type ASAlarm

type ASAlarm struct {
	AutoScaling  []string `json:"auto_scaling"`
	LoadBalancer []string `json:"load_balancer"`
}

ASAlarm - alarm to triggers scale

type ASAlarms

type ASAlarms struct {
	ScaleIn  ASAlarm `json:"scale_in"`
	ScaleOut ASAlarm `json:"scale_out"`
}

ASAlarms - alarms to do trigger scale

type ASMetadata

type ASMetadata struct {
	Alarms           ASAlarms     `json:"alarms"`
	DeletionPolicy   []string     `json:"deletion_policy"`
	ScaleInReceiver  string       `json:"scale_in_receiver"`
	ScaleOutReceiver string       `json:"scale_out_receiver"`
	WebhookIDs       ASWebhookIDs `json:"webhook_ids"`
}

ASMetadata - Medata of an auto scaling group

type ASTask

type ASTask struct {
	Ready  bool       `json:"ready"`
	Result taskResult `json:"result"`
}

ASTask is information of doing task

type ASWebhookIDs

type ASWebhookIDs struct {
	ScaleIn  Webhook `json:"scale_in"`
	ScaleOut Webhook `json:"scale_out"`
}

ASWebhookIDs - information about cluster's receivers

type AccountService

type AccountService interface {
	ListRegion(ctx context.Context) (*Regions, error)
	GetRegion(ctx context.Context, regionName string) (*Region, error)
	GetUserInfo(ctx context.Context) (*User, error)
}

type AddWorkerPoolsRequest

type AddWorkerPoolsRequest struct {
	WorkerPools []WorkerPool `json:"worker_pools" yaml:"worker_pools"`
}

type Addrs

type Addrs struct {
	HN  []string `json:"HN"`
	HCM []string `json:"HCM"`
	SG  []string `json:"SG"`
	USA []string `json:"USA"`
}

type Agents

type Agents struct {
	Created   string `json:"_created"`
	Hostname  string `json:"hostname"`
	ID        string `json:"_id"`
	Name      string `json:"name"`
	Online    bool   `json:"online"`
	ProjectID string `json:"project_id"`
	Runtime   string `json:"runtime"`
	UserID    string `json:"user_id"`
}

Agents contains agent information.

type AlarmCreateRequest

type AlarmCreateRequest struct {
	AlertInterval    int                          `json:"alert_interval"`
	ClusterID        string                       `json:"cluster_id,omitempty"`
	ClusterName      string                       `json:"cluster_name,omitempty"`
	Comparison       *Comparison                  `json:"comparison,omitempty"`
	Hostname         string                       `json:"hostname,omitempty"`
	HTTPExpectedCode int                          `json:"http_expected_code,omitempty"`
	HTTPHeaders      *[]HTTPHeaders               `json:"http_headers,omitempty"`
	HTTPURL          string                       `json:"http_url,omitempty"`
	Instances        *[]AlarmInstancesMonitors    `json:"instances,omitempty"`
	LoadBalancers    []*AlarmLoadBalancersMonitor `json:"load_balancers,omitempty"`
	Name             string                       `json:"name"`
	Receivers        []AlarmReceiversUse          `json:"receivers"`
	ResourceType     string                       `json:"resource_type"`
	Volumes          *[]AlarmVolumesMonitor       `json:"volumes,omitempty"`
}

AlarmCreateRequest represents create new alarm request payload.

type AlarmInstancesMonitors

type AlarmInstancesMonitors struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

AlarmInstancesMonitors is represents instances payload - which servers will be monitored

type AlarmLoadBalancersMonitor

type AlarmLoadBalancersMonitor struct {
	LoadBalancerID   string `json:"load_balancer_id"`
	LoadBalancerName string `json:"load_balancer_name"`
	TargetID         string `json:"target_id"`
	TargetName       string `json:"target_name,omitempty"`
	TargetType       string `json:"target_type"`
}

AlarmLoadBalancersMonitor is represents load balancer payload - which load balancer will be monitored

type AlarmReceiversUse

type AlarmReceiversUse struct {
	AutoscaleClusterName string `json:"autoscale_cluster_name,omitempty"`
	EmailAddress         string `json:"email_address,omitempty"`
	Name                 string `json:"name"`
	ReceiverID           string `json:"receiver_id"`
	SlackChannelName     string `json:"slack_channel_name,omitempty"`
	SMSInterval          int    `json:"sms_interval,omitempty"`
	SMSNumber            string `json:"sms_number,omitempty"`
	TelegramChatID       string `json:"telegram_chat_id,omitempty"`
	WebhookURL           string `json:"webhook_url,omitempty"`
}

AlarmReceiversUse is represents receiver's payload will be use create alarms

type AlarmUpdateRequest

type AlarmUpdateRequest struct {
	AlertInterval    int                          `json:"alert_interval,omitempty"`
	ClusterID        string                       `json:"cluster_id,omitempty"`
	ClusterName      string                       `json:"cluster_name,omitempty"`
	Comparison       *Comparison                  `json:"comparison,omitempty"`
	Enable           bool                         `json:"enable"`
	Hostname         string                       `json:"hostname,omitempty"`
	HTTPExpectedCode int                          `json:"http_expected_code,omitempty"`
	HTTPHeaders      *[]HTTPHeaders               `json:"http_headers,omitempty"`
	HTTPURL          string                       `json:"http_url,omitempty"`
	Instances        *[]AlarmInstancesMonitors    `json:"instances,omitempty"`
	LoadBalancers    []*AlarmLoadBalancersMonitor `json:"load_balancers,omitempty"`
	Name             string                       `json:"name,omitempty"`
	Receivers        *[]AlarmReceiversUse         `json:"receivers,omitempty"`
	ResourceType     string                       `json:"resource_type,omitempty"`
	Volumes          *[]AlarmVolumesMonitor       `json:"volumes,omitempty"`
}

AlarmUpdateRequest represents update alarm request payload.

type AlarmVolumesMonitor

type AlarmVolumesMonitor struct {
	ID     string `json:"id,omitempty"`
	Name   string `json:"name,omitempty"`
	Device string `json:"device,omitempty"`
}

AlarmVolumesMonitor is represents volumes payload - which volumes will be monitored

type Alarms

type Alarms struct {
	AlertInterval    int                          `json:"alert_interval"`
	ClusterID        string                       `json:"cluster_id,omitempty"`
	ClusterName      string                       `json:"cluster_name,omitempty"`
	Comparison       *Comparison                  `json:"comparison,omitempty"`
	Created          string                       `json:"_created"`
	Creator          string                       `json:"creator"`
	Enable           bool                         `json:"enable"`
	Hostname         string                       `json:"hostname,omitempty"`
	HTTPExpectedCode int                          `json:"http_expected_code,omitempty"`
	HTTPHeaders      []HTTPHeaders                `json:"http_headers,omitempty"`
	HTTPURL          string                       `json:"http_url,omitempty"`
	ID               string                       `json:"_id"`
	Instances        []AlarmInstancesMonitors     `json:"instances,omitempty"`
	LoadBalancers    []*AlarmLoadBalancersMonitor `json:"load_balancers,omitempty"`
	Name             string                       `json:"name"`
	ProjectID        string                       `json:"project_id"`
	Receivers        []AlarmReceiversUse          `json:"receivers"`
	ResourceType     string                       `json:"resource_type"`
	UserID           string                       `json:"user_id"`
	Volumes          []AlarmVolumesMonitor        `json:"volumes,omitempty"`
}

Alarms contains alarm information.

type AlarmsInHistories

type AlarmsInHistories struct {
	AlertInterval    int                          `json:"alert_interval"`
	ClusterID        string                       `json:"cluster_id,omitempty"`
	ClusterName      string                       `json:"cluster_name,omitempty"`
	Comparison       *Comparison                  `json:"comparison,omitempty"`
	Enable           bool                         `json:"enable"`
	Hostname         string                       `json:"hostname,omitempty"`
	HTTPExpectedCode int                          `json:"http_expected_code,omitempty"`
	HTTPHeaders      *[]HTTPHeaders               `json:"http_headers,omitempty"`
	HTTPURL          string                       `json:"http_url,omitempty"`
	ID               string                       `json:"_id"`
	Instances        *[]AlarmInstancesMonitors    `json:"instances,omitempty"`
	LoadBalancers    *[]AlarmLoadBalancersMonitor `json:"load_balancers,omitempty"`
	Name             string                       `json:"name"`
	ProjectID        string                       `json:"project_id"`
	Receivers        *[]struct {
		ReceiverID string   `json:"receiver_id"`
		Methods    []string `json:"methods"`
	} `json:"receivers"`
	ResourceType string                 `json:"resource_type"`
	UserID       string                 `json:"user_id"`
	Volumes      *[]AlarmVolumesMonitor `json:"volumes,omitempty"`
}

AlarmsInHistories contains alarm information in a history

type AttachedVolume

type AttachedVolume struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Size         int    `json:"size"`
	AttachedType string `json:"attached_type"`
	Type         string `json:"type"`
	Category     string `json:"category"`
}

AttachedVolume contains attached volumes of a server.

type AutoScalingDataDisk

type AutoScalingDataDisk struct {
	DeleteOnTermination bool   `json:"delete_on_termination"`
	Size                int    `json:"size"`
	Type                string `json:"type"`
}

AutoScalingDataDisk is represents for a data disk being created with servers

type AutoScalingEvent

type AutoScalingEvent struct {
	ActionName string `json:"action"`
	ActionType string `json:"type"`
	Metadata   struct {
		Action struct {
			Outputs map[string]interface{} `json:"outputs"`
		} `json:"action"`
	} `json:"meta_data"`
	ClusterID    string `json:"cluster_id"`
	ID           string `json:"id"`
	Level        string `json:"level"`
	ObjectType   string `json:"otype"`
	StatusReason string `json:"status_reason"`
	Timestamp    string `json:"timestamp"`
}

AutoScalingEvent is represents for a event of auto scaling group

type AutoScalingGroup

type AutoScalingGroup struct {
	Created                        string                        `json:"created_at"`
	Data                           map[string]interface{}        `json:"data"`
	DeletionPolicyInformations     DeletionInformation           `json:"deletion_info,omitempty"`
	DesiredCapacity                int                           `json:"desired_capacity"`
	ID                             string                        `json:"id"`
	LoadBalancerPolicyInformations LoadBalancerPolicyInformation `json:"load_balancer_info,omitempty"`
	MaxSize                        int                           `json:"max_size"`
	Metadata                       ASMetadata                    `json:"metadata"`
	MinSize                        int                           `json:"min_size"`
	Name                           string                        `json:"name"`
	NodeIDs                        []string                      `json:"node_ids"`
	ProfileID                      string                        `json:"profile_id"`
	ProfileName                    string                        `json:"profile_name"`
	ScaleInPolicyInformations      []ScalePolicyInformation      `json:"scale_in_info,omitempty"`
	ScaleOutPolicyInformations     []ScalePolicyInformation      `json:"scale_out_info,omitempty"`
	Status                         string                        `json:"status"`
	TaskID                         string                        `json:"task_id,omitempty"`
	Timeout                        int                           `json:"timeout"`
	Updated                        string                        `json:"updated_at"`
}

AutoScalingGroup - is represents an auto scaling group

type AutoScalingGroupCreateRequest

type AutoScalingGroupCreateRequest struct {
	DeletionPolicyInformations     *DeletionInformation           `json:"deletion_info,omitempty"`
	DesiredCapacity                int                            `json:"desired_capacity"`
	LoadBalancerPolicyInformations *LoadBalancerPolicyInformation `json:"load_balancer_info,omitempty"`
	MaxSize                        int                            `json:"max_size"`
	MinSize                        int                            `json:"min_size"`
	Name                           string                         `json:"name"`
	ProfileID                      string                         `json:"profile_id"`
	ScaleInPolicyInformations      *[]ScalePolicyInformation      `json:"scale_in_info,omitempty"`
	ScaleOutPolicyInformations     *[]ScalePolicyInformation      `json:"scale_out_info,omitempty"`
}

AutoScalingGroupCreateRequest - payload use to create auto scaling group

type AutoScalingGroupUpdateRequest

type AutoScalingGroupUpdateRequest struct {
	DesiredCapacity                int                            `json:"desired_capacity"`
	LoadBalancerPolicyInformations *LoadBalancerPolicyInformation `json:"load_balancer_info,omitempty"`
	MaxSize                        int                            `json:"max_size"`
	MinSize                        int                            `json:"min_size"`
	Name                           string                         `json:"name"`
	ProfileID                      string                         `json:"profile_id"`
	ProfileOnly                    bool                           `json:"profile_only"`
}

AutoScalingGroupUpdateRequest - payload use to update auto scaling group

type AutoScalingNetworks

type AutoScalingNetworks struct {
	ID             string    `json:"id"`
	SecurityGroups []*string `json:"security_groups,omitempty"`
}

AutoScalingNetworks - is represents for relationship between network and firewalls

type AutoScalingNode

type AutoScalingNode struct {
	Status       string                 `json:"status"`
	Name         string                 `json:"name"`
	ProfileID    string                 `json:"profile_id"`
	ProfileName  string                 `json:"profile_name"`
	PhysicalID   string                 `json:"physical_id"`
	StatusReason string                 `json:"status_reason"`
	ID           string                 `json:"id"`
	Addresses    map[string]interface{} `json:"addresses"`
}

AutoScalingNode is represents a cloud server in auto scaling group

type AutoScalingNodesDelete

type AutoScalingNodesDelete struct {
	Nodes []string `json:"nodes"`
}

AutoScalingNodesDelete is represents a list cloud server being deleted

type AutoScalingOperatingSystem

type AutoScalingOperatingSystem struct {
	CreateFrom string `json:"type,omitempty"`
	Error      string `json:"error,omitempty"`
	ID         string `json:"id,omitempty"`
	OSName     string `json:"os_name,omitempty"`
}

AutoScalingOperatingSystem is represents for operating system being use to create servers

type AutoScalingPolicies

type AutoScalingPolicies struct {
	ScaleInPolicyInformations      []ScalePolicyInformation      `json:"scale_in_info,omitempty"`
	ScaleOutPolicyInformations     []ScalePolicyInformation      `json:"scale_out_info,omitempty"`
	LoadBalancerPolicyInformations LoadBalancerPolicyInformation `json:"load_balancer_info,omitempty"`
	DeletionPolicyInformations     DeletionInformation           `json:"deletion_info,omitempty"`
	DoingTasks                     []string                      `json:"doing_task,omitempty"`
}

AutoScalingPolicies - information of policies using for auto scaling group

type AutoScalingSchdeule

type AutoScalingSchdeule struct {
	ClusterID string                    `json:"cluster_id"`
	Created   string                    `json:"created_at"`
	ID        string                    `json:"_id"`
	Name      string                    `json:"name"`
	Sizing    AutoScalingSchdeuleSizing `json:"sizing"`
	Status    string                    `json:"status"`
	TaskID    string                    `json:"task_id"`
	Valid     AutoScalingSchdeuleValid  `json:"valid"`
}

AutoScalingSchdeule - cron triggers to do time-based scale

type AutoScalingSchdeuleCreateRequest

type AutoScalingSchdeuleCreateRequest struct {
	Name   string                    `json:"name"`
	Sizing AutoScalingSchdeuleSizing `json:"sizing"`
	Valid  AutoScalingSchdeuleValid  `json:"valid"`
}

AutoScalingSchdeuleCreateRequest - payload use create a scheduler (cron trigger)

type AutoScalingSchdeuleInputs

type AutoScalingSchdeuleInputs struct {
	CronPattern string          `json:"cron_pattern"`
	Inputs      AutoScalingSize `json:"inputs"`
}

AutoScalingSchdeuleInputs - represents for a input of cron triggers

type AutoScalingSchdeuleSizing

type AutoScalingSchdeuleSizing struct {
	From AutoScalingSchdeuleInputs `json:"_from"`
	To   AutoScalingSchdeuleInputs `json:"_to,omitempty"`
	Type string                    `json:"_type"`
}

AutoScalingSchdeuleSizing - represents for phase time of cron triggers

type AutoScalingSchdeuleValid

type AutoScalingSchdeuleValid struct {
	From string  `json:"_from"`
	To   *string `json:"_to,omitempty"`
}

AutoScalingSchdeuleValid - represents for a validation time of cron triggers

type AutoScalingService

type AutoScalingService interface {
	AutoScalingGroups() *autoScalingGroup
	Common() *common
	Events() *event
	LaunchConfigurations() *launchConfiguration
	Nodes() *node
	Policies() *policy
	Schedules() *schedule
	Tasks() *task
	Webhooks() *webhook
}

AutoScalingService is interface wrap others resource's interfaces. Includes: 1. AutoScalingGroups: Provides function interact with an autoscaling group such as:

Create, Update, Delete

2. Events: Provides function to list events of an autoscaling group 3. LaunchConfigurations: Provides function to interact with launch configurations 4. Nodes: Provides function to interact with members of autoscaling group 5. Policies: Provides function to interact with autoscaling policies of autoscaling group 6. Schedules: Provides function to interact with schedule for auto scaling 7. Tasks: Provides function to get information of task 8. Webhooks: Provides fucntion to list webhook triggers scale of autoscaling group

type AutoScalingSize

type AutoScalingSize struct {
	DesiredCapacity int `json:"desired_capacity"`
	MaxSize         int `json:"max_size"`
	MinSize         int `json:"min_size"`
}

AutoScalingSize - size of auto scaling group

type AutoScalingWebhook

type AutoScalingWebhook struct {
	ActionID    string `json:"action_id"`
	ActionType  string `json:"action_type"`
	ClusterID   string `json:"cluster_id"`
	ClusterName string `json:"cluster_name"`
}

AutoScalingWebhook is represents for a Webhook to trigger scale

type AvailabilityZone

type AvailabilityZone struct {
	Active    bool   `json:"active"`
	Icon      string `json:"icon"`
	Name      string `json:"name"`
	Order     int    `json:"order"`
	ShortName string `json:"short_name"`
}

type BaseFirewall

type BaseFirewall struct {
	ID             string         `json:"id"`
	Name           string         `json:"name"`
	Description    string         `json:"description"`
	Tags           []string       `json:"tags"`
	CreatedAt      string         `json:"created_at"`
	UpdatedAt      string         `json:"updated_at"`
	RevisionNumber int            `json:"revision_number"`
	ProjectID      string         `json:"project_id"`
	ServersCount   int            `json:"servers_count"`
	RulesCount     int            `json:"rules_count"`
	InBound        []FirewallRule `json:"inbound"`
	OutBound       []FirewallRule `json:"outbound"`
}

type CDNService

type CDNService interface {
	List(ctx context.Context, opts *ListOptions) (*DomainsResp, error)
	Get(ctx context.Context, domainID string) (*ExtendedDomain, error)
	Create(ctx context.Context, cdrq *CreateDomainReq) (*CreateDomainResp, error)
	Update(ctx context.Context, domainID string, udrq *UpdateDomainReq) (*UpdateDomainResp, error)
	Delete(ctx context.Context, domainID string) error
	DeleteCache(ctx context.Context, domainID string, files *Files) error
}

type CheckConnResp

type CheckConnResp struct {
	Status string `json:"status"`
}

type Client

type Client struct {
	AutoScaling       AutoScalingService
	CloudWatcher      CloudWatcherService
	Token             TokenService
	LoadBalancer      LoadBalancerService
	Listener          ListenerService
	Pool              PoolService
	Member            MemberService
	HealthMonitor     HealthMonitorService
	KubernetesEngine  KubernetesEngineService
	ContainerRegistry ContainerRegistryService
	CDN               CDNService
	DNS               DNSService
	Account           AccountService
	VPC               VPCService

	Snapshot SnapshotService

	Volume VolumeService
	Server ServerService

	Service  ServiceInterface
	Firewall FirewallService
	SSHKey   SSHKeyService
	// contains filtered or unexported fields
}

Client represents BizFly API client.

func NewClient

func NewClient(options ...Option) (*Client, error)

NewClient creates new BizFly client.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request) (resp *http.Response, err error)

Do sends API request.

func (*Client) GetServiceUrl

func (c *Client) GetServiceUrl(serviceName string) string

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method, serviceName string, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request.

func (*Client) SetKeystoneToken

func (c *Client) SetKeystoneToken(s string)

SetKeystoneToken sets keystone token value, which will be used for authentication.

type CloudWatcherService

type CloudWatcherService interface {
	Agents() *agents
	Alarms() *alarms
	Histories() *histories
	Receivers() *receivers
	Secrets() *secrets
}

CloudWatcherService is interface wrap others resource's interfaces

type Cluster

type Cluster struct {
	UID              string            `json:"uid" yaml:"uid"`
	Name             string            `json:"name" yaml:"name"`
	Version          ControllerVersion `json:"version" yaml:"version"`
	VPCNetworkID     string            `json:"private_network_id" yaml:"private_network_id"`
	AutoUpgrade      bool              `json:"auto_upgrade" yaml:"auto_upgrade"`
	Tags             []string          `json:"tags" yaml:"tags"`
	ProvisionStatus  string            `json:"provision_status" yaml:"provision_status"`
	ClusterStatus    string            `json:"cluster_status" yaml:"cluster_status"`
	CreatedAt        string            `json:"created_at" yaml:"created_at"`
	CreatedBy        string            `json:"created_by" yaml:"created_by"`
	WorkerPoolsCount int               `json:"worker_pools_count" yaml:"worker_pools_count"`
}

type ClusterCreateRequest

type ClusterCreateRequest struct {
	Name         string       `json:"name" yaml:"name"`
	Version      string       `json:"version" yaml:"version"`
	AutoUpgrade  bool         `json:"auto_upgrade,omitempty" yaml:"auto_upgrade,omitempty"`
	VPCNetworkID string       `json:"private_network_id" yaml:"private_network_id"`
	EnableCloud  bool         `json:"enable_cloud,omitempty" yaml:"enable_cloud,omitempty"`
	Tags         []string     `json:"tags,omitempty" yaml:"tags,omitempty"`
	WorkerPools  []WorkerPool `json:"worker_pools" yaml:"worker_pools"`
}

type ClusterStat

type ClusterStat struct {
	WorkerPoolCount int `json:"worker_pools" yaml:"worker_pools"`
	TotalCPU        int `json:"total_cpu" yaml:"total_cpu"`
	TotalMemory     int `json:"total_memory" yaml:"total_memory"`
}

type Clusters

type Clusters struct {
	Clusters_ []Cluster `json:"clusters" yaml:"clusters"`
}

type Comparison

type Comparison struct {
	CompareType string  `json:"compare_type"`
	Measurement string  `json:"measurement"`
	RangeTime   int     `json:"range_time"`
	Value       float64 `json:"value"`
}

Comparison is represents comparison payload in alarms

type ContainerRegistryService

type ContainerRegistryService interface {
	List(ctx context.Context, opts *ListOptions) ([]*Repository, error)
	Create(ctx context.Context, crpl *createRepositoryPayload) error
	Delete(ctx context.Context, repositoryName string) error
	GetTags(ctx context.Context, repositoryName string) (*TagRepository, error)
	EditRepo(ctx context.Context, repositoryName string, erpl *editRepositoryPayload) error
	DeleteTag(ctx context.Context, tagName string, repositoryName string) error
	GetTag(ctx context.Context, repositoryName string, tagName string, vulnerabilities string) (*Image, error)
}

type ControllerVersion

type ControllerVersion struct {
	ID          string `json:"id,omitempty" yaml:"id,omitempty"`
	Name        string `json:"name,omitempty" yaml:"name,omitempty"`
	Description string `json:"description" yaml:"description"`
	K8SVersion  string `json:"kubernetes_version" yaml:"kubernetes_version"`
}

type CreateCustomImagePayload

type CreateCustomImagePayload struct {
	Name        string `json:"name"`
	DiskFormat  string `json:"disk_format"`
	Description string `json:"description,omitempty"`
	ImageURL    string `json:"image_url,omitempty"`
}

type CreateCustomImageResp

type CreateCustomImageResp struct {
	Image     CustomImage `json:"image"`
	Success   bool        `json:"success"`
	Token     string      `json:"token,omitempty"`
	UploadURI string      `json:"upload_uri,omitempty"`
}

type CreateDomainReq

type CreateDomainReq struct {
	Domain        string `json:"domain"`
	Email         string `json:"email,omitempty"`
	UpstreamAddrs string `json:"upstream_addrs"`
	UpstreamProto string `json:"upstream_proto"`
	PageSpeed     int    `json:"pagespeed"`
}

type CreateDomainResp

type CreateDomainResp struct {
	Message string `json:"message"`
	Domain  Domain `json:"domain"`
}

type CreateRecordPayload

type CreateRecordPayload struct {
	Name              string            `json:"name"`
	Type              string            `json:"type"`
	TTL               int               `json:"ttl"`
	Data              []string          `json:"data"`
	RoutingPolicyData RoutingPolicyData `json:"routing_policy_data"`
}

type CreateVPCPayload

type CreateVPCPayload struct {
	Name        string `json:"name"`
	CIDR        string `json:"cidr,omitempty"`
	Description string `json:"description,omitempty"`
	IsDefault   bool   `json:"is_default,omitempty"`
}

type CustomImage

type CustomImage struct {
	Name            string     `json:"name"`
	Description     string     `json:"description"`
	DiskFormat      string     `json:"disk_format"`
	ContainerFormat string     `json:"container_format"`
	Visibility      string     `json:"visibility"`
	Size            int        `json:"size"`
	VirtualSize     int        `json:"virtual_size"`
	Status          string     `json:"status"`
	Checksum        string     `json:"checksum"`
	Protected       bool       `json:"protected"`
	MinRam          int        `json:"min_ram"`
	MinDisk         int        `json:"min_disk"`
	Owner           string     `json:"owner"`
	OSHidden        bool       `json:"os_hidden"`
	OSHashAlgo      string     `json:"os_hash_algo"`
	OSHashValue     string     `json:"os_hash_value"`
	ID              string     `json:"id"`
	CreatedAt       string     `json:"created_at"`
	UpdatedAt       string     `json:"updated_at"`
	Locations       []Location `json:"locations"`
	DirectURL       string     `json:"direct_url"`
	Tags            []string   `json:"tags"`
	File            string     `json:"file"`
	Schema          string     `json:"schema"`
}

type CustomImageGetResp

type CustomImageGetResp struct {
	Image CustomImage `json:"image"`
	Token string      `json:"token"`
}

type DNSService

type DNSService interface {
	ListZones(ctx context.Context, opts *ListOptions) (*ListZoneResp, error)
	CreateZone(ctx context.Context, czpl *createZonePayload) (*ExtendedZone, error)
	GetZone(ctx context.Context, zoneID string) (*ExtendedZone, error)
	DeleteZone(ctx context.Context, zoneID string) error
	CreateRecord(ctx context.Context, zoneID string, crpl *CreateRecordPayload) (*Record, error)
	GetRecord(ctx context.Context, recordID string) (*Record, error)
	UpdateRecord(ctx context.Context, recordID string, urpl *UpdateRecordPayload) (*ExtendedRecord, error)
	DeleteRecord(ctx context.Context, recordID string) error
}

type DeleteionPolicyHooks

type DeleteionPolicyHooks struct {
	URL     string                  `json:"url"`
	Method  *string                 `json:"method"`
	Params  *map[string]interface{} `json:"params"`
	Headers *map[string]interface{} `json:"headers"`
	Verify  *bool                   `json:"verify"`
}

DeleteionPolicyHooks represents a hooks was triggered when delete node in auto scaling group

type DeletionInformation

type DeletionInformation struct {
	ID    string               `json:"id"`
	Hooks DeleteionPolicyHooks `json:"hooks"`
}

DeletionInformation - represents a deletion policy

type Domain

type Domain struct {
	ID             int    `json:"id"`
	User           int    `json:"user"`
	Certificate    int    `json:"certificate"`
	CName          string `json:"cname"`
	UpstreamAddrs  string `json:"upstream_addrs"`
	Slug           string `json:"slug"`
	PageSpeed      int    `json:"pagespeed"`
	UpstreamProto  string `json:"upstream_proto"`
	DDOSProtection int    `json:"ddos_protection"`
	Status         string `json:"status"`
	CreatedAt      string `json:"created_at"`
	DomainID       string `json:"domain_id"`
	Domain         string `json:"domain"`
	Type           string `json:"type"`
}

type DomainsResp

type DomainsResp struct {
	Domains []Domain `json:"results"`
	Next    string   `json:"next"`
	Prev    string   `json:"prev"`
	Pages   int      `json:"pages"`
	Total   int      `json:"total"`
}

type ExtendedCluster

type ExtendedCluster struct {
	Cluster
	WorkerPools []ExtendedWorkerPool `json:"worker_pools" yaml:"worker_pools"`
}

type ExtendedDomain

type ExtendedDomain struct {
	Domain
	Last24hUsage int          `json:"last_24h_usage"`
	UpstreamHost string       `json:"upstream_host"`
	Slug         string       `json:"slug"`
	SecretKey    string       `json:"secret_key"`
	DomainCDN    string       `json:"domain_cdn"`
	OriginAddrs  []OriginAddr `json:"origin_addrs"`
	HostID       string       `json:"host_id"`
}

type ExtendedRecord

type ExtendedRecord struct {
	Record
	Data []RecordData `json:"data"`
}

type ExtendedWorkerPool

type ExtendedWorkerPool struct {
	WorkerPool
	UID                string `json:"id" yaml:"id"`
	ProvisionStatus    string `json:"provision_status" yaml:"provision_status"`
	LaunchConfigID     string `json:"launch_config_id" yaml:"launch_config_id"`
	AutoScalingGroupID string `json:"autoscaling_group_id" yaml:"autoscaling_group_id"`
	CreatedAt          string `json:"created_at" yaml:"created_at"`
}

type ExtendedWorkerPools

type ExtendedWorkerPools struct {
	WorkerPools []ExtendedWorkerPool `json:"worker_pools" yaml:"worker_pools"`
}

type ExtendedZone

type ExtendedZone struct {
	Zone
	RecordsSet []RecordSet `json:"records_set"`
}

type Files

type Files struct {
	Files []string `json:"files"`
}

type Firewall

type Firewall struct {
	BaseFirewall
	Servers []string `json:"servers"`
}

type FirewallDeleteResponse

type FirewallDeleteResponse struct {
	Message string `json:"message"`
}

type FirewallDetail

type FirewallDetail struct {
	BaseFirewall
	Servers []*Server `json:"servers"`
}

type FirewallRemoveServerRequest

type FirewallRemoveServerRequest struct {
	Servers []string `json:"servers"`
}

type FirewallRequestPayload

type FirewallRequestPayload struct {
	Name     string                      `json:"name"`
	InBound  []FirewallRuleCreateRequest `json:"inbound,omitempty"`
	OutBound []FirewallRuleCreateRequest `json:"outbound,omitempty"`
	Targets  []string                    `json:"targets,omitempty"`
}

type FirewallRule

type FirewallRule struct {
	ID             string   `json:"id"`
	FirewallID     string   `json:"security_group_id"`
	EtherType      string   `json:"ethertype"`
	Direction      string   `json:"direction"`
	Protocol       string   `json:"protocol"`
	PortRangeMin   int      `json:"port_range_min"`
	PortRangeMax   int      `json:"port_range_max"`
	RemoteIPPrefix string   `json:"remote_ip_prefix"`
	Description    string   `json:"description"`
	Tags           []string `json:"tags"`
	CreatedAt      string   `json:"created_at"`
	UpdatedAt      string   `json:"updated_at"`
	RevisionNumber int      `json:"revision_number"`
	ProjectID      string   `json:"project_id"`
	Type           string   `json:"type"`
	CIDR           string   `json:"cidr"`
	PortRange      string   `json:"port_range"`
}

type FirewallRuleCreateRequest

type FirewallRuleCreateRequest struct {
	Type      string `json:"type"`
	Protocol  string `json:"protocol"`
	PortRange string `json:"port_range"`
	CIDR      string `json:"cidr"`
}

type FirewallRuleCreateResponse

type FirewallRuleCreateResponse struct {
	Rule FirewallRule `json:"security_group_rule"`
}

type FirewallSingleRuleCreateRequest

type FirewallSingleRuleCreateRequest struct {
	FirewallRuleCreateRequest
	Direction string `json:"direction"`
}

type Flavor

type Flavor struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Ram  int    `json:"ram"`
	VCPU int    `json:"vcpu"`
}

Flavor contains flavor information.

type FullCluster

type FullCluster struct {
	ExtendedCluster
	Stat ClusterStat `json:"stat" yaml:"stat"`
}

type HTTPHeaders

type HTTPHeaders struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

HTTPHeaders is is represents http headers - which using call to http_url

type HealthMonitor

type HealthMonitor struct {
	Name           string       `json:"name"`
	Type           string       `json:"type"`
	Delay          int          `json:"delay"`
	MaxRetries     int          `json:"max_retries"`
	MaxRetriesDown int          `json:"max_retries_down"`
	TimeOut        int          `json:"timeout"`
	HTTPMethod     string       `json:"http_method"`
	UrlPath        string       `json:"url_path"`
	ExpectedCodes  string       `json:"expected_codes"`
	HTTPVersion    float32      `json:"http_version"`
	OpratingStatus string       `json:"oprating_status"`
	DomainName     string       `json:"domain_name"`
	ID             string       `json:"id"`
	CreatedAt      string       `json:"created_at"`
	UpdatedAt      string       `json:"updated_at"`
	TenantID       string       `json:"tenant_id"`
	Pool           []resourceID `json:"pool"`
}

type HealthMonitorCreateRequest

type HealthMonitorCreateRequest struct {
	Name           string  `json:"name"`
	Type           string  `json:"type"`
	TimeOut        int     `json:"timeout,omitempty"`
	PoolID         string  `json:"pool_id"`
	Delay          int     `json:"delay,omitempty"`
	MaxRetries     int     `json:"max_retries,omitempty"`
	MaxRetriesDown int     `json:"max_retries_down,omitempty"`
	HTTPMethod     string  `json:"http_method,omitempty"`
	HTTPVersion    float32 `json:"http_version,omitempty"`
	URLPath        string  `json:"url_path,omitempty"`
	ExpectedCodes  string  `json:"expected_codes,omitempty"`
	DomainName     string  `json:"domain_name,omitempty"`
}

type HealthMonitorService

type HealthMonitorService interface {
	Get(ctx context.Context, healthMonitorID string) (*HealthMonitor, error)
	Delete(ctx context.Context, healthMonitorID string) error
	Create(ctx context.Context, poolID string, hmcr *HealthMonitorCreateRequest) (*HealthMonitor, error)
	Update(Ctx context.Context, healthMonitorID string, hmur *HealthMonitorUpdateRequest) (*HealthMonitor, error)
}

HealthMonitorService is an interface to interact with BizFly API Health Monitor endpoint.

type HealthMonitorUpdateRequest

type HealthMonitorUpdateRequest struct {
	Name           string  `json:"name"`
	TimeOut        int     `json:"timeout,omitempty"`
	Delay          int     `json:"delay,omitempty"`
	MaxRetries     int     `json:"max_retries,omitempty"`
	MaxRetriesDown int     `json:"max_retries_down,omitempty"`
	HTTPMethod     string  `json:"http_method,omitempty"`
	HTTPVersion    float32 `json:"http_version,omitempty"`
	URLPath        string  `json:"url_path,omitempty"`
	ExpectedCodes  string  `json:"expected_codes,omitempty"`
	DomainName     string  `json:"domain_name,omitempty"`
}

type Histories

type Histories struct {
	HistoryID   string            `json:"_id"`
	Name        string            `json:"name"`
	ProjectID   string            `json:"project_id,omitempty"`
	UserID      string            `json:"user_id,omitempty"`
	Resource    interface{}       `json:"resource,omitempty"`
	State       string            `json:"state,omitempty"`
	Measurement string            `json:"measurement,omitempty"`
	AlarmID     string            `json:"alarm_id"`
	Alarm       AlarmsInHistories `json:"alarm,omitempty"`
	Created     string            `json:"_created,omitempty"`
}

Histories contains history information.

type HooksPolicyCreateRequest

type HooksPolicyCreateRequest struct {
	Criteria              string               `json:"criteria,omitempty"`
	DestroyAfterDeletion  bool                 `json:"destroy_after_deletion,omitempty"`
	GracePeriod           int                  `json:"grace_period,omitempty"`
	Hooks                 DeleteionPolicyHooks `json:"hooks,omitempty"`
	ReduceDesiredCapacity bool                 `json:"reduce_desired_capacity,omitempty"`
	Type                  string               `json:"policy_type"`
}

HooksPolicyCreateRequest represents payload use create a deletion policy

type IAM

type IAM struct {
	Expire          string `json:"expire"`
	TenantID        string `json:"tenant_id"`
	TenantName      string `json:"tenant_name"`
	VerifiedPhone   bool   `json:"verified_phone"`
	VerifiedEmail   bool   `json:"verified_email"`
	VerifiedPayment bool   `json:"verified_payment"`
}

type IP

type IP struct {
	Version    int    `json:"version"`
	Address    string `json:"addr"`
	Type       string `json:"OS-EXT-IPS:type"`
	MacAddress string `json:"0S-EXT-IPS-MAC:mac_addr"`
}

IP represents the IP address, version and mac address of a port

type IPAddress

type IPAddress struct {
	LanAddresses   []IP `json:"LAN"`
	WanV4Addresses []IP `json:"WAN_V4"`
	WanV6Addresses []IP `json:"WAN_V6"`
}

IPAddresses contains LAN & WAN Ip address of a Cloud Server

type Image

type Image struct {
	Repository      Repository      `json:"repository"`
	Tag             RepositoryTag   `json:"tag"`
	Vulnerabilities []Vulnerability `json:"vulnerabilities"`
}

type KeyPair

type KeyPair struct {
	SSHKeyPair SSHKey `json:"keypair"`
}

type KubernetesEngineService

type KubernetesEngineService interface {
	List(ctx context.Context, opts *ListOptions) ([]*Cluster, error)
	Create(ctx context.Context, req *ClusterCreateRequest) (*ExtendedCluster, error)
	Get(ctx context.Context, id string) (*FullCluster, error)
	Delete(ctx context.Context, id string) error
	AddWorkerPools(ctx context.Context, id string, awp *AddWorkerPoolsRequest) ([]*ExtendedWorkerPool, error)
	RecycleNode(ctx context.Context, clusterUID string, PoolID string, NodePhysicalID string) error
	DeleteClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string) error
	GetClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string) (*WorkerPoolWithNodes, error)
	UpdateClusterWorkerPool(ctx context.Context, clusterUID string, PoolID string, uwp *UpdateWorkerPoolRequest) error
	DeleteClusterWorkerPoolNode(ctx context.Context, clusterUID string, PoolID string, NodeID string) error
	GetKubeConfig(ctx context.Context, clusterUID string) (string, error)
}

type LaunchConfiguration

type LaunchConfiguration struct {
	AvailabilityZone string                     `json:"availability_zone"`
	Created          string                     `json:"created_at,omitempty"`
	DataDisks        []*AutoScalingDataDisk     `json:"datadisks,omitempty"`
	Flavor           string                     `json:"flavor"`
	ID               string                     `json:"id,omitempty"`
	Metadata         map[string]interface{}     `json:"metadata"`
	Name             string                     `json:"name"`
	NetworkPlan      string                     `json:"network_plan,omitempty"`
	Networks         []*AutoScalingNetworks     `json:"networks,omitempty"`
	OperatingSystem  AutoScalingOperatingSystem `json:"os"`
	ProfileType      string                     `json:"profile_type,omitempty"`
	RootDisk         *AutoScalingDataDisk       `json:"rootdisk"`
	SecurityGroups   []*string                  `json:"security_groups,omitempty"`
	SSHKey           string                     `json:"key_name,omitempty"`
	Status           string                     `json:"status,omitempty"`
	Type             string                     `json:"type,omitempty"`
	UserData         string                     `json:"user_data,omitempty"`
}

LaunchConfiguration - is represents a launch configurations

type ListOptions

type ListOptions struct {
	Page  int `json:"page,omitempty"`
	Limit int `json:"limit,omitempty"`
}

ListOptions specifies the optional parameters for List method.

type ListZoneResp

type ListZoneResp struct {
	Zones []Zone `json:"zones"`
	Meta  Meta   `json:"_meta"`
}

type Listener

type Listener struct {
	ID                     string            `json:"id"`
	TimeoutClientData      int               `json:"timeout_client_data"`
	Description            string            `json:"description"`
	SNIContainerRefs       []string          `json:"sni_container_refs"`
	Name                   string            `json:"name"`
	ConnectionLimit        int               `json:"connection_limit"`
	UpdatedAt              string            `json:"updated_at"`
	ProjectID              string            `json:"project_id"`
	TimeoutMemberData      int               `json:"timeout_member_data"`
	TimeoutMemberConnect   int               `json:"timeout_member_connect"`
	L7Policies             []resourceID      `json:"l7policies"`
	TenandID               string            `json:"tenant_id"`
	DefaultTLSContainerRef *string           `json:"default_tls_container_ref"`
	AdminStateUp           bool              `json:"admin_state_up"`
	CreatedAt              string            `json:"created_at"`
	OperatingStatus        string            `json:"operating_status"`
	ProtocolPort           int               `json:"protocol_port"`
	LoadBalancers          []resourceID      `json:"loadbalancers"`
	ProvisoningStatus      string            `json:"provisioning_status"`
	DefaultPoolID          string            `json:"default_pool_id"`
	Protocol               string            `json:"protocol"`
	InsertHeaders          map[string]string `json:"insert_headers"`
	TimeoutTCPInspect      int               `json:"timeout_tcp_inspect"`
}

Listener contains listener information.

type ListenerCreateRequest

type ListenerCreateRequest struct {
	TimeoutTCPInspect      *int               `json:"timeout_tcp_inspect,omitempty"`
	TimeoutMemberData      *int               `json:"timeout_member_data,omitempty"`
	TimeoutMemberConnect   *int               `json:"timeout_member_connect,omitempty"`
	TimeoutClientData      *int               `json:"timeout_client_data,omitempty"`
	SNIContainerRefs       *[]string          `json:"sni_container_refs,omitempty"`
	ProtocolPort           int                `json:"protocol_port"`
	Protocol               string             `json:"protocol"`
	Name                   *string            `json:"name,omitempty"`
	L7Policies             *[]resourceID      `json:"l7policies,omitempty"`
	InsertHeaders          *map[string]string `json:"insert_headers,omitempty"`
	Description            *string            `json:"description,omitempty"`
	DefaultTLSContainerRef *string            `json:"default_tls_container_ref,omitempty"`
	DefaultPoolID          *string            `json:"default_pool_id,omitempty"`
}

ListenerCreateRequest represents create new listener request payload.

type ListenerService

type ListenerService interface {
	List(ctx context.Context, loadBalancerID string, opts *ListOptions) ([]*Listener, error)
	Create(ctx context.Context, loadBalancerID string, req *ListenerCreateRequest) (*Listener, error)
	Get(ctx context.Context, id string) (*Listener, error)
	Update(ctx context.Context, id string, req *ListenerUpdateRequest) (*Listener, error)
	Delete(ctx context.Context, id string) error
}

ListenerService is an interface to interact with BizFly API Listeners endpoint.

type ListenerUpdateRequest

type ListenerUpdateRequest struct {
	TimeoutTCPInspect      *int               `json:"timeout_tcp_inspect,omitempty"`
	TimeoutMemberData      *int               `json:"timeout_member_data,omitempty"`
	TimeoutMemberConnect   *int               `json:"timeout_member_connect,omitempty"`
	TimeoutClientData      *int               `json:"timeout_client_data,omitempty"`
	SNIContainerRefs       *[]string          `json:"sni_container_refs,omitempty"`
	Name                   *string            `json:"name,omitempty"`
	L7Policies             *[]resourceID      `json:"l7policies,omitempty"`
	InsertHeaders          *map[string]string `json:"insert_headers,omitempty"`
	Description            *string            `json:"description,omitempty"`
	DefaultTLSContainerRef *string            `json:"default_tls_container_ref,omitempty"`
	DefaultPoolID          *string            `json:"default_pool_id,omitempty"`
	AdminStateUp           *bool              `json:"admin_state_up,omitempty"`
}

ListenerUpdateRequest represents update listener request payload.

type LoadBalancer

type LoadBalancer struct {
	ID                 string       `json:"id"`
	FlavorID           string       `json:"flavor_id"`
	Description        string       `json:"description"`
	Provider           string       `json:"provider"`
	UpdatedAt          string       `json:"updated_at"`
	Listeners          []resourceID `json:"listeners"`
	VipSubnetID        string       `json:"vip_subnet_id"`
	ProjectID          string       `json:"project_id"`
	VipQosPolicyID     string       `json:"vip_qos_policy_id"`
	VipNetworkID       string       `json:"vip_network_id"`
	NetworkType        string       `json:"network_type"`
	VipAddress         string       `json:"vip_address"`
	VipPortID          string       `json:"vip_port_id"`
	AdminStateUp       bool         `json:"admin_state_up"`
	Name               string       `json:"name"`
	OperatingStatus    string       `json:"operating_status"`
	ProvisioningStatus string       `json:"provisioning_status"`
	Pools              []resourceID `json:"pools"`
	Type               string       `json:"type"`
	TenantID           string       `json:"tenant_id"`
	CreatedAt          string       `json:"created_at"`
}

LoadBalancer contains load balancer information.

type LoadBalancerCreateRequest

type LoadBalancerCreateRequest struct {
	Description string   `json:"description,omitempty"`
	Type        string   `json:"type"`
	Listeners   []string `json:"listeners,omitempty"`
	Name        string   `json:"name"`
	NetworkType string   `json:"network_type"`
}

LoadBalancerCreateRequest represents create new load balancer request payload.

type LoadBalancerDeleteRequest

type LoadBalancerDeleteRequest struct {
	Cascade bool   `json:"cascade"`
	ID      string `json:"loadbalancer_id"`
}

LoadBalancerDeleteRequest represents delete load balancer request payload.

type LoadBalancerPolicyInformation

type LoadBalancerPolicyInformation struct {
	LoadBalancerID   string `json:"id"`
	LoadBalancerName string `json:"name,omitempty"`
	ServerGroupID    string `json:"server_group_id"`
	ServerGroupName  string `json:"server_group_name,omitempty"`
	ServerGroupPort  int    `json:"server_group_port"`
}

LoadBalancerPolicyInformation - information of load balancer will be use for auto scaling group

type LoadBalancerScalingPolicy

type LoadBalancerScalingPolicy struct {
	ID         string `json:"load_balancer_id"`
	Name       string `json:"load_balancer_name,omitempty"`
	TargetID   string `json:"target_id"`
	TargetName string `json:"target_name,omitempty"`
	TargetType string `json:"target_type"`
}

LoadBalancerScalingPolicy represents payload load balancers in LoadBalancersPolicyCreateRequest/Update

type LoadBalancerService

type LoadBalancerService interface {
	List(ctx context.Context, opts *ListOptions) ([]*LoadBalancer, error)
	Create(ctx context.Context, req *LoadBalancerCreateRequest) (*LoadBalancer, error)
	Get(ctx context.Context, id string) (*LoadBalancer, error)
	Update(ctx context.Context, id string, req *LoadBalancerUpdateRequest) (*LoadBalancer, error)
	Delete(ctx context.Context, req *LoadBalancerDeleteRequest) error
}

LoadBalancerService is an interface to interact with BizFly API Load Balancers endpoint.

type LoadBalancerUpdateRequest

type LoadBalancerUpdateRequest struct {
	Name         *string `json:"name,omitempty"`
	Description  *string `json:"description,omitempty"`
	AdminStateUp *bool   `json:"admin_state_up,omitempty"`
}

LoadBalancerUpdateRequest represents update load balancer request payload.

type LoadBalancersPolicyCreateRequest

type LoadBalancersPolicyCreateRequest struct {
	CoolDown      int                       `json:"cooldown,omitempty"`
	Event         string                    `json:"event,omitempty"`
	LoadBalancers LoadBalancerScalingPolicy `json:"load_balancers,omitempty"`
	MetricType    string                    `json:"metric,omitempty"`
	RangeTime     int                       `json:"range_time,omitempty"`
	ScaleSize     int                       `json:"number,omitempty"`
	Threshold     int                       `json:"threshold,omitempty"`
}

LoadBalancersPolicyCreateRequest represents payload in create a load balancer policy

type LoadBalancersPolicyUpdateRequest

type LoadBalancersPolicyUpdateRequest struct {
	CoolDown      int                       `json:"cooldown,omitempty"`
	Event         string                    `json:"event,omitempty"`
	LoadBalancers LoadBalancerScalingPolicy `json:"load_balancers,omitempty"`
	MetricType    string                    `json:"metric,omitempty"`
	RangeTime     int                       `json:"range_time,omitempty"`
	ScaleSize     int                       `json:"number,omitempty"`
	Threshold     int                       `json:"threshold,omitempty"`
}

LoadBalancersPolicyUpdateRequest represents payload in create a load balancer policy

type Location

type Location struct {
	URL      string            `json:"url"`
	Metadata map[string]string `json:"metadata,"`
}

type Member

type Member struct {
	ID                string  `json:"id"`
	TenandID          string  `json:"tenant_id"`
	AdminStateUp      bool    `json:"admin_state_up"`
	Name              string  `json:"name"`
	UpdatedAt         string  `json:"updated_at"`
	OperatingStatus   string  `json:"operating_status"`
	MonitorAddress    *string `json:"monitor_address"`
	ProvisoningStatus string  `json:"provisioning_status"`
	ProjectID         string  `json:"project_id"`
	ProtocolPort      int     `json:"protocol_port"`
	SubnetID          string  `json:"subnet_id"`
	MonitorPort       *int    `json:"monitor_port"`
	Address           string  `json:"address"`
	Weight            int     `json:"weight"`
	CreatedAt         string  `json:"created_at"`
	Backup            bool    `json:"backup"`
}

Member contains member information.

type MemberCreateRequest

type MemberCreateRequest struct {
	Name           string `json:"name"`
	Weight         int    `json:"weight,omitempty"`
	Address        string `json:"address"`
	ProtocolPort   int    `json:"protocol_port"`
	MonitorAddress string `json:"monitor_address,omitempty"`
	MonitorPort    int    `json:"monitor_port,omitempty"`
	Backup         bool   `json:"backup,omitempty"`
}

MemberCreateRequest represents create member request payload

type MemberService

type MemberService interface {
	List(ctx context.Context, poolID string, opts *ListOptions) ([]*Member, error)
	Get(ctx context.Context, poolID, id string) (*Member, error)
	Update(ctx context.Context, poolID, id string, req *MemberUpdateRequest) (*Member, error)
	Delete(ctx context.Context, poolID, id string) error
	Create(ctx context.Context, poolID string, req *MemberCreateRequest) (*Member, error)
}

MemberService is an interface to interact with BizFly API Members endpoint.

type MemberUpdateRequest

type MemberUpdateRequest struct {
	Name           string  `json:"name"`
	Weight         int     `json:"weight"`
	AdminStateUp   bool    `json:"admin_state_up"`
	MonitorAddress *string `json:"monitor_address"`
	MonitorPort    *int    `json:"monitor_port"`
	Backup         bool    `json:"backup"`
}

MemberUpdateRequest represents update member request payload.

type Meta

type Meta struct {
	MaxResults int `json:"max_results"`
	Total      int `json:"total"`
	Page       int `json:"page"`
}

type Option

type Option func(c *Client) error

Option set Client specific attributes

func WithAPIUrl

func WithAPIUrl(u string) Option

WithAPIUrl sets the API url option for BizFly client.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the client option for BizFly client.

func WithRegionName

func WithRegionName(region string) Option

WithRegionName sets the client region for BizFly client.

func WithTenantID deprecated

func WithTenantID(id string) Option

WithTenantID sets the tenant id name option for BizFly client

Deprecated: X-Tenant-Id header required will be removed in API server.

func WithTenantName deprecated

func WithTenantName(tenant string) Option

WithTenantName sets the tenant name option for BizFly client.

Deprecated: X-Tenant-Name header required will be removed in API server.

type OriginAddr

type OriginAddr struct {
	Type string `json:"type"`
	Host string `json:"host"`
}

type PolicyCreateRequest

type PolicyCreateRequest struct {
	CoolDown   int    `json:"cooldown,omitempty"`
	Event      string `json:"event,omitempty"`
	MetricType string `json:"metric,omitempty"`
	RangeTime  int    `json:"range_time,omitempty"`
	ScaleSize  int    `json:"number,omitempty"`
	Threshold  int    `json:"threshold,omitempty"`
}

PolicyCreateRequest represents payload use create a policy

type PolicyUpdateRequest

type PolicyUpdateRequest struct {
	CoolDown   int    `json:"cooldown,omitempty"`
	Event      string `json:"event,omitempty"`
	MetricType string `json:"metric,omitempty"`
	RangeTime  int    `json:"range_time,omitempty"`
	ScaleSize  int    `json:"number,omitempty"`
	Threshold  int    `json:"threshold,omitempty"`
}

PolicyUpdateRequest represents payload use update a policy

type Pool

type Pool struct {
	ID                 string              `json:"id"`
	TenandID           string              `json:"tenant_id"`
	Description        string              `json:"description"`
	LBAlgorithm        string              `json:"lb_algorithm"`
	Name               string              `json:"name"`
	HealthMonitor      *HealthMonitor      `json:"healthmonitor"`
	UpdatedAt          string              `json:"updated_at"`
	OperatingStatus    string              `json:"operating_status"`
	Listeners          []resourceID        `json:"listeners"`
	SessionPersistence *SessionPersistence `json:"session_persistence"`
	ProvisoningStatus  string              `json:"provisioning_status"`
	ProjectID          string              `json:"project_id"`
	LoadBalancers      []resourceID        `json:"loadbalancers"`
	Members            []string            `json:"memebers"`
	AdminStateUp       bool                `json:"admin_state_up"`
	Protocol           string              `json:"protocol"`
	CreatedAt          string              `json:"created_at"`
	HealthMonitorID    string              `json:"healthmonitor_id"`
}

Pool contains pool information.

type PoolCreateRequest

type PoolCreateRequest struct {
	Description        *string             `json:"description,omitempty"`
	LBAlgorithm        string              `json:"lb_algorithm"`
	ListenerID         *string             `json:"listener_id"`
	Name               *string             `json:"name,omitempty"`
	Protocol           string              `json:"protocol"`
	SessionPersistence *SessionPersistence `json:"session_persistence"`
}

PoolCreateRequest represents create new pool request payload.

type PoolNode

type PoolNode struct {
	ID           string   `json:"id" yaml:"id"`
	Name         string   `json:"name" yaml:"name"`
	PhysicalID   string   `json:"physical_id" yaml:"physical_id"`
	IPAddresses  []string `json:"ip_addresses" yaml:"ip_addresses"`
	Status       string   `json:"status" yaml:"status"`
	StatusReason string   `json:"status_reason" yaml:"status_reason"`
}

type PoolService

type PoolService interface {
	List(ctx context.Context, loadBalancerID string, opts *ListOptions) ([]*Pool, error)
	Create(ctx context.Context, loadBalancerID string, req *PoolCreateRequest) (*Pool, error)
	Get(ctx context.Context, id string) (*Pool, error)
	Update(ctx context.Context, id string, req *PoolUpdateRequest) (*Pool, error)
	Delete(ctx context.Context, id string) error
}

PoolService is an interface to interact with BizFly API Pools endpoint.

type PoolUpdateRequest

type PoolUpdateRequest struct {
	AdminStateUp       *bool               `json:"admin_state_up,omitempty"`
	Description        *string             `json:"description,omitempty"`
	LBAlgorithm        *string             `json:"lb_algorithm,omitempty"`
	Name               *string             `json:"name,omitempty"`
	SessionPersistence *SessionPersistence `json:"session_persistence"`
}

PoolUpdateRequest represents update pool request payload.

type ReceiverCreateRequest

type ReceiverCreateRequest struct {
	AutoScale      *AutoScalingWebhook `json:"autoscale,omitempty"`
	EmailAddress   string              `json:"email_address,omitempty"`
	Name           string              `json:"name"`
	Slack          *Slack              `json:"slack,omitempty"`
	SMSNumber      string              `json:"sms_number,omitempty"`
	TelegramChatID string              `json:"telegram_chat_id,omitempty"`
	WebhookURL     string              `json:"webhook_url,omitempty"`
}

ReceiverCreateRequest contains receiver information.

type Receivers

type Receivers struct {
	AutoScale              *AutoScalingWebhook `json:"autoscale,omitempty"`
	Created                string              `json:"_created"`
	Creator                string              `json:"creator"`
	EmailAddress           string              `json:"email_address,omitempty"`
	Name                   string              `json:"name"`
	ProjectID              string              `json:"project_id,omitempty"`
	ReceiverID             string              `json:"_id"`
	Slack                  *Slack              `json:"slack,omitempty"`
	SMSNumber              string              `json:"sms_number,omitempty"`
	TelegramChatID         string              `json:"telegram_chat_id,omitempty"`
	UserID                 string              `json:"user_id,omitempty"`
	VerifiedEmailDddress   bool                `json:"verified_email_address,omitempty"`
	VerifiedSMSNumber      bool                `json:"verified_sms_number,omitempty"`
	VerifiedTelegramChatID bool                `json:"verified_telegram_chat_id,omitempty"`
	VerifiedWebhookURL     bool                `json:"verified_webhook_url,omitempty"`
	WebhookURL             string              `json:"webhook_url,omitempty"`
}

Receivers contains receiver information.

type Record

type Record struct {
	ID                string            `json:"id"`
	Name              string            `json:"name"`
	Delete            int               `json:"deleted"`
	CreatedAt         string            `json:"created_at"`
	UpdatedAt         string            `json:"updated_at"`
	TenantID          string            `json:"tenant_id"`
	ZoneID            string            `json:"zone_id"`
	Type              string            `json:"type"`
	TTL               int               `json:"ttl"`
	Data              []string          `json:"data"`
	RoutingPolicyData RoutingPolicyData `json:"routing_policy_data"`
}

type RecordData

type RecordData struct {
	Value    string `json:"value"`
	Priority int    `json:"priority"`
}

type RecordSet

type RecordSet struct {
	ID                string            `json:"id"`
	Name              string            `json:"name"`
	Type              string            `json:"type"`
	TTL               int               `json:"ttl"`
	Data              []string          `json:"data"`
	RoutingPolicyData RoutingPolicyData `json:"routing_policy_data"`
}

type Records

type Records struct {
	Records []Record `json:"records"`
}

type Region

type Region struct {
	Active     bool               `json:"active"`
	Icon       string             `json:"icon"`
	Name       string             `json:"name"`
	Order      int                `json:"order"`
	RegionName string             `json:"region_name"`
	ShortName  string             `json:"short_name"`
	Zones      []AvailabilityZone `json:"zones"`
}

type Regions

type Regions struct {
	HN  Region `json:"HN"`
	HCM Region `json:"HCM"`
}

type Repositories

type Repositories struct {
	Repositories []Repository `json:"repositories"`
}

type Repository

type Repository struct {
	Name      string `json:"name"`
	LastPush  string `json:"last_push"`
	Pulls     int    `json:"pulls"`
	Public    bool   `json:"public"`
	CreatedAt string `json:"created_at"`
}

type RepositoryTag

type RepositoryTag struct {
	Name            string `json:"name"`
	Author          string `json:"author"`
	LastUpdated     string `json:"last_updated"`
	CreatedAt       string `json:"created_at"`
	LastScan        string `json:"last_scan"`
	ScanStatus      string `json:"scan_status"`
	Vulnerabilities int    `json:"vulnerabilities"`
	Fixes           int    `json:"fixes"`
}

type ResponseRequest

type ResponseRequest struct {
	Created string `json:"_created,omitempty"`
	Deleted bool   `json:"_deleted,omitempty"`
	ID      string `json:"_id,omitempty"`
	Status  string `json:"_status,omitempty"`
}

ResponseRequest represents api's response.

type RoutingData

type RoutingData struct {
	AddrsV4 Addrs `json:"addrs_v4"`
	AddrsV6 Addrs `json:"addrs_v6"`
}

type RoutingPolicyData

type RoutingPolicyData struct {
	RoutingData RoutingData `json:"routing_data,omitempty"`
	HealthCheck struct {
		TCPConnect struct {
			TCPPort int `json:"tcp_port"`
		} `json:"tcp_connect,omitempty"`
		HTTPStatus struct {
			HTTPPort int    `json:"http_port"`
			URLPath  string `json:"url_path"`
			VHost    string `json:"vhost"`
			OkCodes  []int  `json:"ok_codes"`
			Interval int    `json:"internal"`
		} `json:"http_status,omitempty"`
	} `json:"healthcheck,omitempty"`
}

type SSHKey

type SSHKey struct {
	Name        string `json:"name"`
	PublicKey   string `json:"public_key"`
	FingerPrint string `json:"fingerprint"`
}

type SSHKeyCreateRequest

type SSHKeyCreateRequest struct {
	Name      string `json:"name"`
	PublicKey string `json:"public_key"`
}

type SSHKeyCreateResponse

type SSHKeyCreateResponse struct {
	SSHKey
	UserID string `json:"user_id"`
}

type SSHKeyDeleteResponse

type SSHKeyDeleteResponse struct {
	Message string `json:"message"`
}

type SSHKeyService

type SSHKeyService interface {
	List(ctx context.Context, opts *ListOptions) ([]*KeyPair, error)
	Create(ctx context.Context, scr *SSHKeyCreateRequest) (*SSHKeyCreateResponse, error)
	Delete(ctx context.Context, keyname string) (*SSHKeyDeleteResponse, error)
}

SSHKeyService is an interface to interact with BizFly API SSH Key

type ScalePolicyInformation

type ScalePolicyInformation struct {
	BestEffort bool    `json:"best_effort"`
	CoolDown   int     `json:"cooldown"`
	Event      string  `json:"event,omitempty"`
	ID         *string `json:"id,omitempty"`
	MetricType string  `json:"metric"`
	RangeTime  int     `json:"range_time"`
	ScaleSize  int     `json:"number"`
	Threshold  float64 `json:"threshold"`
	Type       *string `json:"type,omitempty"`
}

ScalePolicyInformation - information about a scale policy

type SecretCreateRequest

type SecretCreateRequest struct {
	Name string `json:"name,omitempty"`
}

SecretCreateRequest represents create new secret request payload.

type Secrets

type Secrets struct {
	Created   string `json:"_created,omitempty"`
	ID        string `json:"_id"`
	Name      string `json:"name"`
	ProjectID string `json:"project_id,omitempty"`
	Secret    string `json:"secret,omitempty"`
	UserID    string `json:"user_id,omitempty"`
}

Secrets contains secrets information.

type SecretsCreateRequest

type SecretsCreateRequest struct {
	Name string `json:"name,omitempty"`
}

SecretsCreateRequest contains receiver information.

type Server

type Server struct {
	ID               string                 `json:"id"`
	Name             string                 `json:"name"`
	KeyName          string                 `json:"key_name"`
	UserID           string                 `json:"user_id"`
	ProjectID        string                 `json:"tenant_id"`
	CreatedAt        string                 `json:"created"`
	UpdatedAt        string                 `json:"updated"`
	Status           string                 `json:"status"`
	IPv6             bool                   `json:"ipv6"`
	SecurityGroup    []ServerSecurityGroup  `json:"security_group"`
	Addresses        map[string]interface{} `json:"addresses"` // Deprecated: This field will be removed in the near future
	Metadata         map[string]string      `json:"metadata"`
	Flavor           Flavor                 `json:"flavor"`
	Progress         int                    `json:"progress"`
	AttachedVolumes  []AttachedVolume       `json:"os-extended-volumes:volumes_attached"`
	AvailabilityZone string                 `json:"OS-EXT-AZ:availability_zone"`
	Category         string                 `json:"category"`
	IPAddresses      IPAddress              `json:"ip_addresses"`
	RegionName       string                 `json:"region_name"`
}

Server contains server information.

type ServerAction

type ServerAction struct {
	Action        string   `json:"action"`
	ImageID       string   `json:"image,omitempty"`
	FlavorName    string   `json:"flavor_name,omitempty"`
	ConsoleType   string   `json:"type,omitempty"`
	FirewallIDs   []string `json:"firewall_ids,omitempty"`
	NewType       string   `json:"new_type,omitempty"`
	VPCNetworkIDs []string `json:"vpc_network_ids,omitempty"`
}

ServerAction represents server action request payload.

type ServerConsoleResponse

type ServerConsoleResponse struct {
	URL  string `json:"url"`
	Type string `json:"type"`
}

ServerConsoleResponse contains information of server console url.

type ServerCreateRequest

type ServerCreateRequest struct {
	Name             string        `json:"name"`
	FlavorName       string        `json:"flavor"`
	SSHKey           string        `json:"sshkey,omitempty"`
	Password         bool          `json:"password"`
	RootDisk         *ServerDisk   `json:"rootdisk"`
	DataDisks        []*ServerDisk `json:"datadisks,omitempty"`
	Type             string        `json:"type"`
	AvailabilityZone string        `json:"availability_zone"`
	OS               *ServerOS     `json:"os"`
	Quantity         int           `json:"quantity,omitempty"`
}

ServerCreateRequest represents create a new server payload.

type ServerCreateResponse

type ServerCreateResponse struct {
	Task []string `json:"task_id"`
}

ServerCreateResponse contains response tasks when create server

type ServerDisk

type ServerDisk struct {
	Size int    `json:"size"`
	Type string `json:"type"`
}

ServerDisk contains server's disk information.

type ServerMessageResponse

type ServerMessageResponse struct {
	Message string `json:"message"`
}

ServerMessageResponse contains message response from Cloud Server API.

type ServerOS

type ServerOS struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

ServerOS contains OS information of server.

type ServerSecurityGroup

type ServerSecurityGroup struct {
	Name string `json:"name"`
}

ServerSecurityGroup contains information of security group of a server.

type ServerService

type ServerService interface {
	List(ctx context.Context, opts *ListOptions) ([]*Server, error)
	Create(ctx context.Context, scr *ServerCreateRequest) (*ServerCreateResponse, error)
	Get(ctx context.Context, id string) (*Server, error)
	Delete(ctx context.Context, id string) error
	Resize(ctx context.Context, id string, newFlavor string) (*ServerTask, error)
	Start(ctx context.Context, id string) (*Server, error)
	Stop(ctx context.Context, id string) (*Server, error)
	SoftReboot(ctx context.Context, id string) (*ServerMessageResponse, error)
	HardReboot(ctx context.Context, id string) (*ServerMessageResponse, error)
	Rebuild(ctx context.Context, id string, imageID string) (*ServerTask, error)
	GetVNC(ctx context.Context, id string) (*ServerConsoleResponse, error)
	ListFlavors(ctx context.Context) ([]*serverFlavorResponse, error)
	ListOSImages(ctx context.Context) ([]osImageResponse, error)
	GetTask(ctx context.Context, id string) (*ServerTaskResponse, error)
	ChangeCategory(ctx context.Context, id string, newCategory string) (*ServerTask, error)
	AddVPC(ctx context.Context, id string, vpcs []string) (*Server, error)
	RemoveVPC(ctx context.Context, id string, vpcs []string) (*Server, error)
	ListCustomImages(ctx context.Context) ([]*CustomImage, error)
	CreateCustomImage(ctx context.Context, cipl *CreateCustomImagePayload) (*CreateCustomImageResp, error)
	DeleteCustomImage(ctx context.Context, imageID string) error
	GetCustomImage(ctx context.Context, imageID string) (*CustomImageGetResp, error)
}

ServerService is an interface to interact with BizFly Cloud API.

type ServerTask

type ServerTask struct {
	TaskID string `json:"task_id"`
}

ServerTask contains task information.

type ServerTaskResponse

type ServerTaskResponse struct {
	Ready  bool             `json:"ready"`
	Result ServerTaskResult `json:"result"`
}

type ServerTaskResult

type ServerTaskResult struct {
	Action   string `json:"action"`
	Progress int    `json:"progress"`
	Success  bool   `json:"success"`
	Server
}

type Service

type Service struct {
	Name          string `json:"name"`
	Code          string `json:"code"`
	CanonicalName string `json:"canonical_name"`
	Id            int    `json:"id"`
	Region        string `json:"region"`
	Icon          string `json:"icon"`
	Description   string `json:"description"`
	Enabled       bool   `json:"enabled"`
	ServiceUrl    string `json:"service_url"`
}

type ServiceInterface

type ServiceInterface interface {
	List(ctx context.Context) ([]*Service, error)
}

type ServiceList

type ServiceList struct {
	Services []*Service `json:"services"`
}

type SessionPersistence

type SessionPersistence struct {
	Type                   string  `json:"type"`
	CookieName             *string `json:"cookie_name,omitempty"`
	PersistenceTimeout     *string `json:"persistence_timeout,omitempty"`
	PersistenceGranularity *string `json:"persistence_granularity,omitempty"`
}

SessionPersistence object controls how LoadBalacner sends request to backend. See https://support.bizflycloud.vn/api/loadbalancer/#post-loadbalancer-load_balancer_id-pools

type Slack

type Slack struct {
	SlackChannelName string `json:"channel_name"`
	WebhookURL       string `json:"webhook_url"`
}

Slack is represents slack payload - which will be use create a receiver

type Snapshot

type Snapshot struct {
	Id               string            `json:"id"`
	Name             string            `json:"name"`
	Status           string            `json:"status"`
	VolumeTypeId     string            `json:"volume_type_id"`
	VolumeId         string            `json:"volume_id"`
	Size             int               `json:"size"`
	Progress         string            `json:"os-extended-snapshot-attributes:progress"`
	TenantId         string            `json:"os-extended-snapshot-attributes:project_id"`
	Metadata         map[string]string `json:"metadata"`
	Description      string            `json:"description"`
	IsUsingAutoscale bool              `json:"is_using_autoscale"`
	UpdatedAt        string            `json:"updated_at"`
	CreateAt         string            `json:"created_at"`
	FromVolume       Volume            `json:"volume"`
	Category         string            `json:"category"`
}

Snapshot contains snapshot information

type SnapshotCreateRequest

type SnapshotCreateRequest struct {
	Name     string `json:"name"`
	VolumeId string `json:"volume_id"`
	Force    bool   `json:"force"`
}

SnapshotCreateRequest represents create new volume request payload.

type SnapshotService

type SnapshotService interface {
	List(ctx context.Context, opts *ListOptions) ([]*Snapshot, error)
	Create(ctx context.Context, scr *SnapshotCreateRequest) (*Snapshot, error)
	Get(ctx context.Context, id string) (*Snapshot, error)
	Delete(ctx context.Context, id string) error
}

SnapshotService is an interface to interact with BizFly API Snapshot endpoint.

type Subnet

type Subnet struct {
	ID              string              `json:"id"`
	Name            string              `json:"name"`
	TenantID        string              `json:"tenant_id"`
	NetworkID       string              `json:"network_id"`
	IPVersion       int                 `json:"ip_version"`
	SubnetPoolID    string              `json:"subnet_pool_id"`
	EnableDHCP      bool                `json:"enable_dhcp"`
	IPv6RaMode      string              `json:"ipv6_ra_mode"`
	IPv6AddressMode string              `json:"ipv6_address_mode"`
	GatewayIP       string              `json:"gateway_ip"`
	CIDR            string              `json:"cidr"`
	AllocationPools []map[string]string `json:"allocation_pools"`
	HostRoutes      []string            `json:"host_routes"`
	DNSNameServers  []string            `json:"dns_nameservers"`
	Description     string              `json:"description"`
	ServiceTypes    []string            `json:"service_types"`
	Tags            []string            `json:"tags"`
	CreatedAt       string              `json:"created_at"`
	UpdatedAt       string              `json:"updated_at"`
	RevisionNumber  int                 `json:"revision_number"`
	ProjectID       string              `json:"project_id"`
}

type TagRepository

type TagRepository struct {
	Repository Repository      `json:"repository"`
	Tags       []RepositoryTag `json:"tags"`
}

type Task

type Task struct {
	TaskID string `json:"task_id"`
}

Task represents task response when perform an action.

type TaskResponses

type TaskResponses struct {
	Message string `json:"message"`
	TaskID  string `json:"task_id,omitempty"`
}

TaskResponses is responses

type Token

type Token struct {
	KeystoneToken string `json:"token"`
	ExpiresAt     string `json:"expires_at"`
}

Token contains token information.

type TokenCreateRequest

type TokenCreateRequest struct {
	AuthMethod    string `json:"auth_method"`
	Username      string `json:"username,omitempty"`
	Password      string `json:"password,omitempty"`
	ProjectName   string `json:"project_name,omitempty"`
	AppCredID     string `json:"credential_id,omitempty"`
	AppCredSecret string `json:"credential_secret,omitempty"`
}

TokenCreateRequest represents create new token request payload.

type TokenService

type TokenService interface {
	Create(ctx context.Context, request *TokenCreateRequest) (*Token, error)
	Refresh(ctx context.Context) (*Token, error)
}

TokenService is an interface to interact with BizFly API token endpoint.

type Trial

type Trial struct {
	StartedAt    string `json:"started_at"`
	ExpiredAt    string `json:"expired_at"`
	Active       bool   `json:"active"`
	Enable       bool   `json:"enable"`
	ServiceLevel int    `json:"service_level"`
}

type UpdateDomainReq

type UpdateDomainReq struct {
	UpstreamAddrs string `json:"upstream_addrs"`
	UpstreamProto string `json:"upstream_proto"`
	PageSpeed     int    `json:"pagespeed"`
	SecureLink    int    `json:"secure_link"`
}

type UpdateDomainResp

type UpdateDomainResp struct {
	Message string         `json:"message"`
	Domain  ExtendedDomain `json:"domain"`
}

type UpdateRecordPayload

type UpdateRecordPayload struct {
	Name              string            `json:"name,omitempty"`
	Type              string            `json:"type,omitempty"`
	TTL               int               `json:"ttl,omitempty"`
	Data              []RecordData      `json:"data,omitempty"`
	RoutingPolicyData RoutingPolicyData `json:"routing_policy_data,omitempty"`
}

type UpdateVPCPayload

type UpdateVPCPayload struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	CIDR        string `json:"cidr,omitempty"`
	IsDefault   bool   `json:"is_default,omitempty"`
}

type UpdateWorkerPoolRequest

type UpdateWorkerPoolRequest struct {
	DesiredSize       int  `json:"desired_size,omitempty" yaml:"desired_size,omitempty"`
	EnableAutoScaling bool `json:"enable_autoscaling,omitempty" yaml:"enable_autoscaling,omitempty"`
	MinSize           int  `json:"min_size,omitempty" yaml:"min_size,omitempty"`
	MaxSize           int  `json:"max_size,omitempty" yaml:"max_size,omitempty"`
}

type User

type User struct {
	Service           string             `json:"service"`
	URLType           string             `json:"url_type"`
	Origin            string             `json:"origin"`
	ClientType        string             `json:"client_type"`
	BillingBalance    int                `json:"billing_balance"`
	Balances          map[string]float32 `json:"balances"`
	PaymentMethod     string             `json:"payment_method"`
	BillingAccID      string             `json:"billing_acc_id"`
	Debit             bool               `json:"debit"`
	Email             string             `json:"email"`
	Phone             string             `json:"phone"`
	FullName          string             `json:"full_name"`
	VerifiedEmail     bool               `json:"verified_email"`
	VerifiedPhone     bool               `json:"verified_phone"`
	LoginAlert        bool               `json:"login_alert"`
	VerifiedPayment   bool               `json:"verified_payment"`
	LastRegion        string             `json:"last_region"`
	LastProject       string             `json:"last_project"`
	Type              string             `json:"type"`
	OTP               bool               `json:"otp"`
	Services          []Service          `json:"services"`
	Whitelist         []string           `json:"whitelist"`
	Expires           string             `json:"expires"`
	TenantID          string             `json:"tenant_id"`
	TenantName        string             `json:"tenant_name"`
	KsUserID          string             `json:"ks_user_id"`
	IAM               IAM                `json:"iam"`
	Domains           []string           `json:"domains"`
	PaymentType       string             `json:"payment_type"`
	DOB               string             `json:"dob"`
	Gender            string             `json:"_gender"`
	Trial             Trial              `json:"trial"`
	HasExpiredInvoice bool               `json:"has_expired_invoice"`
	NegativeBalance   bool               `json:"negative_balance"`
	Promotion         []string           `json:"promotion"`
}

type VPC

type VPC struct {
	ID                    string   `json:"id"`
	Name                  string   `json:"name"`
	TenantID              string   `json:"tenant_id"`
	AdminStateUp          bool     `json:"admin_state_up"`
	MTU                   int      `json:"mtu"`
	Status                string   `json:"status"`
	Subnets               []Subnet `json:"subnets"`
	Shared                bool     `json:"shared"`
	AvailabilityZoneHints []string `json:"availability_zone_hints"`
	AvailabilityZones     []string `json:"availability_zones"`
	IPv4AddressScope      string   `json:"ipv4_address_scope"`
	IPv6AddressScope      string   `json:"ipv6_address_scope"`
	RouterExternal        bool     `json:"router:external"`
	Description           string   `json:"description"`
	PortSecurityEnabled   bool     `json:"port_security_enabled"`
	QosPolicyID           string   `json:"qos_policy_id"`
	Tags                  []string `json:"tags"`
	CreatedAt             string   `json:"created_at"`
	UpdatedAt             string   `json:"updated_at"`
	RevisionNumber        int      `json:"revision_number"`
	IsDefault             bool     `json:"is_default"`
}

type VPCService

type VPCService interface {
	List(ctx context.Context) ([]*VPC, error)
	Get(ctx context.Context, vpcID string) (*VPC, error)
	Update(ctx context.Context, vpcID string, uvpl *UpdateVPCPayload) (*VPC, error)
	Create(ctx context.Context, cvpl *CreateVPCPayload) (*VPC, error)
	Delete(ctx context.Context, vpcID string) error
}

type Volume

type Volume struct {
	ID               string             `json:"id"`
	Size             int                `json:"size"`
	AttachedType     string             `json:"attached_type"`
	Name             string             `json:"name"`
	VolumeType       string             `json:"type"`
	Description      string             `json:"description"`
	SnapshotID       string             `json:"snapshot_id"`
	Bootable         bool               `json:"bootable"`
	AvailabilityZone string             `json:"availability_zone"`
	Status           string             `json:"status"`
	UserID           string             `json:"user_id"`
	ProjectID        string             `json:"os-vol-tenant-attr:tenant_id"`
	CreatedAt        string             `json:"created_at"`
	UpdatedAt        string             `json:"updated_at"`
	Metadata         map[string]string  `json:"metadata"`
	Attachments      []VolumeAttachment `json:"attachments"`
	Category         string             `json:"category"`
}

Volume contains volume information.

type VolumeAction

type VolumeAction struct {
	Type       string `json:"type"`
	NewSize    int    `json:"new_size,omitempty"`
	ServerID   string `json:"instance_uuid,omitempty"`
	SnapshotID string `json:"snapshot_id,omitempty"`
}

VolumeAction represents volume action request payload.

type VolumeAttachDetachResponse

type VolumeAttachDetachResponse struct {
	Message      string `json:"message"`
	VolumeDetail Volume `json:"volume_detail"`
}

VolumeAttachDetachResponse contains information when detach or attach a volume from/to a server.

type VolumeAttachment

type VolumeAttachment struct {
	Server       Server `json:"server"`
	ServerID     string `json:"server_id"`
	AttachmentID string `json:"attachment_id"`
	VolumeID     string `json:"volume_id"`
	Device       string `json:"device"`
	ID           string `json:"id"`
}

VolumeAttachment contains volume attachment information.

type VolumeCreateRequest

type VolumeCreateRequest struct {
	Name             string `json:"name"`
	Size             int    `json:"size"`
	VolumeType       string `json:"volume_type"`
	VolumeCategory   string `json:"category"`
	AvailabilityZone string `json:"availability_zone"`
	SnapshotID       string `json:"snapshot_id,omitempty"`
	ServerID         string `json:"instance_uuid,omitempty"`
}

VolumeCreateRequest represents create new volume request payload.

type VolumeService

type VolumeService interface {
	List(ctx context.Context, opts *ListOptions) ([]*Volume, error)
	Create(ctx context.Context, req *VolumeCreateRequest) (*Volume, error)
	Get(ctx context.Context, id string) (*Volume, error)
	Delete(ctx context.Context, id string) error
	ExtendVolume(ctx context.Context, id string, newsize int) (*Task, error)
	Attach(ctx context.Context, id string, serverID string) (*VolumeAttachDetachResponse, error)
	Detach(ctx context.Context, id string, serverID string) (*VolumeAttachDetachResponse, error)
	Restore(ctx context.Context, id string, snapshotID string) (*Task, error)
}

VolumeService is an interface to interact with BizFly API Volume endpoint.

type Vulnerability

type Vulnerability struct {
	Package     string `json:"package"`
	Name        string `json:"name"`
	Namespace   string `json:"namespace"`
	Description string `json:"description"`
	Link        string `json:"link"`
	Severity    string `json:"severity"`
	FixedBy     string `json:"fixed_by"`
}

type Webhook

type Webhook struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

Webhook - informaion of cluster's receiver

type WorkerPool

type WorkerPool struct {
	Name              string   `json:"name" yaml:"name"`
	Version           string   `json:"version,omitempty" yaml:"version,omitempty"`
	Flavor            string   `json:"flavor" yaml:"flavor"`
	ProfileType       string   `json:"profile_type" yaml:"profile_type"`
	VolumeType        string   `json:"volume_type" yaml:"volume_type"`
	VolumeSize        int      `json:"volume_size" yaml:"volume_size"`
	AvailabilityZone  string   `json:"availability_zone" yaml:"availability_zone"`
	DesiredSize       int      `json:"desired_size" yaml:"desired_size"`
	EnableAutoScaling bool     `json:"enable_autoscaling,omitempty" yaml:"enable_autoscaling,omitempty"`
	MinSize           int      `json:"min_size,omitempty" yaml:"min_size,omitempty"`
	MaxSize           int      `json:"max_size,omitempty" yaml:"max_size,omitempty"`
	Tags              []string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

type WorkerPoolWithNodes

type WorkerPoolWithNodes struct {
	ExtendedWorkerPool
	Nodes []PoolNode `json:"nodes" yaml:"nodes"`
}

type Zone

type Zone struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	Deleted    int      `json:"deleted"`
	CreatedAt  string   `json:"created_at"`
	UpdatedAt  string   `json:"updated_at"`
	TenantId   string   `json:"tenant_id"`
	NameServer []string `json:"nameserver"`
	TTL        int      `json:"ttl"`
	Active     bool     `json:"active"`
	RecordsSet []string `json:"records_set"`
}

Jump to

Keyboard shortcuts

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