heficed

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenUrl string = "https://iam-proxy.heficed.com/oauth2/token"
	APIUrl   string = "https://api.heficed.com"
)
View Source
const APIPath = "protocompute"

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingType

type BillingType struct {
	Id   int32  `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type CancellationRequest

type CancellationRequest struct {
	Type_       string `json:"type,omitempty"`
	Created     int32  `json:"created,omitempty"`
	Termination int32  `json:"termination,omitempty"`
	Reason      string `json:"reason,omitempty"`
}

type Client

type Client struct {
	*http.Client
}

func NewClient

func NewClient(cfg Config) (*Client, error)

type Config

type Config struct {
	ClientId     string
	ClientSecret string
	TenantId     string
	Scopes       []string
}

type InstanceType

type InstanceType struct {
	Id   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type IpmiProxy

type IpmiProxy struct {
	Hostname    string `json:"hostname,omitempty"`
	Port        int    `json:"port,omitempty"`
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`
	ReleaseDate string `json:"releaseDate,omitempty"`
}

type KronosCloudTemplate

type KronosCloudTemplate struct {
	Id      string `json:"id,omitempty"`
	Created int32  `json:"created,omitempty"`
	// Size in GB
	Size           float32 `json:"size,omitempty"`
	Version        string  `json:"version,omitempty"`
	Name           string  `json:"name,omitempty"`
	LocationId     string  `json:"locationId,omitempty"`
	InstanceTypeId string  `json:"instanceTypeId,omitempty"`
}

type Location

type Location struct {
	Id        string `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	Continent string `json:"continent,omitempty"`
}

type Network

type Network struct {
	V4 NetworkV4
	V6 NetworkV6
}

type NetworkV4

type NetworkV4 struct {
	IpAddress     string   `json:"ipaddress,omitempty"`
	Netmask       string   `json:"netmask,omitempty"`
	Gateway       string   `json:"gateway,omitempty"`
	AdditionalIps []string `json:"additionalIps,omitempty"`
	Resolvers     []string `json:"resolvers,omitempty"`
}

type NetworkV6

type NetworkV6 struct {
	IpAddress     string   `json:"ipaddress,omitempty"`
	Netmask       string   `json:"netmask,omitempty"`
	Gateway       string   `json:"gateway,omitempty"`
	AdditionalIps []string `json:"additionalIps,omitempty"`
	Resolvers     []string `json:"resolvers,omitempty"`
}

type NewInstance added in v0.1.2

type NewInstance struct {
	LocationId    string
	FlavorId      string
	Hostname      string
	BillingTypeId int
}

type ProtoCompute

type ProtoCompute struct {
	Id             int64                     `json:"id,omitempty"`
	Status         string                    `json:"status,omitempty"`
	Hostname       string                    `json:"hostname,omitempty"`
	InstanceType   *InstanceType             `json:"instanceType,omitempty"`
	Location       *Location                 `json:"location,omitempty"`
	Template       *KronosCloudTemplate      `json:"template,omitempty"`
	Network        *Network                  `json:"network,omitempty"`
	Billing        *ServiceBilling           `json:"billing,omitempty"`
	Flavor         *ProtoComputeFlavorSimple `json:"flavor,omitempty"`
	Password       string                    `json:"password,omitempty"`
	IpmiProxy      *IpmiProxy                `json:"ipmiProxy,omitempty"`
	CpuLimited     bool                      `json:"cpuLimited,omitempty"`
	NetworkLimited bool                      `json:"networkLimited,omitempty"`
	Eta            string                    `json:"eta,omitempty"`
}

type ProtoComputeCpu

type ProtoComputeCpu struct {
	Count int32  `json:"count,omitempty"`
	Type_ string `json:"type,omitempty"`
}

type ProtoComputeDisk

type ProtoComputeDisk struct {
	Count int32  `json:"count,omitempty"`
	Size  string `json:"size,omitempty"`
	Type_ string `json:"type,omitempty"`
	Label string `json:"label,omitempty"`
}

type ProtoComputeFlavor

type ProtoComputeFlavor struct {
	Id         string              `json:"id,omitempty"`
	LocationId string              `json:"locationId,omitempty"`
	Pricing    []ProtoComputePrice `json:"pricing,omitempty"`
	Cpus       []string            `json:"cpus,omitempty"`
	Memory     []string            `json:"memory,omitempty"`
	Disks      []string            `json:"disks,omitempty"`
}

type ProtoComputeFlavorSimple

type ProtoComputeFlavorSimple struct {
	Id     string               `json:"id,omitempty"`
	Name   string               `json:"name,omitempty"`
	Cpus   *[]ProtoComputeCpu   `json:"cpus,omitempty"`
	Memory []ProtoComputeMemory `json:"memory,omitempty"`
	Disks  *[]ProtoComputeDisk  `json:"disks,omitempty"`
	Nics   *[]ProtoComputeNic   `json:"nics,omitempty"`
}

type ProtoComputeMemory

type ProtoComputeMemory struct {
	Total string `json:"total,omitempty"`
	Count int32  `json:"count,omitempty"`
	Type_ string `json:"type,omitempty"`
}

type ProtoComputeNic

type ProtoComputeNic struct {
	Count int32  `json:"count,omitempty"`
	Type_ string `json:"type,omitempty"`
}

type ProtoComputePrice

type ProtoComputePrice struct {
	BillingTypeId int32   `json:"billingTypeId,omitempty"`
	Amount        float32 `json:"amount,omitempty"`
	SetupFee      float32 `json:"setupFee,omitempty"`
}

type Protos

type Protos struct {
	*Client
}

func (*Protos) CreateInstance added in v0.1.2

func (p *Protos) CreateInstance(cfg NewInstance) (int, error)

func (*Protos) GetInstance

func (p *Protos) GetInstance(id int) ProtoCompute

func (*Protos) ListInstances

func (p *Protos) ListInstances() []ProtoCompute

type ServiceBilling

type ServiceBilling struct {
	Product            string       `json:"product,omitempty"`
	Type_              *BillingType `json:"type,omitempty"`
	Status             string       `json:"status,omitempty"`
	HourlySpendingRate float32      `json:"hourlySpendingRate,omitempty"`
	Price              float32      `json:"price,omitempty"`
	StartDate          int32        `json:"startDate,omitempty"`
	EndDate            int32        `json:"endDate,omitempty"`
	Sla                struct {
		Id   int    `json:"id,omitempty"`
		Name string `json:"name,omitempty"`
	} `json:"sla,omitempty"`
	CancellationRequest *CancellationRequest `json:"cancellationRequest,omitempty"`
}

Jump to

Keyboard shortcuts

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