Documentation ¶
Index ¶
- Constants
- Variables
- func CheckResponse(r *http.Response) error
- func DoRequestWithClient(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error)
- func PtrTo[T any](v T) *T
- type AddInstancePortsRequest
- type AddressType
- type ArgError
- type AssignFloatingIPRequest
- type AssignSecurityGroupRequest
- type Attachment
- type BareMetalCapacity
- type BareMetalFlavor
- type BareMetalFlavorsOpts
- type BareMetalFlavorsRequest
- type BareMetalInstancesListOpts
- type BareMetalInterfaceOpts
- type BareMetalQuotaCheckRequest
- type BareMetalRebuildOpts
- type BareMetalRebuildRequest
- type BareMetalServerCreateRequest
- type BareMetalService
- type CIDR
- type ChangedRuleAction
- type ChangedRules
- type Client
- type ClientOpt
- func SetAPIKey(apiKey string) ClientOpt
- func SetBaseURL(bu string) ClientOpt
- func SetProject(project int) ClientOpt
- func SetRegion(region int) ClientOpt
- func SetRequestHeaders(headers map[string]string) ClientOpt
- func SetUserAgent(ua string) ClientOpt
- func WithRetryAndBackoffs(retryConfig RetryConfig) ClientOpt
- type CloudConfig
- type CombinedQuota
- type DiskMetrics
- type EtherType
- func (et EtherType) IsValid() error
- func (et EtherType) List() []EtherType
- func (et *EtherType) MarshalJSON() ([]byte, error)
- func (et EtherType) String() string
- func (et EtherType) StringList() []string
- func (et *EtherType) UnmarshalJSON(data []byte) error
- func (et EtherType) ValidOrNil() (*EtherType, error)
- type ExternalFixedIP
- type ExternalGatewayInfo
- type ExternalGatewayInfoCreate
- type Flavor
- type FlavorListOptions
- type FlavorsOptions
- type FlavorsService
- type FlavorsServiceOp
- func (s *FlavorsServiceOp) List(ctx context.Context, opts *FlavorListOptions) ([]Flavor, *Response, error)
- func (s *FlavorsServiceOp) ListBaremetal(ctx context.Context, opts *FlavorListOptions) ([]Flavor, *Response, error)
- func (s *FlavorsServiceOp) ListBaremetalForClient(ctx context.Context, opts *FlavorListOptions) ([]Flavor, *Response, error)
- type FloatingIP
- type FloatingIPCreateRequest
- type FloatingIPMetadata
- type FloatingIPSource
- type FloatingIPsService
- type FloatingipsServiceOp
- func (s *FloatingipsServiceOp) Assign(ctx context.Context, fipID string, reqBody *AssignFloatingIPRequest) (*FloatingIP, *Response, error)
- func (s *FloatingipsServiceOp) Create(ctx context.Context, reqBody *FloatingIPCreateRequest) (*TaskResponse, *Response, error)
- func (s *FloatingipsServiceOp) Delete(ctx context.Context, fipID string) (*TaskResponse, *Response, error)
- func (s *FloatingipsServiceOp) Get(ctx context.Context, fipID string) (*FloatingIP, *Response, error)
- func (s *FloatingipsServiceOp) List(ctx context.Context) ([]FloatingIP, *Response, error)
- func (s *FloatingipsServiceOp) ListAvailable(ctx context.Context) ([]FloatingIP, *Response, error)
- func (s *FloatingipsServiceOp) MetadataCreate(ctx context.Context, fipID string, reqBody *Metadata) (*Response, error)
- func (s *FloatingipsServiceOp) MetadataDeleteItem(ctx context.Context, fipID string, opts *MetadataItemOptions) (*Response, error)
- func (s *FloatingipsServiceOp) MetadataGetItem(ctx context.Context, fipID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
- func (s *FloatingipsServiceOp) MetadataList(ctx context.Context, fipID string) ([]MetadataDetailed, *Response, error)
- func (s *FloatingipsServiceOp) MetadataUpdate(ctx context.Context, fipID string, reqBody *Metadata) (*Response, error)
- func (s *FloatingipsServiceOp) UnAssign(ctx context.Context, fipID string) (*FloatingIP, *Response, error)
- type HTTPMethod
- type HWFirmwareType
- type HWMachineType
- type HardwareDescription
- type HealthMonitor
- type HealthMonitorCreateRequest
- type HealthMonitorType
- type HostRoute
- type ID
- type IDName
- type Image
- type ImageCreateRequest
- type ImageListOptions
- type ImageUpdateRequest
- type ImageUploadRequest
- type ImagesBaremetal
- type ImagesMetadata
- type ImagesProject
- type ImagesService
- type ImagesServiceOp
- func (s *ImagesServiceOp) Create(ctx context.Context, reqBody *ImageCreateRequest) (*TaskResponse, *Response, error)
- func (s *ImagesServiceOp) Delete(ctx context.Context, imageID string) (*TaskResponse, *Response, error)
- func (s *ImagesServiceOp) Get(ctx context.Context, imageID string) (*Image, *Response, error)
- func (s *ImagesServiceOp) ImagesBaremetalCreate(ctx context.Context, reqBody *ImageCreateRequest) (*TaskResponse, *Response, error)
- func (s *ImagesServiceOp) ImagesBaremetalList(ctx context.Context, opts *ImageListOptions) ([]Image, *Response, error)
- func (s *ImagesServiceOp) ImagesProjectList(ctx context.Context) ([]Image, *Response, error)
- func (s *ImagesServiceOp) List(ctx context.Context, opts *ImageListOptions) ([]Image, *Response, error)
- func (s *ImagesServiceOp) MetadataCreate(ctx context.Context, imageID string, reqBody *Metadata) (*Response, error)
- func (s *ImagesServiceOp) MetadataDeleteItem(ctx context.Context, imageID string, opts *MetadataItemOptions) (*Response, error)
- func (s *ImagesServiceOp) MetadataGetItem(ctx context.Context, imageID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
- func (s *ImagesServiceOp) MetadataList(ctx context.Context, imageID string) ([]MetadataDetailed, *Response, error)
- func (s *ImagesServiceOp) MetadataUpdate(ctx context.Context, imageID string, reqBody *Metadata) (*Response, error)
- func (s *ImagesServiceOp) Update(ctx context.Context, imageID string, reqBody *ImageUpdateRequest) (*Image, *Response, error)
- func (s *ImagesServiceOp) Upload(ctx context.Context, reqBody *ImageUploadRequest) (*TaskResponse, *Response, error)
- type Instance
- type InstanceAction
- type InstanceAddress
- type InstanceAttachInterfaceRequest
- type InstanceAvailableNames
- type InstanceCheckFlavorVolumeRequest
- type InstanceCheckLimitsRequest
- type InstanceCheckLimitsVolume
- type InstanceCreateRequest
- type InstanceDeleteOptions
- type InstanceDetachInterfaceRequest
- type InstanceFlavor
- type InstanceFlavorUpdateRequest
- type InstanceInterface
- type InstanceListOptions
- type InstanceMetadata
- type InstanceMetrics
- type InstanceMetricsListRequest
- type InstancePort
- type InstancePortInterface
- type InstancePutIntoServerGroupRequest
- type InstanceSecurityGroup
- type InstanceSubPort
- type InstanceVolume
- type InstanceVolumeCreate
- type InstancesService
- type InstancesServiceOp
- func (s *InstancesServiceOp) AttachInterface(ctx context.Context, instanceID string, ...) (*TaskResponse, *Response, error)
- func (s *InstancesServiceOp) AvailableFlavors(ctx context.Context, reqBody *InstanceCheckFlavorVolumeRequest, ...) ([]Flavor, *Response, error)
- func (s *InstancesServiceOp) AvailableFlavorsToResize(ctx context.Context, instanceID string, opts *FlavorsOptions) ([]Flavor, *Response, error)
- func (s *InstancesServiceOp) AvailableNames(ctx context.Context) (*InstanceAvailableNames, *Response, error)
- func (s *InstancesServiceOp) BareMetalCheckQuotasForInstanceCreation(ctx context.Context, reqBody *BareMetalQuotaCheckRequest) (Quota, *Response, error)
- func (s *InstancesServiceOp) BareMetalCreateInstance(ctx context.Context, reqBody *BareMetalServerCreateRequest) (*TaskResponse, *Response, error)
- func (s *InstancesServiceOp) BareMetalGetCountAvailableNodes(ctx context.Context) (*BareMetalCapacity, *Response, error)
- func (s *InstancesServiceOp) BareMetalListFlavors(ctx context.Context, opts *BareMetalFlavorsOpts, ...) ([]BareMetalFlavor, *Response, error)
- func (s *InstancesServiceOp) BareMetalListInstances(ctx context.Context, opts *BareMetalInstancesListOpts) ([]Instance, *Response, error)
- func (s *InstancesServiceOp) BareMetalRebuildInstance(ctx context.Context, instanceID string, reqBody *BareMetalRebuildRequest) (*TaskResponse, *Response, error)
- func (s *InstancesServiceOp) CheckLimits(ctx context.Context, reqBody *InstanceCheckLimitsRequest) (*map[string]int, *Response, error)
- func (s *InstancesServiceOp) Create(ctx context.Context, reqBody *InstanceCreateRequest) (*TaskResponse, *Response, error)
- func (s *InstancesServiceOp) Delete(ctx context.Context, instanceID string, opts *InstanceDeleteOptions) (*TaskResponse, *Response, error)
- func (s *InstancesServiceOp) DetachInterface(ctx context.Context, instanceID string, ...) (*TaskResponse, *Response, error)
- func (s *InstancesServiceOp) FilterBySecurityGroup(ctx context.Context, securityGroupID string) ([]Instance, *Response, error)
- func (s *InstancesServiceOp) Get(ctx context.Context, instanceID string) (*Instance, *Response, error)
- func (s *InstancesServiceOp) GetConsole(ctx context.Context, instanceID string) (*RemoteConsole, *Response, error)
- func (s *InstancesServiceOp) InstancePowercycle(ctx context.Context, instanceID string) (*Instance, *Response, error)
- func (s *InstancesServiceOp) InstanceReboot(ctx context.Context, instanceID string) (*Instance, *Response, error)
- func (s *InstancesServiceOp) InstanceResume(ctx context.Context, instanceID string) (*Instance, *Response, error)
- func (s *InstancesServiceOp) InstanceStart(ctx context.Context, instanceID string) (*Instance, *Response, error)
- func (s *InstancesServiceOp) InstanceStop(ctx context.Context, instanceID string) (*Instance, *Response, error)
- func (s *InstancesServiceOp) InstanceSuspend(ctx context.Context, instanceID string) (*Instance, *Response, error)
- func (s *InstancesServiceOp) InterfaceList(ctx context.Context, instanceID string) ([]InstancePortInterface, *Response, error)
- func (s *InstancesServiceOp) List(ctx context.Context, opts *InstanceListOptions) ([]Instance, *Response, error)
- func (s *InstancesServiceOp) MetadataCreate(ctx context.Context, instanceID string, metadata *Metadata) (*Response, error)
- func (s *InstancesServiceOp) MetadataDeleteItem(ctx context.Context, instanceID string, opts *MetadataItemOptions) (*Response, error)
- func (s *InstancesServiceOp) MetadataGet(ctx context.Context, instanceID string) (*MetadataDetailed, *Response, error)
- func (s *InstancesServiceOp) MetadataGetItem(ctx context.Context, instanceID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
- func (s *InstancesServiceOp) MetadataList(ctx context.Context, instanceID string) ([]MetadataDetailed, *Response, error)
- func (s *InstancesServiceOp) MetadataUpdate(ctx context.Context, instanceID string, reqBody *Metadata) (*Response, error)
- func (s *InstancesServiceOp) MetricsList(ctx context.Context, instanceID string, reqBody *InstanceMetricsListRequest) ([]InstanceMetrics, *Response, error)
- func (s *InstancesServiceOp) PortsList(ctx context.Context, instanceID string) ([]InstancePort, *Response, error)
- func (s *InstancesServiceOp) PutIntoServerGroup(ctx context.Context, instanceID string, ...) (*TaskResponse, *Response, error)
- func (s *InstancesServiceOp) RemoveFromServerGroup(ctx context.Context, instanceID string) (*TaskResponse, *Response, error)
- func (s *InstancesServiceOp) Rename(ctx context.Context, instanceID string, reqBody *Name) (*Instance, *Response, error)
- func (s *InstancesServiceOp) SecurityGroupAssign(ctx context.Context, instanceID string, reqBody *AssignSecurityGroupRequest) (*Response, error)
- func (s *InstancesServiceOp) SecurityGroupList(ctx context.Context, instanceID string) ([]IDName, *Response, error)
- func (s *InstancesServiceOp) SecurityGroupUnAssign(ctx context.Context, instanceID string, reqBody *AssignSecurityGroupRequest) (*Response, error)
- func (s *InstancesServiceOp) UpdateFlavor(ctx context.Context, instanceID string, reqBody *InstanceFlavorUpdateRequest) (*TaskResponse, *Response, error)
- type InterfaceFloatingIP
- type InterfaceType
- type KeyPair
- type KeyPairCreateRequest
- type KeyPairCreateRequestV2
- type KeyPairShareRequest
- type KeyPairV2
- type KeyPairsListOptionsV2
- type KeyPairsService
- type KeyPairsServiceOp
- func (s *KeyPairsServiceOp) Create(ctx context.Context, reqBody *KeyPairCreateRequest) (*TaskResponse, *Response, error)
- func (s *KeyPairsServiceOp) CreateV2(ctx context.Context, reqBody *KeyPairCreateRequestV2) (*KeyPairV2, *Response, error)
- func (s *KeyPairsServiceOp) Delete(ctx context.Context, keypairID string) (*TaskResponse, *Response, error)
- func (s *KeyPairsServiceOp) DeleteV2(ctx context.Context, keypairID string) (*Response, error)
- func (s *KeyPairsServiceOp) Get(ctx context.Context, keypairID string) (*KeyPair, *Response, error)
- func (s *KeyPairsServiceOp) GetV2(ctx context.Context, keypairID string) (*KeyPairV2, *Response, error)
- func (s *KeyPairsServiceOp) List(ctx context.Context) ([]KeyPair, *Response, error)
- func (s *KeyPairsServiceOp) ListV2(ctx context.Context) ([]KeyPairV2, *Response, error)
- func (s *KeyPairsServiceOp) Share(ctx context.Context, keypairID string, reqBody *KeyPairShareRequest) (*KeyPair, *Response, error)
- type Keystone
- type KeystoneState
- type L7PoliciesService
- type L7PoliciesServiceOp
- func (s *L7PoliciesServiceOp) Create(ctx context.Context, reqBody *L7PolicyCreateRequest) (*TaskResponse, *Response, error)
- func (s *L7PoliciesServiceOp) Delete(ctx context.Context, l7PolicyID string) (*TaskResponse, *Response, error)
- func (s *L7PoliciesServiceOp) Get(ctx context.Context, l7PolicyID string) (*L7Policy, *Response, error)
- func (s *L7PoliciesServiceOp) List(ctx context.Context) ([]L7Policy, *Response, error)
- func (s *L7PoliciesServiceOp) Update(ctx context.Context, l7PolicyID string, reqBody *L7PolicyUpdateRequest) (*TaskResponse, *Response, error)
- type L7Policy
- type L7PolicyAction
- type L7PolicyCreateRequest
- type L7PolicyUpdateRequest
- type L7Rule
- type L7RuleCompareType
- type L7RuleCreateRequest
- type L7RuleType
- type L7RuleUpdateRequest
- type L7RulesService
- type L7RulesServiceOp
- func (s *L7RulesServiceOp) Create(ctx context.Context, l7PolicyID string, reqBody *L7RuleCreateRequest) (*TaskResponse, *Response, error)
- func (s *L7RulesServiceOp) Delete(ctx context.Context, l7PolicyID string, l7RuleID string) (*TaskResponse, *Response, error)
- func (s *L7RulesServiceOp) Get(ctx context.Context, l7PolicyID string, l7RuleID string) (*L7Rule, *Response, error)
- func (s *L7RulesServiceOp) List(ctx context.Context, l7PolicyID string) ([]L7Rule, *Response, error)
- func (s *L7RulesServiceOp) Update(ctx context.Context, l7PolicyID string, l7RuleID string, ...) (*TaskResponse, *Response, error)
- type LifeCyclePoliciesService
- type LifeCyclePoliciesServiceOp
- func (s LifeCyclePoliciesServiceOp) AddSchedules(ctx context.Context, lifeCyclePolicyID int, ...) (*LifeCyclePolicy, *Response, error)
- func (s LifeCyclePoliciesServiceOp) AddVolumes(ctx context.Context, lifeCyclePolicyID int, ...) (*LifeCyclePolicy, *Response, error)
- func (s LifeCyclePoliciesServiceOp) Create(ctx context.Context, reqBody *LifeCyclePolicyCreateRequest) (*LifeCyclePolicy, *Response, error)
- func (s LifeCyclePoliciesServiceOp) Delete(ctx context.Context, lifeCyclePolicyID int) (*Response, error)
- func (s LifeCyclePoliciesServiceOp) EstimateCronMaxPolicyUsage(ctx context.Context, reqBody *LifeCyclePolicyEstimateCronRequest) (*LifeCyclePolicyMaxPolicyUsage, *Response, error)
- func (s LifeCyclePoliciesServiceOp) EstimateIntervalMaxPolicyUsage(ctx context.Context, reqBody *LifeCyclePolicyEstimateIntervalRequest) (*LifeCyclePolicyMaxPolicyUsage, *Response, error)
- func (s LifeCyclePoliciesServiceOp) Get(ctx context.Context, lifecyclePolicyID int, getOpts *LifeCyclePolicyGetOptions) (*LifeCyclePolicy, *Response, error)
- func (s LifeCyclePoliciesServiceOp) List(ctx context.Context, listOpts *LifeCyclePolicyListOptions) ([]LifeCyclePolicy, *Response, error)
- func (s LifeCyclePoliciesServiceOp) RemoveSchedules(ctx context.Context, lifeCyclePolicyID int, ...) (*LifeCyclePolicy, *Response, error)
- func (s LifeCyclePoliciesServiceOp) RemoveVolumes(ctx context.Context, lifeCyclePolicyID int, ...) (*LifeCyclePolicy, *Response, error)
- func (s LifeCyclePoliciesServiceOp) Update(ctx context.Context, lifeCyclePolicyID int, ...) (*LifeCyclePolicy, *Response, error)
- type LifeCyclePolicy
- type LifeCyclePolicyAction
- type LifeCyclePolicyAddSchedulesRequest
- type LifeCyclePolicyAddVolumesRequest
- type LifeCyclePolicyCommonCreateScheduleRequest
- type LifeCyclePolicyCommonSchedule
- type LifeCyclePolicyCreateCronScheduleRequest
- type LifeCyclePolicyCreateIntervalScheduleRequest
- type LifeCyclePolicyCreateRequest
- type LifeCyclePolicyCreateScheduleRequest
- type LifeCyclePolicyCronSchedule
- type LifeCyclePolicyCurrency
- type LifeCyclePolicyEstimateCronRequest
- type LifeCyclePolicyEstimateIntervalRequest
- type LifeCyclePolicyEstimateOpts
- type LifeCyclePolicyGetOptions
- type LifeCyclePolicyIntervalSchedule
- type LifeCyclePolicyListOptions
- type LifeCyclePolicyMaxPolicyUsage
- type LifeCyclePolicyPolicyUsageCost
- type LifeCyclePolicyRawSchedule
- type LifeCyclePolicyRemoveSchedulesRequest
- type LifeCyclePolicyRemoveVolumesRequest
- type LifeCyclePolicyRetentionTimer
- type LifeCyclePolicySchedule
- type LifeCyclePolicyScheduleType
- type LifeCyclePolicyStatus
- type LifeCyclePolicyUpdateRequest
- type LifeCyclePolicyVolume
- type LimiterStats
- type ListCombinedOptions
- type Listener
- type ListenerCreateRequest
- type ListenerListOptions
- type ListenerUpdateRequest
- type Loadbalancer
- type LoadbalancerAlgorithm
- type LoadbalancerCheckLimitsRequest
- type LoadbalancerCreateRequest
- type LoadbalancerHealthMonitor
- type LoadbalancerListOptions
- type LoadbalancerListenerCreateRequest
- type LoadbalancerListenerProtocol
- type LoadbalancerListeners
- type LoadbalancerMetadata
- type LoadbalancerMetrics
- type LoadbalancerMetricsListRequest
- type LoadbalancerPoolCreateRequest
- type LoadbalancerPoolProtocol
- type LoadbalancerPools
- type LoadbalancerPoolsMember
- type LoadbalancerSessionPersistence
- type LoadbalancerStats
- type LoadbalancersService
- type LoadbalancersServiceOp
- func (s *LoadbalancersServiceOp) CheckLimits(ctx context.Context, reqBody *LoadbalancerCheckLimitsRequest) (*map[string]int, *Response, error)
- func (s *LoadbalancersServiceOp) Create(ctx context.Context, reqBody *LoadbalancerCreateRequest) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) Delete(ctx context.Context, loadbalancerID string) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) FlavorList(ctx context.Context, opts *FlavorsOptions) ([]Flavor, *Response, error)
- func (s *LoadbalancersServiceOp) Get(ctx context.Context, loadbalancerID string) (*Loadbalancer, *Response, error)
- func (s *LoadbalancersServiceOp) HealthMonitorCreate(ctx context.Context, poolID string, reqBody *HealthMonitorCreateRequest) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) HealthMonitorDelete(ctx context.Context, poolID string) (*Response, error)
- func (s *LoadbalancersServiceOp) List(ctx context.Context, opts *LoadbalancerListOptions) ([]Loadbalancer, *Response, error)
- func (s *LoadbalancersServiceOp) ListenerCreate(ctx context.Context, reqBody *ListenerCreateRequest) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) ListenerDelete(ctx context.Context, listenerID string) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) ListenerGet(ctx context.Context, listenerID string) (*Listener, *Response, error)
- func (s *LoadbalancersServiceOp) ListenerList(ctx context.Context, opts *ListenerListOptions) ([]Listener, *Response, error)
- func (s *LoadbalancersServiceOp) ListenerRename(ctx context.Context, listenerID string, reqBody *Name) (*Listener, *Response, error)
- func (s *LoadbalancersServiceOp) ListenerUpdate(ctx context.Context, listenerID string, reqBody *ListenerUpdateRequest) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) MetadataCreate(ctx context.Context, loadbalancerID string, reqBody *Metadata) (*Response, error)
- func (s *LoadbalancersServiceOp) MetadataDeleteItem(ctx context.Context, loadbalancerID string, opts *MetadataItemOptions) (*Response, error)
- func (s *LoadbalancersServiceOp) MetadataGetItem(ctx context.Context, loadbalancerID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
- func (s *LoadbalancersServiceOp) MetadataList(ctx context.Context, loadbalancerID string) ([]MetadataDetailed, *Response, error)
- func (s *LoadbalancersServiceOp) MetadataUpdate(ctx context.Context, loadbalancerID string, reqBody *Metadata) (*Response, error)
- func (s *LoadbalancersServiceOp) MetricsList(ctx context.Context, loadbalancerID string, ...) ([]LoadbalancerMetrics, *Response, error)
- func (s *LoadbalancersServiceOp) PoolCreate(ctx context.Context, reqBody *PoolCreateRequest) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) PoolDelete(ctx context.Context, poolID string) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) PoolGet(ctx context.Context, poolID string) (*Pool, *Response, error)
- func (s *LoadbalancersServiceOp) PoolList(ctx context.Context, opts *PoolListOptions) ([]Pool, *Response, error)
- func (s *LoadbalancersServiceOp) PoolMemberCreate(ctx context.Context, poolID string, reqBody *PoolMemberCreateRequest) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) PoolMemberDelete(ctx context.Context, poolID, memberID string) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) PoolUpdate(ctx context.Context, poolID string, reqBody *PoolUpdateRequest) (*TaskResponse, *Response, error)
- func (s *LoadbalancersServiceOp) Rename(ctx context.Context, loadbalancerID string, reqBody *Name) (*Loadbalancer, *Response, error)
- type Metadata
- type MetadataCreateRequest
- type MetadataDetailed
- type MetadataItemOptions
- type MetadataRoot
- type MetricsDatabase
- type Name
- type Network
- type NetworkCreateRequest
- type NetworkListOptions
- type NetworkSubnetwork
- type NetworkType
- type NetworksMetadata
- type NetworksService
- type NetworksServiceOp
- func (s *NetworksServiceOp) Create(ctx context.Context, reqBody *NetworkCreateRequest) (*TaskResponse, *Response, error)
- func (s *NetworksServiceOp) Delete(ctx context.Context, networkID string) (*TaskResponse, *Response, error)
- func (s *NetworksServiceOp) Get(ctx context.Context, networkID string) (*Network, *Response, error)
- func (s *NetworksServiceOp) List(ctx context.Context, opts *NetworkListOptions) ([]Network, *Response, error)
- func (s *NetworksServiceOp) ListNetworksWithSubnets(ctx context.Context, opts *NetworksWithSubnetsOptions) ([]NetworkSubnetwork, *Response, error)
- func (s *NetworksServiceOp) MetadataCreate(ctx context.Context, networkID string, reqBody *Metadata) (*Response, error)
- func (s *NetworksServiceOp) MetadataDeleteItem(ctx context.Context, networkID string, opts *MetadataItemOptions) (*Response, error)
- func (s *NetworksServiceOp) MetadataGetItem(ctx context.Context, networkID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
- func (s *NetworksServiceOp) MetadataList(ctx context.Context, networkID string) ([]MetadataDetailed, *Response, error)
- func (s *NetworksServiceOp) MetadataUpdate(ctx context.Context, networkID string, reqBody *Metadata) (*Response, error)
- func (s *NetworksServiceOp) PortList(ctx context.Context, networkID string) ([]PortsInstance, *Response, error)
- func (s *NetworksServiceOp) UpdateName(ctx context.Context, networkID string, reqBody *Name) (*Network, *Response, error)
- type NetworksWithSubnetsOptions
- type NotificationThresholdUpdateRequest
- type OSType
- type OperatingStatus
- type Payload
- type Pool
- type PoolCreateRequest
- type PoolListOptions
- type PoolMember
- type PoolMemberCreateRequest
- type PoolUpdateRequest
- type Port
- type PortIP
- type PortsAllowedAddressPairs
- type PortsAllowedAddressPairsRequest
- type PortsInstance
- type PortsSecurityGroupNames
- type PortsService
- type PortsServiceOp
- func (s *PortsServiceOp) Assign(ctx context.Context, portID string, reqBody *PortsAllowedAddressPairsRequest) (*Port, *Response, error)
- func (s *PortsServiceOp) DisablePortSecurity(ctx context.Context, portID string) (*InstancePortInterface, *Response, error)
- func (s *PortsServiceOp) EnablePortSecurity(ctx context.Context, portID string) (*InstancePortInterface, *Response, error)
- type Project
- type ProjectCreateRequest
- type ProjectListOptions
- type ProjectState
- type ProjectUpdateRequest
- type ProjectsService
- type ProjectsServiceOp
- func (s *ProjectsServiceOp) Create(ctx context.Context, reqBody *ProjectCreateRequest) (*Project, *Response, error)
- func (s *ProjectsServiceOp) Delete(ctx context.Context, projectID string) (*TaskResponse, *Response, error)
- func (s *ProjectsServiceOp) Get(ctx context.Context, projectID string) (*Project, *Response, error)
- func (s *ProjectsServiceOp) List(ctx context.Context, opts *ProjectListOptions) ([]Project, *Response, error)
- func (s *ProjectsServiceOp) Update(ctx context.Context, projectID string, reqBody *ProjectUpdateRequest) (*Project, *Response, error)
- type ProvisioningStatus
- type Quota
- type QuotaNotificationThreshold
- type QuotasService
- type QuotasServiceOp
- func (s *QuotasServiceOp) DeleteNotificationThreshold(ctx context.Context, clientID int) (*Response, error)
- func (s *QuotasServiceOp) GetNotificationThreshold(ctx context.Context, clientID int) (*QuotaNotificationThreshold, *Response, error)
- func (s *QuotasServiceOp) ListCombined(ctx context.Context, opts *ListCombinedOptions) (*CombinedQuota, *Response, error)
- func (s *QuotasServiceOp) ListGlobal(ctx context.Context, clientID int) (*Quota, *Response, error)
- func (s *QuotasServiceOp) ListRegional(ctx context.Context, clientID, regionID int) (*Quota, *Response, error)
- func (s *QuotasServiceOp) UpdateNotificationThreshold(ctx context.Context, clientID int, reqBody *NotificationThresholdUpdateRequest) (*QuotaNotificationThreshold, *Response, error)
- type Region
- type RegionEndpointType
- type RegionGetOptions
- type RegionListOptions
- type RegionState
- type RegionsService
- type RegionsServiceOp
- type RemoteConsole
- type RequestCompletionCallback
- type Reservation
- type ReservedFixedIP
- type ReservedFixedIPCreateRequest
- type ReservedFixedIPInstancePort
- type ReservedFixedIPListOptions
- type ReservedFixedIPType
- type ReservedFixedIPsService
- type ReservedFixedIPsServiceOp
- func (s *ReservedFixedIPsServiceOp) AddInstancePorts(ctx context.Context, reservedFixedIPID string, ...) ([]ReservedFixedIPInstancePort, *Response, error)
- func (s *ReservedFixedIPsServiceOp) Create(ctx context.Context, reqBody *ReservedFixedIPCreateRequest) (*TaskResponse, *Response, error)
- func (s *ReservedFixedIPsServiceOp) Delete(ctx context.Context, reservedFixedIPID string) (*TaskResponse, *Response, error)
- func (s *ReservedFixedIPsServiceOp) Get(ctx context.Context, reservedFixedIPID string) (*ReservedFixedIP, *Response, error)
- func (s *ReservedFixedIPsServiceOp) List(ctx context.Context, opts *ReservedFixedIPListOptions) ([]ReservedFixedIP, *Response, error)
- func (s *ReservedFixedIPsServiceOp) ListInstancePorts(ctx context.Context, reservedFixedIPID string) ([]ReservedFixedIPInstancePort, *Response, error)
- func (s *ReservedFixedIPsServiceOp) ListInstancePortsAvailable(ctx context.Context, reservedFixedIPID string) ([]ReservedFixedIPInstancePort, *Response, error)
- func (s *ReservedFixedIPsServiceOp) ReplaceInstancePorts(ctx context.Context, reservedFixedIPID string, ...) ([]ReservedFixedIPInstancePort, *Response, error)
- func (s *ReservedFixedIPsServiceOp) SwitchVIPStatus(ctx context.Context, reservedFixedIPID string, reqBody *SwitchVIPStatusRequest) (*ReservedFixedIP, *Response, error)
- type Response
- type ResponseError
- type RetryConfig
- type RoleAssignment
- type Router
- type RouterAttachRequest
- type RouterCreateRequest
- type RouterDetachRequest
- type RouterInterface
- type RouterInterfaceCreate
- type RouterUpdateRequest
- type RoutersService
- type RoutersServiceOp
- func (s *RoutersServiceOp) Attach(ctx context.Context, routerID string, reqBody *RouterAttachRequest) (*Router, *Response, error)
- func (s *RoutersServiceOp) Create(ctx context.Context, reqBody *RouterCreateRequest) (*TaskResponse, *Response, error)
- func (s *RoutersServiceOp) Delete(ctx context.Context, routerID string) (*TaskResponse, *Response, error)
- func (s *RoutersServiceOp) Detach(ctx context.Context, routerID string, reqBody *RouterDetachRequest) (*Router, *Response, error)
- func (s *RoutersServiceOp) Get(ctx context.Context, routerID string) (*Router, *Response, error)
- func (s *RoutersServiceOp) List(ctx context.Context) ([]Router, *Response, error)
- func (s *RoutersServiceOp) Update(ctx context.Context, routerID string, reqBody *RouterUpdateRequest) (*Router, *Response, error)
- type RuleCreateRequest
- type RuleUpdateRequest
- type SSHKey
- type Secret
- type SecretCreateRequest
- type SecretCreateRequestV2
- type SecretType
- type SecretsService
- type SecretsServiceOp
- func (s *SecretsServiceOp) Create(ctx context.Context, reqBody *SecretCreateRequest) (*TaskResponse, *Response, error)
- func (s *SecretsServiceOp) CreateV2(ctx context.Context, reqBody *SecretCreateRequestV2) (*TaskResponse, *Response, error)
- func (s *SecretsServiceOp) Delete(ctx context.Context, secretID string) (*TaskResponse, *Response, error)
- func (s *SecretsServiceOp) Get(ctx context.Context, secretID string) (*Secret, *Response, error)
- func (s *SecretsServiceOp) List(ctx context.Context) ([]Secret, *Response, error)
- type SecurityGroup
- type SecurityGroupCreateRequest
- type SecurityGroupCreateRequestInner
- type SecurityGroupListOptions
- type SecurityGroupRule
- type SecurityGroupRuleDirection
- func (rd SecurityGroupRuleDirection) IsValid() error
- func (rd SecurityGroupRuleDirection) List() []SecurityGroupRuleDirection
- func (rd *SecurityGroupRuleDirection) MarshalJSON() ([]byte, error)
- func (rd SecurityGroupRuleDirection) String() string
- func (rd SecurityGroupRuleDirection) StringList() []string
- func (rd *SecurityGroupRuleDirection) UnmarshalJSON(data []byte) error
- func (rd SecurityGroupRuleDirection) ValidOrNil() (*SecurityGroupRuleDirection, error)
- type SecurityGroupRuleProtocol
- func (p SecurityGroupRuleProtocol) IsValid() error
- func (p SecurityGroupRuleProtocol) List() []SecurityGroupRuleProtocol
- func (p *SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error)
- func (p SecurityGroupRuleProtocol) String() string
- func (p SecurityGroupRuleProtocol) StringList() []string
- func (p *SecurityGroupRuleProtocol) UnmarshalJSON(data []byte) error
- func (p SecurityGroupRuleProtocol) ValidOrNil() (*SecurityGroupRuleProtocol, error)
- type SecurityGroupUpdateRequest
- type SecurityGroupsMetadata
- type SecurityGroupsRules
- type SecurityGroupsService
- type SecurityGroupsServiceOp
- func (s *SecurityGroupsServiceOp) Create(ctx context.Context, reqBody *SecurityGroupCreateRequest) (*SecurityGroup, *Response, error)
- func (s *SecurityGroupsServiceOp) DeepCopy(ctx context.Context, securityGroupID string, reqBody *Name) (*Response, error)
- func (s *SecurityGroupsServiceOp) Delete(ctx context.Context, securityGroupID string) (*Response, error)
- func (s *SecurityGroupsServiceOp) Get(ctx context.Context, securityGroupID string) (*SecurityGroup, *Response, error)
- func (s *SecurityGroupsServiceOp) List(ctx context.Context, opts *SecurityGroupListOptions) ([]SecurityGroup, *Response, error)
- func (s *SecurityGroupsServiceOp) MetadataCreate(ctx context.Context, securityGroupID string, reqBody *Metadata) (*Response, error)
- func (s *SecurityGroupsServiceOp) MetadataDeleteItem(ctx context.Context, securityGroupID string, opts *MetadataItemOptions) (*Response, error)
- func (s *SecurityGroupsServiceOp) MetadataGetItem(ctx context.Context, securityGroupID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
- func (s *SecurityGroupsServiceOp) MetadataList(ctx context.Context, securityGroupID string) ([]MetadataDetailed, *Response, error)
- func (s *SecurityGroupsServiceOp) MetadataUpdate(ctx context.Context, securityGroupID string, reqBody *Metadata) (*Response, error)
- func (s *SecurityGroupsServiceOp) RuleCreate(ctx context.Context, securityGroupID string, reqBody *RuleCreateRequest) (*SecurityGroupRule, *Response, error)
- func (s *SecurityGroupsServiceOp) RuleDelete(ctx context.Context, securityGroupID string) (*TaskResponse, *Response, error)
- func (s *SecurityGroupsServiceOp) RuleUpdate(ctx context.Context, securityGroupID string, reqBody *RuleUpdateRequest) (*SecurityGroupRule, *Response, error)
- func (s *SecurityGroupsServiceOp) Update(ctx context.Context, securityGroupID string, ...) (*SecurityGroup, *Response, error)
- type ServerGroup
- type ServerGroupCreateRequest
- type ServerGroupInstance
- type ServerGroupPolicy
- type ServerGroupsService
- type ServerGroupsServiceOp
- func (s *ServerGroupsServiceOp) Create(ctx context.Context, reqBody *ServerGroupCreateRequest) (*ServerGroup, *Response, error)
- func (s *ServerGroupsServiceOp) Delete(ctx context.Context, serverGroupID string) (*Response, error)
- func (s *ServerGroupsServiceOp) Get(ctx context.Context, serverGroupID string) (*ServerGroup, *Response, error)
- func (s *ServerGroupsServiceOp) List(ctx context.Context) ([]ServerGroup, *Response, error)
- type SessionPersistence
- type Snapshot
- type SnapshotCreateRequest
- type SnapshotListOptions
- type SnapshotsService
- type SnapshotsServiceOp
- func (s *SnapshotsServiceOp) Create(ctx context.Context, reqBody *SnapshotCreateRequest) (*TaskResponse, *Response, error)
- func (s *SnapshotsServiceOp) Delete(ctx context.Context, snapshotID string) (*TaskResponse, *Response, error)
- func (s *SnapshotsServiceOp) Get(ctx context.Context, snapshotID string) (*Snapshot, *Response, error)
- func (s *SnapshotsServiceOp) List(ctx context.Context, opts *SnapshotListOptions) ([]Snapshot, *Response, error)
- func (s *SnapshotsServiceOp) MetadataUpdate(ctx context.Context, snapshotID string, reqBody *MetadataCreateRequest) (*Snapshot, *Response, error)
- type Subnetwork
- type SubnetworkCreateRequest
- type SubnetworkListOptions
- type SubnetworkUpdateRequest
- type SubnetworksMetadata
- type SubnetworksService
- type SubnetworksServiceOp
- func (s *SubnetworksServiceOp) Create(ctx context.Context, reqBody *SubnetworkCreateRequest) (*TaskResponse, *Response, error)
- func (s *SubnetworksServiceOp) Delete(ctx context.Context, subnetworkID string) (*TaskResponse, *Response, error)
- func (s *SubnetworksServiceOp) Get(ctx context.Context, subnetworkID string) (*Subnetwork, *Response, error)
- func (s *SubnetworksServiceOp) List(ctx context.Context, opts *SubnetworkListOptions) ([]Subnetwork, *Response, error)
- func (s *SubnetworksServiceOp) MetadataCreate(ctx context.Context, subnetworkID string, reqBody *Metadata) (*Response, error)
- func (s *SubnetworksServiceOp) MetadataDeleteItem(ctx context.Context, subnetworkID string, opts *MetadataItemOptions) (*Response, error)
- func (s *SubnetworksServiceOp) MetadataGetItem(ctx context.Context, subnetworkID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
- func (s *SubnetworksServiceOp) MetadataList(ctx context.Context, subnetworkID string) ([]MetadataDetailed, *Response, error)
- func (s *SubnetworksServiceOp) MetadataUpdate(ctx context.Context, subnetworkID string, reqBody *Metadata) (*Response, error)
- func (s *SubnetworksServiceOp) Update(ctx context.Context, subnetworkID string, reqBody *SubnetworkUpdateRequest) (*Subnetwork, *Response, error)
- type SwitchVIPStatusRequest
- type Task
- type TaskAcknowledgeAllOptions
- type TaskListOptions
- type TaskResponse
- type TaskSorting
- type TaskState
- type TasksService
- type TasksServiceOp
- func (s *TasksServiceOp) Acknowledge(ctx context.Context, taskID string) (*Task, *Response, error)
- func (s *TasksServiceOp) AcknowledgeAll(ctx context.Context, opts *TaskAcknowledgeAllOptions) (*Response, error)
- func (s *TasksServiceOp) Get(ctx context.Context, taskID string) (*Task, *Response, error)
- func (s *TasksServiceOp) List(ctx context.Context, opts *TaskListOptions) ([]Task, *Response, error)
- func (s *TasksServiceOp) ListActive(ctx context.Context) ([]Task, *Response, error)
- type TimeUnit
- type UpdateAssignmentRequest
- type User
- type UserListOptions
- type UserRole
- type UserRoleListOptions
- type UsersService
- type UsersServiceOp
- func (s *UsersServiceOp) AssignRole(ctx context.Context, reqBody *UpdateAssignmentRequest) (*UserRole, *Response, error)
- func (s *UsersServiceOp) DeleteAssignment(ctx context.Context, assignmentID int) (*Response, error)
- func (s *UsersServiceOp) List(ctx context.Context, opts *UserListOptions) ([]User, *Response, error)
- func (s *UsersServiceOp) ListAssignment(ctx context.Context, opts *UserRoleListOptions) ([]RoleAssignment, *Response, error)
- func (s *UsersServiceOp) ListRoles(ctx context.Context, opts *UserRoleListOptions) ([]UserRole, *Response, error)
- func (s *UsersServiceOp) UpdateAssignment(ctx context.Context, assignmentID int, reqBody *UpdateAssignmentRequest) (*Response, error)
- type Volume
- type VolumeAttachRequest
- type VolumeChangeTypeRequest
- type VolumeCreateRequest
- type VolumeDetachRequest
- type VolumeExtendSizeRequest
- type VolumeImageMetadata
- type VolumeListOptions
- type VolumeMetadata
- type VolumeSource
- type VolumeType
- type VolumesService
- type VolumesServiceOp
- func (s *VolumesServiceOp) Attach(ctx context.Context, volumeID string, reqBody *VolumeAttachRequest) (*Volume, *Response, error)
- func (s *VolumesServiceOp) ChangeType(ctx context.Context, volumeID string, reqBody *VolumeChangeTypeRequest) (*Volume, *Response, error)
- func (s *VolumesServiceOp) Create(ctx context.Context, reqBody *VolumeCreateRequest) (*TaskResponse, *Response, error)
- func (s *VolumesServiceOp) Delete(ctx context.Context, volumeID string) (*TaskResponse, *Response, error)
- func (s *VolumesServiceOp) Detach(ctx context.Context, volumeID string, reqBody *VolumeDetachRequest) (*Volume, *Response, error)
- func (s *VolumesServiceOp) Extend(ctx context.Context, volumeID string, reqBody *VolumeExtendSizeRequest) (*TaskResponse, *Response, error)
- func (s *VolumesServiceOp) Get(ctx context.Context, volumeID string) (*Volume, *Response, error)
- func (s *VolumesServiceOp) List(ctx context.Context, opts *VolumeListOptions) ([]Volume, *Response, error)
- func (s *VolumesServiceOp) MetadataCreate(ctx context.Context, volumeID string, reqBody *Metadata) (*Response, error)
- func (s *VolumesServiceOp) MetadataDeleteItem(ctx context.Context, volumeID string, opts *MetadataItemOptions) (*Response, error)
- func (s *VolumesServiceOp) MetadataGetItem(ctx context.Context, volumeID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
- func (s *VolumesServiceOp) MetadataList(ctx context.Context, volumeID string) ([]MetadataDetailed, *Response, error)
- func (s *VolumesServiceOp) MetadataUpdate(ctx context.Context, volumeID string, reqBody *Metadata) (*Response, error)
- func (s *VolumesServiceOp) Rename(ctx context.Context, volumeID string, reqBody *Name) (*Volume, *Response, error)
- func (s *VolumesServiceOp) Revert(ctx context.Context, volumeID string) (*TaskResponse, *Response, error)
- type VrrpIP
- type Zone
Constants ¶
const ( LifeCyclePolicyScheduleTypeCron LifeCyclePolicyScheduleType = "cron" LifeCyclePolicyScheduleTypeInterval LifeCyclePolicyScheduleType = "interval" LifeCyclePolicyStatusActive LifeCyclePolicyStatus = "active" LifeCyclePolicyStatusPaused LifeCyclePolicyStatus = "paused" LifeCyclePolicyActionVolumeSnapshot LifeCyclePolicyAction = "volume_snapshot" )
const ( ReservedFixedIPTypeExternal = "external" ReservedFixedIPTypeSubnet = "subnet" ReservedFixedIPTypeAnySubnet = "any_subnet" ReservedFixedIPTypeIPAddress = "ip_address" )
Variables ¶
var ( ErrMultipleResourcesWithTheSameName = errors.New("there are multiple resources with the same name") ErrResourceDoesntExist = errors.New("resource doesn't exist") )
var ( ErrLifeCyclePolicyInvalidScheduleType = fmt.Errorf("invalid schedule type") ErrLifeCyclePolicyInvalidStatus = fmt.Errorf("invalid lifecycle policy status") ErrLifeCyclePolicyInvalidAction = fmt.Errorf("invalid lifecycle policy action") )
var ( ErrSGEtherTypeNotAllowed = fmt.Errorf("invalid EtherType, allowed only %s or %s", EtherTypeIPv4, EtherTypeIPv6) ErrSGInvalidProtocol = fmt.Errorf("invalid Protocol") ErrSGRuleDirectionNotAllowed = fmt.Errorf("invalid RuleDirection type, allowed only %s or %s", SGRuleDirectionIngress, SGRuleDirectionEgress) )
var ErrVolumeTypeStatus = fmt.Errorf("invalid VolumeType type")
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ResponseError. Any other response body will be silently ignored. If the API error response does not include the request ID in its body, the one from its header will be used.
Types ¶
type AddInstancePortsRequest ¶
type AddInstancePortsRequest struct {
PortIDs []string `json:"port_ids"`
}
type AddressType ¶
type AddressType string
const ( AddressTypeFixed AddressType = "fixed" AddressTypeFloating AddressType = "floating" )
type ArgError ¶
type ArgError struct {
// contains filtered or unexported fields
}
ArgError is an error that represents an error with an input to edgecloud. It identifies the argument and the cause (if possible).
func NewArgError ¶
NewArgError creates an InputError.
type AssignFloatingIPRequest ¶
type AssignFloatingIPRequest struct { PortID string `json:"port_id" validate:"required"` FixedIPAddress net.IP `json:"fixed_ip_address,omitempty"` Metadata Metadata `json:"metadata,omitempty"` }
AssignFloatingIPRequest represents a request to assign a Floating IP to an instance or a load balancer.
type AssignSecurityGroupRequest ¶
type AssignSecurityGroupRequest struct { Name string `json:"name,omitempty"` PortsSecurityGroupNames []PortsSecurityGroupNames `json:"ports_security_group_names,omitempty"` }
type Attachment ¶
type Attachment struct { ServerID string `json:"server_id"` InstanceName string `json:"instance_name"` AttachmentID string `json:"attachment_id"` VolumeID string `json:"volume_id"` Device string `json:"device"` AttachedAt string `json:"attached_at"` }
Attachment represents an attachment structure.
type BareMetalCapacity ¶ added in v2.0.21
type BareMetalFlavor ¶ added in v2.0.21
type BareMetalFlavor struct { FlavorName string `json:"flavor_name"` PricePerMonth int `json:"price_per_month"` Disabled bool `json:"disabled"` HardwareDescription HardwareDescription `json:"hardware_description,omitempty"` CurrencyCode string `json:"currency_code"` PriceStatus string `json:"price_status"` FlavorID string `json:"flavor_id"` PricePerHour int `json:"price_per_hour"` ResourceClass string `json:"resource_class"` }
BareMetalFlavor represents an EdgecenterCloud BareMetalFlavor.
type BareMetalFlavorsOpts ¶ added in v2.0.21
type BareMetalFlavorsOpts struct {
IncludePrices bool `url:"include_prices,omitempty"`
}
type BareMetalFlavorsRequest ¶ added in v2.0.21
type BareMetalFlavorsRequest struct {
ImageID string `json:"image_id" url:"image_id,omitempty"`
}
type BareMetalInstancesListOpts ¶ added in v2.0.21
type BareMetalInstancesListOpts struct { Name string `url:"name,omitempty" validate:"omitempty"` ProfileName string `url:"profile_name,omitempty" validate:"omitempty"` OnlyWithFixedExternalIP bool `url:"only_with_fixed_external_ip,omitempty" validate:"omitempty"` Limit int `url:"limit,omitempty" validate:"omitempty"` Offset int `url:"offset,omitempty" validate:"omitempty"` FlavorID string `url:"flavor_id,omitempty" validate:"omitempty"` Status string `url:"status,omitempty" validate:"omitempty"` ChangesBefore string `url:"changes-before,omitempty" validate:"omitempty"` IP string `url:"ip,omitempty" validate:"omitempty"` UUID string `url:"uuid,omitempty" validate:"omitempty"` MetadataKV string `url:"metadata_kv,omitempty" validate:"omitempty"` MetadataK string `url:"metadata_k,omitempty" validate:"omitempty"` OrderBy string `url:"order_by,omitempty" validate:"omitempty"` }
BareMetalInstancesListOpts allows the filtering and sorting of paginated collections through the API.
type BareMetalInterfaceOpts ¶ added in v2.0.21
type BareMetalInterfaceOpts struct { Type InterfaceType `json:"type" validate:"omitempty,enum"` NetworkID string `json:"network_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"` SubnetID string `json:"subnet_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"` PortID string `json:"port_id,omitempty" validate:"rfe=Type:reserved_fixed_ip,allowed_without_all=NetworkID SubnetID,omitempty,uuid4"` FloatingIP *InterfaceFloatingIP `json:"floating_ip,omitempty" validate:"omitempty,dive"` }
type BareMetalQuotaCheckRequest ¶ added in v2.0.21
type BareMetalQuotaCheckRequest struct { Flavor string `json:"flavor" required:"true"` Interfaces []BareMetalInterfaceOpts `json:"interfaces" required:"true" validate:"required,dive"` }
type BareMetalRebuildOpts ¶ added in v2.0.21
type BareMetalRebuildOpts struct {
InstanceID string `json:"instance_id" required:"true" validate:"uuid4"`
}
BareMetalRebuildOpts allows the filtering and sorting of paginated collections through the API.
type BareMetalRebuildRequest ¶ added in v2.0.21
type BareMetalRebuildRequest struct {
ImageID string `json:"image_id" validate:"omitempty"`
}
type BareMetalServerCreateRequest ¶ added in v2.0.21
type BareMetalServerCreateRequest struct { KeypairName string `json:"keypair_name,omitempty"` AppTemplateID string `json:"apptemplate_id,omitempty"` Flavor string `json:"flavor" required:"true"` Metadata Metadata `json:"metadata,omitempty" validate:"omitempty,dive"` NameTemplates []string `json:"name_templates,omitempty" validate:"required_without=Names"` Username string `json:"username,omitempty" validate:"omitempty,required_with=Password"` Password string `json:"password,omitempty" validate:"omitempty,required_with=Username"` Names []string `json:"names,omitempty" validate:"required_without=NameTemplates"` Interfaces []BareMetalInterfaceOpts `json:"interfaces" required:"true" validate:"required,dive"` ImageID string `json:"image_id" validate:"omitempty"` UserData string `json:"user_data,omitempty" validate:"omitempty,base64"` AppConfig map[string]interface{} `json:"app_config,omitempty" validate:"omitempty,dive"` }
BareMetalServerCreateRequest represents a request to create an bare metal server.
type BareMetalService ¶ added in v2.0.21
type BareMetalService interface { BareMetalListInstances(context.Context, *BareMetalInstancesListOpts) ([]Instance, *Response, error) BareMetalCreateInstance(context.Context, *BareMetalServerCreateRequest) (*TaskResponse, *Response, error) BareMetalRebuildInstance(context.Context, string, *BareMetalRebuildRequest) (*TaskResponse, *Response, error) BareMetalListFlavors(context.Context, *BareMetalFlavorsOpts, *BareMetalFlavorsRequest) ([]BareMetalFlavor, *Response, error) BareMetalGetCountAvailableNodes(context.Context) (*BareMetalCapacity, *Response, error) BareMetalCheckQuotasForInstanceCreation(context.Context, *BareMetalQuotaCheckRequest) (Quota, *Response, error) }
BareMetalService is an interface for creating and managing bare metal Instances with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/instances
type CIDR ¶
func ParseCIDRString ¶ added in v2.0.6
func (CIDR) MarshalJSON ¶ added in v2.0.6
MarshalJSON - implements Marshaler interface for CIDR.
func (*CIDR) UnmarshalJSON ¶ added in v2.0.6
UnmarshalJSON - implements Unmarshaler interface for CIDR.
type ChangedRuleAction ¶
type ChangedRuleAction string
const ( ChangedRuleCreate ChangedRuleAction = "create" ChangedRuleDelete ChangedRuleAction = "delete" )
type ChangedRules ¶
type ChangedRules struct { Description string `json:"description"` RemoteIPPrefix string `json:"remote_ip_prefix,omitempty"` SecurityGroupRuleID string `json:"security_group_rule_id,omitempty"` PortRangeMax int `json:"port_range_max,omitempty"` Protocol SecurityGroupRuleProtocol `json:"protocol,omitempty"` PortRangeMin int `json:"port_range_min,omitempty"` EtherType EtherType `json:"ethertype,omitempty" required:"true"` RemoteGroupID string `json:"remote_group_id,omitempty"` Direction SecurityGroupRuleDirection `json:"direction"` Action ChangedRuleAction `json:"action"` }
type Client ¶
type Client struct { // HTTP client used to communicate with the EdgecenterCloud API. HTTPClient *http.Client // Base URL for API requests. BaseURL *url.URL // User agent for client UserAgent string // APIKey token for client APIKey string // RegionID for client Region int // ProjectID for client Project int Flavors FlavorsService Floatingips FloatingIPsService Images ImagesService Instances InstancesService KeyPairs KeyPairsService Loadbalancers LoadbalancersService L7Policies L7PoliciesService L7Rules L7RulesService Networks NetworksService Ports PortsService Projects ProjectsService Quotas QuotasService Regions RegionsService ReservedFixedIP ReservedFixedIPsService Routers RoutersService SecurityGroups SecurityGroupsService Secrets SecretsService ServerGroups ServerGroupsService Snapshots SnapshotsService Subnetworks SubnetworksService Tasks TasksService Volumes VolumesService Users UsersService LifeCyclePolicies LifeCyclePoliciesService // Optional retry values. Setting the RetryConfig.RetryMax value enables automatically retrying requests // that fail with 429 or 500-level response codes RetryConfig RetryConfig // contains filtered or unexported fields }
Client manages communication with EdgecenterCloud API.
func NewClient ¶
NewClient returns a new EdgecenterCloud API, using the given http.Client to perform all requests.
func NewWithRetries ¶
NewWithRetries returns a new EdgecenterCloud API client with default retries config.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(_ context.Context, method, urlStr string, body interface{}) (*http.Request, error)
NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.
type ClientOpt ¶
ClientOpt are options for New.
func SetBaseURL ¶
SetBaseURL is a client option for setting the base URL.
func SetProject ¶
SetProject is a client option for setting the Project.
func SetRequestHeaders ¶
SetRequestHeaders sets optional HTTP headers on the client that are sent on each HTTP request.
func SetUserAgent ¶
SetUserAgent is a client option for setting the user agent.
func WithRetryAndBackoffs ¶
func WithRetryAndBackoffs(retryConfig RetryConfig) ClientOpt
WithRetryAndBackoffs sets retry values. Setting the RetryConfig.RetryMax value enables automatically retrying requests that fail with 429 or 500-level response codes using the go-retryablehttp client.
type CloudConfig ¶
type CloudConfig struct { APIUrl string `yaml:"apiURL"` APIToken string `yaml:"apiToken"` AccessToken string `yaml:"accessToken"` RefreshToken string `yaml:"refreshToken"` ProjectID int `yaml:"projectID"` RegionID int `yaml:"regionID"` }
CloudConfig used only for import.
type CombinedQuota ¶
type DiskMetrics ¶
type EtherType ¶
type EtherType string
func (*EtherType) MarshalJSON ¶ added in v2.0.11
MarshalJSON - implements Marshaler interface.
func (EtherType) StringList ¶ added in v2.0.11
func (*EtherType) UnmarshalJSON ¶ added in v2.0.11
UnmarshalJSON - implements Unmarshaler interface.
func (EtherType) ValidOrNil ¶ added in v2.0.11
type ExternalFixedIP ¶
type ExternalGatewayInfo ¶
type ExternalGatewayInfo struct { ExternalFixedIPs []ExternalFixedIP `json:"external_fixed_ips"` NetworkID string `json:"network_id"` EnableSnat bool `json:"enable_snat"` }
type Flavor ¶
type Flavor struct { FlavorID string `json:"flavor_id"` FlavorName string `json:"flavor_name"` VCPUS int `json:"vcpus"` RAM int `json:"ram"` HardwareDescription HardwareDescription `json:"hardware_description,omitempty"` Disabled bool `json:"disabled"` ResourceClass string `json:"resource_class"` }
Flavor represents an EdgecenterCloud Flavor.
type FlavorListOptions ¶
type FlavorListOptions struct { IncludePrices bool `url:"include_prices,omitempty" validate:"omitempty"` Disabled bool `url:"disabled,omitempty" validate:"omitempty"` ExcludeWindows bool `url:"exclude_windows,omitempty" validate:"omitempty"` }
FlavorListOptions specifies the optional query parameters to List method.
type FlavorsOptions ¶
type FlavorsOptions struct {
IncludePrices bool `url:"include_prices,omitempty" validate:"omitempty"`
}
FlavorsOptions specifies the optional query parameters to Get loadbalancer or instance flavor method.
type FlavorsService ¶
type FlavorsService interface { List(context.Context, *FlavorListOptions) ([]Flavor, *Response, error) ListBaremetal(context.Context, *FlavorListOptions) ([]Flavor, *Response, error) ListBaremetalForClient(context.Context, *FlavorListOptions) ([]Flavor, *Response, error) }
FlavorsService is an interface for creating and managing Flavors with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/flavors
type FlavorsServiceOp ¶
type FlavorsServiceOp struct {
// contains filtered or unexported fields
}
FlavorsServiceOp handles communication with Flavors methods of the EdgecenterCloud API.
func (*FlavorsServiceOp) List ¶
func (s *FlavorsServiceOp) List(ctx context.Context, opts *FlavorListOptions) ([]Flavor, *Response, error)
List get flavors.
func (*FlavorsServiceOp) ListBaremetal ¶
func (s *FlavorsServiceOp) ListBaremetal(ctx context.Context, opts *FlavorListOptions) ([]Flavor, *Response, error)
ListBaremetal get baremetal flavors.
func (*FlavorsServiceOp) ListBaremetalForClient ¶
func (s *FlavorsServiceOp) ListBaremetalForClient(ctx context.Context, opts *FlavorListOptions) ([]Flavor, *Response, error)
ListBaremetalForClient get baremetal flavors from default project for current client.
type FloatingIP ¶
type FloatingIP struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Status string `json:"status"` FixedIPAddress net.IP `json:"fixed_ip_address,omitempty"` FloatingIPAddress string `json:"floating_ip_address,omitempty"` DNSDomain string `json:"dns_domain"` DNSName string `json:"dns_name"` RouterID string `json:"router_id"` SubnetID string `json:"subnet_id"` CreatorTaskID string `json:"creator_task_id"` Metadata []MetadataDetailed `json:"metadata,omitempty"` TaskID string `json:"task_id"` PortID string `json:"port_id,omitempty"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` Instance Instance `json:"instance,omitempty"` Loadbalancer Loadbalancer `json:"loadbalancer,omitempty"` }
FloatingIP represents an EdgecenterCloud FloatingIP.
type FloatingIPCreateRequest ¶
type FloatingIPCreateRequest struct { PortID string `json:"port_id,omitempty"` FixedIPAddress net.IP `json:"fixed_ip_address,omitempty"` Metadata Metadata `json:"metadata,omitempty"` }
FloatingIPCreateRequest represents a request to create a Floating IP.
type FloatingIPMetadata ¶
type FloatingIPMetadata interface { MetadataList(context.Context, string) ([]MetadataDetailed, *Response, error) MetadataCreate(context.Context, string, *Metadata) (*Response, error) MetadataUpdate(context.Context, string, *Metadata) (*Response, error) MetadataDeleteItem(context.Context, string, *MetadataItemOptions) (*Response, error) MetadataGetItem(context.Context, string, *MetadataItemOptions) (*MetadataDetailed, *Response, error) }
type FloatingIPSource ¶
type FloatingIPSource string
const ( NewFloatingIP FloatingIPSource = "new" ExistingFloatingIP FloatingIPSource = "existing" )
type FloatingIPsService ¶
type FloatingIPsService interface { List(context.Context) ([]FloatingIP, *Response, error) Get(context.Context, string) (*FloatingIP, *Response, error) Create(context.Context, *FloatingIPCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) Assign(context.Context, string, *AssignFloatingIPRequest) (*FloatingIP, *Response, error) UnAssign(context.Context, string) (*FloatingIP, *Response, error) ListAvailable(context.Context) ([]FloatingIP, *Response, error) FloatingIPMetadata }
FloatingIPsService is an interface for creating and managing FloatingIPs with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/floatingips
type FloatingipsServiceOp ¶
type FloatingipsServiceOp struct {
// contains filtered or unexported fields
}
FloatingipsServiceOp handles communication with FloatingIPs methods of the EdgecenterCloud API.
func (*FloatingipsServiceOp) Assign ¶
func (s *FloatingipsServiceOp) Assign(ctx context.Context, fipID string, reqBody *AssignFloatingIPRequest) (*FloatingIP, *Response, error)
Assign a floating IP to an instance or a load balancer.
func (*FloatingipsServiceOp) Create ¶
func (s *FloatingipsServiceOp) Create(ctx context.Context, reqBody *FloatingIPCreateRequest) (*TaskResponse, *Response, error)
Create a Floating IP.
func (*FloatingipsServiceOp) Delete ¶
func (s *FloatingipsServiceOp) Delete(ctx context.Context, fipID string) (*TaskResponse, *Response, error)
Delete the Floating IP.
func (*FloatingipsServiceOp) Get ¶
func (s *FloatingipsServiceOp) Get(ctx context.Context, fipID string) (*FloatingIP, *Response, error)
Get a Floating IP.
func (*FloatingipsServiceOp) List ¶
func (s *FloatingipsServiceOp) List(ctx context.Context) ([]FloatingIP, *Response, error)
List get floating IPs.
func (*FloatingipsServiceOp) ListAvailable ¶
func (s *FloatingipsServiceOp) ListAvailable(ctx context.Context) ([]FloatingIP, *Response, error)
ListAvailable floating IPs.
func (*FloatingipsServiceOp) MetadataCreate ¶
func (s *FloatingipsServiceOp) MetadataCreate(ctx context.Context, fipID string, reqBody *Metadata) (*Response, error)
MetadataCreate or update floating IP metadata.
func (*FloatingipsServiceOp) MetadataDeleteItem ¶
func (s *FloatingipsServiceOp) MetadataDeleteItem(ctx context.Context, fipID string, opts *MetadataItemOptions) (*Response, error)
MetadataDeleteItem a floating IP metadata item by key.
func (*FloatingipsServiceOp) MetadataGetItem ¶
func (s *FloatingipsServiceOp) MetadataGetItem(ctx context.Context, fipID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
MetadataGetItem floating IP detailed metadata.
func (*FloatingipsServiceOp) MetadataList ¶
func (s *FloatingipsServiceOp) MetadataList(ctx context.Context, fipID string) ([]MetadataDetailed, *Response, error)
MetadataList floating IP detailed metadata items.
func (*FloatingipsServiceOp) MetadataUpdate ¶
func (s *FloatingipsServiceOp) MetadataUpdate(ctx context.Context, fipID string, reqBody *Metadata) (*Response, error)
MetadataUpdate floating IP metadata.
func (*FloatingipsServiceOp) UnAssign ¶
func (s *FloatingipsServiceOp) UnAssign(ctx context.Context, fipID string) (*FloatingIP, *Response, error)
UnAssign a floating IP from an instance or a load balancer.
type HTTPMethod ¶
type HTTPMethod string
const ( HTTPMethodCONNECT HTTPMethod = "CONNECT" HTTPMethodDELETE HTTPMethod = "DELETE" HTTPMethodGET HTTPMethod = "GET" HTTPMethodHEAD HTTPMethod = "HEAD" HTTPMethodOPTIONS HTTPMethod = "OPTIONS" HTTPMethodPATCH HTTPMethod = "PATCH" HTTPMethodPOST HTTPMethod = "POST" HTTPMethodPUT HTTPMethod = "PUT" HTTPMethodTRACE HTTPMethod = "TRACE" )
type HWFirmwareType ¶
type HWFirmwareType string
const ( HWFirmwareTypeBios HWFirmwareType = "bios" HWFirmwareTypeUEFI HWFirmwareType = "uefi" )
type HWMachineType ¶
type HWMachineType string
const ( HWMachineTypeI440 HWMachineType = "i440" HWMachineTypeQ35 HWMachineType = "q35" )
type HardwareDescription ¶
type HealthMonitor ¶
type HealthMonitor struct { MaxRetries int `json:"max_retries,omitempty"` Type HealthMonitorType `json:"type,omitempty"` Delay int `json:"delay,omitempty"` Timeout int `json:"timeout,omitempty"` URLPath string `json:"url_path,omitempty"` HTTPMethod *HTTPMethod `json:"http_method,omitempty"` MaxRetriesDown int `json:"max_retries_down,omitempty"` ExpectedCodes string `json:"expected_codes,omitempty"` ID string `json:"id,omitempty"` }
HealthMonitor represents an EdgecenterCloud Loadbalancer Pool HealthMonitor.
type HealthMonitorCreateRequest ¶
type HealthMonitorCreateRequest struct { MaxRetries int `json:"max_retries" required:"true"` Type HealthMonitorType `json:"type" required:"true"` Delay int `json:"delay" required:"true"` Timeout int `json:"timeout" required:"true"` URLPath string `json:"url_path,omitempty"` HTTPMethod *HTTPMethod `json:"http_method,omitempty"` MaxRetriesDown int `json:"max_retries_down,omitempty"` ExpectedCodes string `json:"expected_codes,omitempty"` ID string `json:"id,omitempty"` }
HealthMonitorCreateRequest represents a request to create a Loadbalancer Pool Health Monitor.
type HealthMonitorType ¶
type HealthMonitorType string
const ( HealthMonitorTypeHTTP HealthMonitorType = "HTTP" HealthMonitorTypeHTTPS HealthMonitorType = "HTTPS" HealthMonitorTypePING HealthMonitorType = "PING" HealthMonitorTypeTCP HealthMonitorType = "TCP" HealthMonitorTypeTLSHello HealthMonitorType = "TLS-HELLO" HealthMonitorTypeUDPConnect HealthMonitorType = "UDP-CONNECT" )
type HostRoute ¶
HostRoute represents a route that should be used by devices with IPs from a subnet (not including local subnet route).
type Image ¶
type Image struct { DiskFormat string `json:"disk_format"` MetadataDetailed []MetadataDetailed `json:"metadata_detailed,omitempty"` Metadata Metadata `json:"metadata"` MinRAM int `json:"min_ram"` MinDisk int `json:"min_disk"` OSVersion string `json:"os_version"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` TaskID string `json:"task_id"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` CreatorTaskID string `json:"creator_task_id"` Status string `json:"status"` OSType OSType `json:"os_type"` SSHKey SSHKey `json:"ssh_key"` OSDistro string `json:"os_distro"` Visibility string `json:"visibility"` DisplayOrder int `json:"display_order"` HWFirmwareType HWFirmwareType `json:"hw_firmware_type"` Name string `json:"name"` Size int `json:"size"` IsBaremetal bool `json:"is_baremetal"` HWMachineType HWMachineType `json:"hw_machine_type"` Description string `json:"description"` ID string `json:"id"` }
Image represents an EdgecenterCloud Image.
type ImageCreateRequest ¶
type ImageCreateRequest struct { SSHKey SSHKey `json:"ssh_key"` OSType OSType `json:"os_type"` Name string `json:"name" required:"true" validate:"required"` IsBaremetal bool `json:"is_baremetal"` VolumeID string `json:"volume_id" required:"true" validate:"required"` HWMachineType HWMachineType `json:"hw_machine_type"` HWFirmwareType HWFirmwareType `json:"hw_firmware_type"` Source string `json:"source"` Metadata Metadata `json:"metadata"` }
type ImageListOptions ¶
type ImageUpdateRequest ¶
type ImageUpdateRequest struct { SSHKey SSHKey `json:"ssh_key"` Name string `json:"name"` IsBaremetal bool `json:"is_baremetal"` HWMachineType HWMachineType `json:"hw_machine_type"` HWFirmwareType HWFirmwareType `json:"hw_firmware_type"` OSType OSType `json:"os_type"` Metadata Metadata `json:"metadata"` }
type ImageUploadRequest ¶
type ImageUploadRequest struct { SSHKey SSHKey `json:"ssh_key"` OSDistro string `json:"os_distro"` Name string `json:"name" required:"true" validate:"required"` URL string `json:"url" required:"true" validate:"required"` COWFormat bool `json:"cow_format"` OSVersion string `json:"os_version"` IsBaremetal bool `json:"is_baremetal"` HWMachineType HWMachineType `json:"hw_machine_type"` HWFirmwareType HWFirmwareType `json:"hw_firmware_type"` OSType OSType `json:"os_type"` Metadata Metadata `json:"metadata"` }
type ImagesBaremetal ¶
type ImagesBaremetal interface { ImagesBaremetalList(context.Context, *ImageListOptions) ([]Image, *Response, error) ImagesBaremetalCreate(context.Context, *ImageCreateRequest) (*TaskResponse, *Response, error) }
type ImagesMetadata ¶
type ImagesMetadata interface { MetadataList(context.Context, string) ([]MetadataDetailed, *Response, error) MetadataCreate(context.Context, string, *Metadata) (*Response, error) MetadataUpdate(context.Context, string, *Metadata) (*Response, error) MetadataDeleteItem(context.Context, string, *MetadataItemOptions) (*Response, error) MetadataGetItem(context.Context, string, *MetadataItemOptions) (*MetadataDetailed, *Response, error) }
type ImagesProject ¶
type ImagesService ¶
type ImagesService interface { List(context.Context, *ImageListOptions) ([]Image, *Response, error) Create(context.Context, *ImageCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) Get(context.Context, string) (*Image, *Response, error) Update(context.Context, string, *ImageUpdateRequest) (*Image, *Response, error) Upload(context.Context, *ImageUploadRequest) (*TaskResponse, *Response, error) ImagesBaremetal ImagesProject ImagesMetadata }
ImagesService is an interface for creating and managing Images with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/images
type ImagesServiceOp ¶
type ImagesServiceOp struct {
// contains filtered or unexported fields
}
ImagesServiceOp handles communication with Images methods of the EdgecenterCloud API.
func (*ImagesServiceOp) Create ¶
func (s *ImagesServiceOp) Create(ctx context.Context, reqBody *ImageCreateRequest) (*TaskResponse, *Response, error)
Create an Image.
func (*ImagesServiceOp) Delete ¶
func (s *ImagesServiceOp) Delete(ctx context.Context, imageID string) (*TaskResponse, *Response, error)
Delete an image.
func (*ImagesServiceOp) ImagesBaremetalCreate ¶
func (s *ImagesServiceOp) ImagesBaremetalCreate(ctx context.Context, reqBody *ImageCreateRequest) (*TaskResponse, *Response, error)
ImagesBaremetalCreate an Image.
func (*ImagesServiceOp) ImagesBaremetalList ¶
func (s *ImagesServiceOp) ImagesBaremetalList(ctx context.Context, opts *ImageListOptions) ([]Image, *Response, error)
ImagesBaremetalList get images of baremetal instances.
func (*ImagesServiceOp) ImagesProjectList ¶
ImagesProjectList get images owned by a project.
func (*ImagesServiceOp) List ¶
func (s *ImagesServiceOp) List(ctx context.Context, opts *ImageListOptions) ([]Image, *Response, error)
List get images.
func (*ImagesServiceOp) MetadataCreate ¶
func (s *ImagesServiceOp) MetadataCreate(ctx context.Context, imageID string, reqBody *Metadata) (*Response, error)
MetadataCreate or update security group metadata.
func (*ImagesServiceOp) MetadataDeleteItem ¶
func (s *ImagesServiceOp) MetadataDeleteItem(ctx context.Context, imageID string, opts *MetadataItemOptions) (*Response, error)
MetadataDeleteItem a security group metadata item by key.
func (*ImagesServiceOp) MetadataGetItem ¶
func (s *ImagesServiceOp) MetadataGetItem(ctx context.Context, imageID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
MetadataGetItem security group detailed metadata.
func (*ImagesServiceOp) MetadataList ¶
func (s *ImagesServiceOp) MetadataList(ctx context.Context, imageID string) ([]MetadataDetailed, *Response, error)
MetadataList security group detailed metadata items.
func (*ImagesServiceOp) MetadataUpdate ¶
func (s *ImagesServiceOp) MetadataUpdate(ctx context.Context, imageID string, reqBody *Metadata) (*Response, error)
MetadataUpdate security group metadata.
func (*ImagesServiceOp) Update ¶
func (s *ImagesServiceOp) Update(ctx context.Context, imageID string, reqBody *ImageUpdateRequest) (*Image, *Response, error)
Update image fields.
func (*ImagesServiceOp) Upload ¶
func (s *ImagesServiceOp) Upload(ctx context.Context, reqBody *ImageUploadRequest) (*TaskResponse, *Response, error)
Upload an Image.
type Instance ¶
type Instance struct { ID string `json:"instance_id"` Name string `json:"instance_name"` Addresses map[string][]InstanceAddress `json:"addresses"` CreatedAt string `json:"instance_created,omitempty"` CreatorTaskID string `json:"creator_task_id,omitempty"` Description string `json:"instance_description,omitempty"` Flavor *Flavor `json:"flavor"` KeypairName string `json:"keypair_name,omitempty"` Metadata Metadata `json:"metadata"` MetadataDetailed []MetadataDetailed `json:"metadata_detailed,omitempty"` ProjectID int `json:"project_id"` Region string `json:"region"` RegionID int `json:"region_id"` SecurityGroups []Name `json:"security_groups"` Status string `json:"status,omitempty"` // todo: need to implement new status type TaskID string `json:"task_id"` TaskState string `json:"task_state,omitempty"` VMState string `json:"vm_state,omitempty"` // todo: need to implement new vm_state type Volumes []InstanceVolume `json:"volumes"` }
Instance represents an EdgecenterCloud Instance.
type InstanceAction ¶
type InstanceAction interface { InstanceStart(context.Context, string) (*Instance, *Response, error) InstanceStop(context.Context, string) (*Instance, *Response, error) InstancePowercycle(context.Context, string) (*Instance, *Response, error) InstanceReboot(context.Context, string) (*Instance, *Response, error) InstanceSuspend(context.Context, string) (*Instance, *Response, error) InstanceResume(context.Context, string) (*Instance, *Response, error) }
type InstanceAddress ¶
type InstanceAddress struct { Type string `json:"type"` SubnetName string `json:"subnet_name"` SubnetID string `json:"subnet_id"` Address net.IP `json:"addr"` }
InstanceAddress represent an instance network struct.
type InstanceAttachInterfaceRequest ¶
type InstanceAttachInterfaceRequest struct { Type InterfaceType `json:"type"` SecurityGroups []ID `json:"security_groups"` SubnetID string `json:"subnet_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"` NetworkID string `json:"network_id,omitempty" validate:"rfe=Type:any_subnet,omitempty,uuid4"` PortID string `json:"port_id,omitempty" validate:"rfe=Type:reserved_fixed_ip,allowed_without_all=NetworkID SubnetID,omitempty,uuid4"` }
InstanceAttachInterfaceRequest represents a request to attach Interface to the Instance.
type InstanceAvailableNames ¶
type InstanceAvailableNames struct { AllowedBMNameWinTemplates []string `json:"allowed_bm_name_win_templates"` NameTemplatesLimited bool `json:"name_templates_limited"` AllowedNameWinTemplates []string `json:"allowed_name_win_templates"` AllowedBMNameTemplates []string `json:"allowed_bm_name_templates"` CustomNameAllowed bool `json:"custom_name_allowed"` AllowedNameTemplates []string `json:"allowed_name_templates"` }
type InstanceCheckFlavorVolumeRequest ¶
type InstanceCheckFlavorVolumeRequest struct {
Volumes []InstanceVolumeCreate `json:"volumes" required:"true" validate:"required,dive"`
}
InstanceCheckFlavorVolumeRequest represents a request to get flavors of the instance.
type InstanceCheckLimitsRequest ¶
type InstanceCheckLimitsRequest struct { Names []string `json:"names,omitempty" validate:"required_without=NameTemplates"` NameTemplates []string `json:"name_templates,omitempty" validate:"required_without=Names"` Flavor string `json:"flavor,omitempty"` Interfaces []InstanceInterface `json:"interfaces,omitempty" required:"true" validate:"required,dive"` Volumes []InstanceCheckLimitsVolume `json:"volumes,omitempty" required:"true" validate:"required,dive"` }
InstanceCheckLimitsRequest represents a request to check the limits of an instance.
type InstanceCheckLimitsVolume ¶
type InstanceCheckLimitsVolume struct { Source VolumeSource `json:"source" required:"true" validate:"required,enum"` TypeName VolumeType `json:"type_name,omitempty" validate:"omitempty"` Size int `json:"size,omitempty" validate:"omitempty"` SnapshotID string `json:"snapshot_id,omitempty" validate:"omitempty"` ImageID string `json:"image_id,omitempty" validate:"omitempty"` }
type InstanceCreateRequest ¶
type InstanceCreateRequest struct { Names []string `json:"names,omitempty" validate:"required_without=NameTemplates"` Flavor string `json:"flavor" required:"true"` NameTemplates []string `json:"name_templates,omitempty" validate:"required_without=Names"` KeypairName string `json:"keypair_name,omitempty"` UserData string `json:"user_data,omitempty" validate:"omitempty,base64"` Username string `json:"username,omitempty" validate:"omitempty,required_with=Password"` Password string `json:"password,omitempty" validate:"omitempty,required_with=Username"` Interfaces []InstanceInterface `json:"interfaces" required:"true" validate:"required,dive"` SecurityGroups []ID `json:"security_groups,omitempty" validate:"omitempty,dive,uuid4"` Metadata Metadata `json:"metadata,omitempty" validate:"omitempty,dive"` Configuration map[string]interface{} `json:"configuration,omitempty" validate:"omitempty,dive"` ServerGroupID string `json:"servergroup_id,omitempty" validate:"omitempty,uuid4"` AllowAppPorts bool `json:"allow_app_ports,omitempty"` Volumes []InstanceVolumeCreate `json:"volumes" required:"true" validate:"required,dive"` }
InstanceCreateRequest represents a request to create an Instance.
type InstanceDeleteOptions ¶
type InstanceDeleteOptions struct { Volumes []string `url:"volumes,omitempty" validate:"omitempty,dive,uuid4" delimiter:"comma"` DeleteFloatings bool `url:"delete_floatings,omitempty" validate:"omitempty,allowed_without=FloatingIPs"` FloatingIPs []string `url:"floatings,omitempty" validate:"omitempty,allowed_without=DeleteFloatings,dive,uuid4" delimiter:"comma"` ReservedFixedIPs []string `url:"reserved_fixed_ips,omitempty" validate:"omitempty,dive,uuid4" delimiter:"comma"` }
InstanceDeleteOptions specifies the optional query parameters to Delete method.
type InstanceDetachInterfaceRequest ¶
type InstanceDetachInterfaceRequest struct { PortID string `json:"port_id,omitempty" validate:"omitempty"` IPAddress string `json:"ip_address,omitempty" validate:"omitempty"` }
InstanceDetachInterfaceRequest represents a request to detach Interface from the Instance.
type InstanceFlavor ¶
type InstanceFlavor interface { UpdateFlavor(context.Context, string, *InstanceFlavorUpdateRequest) (*TaskResponse, *Response, error) AvailableFlavors(context.Context, *InstanceCheckFlavorVolumeRequest, *FlavorsOptions) ([]Flavor, *Response, error) AvailableFlavorsToResize(context.Context, string, *FlavorsOptions) ([]Flavor, *Response, error) }
type InstanceFlavorUpdateRequest ¶
type InstanceFlavorUpdateRequest struct {
FlavorID string `json:"flavor_id" required:"true" validate:"required"`
}
InstanceFlavorUpdateRequest represents a request to change the flavor of the instance.
type InstanceInterface ¶
type InstanceInterface struct { Type InterfaceType `json:"type,omitempty" validate:"omitempty,enum"` NetworkID string `json:"network_id,omitempty" validate:"rfe=Type:subnet;any_subnet,omitempty,uuid4"` FloatingIP *InterfaceFloatingIP `json:"floating_ip,omitempty" validate:"omitempty,dive"` PortID string `json:"port_id,omitempty" validate:"rfe=Type:reserved_fixed_ip,allowed_without_all=NetworkID SubnetID,omitempty,uuid4"` SubnetID string `json:"subnet_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"` SecurityGroups []ID `json:"security_groups"` }
type InstanceListOptions ¶
type InstanceListOptions struct { IncludeBaremetal bool `url:"include_baremetal,omitempty" validate:"omitempty"` IncludeK8S bool `url:"include_k8s,omitempty" validate:"omitempty"` ExcludeSecgroup string `url:"exclude_secgroup,omitempty" validate:"omitempty"` AvailableFloating string `url:"available_floating,omitempty" validate:"omitempty"` Name string `url:"name,omitempty" validate:"omitempty"` FlavorID string `url:"flavor_id,omitempty" validate:"omitempty"` Limit int `url:"limit,omitempty" validate:"omitempty"` Offset int `url:"offset,omitempty" validate:"omitempty"` Status string `url:"status,omitempty" validate:"omitempty"` ChangesSince string `url:"changes-since,omitempty" validate:"omitempty"` ChangesBefore string `url:"changes-before,omitempty" validate:"omitempty"` IP string `url:"ip,omitempty" validate:"omitempty"` UUID string `url:"uuid,omitempty" validate:"omitempty"` MetadataKV string `url:"metadata_kv,omitempty" validate:"omitempty"` MetadataK string `url:"metadata_k,omitempty" validate:"omitempty"` OrderBy string `url:"order_by,omitempty" validate:"omitempty"` }
InstanceListOptions specifies the optional query parameters to List method.
type InstanceMetadata ¶
type InstanceMetadata interface { MetadataGet(context.Context, string) (*MetadataDetailed, *Response, error) MetadataList(context.Context, string) ([]MetadataDetailed, *Response, error) MetadataCreate(context.Context, string, *Metadata) (*Response, error) MetadataUpdate(context.Context, string, *Metadata) (*Response, error) MetadataDeleteItem(context.Context, string, *MetadataItemOptions) (*Response, error) MetadataGetItem(context.Context, string, *MetadataItemOptions) (*MetadataDetailed, *Response, error) }
type InstanceMetrics ¶
type InstanceMetrics struct { Disks []DiskMetrics `json:"disks"` CPUUtil int `json:"cpu_util"` NetworkPpsIngress int `json:"network_pps_ingress"` NetworkBpsIngress int `json:"network_Bps_ingress"` NetworkPpsEgress int `json:"network_pps_egress"` NetworkBpsEgress int `json:"network_Bps_egress"` Time string `json:"time"` MemoryUtil int `json:"memory_util"` }
InstanceMetrics represents an EdgecenterCloud Instance metrics.
type InstanceMetricsListRequest ¶
type InstanceMetricsListRequest struct { TimeUnit TimeUnit `json:"time_unit" required:"true" validate:"required,name"` TimeInterval int `json:"time_interval" required:"true" validate:"required,name"` }
InstanceMetricsListRequest represents a request to get a Instance Metrics list.
type InstancePort ¶
type InstancePortInterface ¶
type InstancePortInterface struct { FloatingIPDetails []FloatingIP `json:"floatingip_details"` NetworkDetails NetworkSubnetwork `json:"network_details"` PortSecurityEnabled bool `json:"port_security_enabled"` PortID string `json:"port_id"` MacAddress string `json:"mac_address"` NetworkID string `json:"network_id"` IPAssignments []PortIP `json:"ip_assignments"` SubPorts []InstanceSubPort `json:"sub_ports,omitempty"` }
InstancePortInterface represents an instance port interface.
type InstancePutIntoServerGroupRequest ¶
type InstancePutIntoServerGroupRequest struct {
ServerGroupID string `json:"servergroup_id"`
}
InstancePutIntoServerGroupRequest represents a request to put an Interface into the Server Group.
type InstanceSecurityGroup ¶
type InstanceSecurityGroup interface { FilterBySecurityGroup(context.Context, string) ([]Instance, *Response, error) SecurityGroupList(context.Context, string) ([]IDName, *Response, error) SecurityGroupAssign(context.Context, string, *AssignSecurityGroupRequest) (*Response, error) SecurityGroupUnAssign(context.Context, string, *AssignSecurityGroupRequest) (*Response, error) }
type InstanceSubPort ¶ added in v2.0.23
type InstanceSubPort struct { PortID string `json:"port_id"` MacAddress string `json:"mac_address"` NetworkID string `json:"network_id"` IPAssignments []PortIP `json:"ip_assignments"` NetworkDetails NetworkSubnetwork `json:"network_details"` FloatingIPDetails []FloatingIP `json:"floatingip_details"` SegmentationID int `json:"segmentation_id"` SegmentationType string `json:"segmentation_type"` }
type InstanceVolume ¶
type InstanceVolume struct { ID string `json:"id"` DeleteOnTermination bool `json:"delete_on_termination"` }
InstanceVolume represent an instance volume struct.
type InstanceVolumeCreate ¶
type InstanceVolumeCreate struct { Source VolumeSource `json:"source" required:"true" validate:"required,enum"` BootIndex int `json:"boot_index"` TypeName VolumeType `json:"type_name,omitempty" validate:"omitempty"` Size int `json:"size,omitempty" validate:"rfe=Source:image;new-volume,sfe=Source:snapshot;existing-volume"` Name string `json:"name,omitempty" validate:"omitempty"` AttachmentTag string `json:"attachment_tag,omitempty" validate:"omitempty"` ImageID string `` /* 168-byte string literal not displayed */ VolumeID string `` /* 168-byte string literal not displayed */ SnapshotID string `` /* 168-byte string literal not displayed */ AppTemplateID string `` /* 171-byte string literal not displayed */ Metadata Metadata `json:"metadata,omitempty" validate:"omitempty,dive"` }
InstanceVolumeCreate represent a instance volume create struct.
type InstancesService ¶
type InstancesService interface { List(context.Context, *InstanceListOptions) ([]Instance, *Response, error) Get(context.Context, string) (*Instance, *Response, error) Create(context.Context, *InstanceCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string, *InstanceDeleteOptions) (*TaskResponse, *Response, error) CheckLimits(context.Context, *InstanceCheckLimitsRequest) (*map[string]int, *Response, error) AvailableNames(context.Context) (*InstanceAvailableNames, *Response, error) Rename(context.Context, string, *Name) (*Instance, *Response, error) PortsList(context.Context, string) ([]InstancePort, *Response, error) MetricsList(context.Context, string, *InstanceMetricsListRequest) ([]InstanceMetrics, *Response, error) GetConsole(context.Context, string) (*RemoteConsole, *Response, error) AttachInterface(context.Context, string, *InstanceAttachInterfaceRequest) (*TaskResponse, *Response, error) DetachInterface(context.Context, string, *InstanceDetachInterfaceRequest) (*TaskResponse, *Response, error) InterfaceList(context.Context, string) ([]InstancePortInterface, *Response, error) PutIntoServerGroup(context.Context, string, *InstancePutIntoServerGroupRequest) (*TaskResponse, *Response, error) RemoveFromServerGroup(context.Context, string) (*TaskResponse, *Response, error) InstanceAction InstanceFlavor InstanceSecurityGroup InstanceMetadata BareMetalService }
InstancesService is an interface for creating and managing Instances with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/instances
type InstancesServiceOp ¶
type InstancesServiceOp struct {
// contains filtered or unexported fields
}
InstancesServiceOp handles communication with Instances methods of the EdgecenterCloud API.
func (*InstancesServiceOp) AttachInterface ¶
func (s *InstancesServiceOp) AttachInterface(ctx context.Context, instanceID string, reqBody *InstanceAttachInterfaceRequest) (*TaskResponse, *Response, error)
AttachInterface to the instance.
func (*InstancesServiceOp) AvailableFlavors ¶
func (s *InstancesServiceOp) AvailableFlavors(ctx context.Context, reqBody *InstanceCheckFlavorVolumeRequest, opts *FlavorsOptions) ([]Flavor, *Response, error)
AvailableFlavors get flavors for an instance by volume config.
func (*InstancesServiceOp) AvailableFlavorsToResize ¶
func (s *InstancesServiceOp) AvailableFlavorsToResize(ctx context.Context, instanceID string, opts *FlavorsOptions) ([]Flavor, *Response, error)
AvailableFlavorsToResize Get flavors to resize into.
func (*InstancesServiceOp) AvailableNames ¶
func (s *InstancesServiceOp) AvailableNames(ctx context.Context) (*InstanceAvailableNames, *Response, error)
AvailableNames get instance naming restrictions that are applied to specified project and region.
func (*InstancesServiceOp) BareMetalCheckQuotasForInstanceCreation ¶ added in v2.0.21
func (s *InstancesServiceOp) BareMetalCheckQuotasForInstanceCreation(ctx context.Context, reqBody *BareMetalQuotaCheckRequest) (Quota, *Response, error)
func (*InstancesServiceOp) BareMetalCreateInstance ¶ added in v2.0.21
func (s *InstancesServiceOp) BareMetalCreateInstance(ctx context.Context, reqBody *BareMetalServerCreateRequest) (*TaskResponse, *Response, error)
func (*InstancesServiceOp) BareMetalGetCountAvailableNodes ¶ added in v2.0.21
func (s *InstancesServiceOp) BareMetalGetCountAvailableNodes(ctx context.Context) (*BareMetalCapacity, *Response, error)
func (*InstancesServiceOp) BareMetalListFlavors ¶ added in v2.0.21
func (s *InstancesServiceOp) BareMetalListFlavors(ctx context.Context, opts *BareMetalFlavorsOpts, reqBody *BareMetalFlavorsRequest) ([]BareMetalFlavor, *Response, error)
func (*InstancesServiceOp) BareMetalListInstances ¶ added in v2.0.21
func (s *InstancesServiceOp) BareMetalListInstances(ctx context.Context, opts *BareMetalInstancesListOpts) ([]Instance, *Response, error)
func (*InstancesServiceOp) BareMetalRebuildInstance ¶ added in v2.0.21
func (s *InstancesServiceOp) BareMetalRebuildInstance(ctx context.Context, instanceID string, reqBody *BareMetalRebuildRequest) (*TaskResponse, *Response, error)
func (*InstancesServiceOp) CheckLimits ¶
func (s *InstancesServiceOp) CheckLimits(ctx context.Context, reqBody *InstanceCheckLimitsRequest) (*map[string]int, *Response, error)
CheckLimits check a quota for instance creation.
func (*InstancesServiceOp) Create ¶
func (s *InstancesServiceOp) Create(ctx context.Context, reqBody *InstanceCreateRequest) (*TaskResponse, *Response, error)
Create an Instance.
func (*InstancesServiceOp) Delete ¶
func (s *InstancesServiceOp) Delete(ctx context.Context, instanceID string, opts *InstanceDeleteOptions) (*TaskResponse, *Response, error)
Delete the Instance.
func (*InstancesServiceOp) DetachInterface ¶
func (s *InstancesServiceOp) DetachInterface(ctx context.Context, instanceID string, reqBody *InstanceDetachInterfaceRequest) (*TaskResponse, *Response, error)
DetachInterface from the instance.
func (*InstancesServiceOp) FilterBySecurityGroup ¶
func (s *InstancesServiceOp) FilterBySecurityGroup(ctx context.Context, securityGroupID string) ([]Instance, *Response, error)
FilterBySecurityGroup returns a list of instances with the filter by the security group.
func (*InstancesServiceOp) Get ¶
func (s *InstancesServiceOp) Get(ctx context.Context, instanceID string) (*Instance, *Response, error)
Get individual Instance.
func (*InstancesServiceOp) GetConsole ¶
func (s *InstancesServiceOp) GetConsole(ctx context.Context, instanceID string) (*RemoteConsole, *Response, error)
GetConsole get an Instance console URL.
func (*InstancesServiceOp) InstancePowercycle ¶
func (s *InstancesServiceOp) InstancePowercycle(ctx context.Context, instanceID string) (*Instance, *Response, error)
InstancePowercycle powercycle the instance.
func (*InstancesServiceOp) InstanceReboot ¶
func (s *InstancesServiceOp) InstanceReboot(ctx context.Context, instanceID string) (*Instance, *Response, error)
InstanceReboot reboot the instance.
func (*InstancesServiceOp) InstanceResume ¶
func (s *InstancesServiceOp) InstanceResume(ctx context.Context, instanceID string) (*Instance, *Response, error)
InstanceResume resume the instance.
func (*InstancesServiceOp) InstanceStart ¶
func (s *InstancesServiceOp) InstanceStart(ctx context.Context, instanceID string) (*Instance, *Response, error)
InstanceStart start the instance.
func (*InstancesServiceOp) InstanceStop ¶
func (s *InstancesServiceOp) InstanceStop(ctx context.Context, instanceID string) (*Instance, *Response, error)
InstanceStop stop the instance.
func (*InstancesServiceOp) InstanceSuspend ¶
func (s *InstancesServiceOp) InstanceSuspend(ctx context.Context, instanceID string) (*Instance, *Response, error)
InstanceSuspend suspend the instance.
func (*InstancesServiceOp) InterfaceList ¶
func (s *InstancesServiceOp) InterfaceList(ctx context.Context, instanceID string) ([]InstancePortInterface, *Response, error)
InterfaceList returns a list of network interfaces attached to the Instance.
func (*InstancesServiceOp) List ¶
func (s *InstancesServiceOp) List(ctx context.Context, opts *InstanceListOptions) ([]Instance, *Response, error)
List get instances.
func (*InstancesServiceOp) MetadataCreate ¶
func (s *InstancesServiceOp) MetadataCreate(ctx context.Context, instanceID string, metadata *Metadata) (*Response, error)
MetadataCreate instance metadata (tags).
func (*InstancesServiceOp) MetadataDeleteItem ¶
func (s *InstancesServiceOp) MetadataDeleteItem(ctx context.Context, instanceID string, opts *MetadataItemOptions) (*Response, error)
MetadataDeleteItem a load balancer metadata item by key.
func (*InstancesServiceOp) MetadataGet ¶
func (s *InstancesServiceOp) MetadataGet(ctx context.Context, instanceID string) (*MetadataDetailed, *Response, error)
MetadataGet instance detailed metadata (tags).
func (*InstancesServiceOp) MetadataGetItem ¶
func (s *InstancesServiceOp) MetadataGetItem(ctx context.Context, instanceID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
MetadataGetItem load balancer detailed metadata.
func (*InstancesServiceOp) MetadataList ¶
func (s *InstancesServiceOp) MetadataList(ctx context.Context, instanceID string) ([]MetadataDetailed, *Response, error)
MetadataList instance detailed metadata items.
func (*InstancesServiceOp) MetadataUpdate ¶
func (s *InstancesServiceOp) MetadataUpdate(ctx context.Context, instanceID string, reqBody *Metadata) (*Response, error)
MetadataUpdate instance metadata.
func (*InstancesServiceOp) MetricsList ¶
func (s *InstancesServiceOp) MetricsList(ctx context.Context, instanceID string, reqBody *InstanceMetricsListRequest) ([]InstanceMetrics, *Response, error)
MetricsList get instance metrics.
func (*InstancesServiceOp) PortsList ¶
func (s *InstancesServiceOp) PortsList(ctx context.Context, instanceID string) ([]InstancePort, *Response, error)
PortsList get network ports.
func (*InstancesServiceOp) PutIntoServerGroup ¶
func (s *InstancesServiceOp) PutIntoServerGroup(ctx context.Context, instanceID string, reqBody *InstancePutIntoServerGroupRequest) (*TaskResponse, *Response, error)
PutIntoServerGroup put an instance into server group.
func (*InstancesServiceOp) RemoveFromServerGroup ¶
func (s *InstancesServiceOp) RemoveFromServerGroup(ctx context.Context, instanceID string) (*TaskResponse, *Response, error)
RemoveFromServerGroup remove an instance from server group.
func (*InstancesServiceOp) Rename ¶
func (s *InstancesServiceOp) Rename(ctx context.Context, instanceID string, reqBody *Name) (*Instance, *Response, error)
Rename the Instance.
func (*InstancesServiceOp) SecurityGroupAssign ¶
func (s *InstancesServiceOp) SecurityGroupAssign(ctx context.Context, instanceID string, reqBody *AssignSecurityGroupRequest) (*Response, error)
SecurityGroupAssign the security group to the server.
func (*InstancesServiceOp) SecurityGroupList ¶
func (s *InstancesServiceOp) SecurityGroupList(ctx context.Context, instanceID string) ([]IDName, *Response, error)
SecurityGroupList returns a list of instance security groups.
func (*InstancesServiceOp) SecurityGroupUnAssign ¶
func (s *InstancesServiceOp) SecurityGroupUnAssign(ctx context.Context, instanceID string, reqBody *AssignSecurityGroupRequest) (*Response, error)
SecurityGroupUnAssign the security group to the server.
func (*InstancesServiceOp) UpdateFlavor ¶
func (s *InstancesServiceOp) UpdateFlavor(ctx context.Context, instanceID string, reqBody *InstanceFlavorUpdateRequest) (*TaskResponse, *Response, error)
UpdateFlavor changes the flavor of the server instance.
type InterfaceFloatingIP ¶
type InterfaceFloatingIP struct { Source FloatingIPSource `json:"source" validate:"required,enum"` ExistingFloatingID string `json:"existing_floating_id" validate:"rfe=Source:existing,sfe=Source:new,omitempty,UUID"` }
type InterfaceType ¶
type InterfaceType string
const ( InterfaceTypeAnySubnet InterfaceType = "any_subnet" InterfaceTypeExternal InterfaceType = "external" InterfaceTypeReservedFixedIP InterfaceType = "reserved_fixed_ip" InterfaceTypeSubnet InterfaceType = "subnet" )
type KeyPair ¶
type KeyPair struct { SSHKeyID string `json:"sshkey_id"` PublicKey string `json:"public_key"` PrivateKey string `json:"private_key"` Fingerprint string `json:"fingerprint"` SSHKeyName string `json:"sshkey_name"` State string `json:"state"` CreatedAt string `json:"created_at"` ProjectID int `json:"project_id"` }
KeyPair represents an EdgecenterCloud Key Pair.
type KeyPairCreateRequest ¶
type KeyPairCreateRequest struct { SSHKeyName string `json:"sshkey_name" required:"true"` PublicKey string `json:"public_key"` }
KeyPairCreateRequest represents a request to create a Key Pair.
type KeyPairCreateRequestV2 ¶ added in v2.0.16
type KeyPairCreateRequestV2 struct { ProjectID int `json:"project_id" required:"true"` SSHKeyName string `json:"sshkey_name" required:"true"` PublicKey string `json:"public_key,omitempty"` }
KeyPairCreateRequestV2 represents a request to create a Key Pair.
type KeyPairShareRequest ¶
type KeyPairShareRequest struct {
}KeyPairShareRequest represents a request to share a Key Pair.
type KeyPairV2 ¶ added in v2.0.16
type KeyPairV2 struct { Fingerprint string `json:"fingerprint"` PublicKey string `json:"public_key"` SSHKeyID string `json:"sshkey_id"` SSHKeyName string `json:"sshkey_name"` }
KeyPairV2 represents an EdgecenterCloud Key Pair.
type KeyPairsListOptionsV2 ¶ added in v2.0.16
type KeyPairsListOptionsV2 struct { ProjectID int `url:"project_id,omitempty" validate:"omitempty"` UserID int `url:"user_id,omitempty" validate:"omitempty"` }
KeyPairsListOptionsV2 specifies the optional query parameters to List method.
type KeyPairsService ¶
type KeyPairsService interface { List(context.Context) ([]KeyPair, *Response, error) ListV2(context.Context) ([]KeyPairV2, *Response, error) Get(context.Context, string) (*KeyPair, *Response, error) GetV2(context.Context, string) (*KeyPairV2, *Response, error) Create(context.Context, *KeyPairCreateRequest) (*TaskResponse, *Response, error) CreateV2(context.Context, *KeyPairCreateRequestV2) (*KeyPairV2, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) DeleteV2(context.Context, string) (*Response, error) }
KeyPairsService is an interface for creating and managing SSH keys with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/keypairs
type KeyPairsServiceOp ¶
type KeyPairsServiceOp struct {
// contains filtered or unexported fields
}
KeyPairsServiceOp handles communication with Key Pairs (SSH keys) methods of the EdgecenterCloud API.
func (*KeyPairsServiceOp) Create ¶
func (s *KeyPairsServiceOp) Create(ctx context.Context, reqBody *KeyPairCreateRequest) (*TaskResponse, *Response, error)
Create a Key Pair.
func (*KeyPairsServiceOp) CreateV2 ¶ added in v2.0.16
func (s *KeyPairsServiceOp) CreateV2(ctx context.Context, reqBody *KeyPairCreateRequestV2) (*KeyPairV2, *Response, error)
func (*KeyPairsServiceOp) Delete ¶
func (s *KeyPairsServiceOp) Delete(ctx context.Context, keypairID string) (*TaskResponse, *Response, error)
Delete the Key Pair.
func (*KeyPairsServiceOp) GetV2 ¶ added in v2.0.16
func (s *KeyPairsServiceOp) GetV2(ctx context.Context, keypairID string) (*KeyPairV2, *Response, error)
GetV2 individual Key Pair.
func (*KeyPairsServiceOp) Share ¶
func (s *KeyPairsServiceOp) Share(ctx context.Context, keypairID string, reqBody *KeyPairShareRequest) (*KeyPair, *Response, error)
Share a Key Pair to view for all users in project.
type KeystoneState ¶
type KeystoneState string
const ( KeystoneStateNew KeystoneState = "NEW" KeystoneStateInitializedFailed KeystoneState = "INITIALIZATION_FAILED" KeystoneStateInitialized KeystoneState = "INITIALIZED" KeystoneStateDeleted KeystoneState = "DELETED" )
type L7PoliciesService ¶
type L7PoliciesService interface { List(context.Context) ([]L7Policy, *Response, error) Create(context.Context, *L7PolicyCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) Get(context.Context, string) (*L7Policy, *Response, error) Update(context.Context, string, *L7PolicyUpdateRequest) (*TaskResponse, *Response, error) }
L7PoliciesService is an interface for creating and managing L7Policies with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/l7policies
type L7PoliciesServiceOp ¶
type L7PoliciesServiceOp struct {
// contains filtered or unexported fields
}
L7PoliciesServiceOp handles communication with L7Policies methods of the EdgecenterCloud API.
func (*L7PoliciesServiceOp) Create ¶
func (s *L7PoliciesServiceOp) Create(ctx context.Context, reqBody *L7PolicyCreateRequest) (*TaskResponse, *Response, error)
Create a L7Policy.
func (*L7PoliciesServiceOp) Delete ¶
func (s *L7PoliciesServiceOp) Delete(ctx context.Context, l7PolicyID string) (*TaskResponse, *Response, error)
Delete a L7Policy.
func (*L7PoliciesServiceOp) Get ¶
func (s *L7PoliciesServiceOp) Get(ctx context.Context, l7PolicyID string) (*L7Policy, *Response, error)
Get a L7Policy.
func (*L7PoliciesServiceOp) Update ¶
func (s *L7PoliciesServiceOp) Update(ctx context.Context, l7PolicyID string, reqBody *L7PolicyUpdateRequest) (*TaskResponse, *Response, error)
Update replace L7Policy properties.
type L7Policy ¶
type L7Policy struct { RegionID int `json:"region_id"` ProjectID int `json:"project_id"` Name string `json:"name"` Region string `json:"region"` ID string `json:"id"` TaskID string `json:"task_id"` RedirectHTTPCode *int `json:"redirect_http_code"` Tags []string `json:"tags"` ListenerID string `json:"listener_id"` RedirectPoolID *string `json:"redirect_pool_id"` OperatingStatus string `json:"operating_status"` ProvisioningStatus string `json:"provisioning_status"` RedirectURL *string `json:"redirect_url"` Position int `json:"position"` RedirectPrefix *string `json:"redirect_prefix"` Action L7PolicyAction `json:"action"` Rules []L7Rule `json:"rules"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at,omitempty"` }
L7Policy represents an EdgecenterCloud L7Policy.
type L7PolicyAction ¶
type L7PolicyAction string
const ( L7PolicyActionRedirectPrefix L7PolicyAction = "REDIRECT_PREFIX" L7PolicyActionRedirectToPool L7PolicyAction = "REDIRECT_TO_POOL" L7PolicyActionRedirectToURL L7PolicyAction = "REDIRECT_TO_URL" L7PolicyActionReject L7PolicyAction = "REJECT" )
type L7PolicyCreateRequest ¶
type L7PolicyCreateRequest struct { Tags []string `json:"tags,omitempty"` RedirectHTTPCode int `json:"redirect_http_code,omitempty"` ListenerID string `json:"listener_id" required:"true" validate:"required"` Position int `json:"position,omitempty"` Name string `json:"name,omitempty"` Action L7PolicyAction `json:"action" required:"true" validate:"required"` RedirectURL string `json:"redirect_url,omitempty"` RedirectPrefix string `json:"redirect_prefix,omitempty"` RedirectPoolID string `json:"redirect_pool_id,omitempty"` }
type L7PolicyUpdateRequest ¶
type L7PolicyUpdateRequest struct { Tags []string `json:"tags,omitempty"` RedirectHTTPCode int `json:"redirect_http_code,omitempty"` Position int `json:"position,omitempty"` Name string `json:"name,omitempty"` Action L7PolicyAction `json:"action" required:"true" validate:"required"` RedirectURL string `json:"redirect_url,omitempty"` RedirectPrefix string `json:"redirect_prefix,omitempty"` RedirectPoolID string `json:"redirect_pool_id,omitempty"` }
type L7Rule ¶
type L7Rule struct { RegionID int `json:"region_id"` ProjectID int `json:"project_id"` TaskID string `json:"task_id"` ID string `json:"id"` Region string `json:"region"` ProvisioningStatus string `json:"provisioning_status"` OperatingStatus string `json:"operating_status"` Tags []string `json:"tags"` Value string `json:"value"` Key string `json:"key"` Invert bool `json:"invert"` Type L7RuleType `json:"type"` CompareType L7RuleCompareType `json:"compare_type"` }
type L7RuleCompareType ¶
type L7RuleCompareType string
const ( L7RuleCompareTypeContains L7RuleCompareType = "CONTAINS" L7RuleCompareTypeEndsWith L7RuleCompareType = "ENDS_WITH" L7RuleCompareTypeEqualTo L7RuleCompareType = "EQUAL_TO" L7RuleCompareTypeRegex L7RuleCompareType = "REGEX" L7RuleCompareTypeStartsWith L7RuleCompareType = "STARTS_WITH" )
type L7RuleCreateRequest ¶
type L7RuleCreateRequest struct { Tags []string `json:"tags,omitempty"` CompareType L7RuleCompareType `json:"compare_type" required:"true" validate:"required"` Value string `json:"value" required:"true" validate:"required"` Key string `json:"key,omitempty"` Type L7RuleType `json:"type" required:"true" validate:"required"` Invert bool `json:"invert,omitempty"` }
type L7RuleType ¶
type L7RuleType string
const ( L7RuleTypeCookie L7RuleType = "COOKIE" L7RuleTypeFyleType L7RuleType = "FILE_TYPE" L7RuleTypeHeader L7RuleType = "HEADER" L7RuleTypeHostName L7RuleType = "HOST_NAME" L7RuleTypePath L7RuleType = "PATH" L7RuleTypeSSLConnHasCert L7RuleType = "SSL_CONN_HAS_CERT" L7RuleTypeSSLVerifyResult L7RuleType = "SSL_VERIFY_RESULT" L7RuleTypeSSLDNField L7RuleType = "SSL_DN_FIELD" )
type L7RuleUpdateRequest ¶
type L7RuleUpdateRequest struct { Tags *[]string `json:"tags,omitempty"` CompareType *L7RuleCompareType `json:"compare_type,omitempty"` Value *string `json:"value,omitempty"` Key *string `json:"key,omitempty"` Type *L7RuleType `json:"type,omitempty"` Invert *bool `json:"invert,omitempty"` }
type L7RulesService ¶
type L7RulesService interface { List(context.Context, string) ([]L7Rule, *Response, error) Create(context.Context, string, *L7RuleCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string, string) (*TaskResponse, *Response, error) Get(context.Context, string, string) (*L7Rule, *Response, error) Update(context.Context, string, string, *L7RuleUpdateRequest) (*TaskResponse, *Response, error) }
L7RulesService is an interface for creating and managing L7Rules with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/l7rules
type L7RulesServiceOp ¶
type L7RulesServiceOp struct {
// contains filtered or unexported fields
}
L7RulesServiceOp handles communication with L7Rules methods of the EdgecenterCloud API.
func (*L7RulesServiceOp) Create ¶
func (s *L7RulesServiceOp) Create(ctx context.Context, l7PolicyID string, reqBody *L7RuleCreateRequest) (*TaskResponse, *Response, error)
Create a L7Rule.
func (*L7RulesServiceOp) Delete ¶
func (s *L7RulesServiceOp) Delete(ctx context.Context, l7PolicyID string, l7RuleID string) (*TaskResponse, *Response, error)
Delete a L7Rule.
func (*L7RulesServiceOp) Get ¶
func (s *L7RulesServiceOp) Get(ctx context.Context, l7PolicyID string, l7RuleID string) (*L7Rule, *Response, error)
Get a L7Rule.
func (*L7RulesServiceOp) List ¶
func (s *L7RulesServiceOp) List(ctx context.Context, l7PolicyID string) ([]L7Rule, *Response, error)
List get L7Rules.
func (*L7RulesServiceOp) Update ¶
func (s *L7RulesServiceOp) Update(ctx context.Context, l7PolicyID string, l7RuleID string, reqBody *L7RuleUpdateRequest) (*TaskResponse, *Response, error)
Update replace L7Rule properties.
type LifeCyclePoliciesService ¶ added in v2.0.19
type LifeCyclePoliciesService interface { List(context.Context, *LifeCyclePolicyListOptions) ([]LifeCyclePolicy, *Response, error) Get(context.Context, int, *LifeCyclePolicyGetOptions) (*LifeCyclePolicy, *Response, error) Create(context.Context, *LifeCyclePolicyCreateRequest) (*LifeCyclePolicy, *Response, error) Delete(context.Context, int) (*Response, error) Update(context.Context, int, *LifeCyclePolicyUpdateRequest) (*LifeCyclePolicy, *Response, error) AddSchedules(context.Context, int, *LifeCyclePolicyAddSchedulesRequest) (*LifeCyclePolicy, *Response, error) RemoveSchedules(context.Context, int, *LifeCyclePolicyRemoveSchedulesRequest) (*LifeCyclePolicy, *Response, error) AddVolumes(context.Context, int, *LifeCyclePolicyAddVolumesRequest) (*LifeCyclePolicy, *Response, error) RemoveVolumes(context.Context, int, *LifeCyclePolicyRemoveVolumesRequest) (*LifeCyclePolicy, *Response, error) EstimateCronMaxPolicyUsage(context.Context, *LifeCyclePolicyEstimateCronRequest) (*LifeCyclePolicyMaxPolicyUsage, *Response, error) EstimateIntervalMaxPolicyUsage(context.Context, *LifeCyclePolicyEstimateIntervalRequest) (*LifeCyclePolicyMaxPolicyUsage, *Response, error) }
LifeCyclePoliciesService is an interface for creating and managing lifecycle policies with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/Lifecycle-policy
type LifeCyclePoliciesServiceOp ¶ added in v2.0.19
type LifeCyclePoliciesServiceOp struct {
// contains filtered or unexported fields
}
LifeCyclePoliciesServiceOp handles communication with lifecycle policies methods of the EdgecenterCloud API.
func (LifeCyclePoliciesServiceOp) AddSchedules ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) AddSchedules(ctx context.Context, lifeCyclePolicyID int, reqBody *LifeCyclePolicyAddSchedulesRequest) (*LifeCyclePolicy, *Response, error)
AddSchedules adds a schedules to lifecycle policy with specified unique id.
func (LifeCyclePoliciesServiceOp) AddVolumes ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) AddVolumes(ctx context.Context, lifeCyclePolicyID int, reqBody *LifeCyclePolicyAddVolumesRequest) (*LifeCyclePolicy, *Response, error)
AddVolumes adds a volumes to lifecycle policy with specified unique id.
func (LifeCyclePoliciesServiceOp) Create ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) Create(ctx context.Context, reqBody *LifeCyclePolicyCreateRequest) (*LifeCyclePolicy, *Response, error)
Create is create new lifecycle policy.
func (LifeCyclePoliciesServiceOp) Delete ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) Delete(ctx context.Context, lifeCyclePolicyID int) (*Response, error)
Delete deletes a lifecycle policy with specified unique id.
func (LifeCyclePoliciesServiceOp) EstimateCronMaxPolicyUsage ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) EstimateCronMaxPolicyUsage(ctx context.Context, reqBody *LifeCyclePolicyEstimateCronRequest) (*LifeCyclePolicyMaxPolicyUsage, *Response, error)
EstimateCronMaxPolicyUsage estimates usage of resources and costs for CRON lifecycle policy.
func (LifeCyclePoliciesServiceOp) EstimateIntervalMaxPolicyUsage ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) EstimateIntervalMaxPolicyUsage(ctx context.Context, reqBody *LifeCyclePolicyEstimateIntervalRequest) (*LifeCyclePolicyMaxPolicyUsage, *Response, error)
EstimateIntervalMaxPolicyUsage estimates usage of resources and costs for Interval lifecycle policy.
func (LifeCyclePoliciesServiceOp) Get ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) Get(ctx context.Context, lifecyclePolicyID int, getOpts *LifeCyclePolicyGetOptions) (*LifeCyclePolicy, *Response, error)
Get returns a lifecycle policy with specified unique id.
func (LifeCyclePoliciesServiceOp) List ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) List(ctx context.Context, listOpts *LifeCyclePolicyListOptions) ([]LifeCyclePolicy, *Response, error)
List returns a list of lifecycle policies.
func (LifeCyclePoliciesServiceOp) RemoveSchedules ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) RemoveSchedules(ctx context.Context, lifeCyclePolicyID int, reqBody *LifeCyclePolicyRemoveSchedulesRequest) (*LifeCyclePolicy, *Response, error)
RemoveSchedules removes a schedules from lifecycle policy with specified unique id.
func (LifeCyclePoliciesServiceOp) RemoveVolumes ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) RemoveVolumes(ctx context.Context, lifeCyclePolicyID int, reqBody *LifeCyclePolicyRemoveVolumesRequest) (*LifeCyclePolicy, *Response, error)
RemoveVolumes removes a volumes from lifecycle policy with specified unique id.
func (LifeCyclePoliciesServiceOp) Update ¶ added in v2.0.19
func (s LifeCyclePoliciesServiceOp) Update(ctx context.Context, lifeCyclePolicyID int, reqBody *LifeCyclePolicyUpdateRequest) (*LifeCyclePolicy, *Response, error)
Update updates a lifecycle policy with specified unique id. reqBody are used to construct request body.
type LifeCyclePolicy ¶ added in v2.0.20
type LifeCyclePolicy struct { Name string `json:"name"` ID int `json:"id"` Action LifeCyclePolicyAction `json:"action"` ProjectID int `json:"project_id"` Status LifeCyclePolicyStatus `json:"status"` UserID int `json:"user_id"` RegionID int `json:"region_id"` Volumes []LifeCyclePolicyVolume `json:"volumes"` Schedules []LifeCyclePolicySchedule `json:"schedules"` }
LifeCyclePolicy represents a lifecycle policy resource.
type LifeCyclePolicyAction ¶ added in v2.0.20
type LifeCyclePolicyAction string
func (LifeCyclePolicyAction) IsValid ¶ added in v2.0.20
func (a LifeCyclePolicyAction) IsValid() error
func (LifeCyclePolicyAction) List ¶ added in v2.0.20
func (a LifeCyclePolicyAction) List() []LifeCyclePolicyAction
func (LifeCyclePolicyAction) String ¶ added in v2.0.20
func (a LifeCyclePolicyAction) String() string
func (LifeCyclePolicyAction) StringList ¶ added in v2.0.20
func (a LifeCyclePolicyAction) StringList() []string
type LifeCyclePolicyAddSchedulesRequest ¶ added in v2.0.19
type LifeCyclePolicyAddSchedulesRequest struct {
Schedules []LifeCyclePolicyCreateScheduleRequest `json:"schedules" validate:"required,dive"`
}
LifeCyclePolicyAddSchedulesRequest represents options for AddSchedules.
type LifeCyclePolicyAddVolumesRequest ¶ added in v2.0.19
type LifeCyclePolicyAddVolumesRequest struct {
VolumeIds []string `json:"volume_ids" validate:"required"`
}
LifeCyclePolicyAddVolumesRequest represents options for AddVolumes. Volumes already managed by policy are ignored.
type LifeCyclePolicyCommonCreateScheduleRequest ¶ added in v2.0.20
type LifeCyclePolicyCommonCreateScheduleRequest struct { Type LifeCyclePolicyScheduleType `json:"type" validate:"required,enum"` ResourceNameTemplate string `json:"resource_name_template,omitempty"` MaxQuantity int `json:"max_quantity" validate:"required,gt=0,lt=10001"` RetentionTime *LifeCyclePolicyRetentionTimer `json:"retention_time,omitempty"` }
type LifeCyclePolicyCommonSchedule ¶ added in v2.0.20
type LifeCyclePolicyCommonSchedule struct { Type LifeCyclePolicyScheduleType `json:"type"` ID string `json:"id"` Owner string `json:"owner"` OwnerID int `json:"owner_id"` MaxQuantity int `json:"max_quantity"` UserID int `json:"user_id"` ResourceNameTemplate string `json:"resource_name_template"` RetentionTime *LifeCyclePolicyRetentionTimer `json:"retention_time"` }
type LifeCyclePolicyCreateCronScheduleRequest ¶ added in v2.0.20
type LifeCyclePolicyCreateCronScheduleRequest struct { LifeCyclePolicyCommonCreateScheduleRequest Timezone string `json:"timezone,omitempty"` Week string `json:"week,omitempty"` DayOfWeek string `json:"day_of_week,omitempty"` Month string `json:"month,omitempty"` Day string `json:"day,omitempty"` Hour string `json:"hour,omitempty"` Minute string `json:"minute,omitempty"` }
LifeCyclePolicyCreateCronScheduleRequest represents options used to create a single cron schedule.
func (*LifeCyclePolicyCreateCronScheduleRequest) SetCommonCreateScheduleOpts ¶ added in v2.0.20
func (opts *LifeCyclePolicyCreateCronScheduleRequest) SetCommonCreateScheduleOpts(common LifeCyclePolicyCommonCreateScheduleRequest)
type LifeCyclePolicyCreateIntervalScheduleRequest ¶ added in v2.0.19
type LifeCyclePolicyCreateIntervalScheduleRequest struct { LifeCyclePolicyCommonCreateScheduleRequest Weeks int `json:"weeks,omitempty" validate:"required_without_all=Days Hours Minutes"` Days int `json:"days,omitempty" validate:"required_without_all=Weeks Hours Minutes"` Hours int `json:"hours,omitempty" validate:"required_without_all=Weeks Days Minutes"` Minutes int `json:"minutes,omitempty" validate:"required_without_all=Weeks Days Hours"` }
LifeCyclePolicyCreateIntervalScheduleRequest represents options used to create a single interval schedule.
func (*LifeCyclePolicyCreateIntervalScheduleRequest) SetCommonCreateScheduleOpts ¶ added in v2.0.19
func (opts *LifeCyclePolicyCreateIntervalScheduleRequest) SetCommonCreateScheduleOpts(common LifeCyclePolicyCommonCreateScheduleRequest)
type LifeCyclePolicyCreateRequest ¶ added in v2.0.19
type LifeCyclePolicyCreateRequest struct { Name string `json:"name" validate:"required,name"` Status LifeCyclePolicyStatus `json:"status,omitempty" validate:"omitempty,enum"` Action LifeCyclePolicyAction `json:"action" validate:"required,enum"` Schedules []LifeCyclePolicyCreateScheduleRequest `json:"schedules,omitempty" validate:"dive"` VolumeIds []string `json:"volume_ids,omitempty"` }
type LifeCyclePolicyCreateScheduleRequest ¶ added in v2.0.19
type LifeCyclePolicyCreateScheduleRequest interface {
SetCommonCreateScheduleOpts(opts LifeCyclePolicyCommonCreateScheduleRequest)
}
LifeCyclePolicyCreateScheduleRequest represents options used to create a single schedule.
type LifeCyclePolicyCronSchedule ¶ added in v2.0.20
type LifeCyclePolicyCronSchedule struct { LifeCyclePolicyCommonSchedule Timezone string `json:"timezone"` Week string `json:"week"` DayOfWeek string `json:"day_of_week"` Month string `json:"month"` Day string `json:"day"` Hour string `json:"hour"` Minute string `json:"minute"` }
func (LifeCyclePolicyCronSchedule) GetCommonSchedule ¶ added in v2.0.20
func (s LifeCyclePolicyCronSchedule) GetCommonSchedule() LifeCyclePolicyCommonSchedule
type LifeCyclePolicyCurrency ¶ added in v2.0.20
func ParseCurrency ¶ added in v2.0.19
func ParseCurrency(s string) (*LifeCyclePolicyCurrency, error)
func (LifeCyclePolicyCurrency) MarshalJSON ¶ added in v2.0.20
func (c LifeCyclePolicyCurrency) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface for LifeCyclePolicyCurrency.
func (LifeCyclePolicyCurrency) String ¶ added in v2.0.20
func (c LifeCyclePolicyCurrency) String() string
String - implements Stringer.
func (*LifeCyclePolicyCurrency) UnmarshalJSON ¶ added in v2.0.20
func (c *LifeCyclePolicyCurrency) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface for LifeCyclePolicyCurrency.
type LifeCyclePolicyEstimateCronRequest ¶ added in v2.0.19
type LifeCyclePolicyEstimateCronRequest struct { LifeCyclePolicyEstimateOpts Schedules []LifeCyclePolicyCreateScheduleRequest `json:"schedules"` }
LifeCyclePolicyEstimateCronRequest represent options for EstimateCronMaxPolicyUsage.
type LifeCyclePolicyEstimateIntervalRequest ¶ added in v2.0.19
type LifeCyclePolicyEstimateIntervalRequest struct { LifeCyclePolicyEstimateOpts Schedules []LifeCyclePolicyCreateIntervalScheduleRequest `json:"schedules"` }
LifeCyclePolicyEstimateIntervalRequest represent options for EstimateIntervalMaxPolicyUsage.
type LifeCyclePolicyEstimateOpts ¶ added in v2.0.19
type LifeCyclePolicyEstimateOpts struct { Name string `json:"name" required:"true" validate:"required"` VolumeIds []string `json:"volume_ids"` Status LifeCyclePolicyStatus `json:"status,omitempty" validate:"omitempty,enum"` Action LifeCyclePolicyAction `json:"action" validate:"required,enum"` }
type LifeCyclePolicyGetOptions ¶ added in v2.0.19
type LifeCyclePolicyGetOptions struct {
NeedVolumes bool `url:"need_volumes, omitempty" validate:"omitempty"`
}
type LifeCyclePolicyIntervalSchedule ¶ added in v2.0.20
type LifeCyclePolicyIntervalSchedule struct { LifeCyclePolicyCommonSchedule Weeks int `json:"weeks"` Days int `json:"days"` Hours int `json:"hours"` Minutes int `json:"minutes"` }
func (LifeCyclePolicyIntervalSchedule) GetCommonSchedule ¶ added in v2.0.20
func (s LifeCyclePolicyIntervalSchedule) GetCommonSchedule() LifeCyclePolicyCommonSchedule
type LifeCyclePolicyListOptions ¶ added in v2.0.19
type LifeCyclePolicyListOptions LifeCyclePolicyGetOptions
type LifeCyclePolicyMaxPolicyUsage ¶ added in v2.0.19
type LifeCyclePolicyMaxPolicyUsage struct { CountUsage int `json:"max_volume_snapshot_count_usage"` SizeUsage int `json:"max_volume_snapshot_size_usage"` SequenceLength int `json:"max_volume_snapshot_sequence_length"` MaxCost LifeCyclePolicyPolicyUsageCost `json:"max_cost"` }
type LifeCyclePolicyPolicyUsageCost ¶ added in v2.0.19
type LifeCyclePolicyRawSchedule ¶ added in v2.0.20
type LifeCyclePolicyRawSchedule struct {
json.RawMessage
}
LifeCyclePolicyRawSchedule is internal struct for unmarshalling into LifeCyclePolicySchedule.
func (LifeCyclePolicyRawSchedule) Cook ¶ added in v2.0.20
func (r LifeCyclePolicyRawSchedule) Cook() (LifeCyclePolicySchedule, error)
Cook is method for unmarshalling LifeCyclePolicyRawSchedule into LifeCyclePolicySchedule.
type LifeCyclePolicyRemoveSchedulesRequest ¶ added in v2.0.19
type LifeCyclePolicyRemoveSchedulesRequest struct {
ScheduleIDs []string `json:"schedule_ids" validate:"required"`
}
LifeCyclePolicyRemoveSchedulesRequest represents options for RemoveSchedules.
type LifeCyclePolicyRemoveVolumesRequest ¶ added in v2.0.19
type LifeCyclePolicyRemoveVolumesRequest struct {
VolumeIds []string `json:"volume_ids" validate:"required"`
}
LifeCyclePolicyRemoveVolumesRequest represents options for AddVolumes. Volumes already managed by policy are ignored.
type LifeCyclePolicyRetentionTimer ¶ added in v2.0.20
type LifeCyclePolicySchedule ¶ added in v2.0.20
type LifeCyclePolicySchedule interface {
GetCommonSchedule() LifeCyclePolicyCommonSchedule
}
LifeCyclePolicySchedule represents a schedule resource.
type LifeCyclePolicyScheduleType ¶ added in v2.0.20
type LifeCyclePolicyScheduleType string
func (LifeCyclePolicyScheduleType) IsValid ¶ added in v2.0.20
func (t LifeCyclePolicyScheduleType) IsValid() error
func (LifeCyclePolicyScheduleType) List ¶ added in v2.0.20
func (t LifeCyclePolicyScheduleType) List() []LifeCyclePolicyScheduleType
func (LifeCyclePolicyScheduleType) String ¶ added in v2.0.20
func (t LifeCyclePolicyScheduleType) String() string
func (LifeCyclePolicyScheduleType) StringList ¶ added in v2.0.20
func (t LifeCyclePolicyScheduleType) StringList() []string
type LifeCyclePolicyStatus ¶ added in v2.0.20
type LifeCyclePolicyStatus string
func (LifeCyclePolicyStatus) IsValid ¶ added in v2.0.20
func (s LifeCyclePolicyStatus) IsValid() error
func (LifeCyclePolicyStatus) List ¶ added in v2.0.20
func (s LifeCyclePolicyStatus) List() []LifeCyclePolicyStatus
func (LifeCyclePolicyStatus) String ¶ added in v2.0.20
func (s LifeCyclePolicyStatus) String() string
func (LifeCyclePolicyStatus) StringList ¶ added in v2.0.20
func (s LifeCyclePolicyStatus) StringList() []string
type LifeCyclePolicyUpdateRequest ¶ added in v2.0.19
type LifeCyclePolicyUpdateRequest struct { Name string `json:"name" validate:"required,name"` Status LifeCyclePolicyStatus `json:"status,omitempty" validate:"omitempty,enum"` }
type LifeCyclePolicyVolume ¶ added in v2.0.20
LifeCyclePolicyVolume represents a volume resource.
type LimiterStats ¶
type LimiterStats struct { IopsBaseLimit int `json:"iops_base_limit"` IopsBurstLimit int `json:"iops_burst_limit"` MBpsBaseLimit int `json:"MBps_base_limit"` MBpsBurstLimit int `json:"MBps_burst_limit"` }
LimiterStats represents a limiter_stats structure.
type ListCombinedOptions ¶
type ListCombinedOptions struct {
ClientID int `url:"client_id,omitempty" validate:"omitempty"`
}
ListCombinedOptions specifies the query parameters to ListCombined method.
type Listener ¶
type Listener struct { ID string `json:"id"` LoadbalancerID string `json:"loadbalancer_id"` CreatorTaskID string `json:"creator_task_id"` TaskID string `json:"task_id"` Name string `json:"name"` Protocol LoadbalancerListenerProtocol `json:"protocol"` ProtocolPort int `json:"protocol_port"` PoolCount int `json:"pool_count"` OperatingStatus OperatingStatus `json:"operating_status"` ProvisioningStatus ProvisioningStatus `json:"provisioning_status"` AllowedCIDRs []string `json:"allowed_cidrs"` SNISecretID []string `json:"sni_secret_id"` SecretID string `json:"secret_id"` InsertHeaders map[string]string `json:"insert_headers"` Stats LoadbalancerStats `json:"stats"` }
Listener represents an EdgecenterCloud Loadbalancer Listener.
type ListenerCreateRequest ¶
type ListenerCreateRequest struct { Name string `json:"name" required:"true" validate:"required,name"` Protocol LoadbalancerListenerProtocol `json:"protocol" required:"true"` ProtocolPort int `json:"protocol_port" required:"true"` LoadbalancerID string `json:"loadbalancer_id" required:"true"` InsertXForwarded bool `json:"insert_x_forwarded"` SecretID string `json:"secret_id,omitempty"` SNISecretID []string `json:"sni_secret_id,omitempty"` AllowedCIDRs []string `json:"allowed_cidrs,omitempty"` }
ListenerCreateRequest represents a request to create a Loadbalancer Listener. Used as a separate request to create Listener.
type ListenerListOptions ¶
type ListenerListOptions struct { ShowStats bool `url:"show_stats,omitempty" validate:"omitempty"` LoadbalancerID string `url:"loadbalancer_id,omitempty" validate:"omitempty"` }
ListenerListOptions specifies the optional query parameters to List method.
type ListenerUpdateRequest ¶
type ListenerUpdateRequest struct { Name string `json:"name,omitempty"` SecretID string `json:"secret_id,omitempty"` SNISecretID []string `json:"sni_secret_id,omitempty"` AllowedCIDRs *[]string `json:"allowed_cidrs,omitempty"` }
ListenerUpdateRequest represents a request to update a Loadbalancer Listener.
type Loadbalancer ¶
type Loadbalancer struct { ID string `json:"id"` Name string `json:"name"` Flavor Flavor `json:"flavor"` VipAddress net.IP `json:"vip_address"` VipPortID string `json:"vip_port_id"` VipNetworkID string `json:"vip_network_id"` ProvisioningStatus ProvisioningStatus `json:"provisioning_status"` OperatingStatus OperatingStatus `json:"operating_status"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` CreatorTaskID string `json:"creator_task_id"` TaskID string `json:"task_id"` MetadataDetailed []MetadataDetailed `json:"metadata,omitempty"` Stats LoadbalancerStats `json:"stats"` Listeners []Listener `json:"listeners"` FloatingIPs []FloatingIP `json:"floating_ips"` VrrpIPs []VrrpIP `json:"vrrp_ips"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` }
Loadbalancer represents an EdgecenterCloud Loadbalancer.
type LoadbalancerAlgorithm ¶
type LoadbalancerAlgorithm string
const ( LoadbalancerAlgorithmRoundRobin LoadbalancerAlgorithm = "ROUND_ROBIN" LoadbalancerAlgorithmLeastConnections LoadbalancerAlgorithm = "LEAST_CONNECTIONS" LoadbalancerAlgorithmSourceIP LoadbalancerAlgorithm = "SOURCE_IP" )
type LoadbalancerCheckLimitsRequest ¶
type LoadbalancerCheckLimitsRequest struct {
FloatingIP InterfaceFloatingIP `json:"floating_ip,omitempty"`
}
LoadbalancerCheckLimitsRequest represents a request to check the limits of a loadbalancer.
type LoadbalancerCreateRequest ¶
type LoadbalancerCreateRequest struct { Name string `json:"name" required:"true" validate:"required,name"` Flavor string `json:"flavor,omitempty"` Listeners []LoadbalancerListenerCreateRequest `json:"listeners,omitempty" validate:"omitempty,dive"` VipPortID string `json:"vip_port_id,omitempty"` VipNetworkID string `json:"vip_network_id,omitempty"` VipSubnetID string `json:"vip_subnet_id,omitempty"` Metadata Metadata `json:"metadata,omitempty" validate:"omitempty,dive"` Tags []string `json:"tag,omitempty"` FloatingIP *InterfaceFloatingIP `json:"floating_ip,omitempty" validate:"omitempty,dive"` }
LoadbalancerCreateRequest represents a request to create a Loadbalancer.
type LoadbalancerListOptions ¶
type LoadbalancerListOptions struct { ShowStats bool `url:"show_stats,omitempty" validate:"omitempty"` AssignedFloating bool `url:"assigned_floating,omitempty" validate:"omitempty"` MetadataKV string `url:"metadata_kv,omitempty" validate:"omitempty"` MetadataK string `url:"metadata_k,omitempty" validate:"omitempty"` }
LoadbalancerListOptions specifies the optional query parameters to List method.
type LoadbalancerListenerCreateRequest ¶
type LoadbalancerListenerCreateRequest struct { Name string `json:"name" required:"true" validate:"required,name"` Protocol LoadbalancerListenerProtocol `json:"protocol" required:"true"` ProtocolPort int `json:"protocol_port" required:"true"` Certificate string `json:"certificate,omitempty"` CertificateChain string `json:"certificate_chain,omitempty"` PrivateKey string `json:"private_key,omitempty"` SecretID string `json:"secret_id,omitempty"` InsertXForwarded bool `json:"insert_x_forwarded"` SNISecretID []string `json:"sni_secret_id,omitempty"` Pools []LoadbalancerPoolCreateRequest `json:"pools,omitempty" validate:"omitempty,dive"` AllowedCIDRs []string `json:"allowed_cidrs,omitempty"` }
LoadbalancerListenerCreateRequest represents a request to create a Loadbalancer Listener. Used as part of a request to create a Loadbalancer.
type LoadbalancerListenerProtocol ¶
type LoadbalancerListenerProtocol string
const ( ListenerProtocolHTTP LoadbalancerListenerProtocol = "HTTP" ListenerProtocolHTTPS LoadbalancerListenerProtocol = "HTTPS" ListenerProtocolTCP LoadbalancerListenerProtocol = "TCP" ListenerProtocolUDP LoadbalancerListenerProtocol = "UDP" ListenerProtocolTerminatedHTTPS LoadbalancerListenerProtocol = "TERMINATED_HTTPS" )
type LoadbalancerListeners ¶
type LoadbalancerListeners interface { ListenerList(context.Context, *ListenerListOptions) ([]Listener, *Response, error) ListenerGet(context.Context, string) (*Listener, *Response, error) ListenerCreate(context.Context, *ListenerCreateRequest) (*TaskResponse, *Response, error) ListenerDelete(context.Context, string) (*TaskResponse, *Response, error) ListenerRename(context.Context, string, *Name) (*Listener, *Response, error) ListenerUpdate(context.Context, string, *ListenerUpdateRequest) (*TaskResponse, *Response, error) }
type LoadbalancerMetadata ¶
type LoadbalancerMetadata interface { MetadataList(context.Context, string) ([]MetadataDetailed, *Response, error) MetadataCreate(context.Context, string, *Metadata) (*Response, error) MetadataUpdate(context.Context, string, *Metadata) (*Response, error) MetadataDeleteItem(context.Context, string, *MetadataItemOptions) (*Response, error) MetadataGetItem(context.Context, string, *MetadataItemOptions) (*MetadataDetailed, *Response, error) }
type LoadbalancerMetrics ¶
type LoadbalancerMetrics struct { CPUUtil int `json:"cpu_util"` Time string `json:"time"` NetworkBpsEgress int `json:"network_Bps_egress"` NetworkBpsIngress int `json:"network_Bps_ingress"` NetworkPpsEgress int `json:"network_pps_egress"` NetworkPpsIngress int `json:"network_pps_ingress"` MemoryUtil int `json:"memory_util"` }
LoadbalancerMetrics represents an EdgecenterCloud Loadbalancer metrics.
type LoadbalancerMetricsListRequest ¶
type LoadbalancerMetricsListRequest struct { TimeInterval int `json:"time_interval" required:"true" validate:"required,name"` TimeUnit TimeUnit `json:"time_unit" required:"true" validate:"required,name"` }
LoadbalancerMetricsListRequest represents a request to get a Loadbalancer Metrics list.
type LoadbalancerPoolCreateRequest ¶
type LoadbalancerPoolCreateRequest struct { Name string `json:"name" required:"true" validate:"required,name"` LoadbalancerAlgorithm LoadbalancerAlgorithm `json:"lb_algorithm,omitempty"` Protocol LoadbalancerPoolProtocol `json:"protocol" required:"true"` LoadbalancerID string `json:"loadbalancer_id,omitempty"` ListenerID string `json:"listener_id,omitempty"` TimeoutClientData int `json:"timeout_client_data,omitempty"` TimeoutMemberData int `json:"timeout_member_data,omitempty"` TimeoutMemberConnect int `json:"timeout_member_connect,omitempty"` Members []PoolMemberCreateRequest `json:"members,omitempty"` HealthMonitor *HealthMonitorCreateRequest `json:"healthmonitor,omitempty"` SessionPersistence *LoadbalancerSessionPersistence `json:"session_persistence,omitempty"` }
LoadbalancerPoolCreateRequest represents a request to create a Loadbalancer Pool. Used as part of a request to create a Loadbalancer.
type LoadbalancerPoolProtocol ¶
type LoadbalancerPoolProtocol string
const ( LBPoolProtocolHTTP LoadbalancerPoolProtocol = "HTTP" LBPoolProtocolHTTPS LoadbalancerPoolProtocol = "HTTPS" LBPoolProtocolTCP LoadbalancerPoolProtocol = "TCP" LBPoolProtocolUDP LoadbalancerPoolProtocol = "UDP" LBPoolProtocolProxy LoadbalancerPoolProtocol = "PROXY" LBPoolProtocolTerminatedHTTPS LoadbalancerPoolProtocol = "TERMINATED_HTTPS" )
type LoadbalancerPools ¶
type LoadbalancerPools interface { PoolGet(context.Context, string) (*Pool, *Response, error) PoolCreate(context.Context, *PoolCreateRequest) (*TaskResponse, *Response, error) PoolDelete(context.Context, string) (*TaskResponse, *Response, error) PoolUpdate(context.Context, string, *PoolUpdateRequest) (*TaskResponse, *Response, error) PoolList(context.Context, *PoolListOptions) ([]Pool, *Response, error) }
type LoadbalancerPoolsMember ¶
type LoadbalancerPoolsMember interface { PoolMemberCreate(context.Context, string, *PoolMemberCreateRequest) (*TaskResponse, *Response, error) PoolMemberDelete(context.Context, string, string) (*TaskResponse, *Response, error) }
type LoadbalancerSessionPersistence ¶
type LoadbalancerSessionPersistence struct { Type SessionPersistence `json:"type" required:"true"` CookieName string `json:"cookie_name,omitempty"` PersistenceTimeout int `json:"persistence_timeout,omitempty"` PersistenceGranularity string `json:"persistence_granularity,omitempty"` }
LoadbalancerSessionPersistence represents a request to create a Loadbalancer Pool Persistence Session.
type LoadbalancerStats ¶
type LoadbalancerStats struct { ActiveConnections int `json:"active_connections"` BytesIn int `json:"bytes_in"` BytesOut int `json:"bytes_out"` RequestErrors int `json:"request_errors"` TotalConnections int `json:"total_connections"` }
LoadbalancerStats represents an EdgecenterCloud Loadbalancer statistic.
type LoadbalancersService ¶
type LoadbalancersService interface { List(context.Context, *LoadbalancerListOptions) ([]Loadbalancer, *Response, error) Get(context.Context, string) (*Loadbalancer, *Response, error) Create(context.Context, *LoadbalancerCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) CheckLimits(context.Context, *LoadbalancerCheckLimitsRequest) (*map[string]int, *Response, error) Rename(context.Context, string, *Name) (*Loadbalancer, *Response, error) MetricsList(context.Context, string, *LoadbalancerMetricsListRequest) ([]LoadbalancerMetrics, *Response, error) FlavorList(context.Context, *FlavorsOptions) ([]Flavor, *Response, error) LoadbalancerListeners LoadbalancerPools LoadbalancerPoolsMember LoadbalancerHealthMonitor LoadbalancerMetadata }
LoadbalancersService is an interface for creating and managing Loadbalancer with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/loadbalancers
type LoadbalancersServiceOp ¶
type LoadbalancersServiceOp struct {
// contains filtered or unexported fields
}
LoadbalancersServiceOp handles communication with Loadbalancers methods of the EdgecenterCloud API.
func (*LoadbalancersServiceOp) CheckLimits ¶
func (s *LoadbalancersServiceOp) CheckLimits(ctx context.Context, reqBody *LoadbalancerCheckLimitsRequest) (*map[string]int, *Response, error)
CheckLimits check a quota for load balancer creation.
func (*LoadbalancersServiceOp) Create ¶
func (s *LoadbalancersServiceOp) Create(ctx context.Context, reqBody *LoadbalancerCreateRequest) (*TaskResponse, *Response, error)
Create a Loadbalancer.
func (*LoadbalancersServiceOp) Delete ¶
func (s *LoadbalancersServiceOp) Delete(ctx context.Context, loadbalancerID string) (*TaskResponse, *Response, error)
Delete the Loadbalancer.
func (*LoadbalancersServiceOp) FlavorList ¶
func (s *LoadbalancersServiceOp) FlavorList(ctx context.Context, opts *FlavorsOptions) ([]Flavor, *Response, error)
FlavorList get load balancer flavors.
func (*LoadbalancersServiceOp) Get ¶
func (s *LoadbalancersServiceOp) Get(ctx context.Context, loadbalancerID string) (*Loadbalancer, *Response, error)
Get individual Loadbalancer.
func (*LoadbalancersServiceOp) HealthMonitorCreate ¶
func (s *LoadbalancersServiceOp) HealthMonitorCreate(ctx context.Context, poolID string, reqBody *HealthMonitorCreateRequest) (*TaskResponse, *Response, error)
HealthMonitorCreate a Loadbalancer Pool HealthMonitor.
func (*LoadbalancersServiceOp) HealthMonitorDelete ¶
func (s *LoadbalancersServiceOp) HealthMonitorDelete(ctx context.Context, poolID string) (*Response, error)
HealthMonitorDelete the Loadbalancer Pool HealthMonitor.
func (*LoadbalancersServiceOp) List ¶
func (s *LoadbalancersServiceOp) List(ctx context.Context, opts *LoadbalancerListOptions) ([]Loadbalancer, *Response, error)
List get load balancers.
func (*LoadbalancersServiceOp) ListenerCreate ¶
func (s *LoadbalancersServiceOp) ListenerCreate(ctx context.Context, reqBody *ListenerCreateRequest) (*TaskResponse, *Response, error)
ListenerCreate a Loadbalancer Listener.
func (*LoadbalancersServiceOp) ListenerDelete ¶
func (s *LoadbalancersServiceOp) ListenerDelete(ctx context.Context, listenerID string) (*TaskResponse, *Response, error)
ListenerDelete the Loadbalancer Listener.
func (*LoadbalancersServiceOp) ListenerGet ¶
func (s *LoadbalancersServiceOp) ListenerGet(ctx context.Context, listenerID string) (*Listener, *Response, error)
ListenerGet a Loadbalancer Listener.
func (*LoadbalancersServiceOp) ListenerList ¶
func (s *LoadbalancersServiceOp) ListenerList(ctx context.Context, opts *ListenerListOptions) ([]Listener, *Response, error)
ListenerList get load balancer listeners.
func (*LoadbalancersServiceOp) ListenerRename ¶
func (s *LoadbalancersServiceOp) ListenerRename(ctx context.Context, listenerID string, reqBody *Name) (*Listener, *Response, error)
ListenerRename a Loadbalancer Listener.
func (*LoadbalancersServiceOp) ListenerUpdate ¶
func (s *LoadbalancersServiceOp) ListenerUpdate(ctx context.Context, listenerID string, reqBody *ListenerUpdateRequest) (*TaskResponse, *Response, error)
ListenerUpdate a Loadbalancer Listener.
func (*LoadbalancersServiceOp) MetadataCreate ¶
func (s *LoadbalancersServiceOp) MetadataCreate(ctx context.Context, loadbalancerID string, reqBody *Metadata) (*Response, error)
MetadataCreate or update load balancer metadata.
func (*LoadbalancersServiceOp) MetadataDeleteItem ¶
func (s *LoadbalancersServiceOp) MetadataDeleteItem(ctx context.Context, loadbalancerID string, opts *MetadataItemOptions) (*Response, error)
MetadataDeleteItem a load balancer metadata item by key.
func (*LoadbalancersServiceOp) MetadataGetItem ¶
func (s *LoadbalancersServiceOp) MetadataGetItem(ctx context.Context, loadbalancerID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
MetadataGetItem load balancer detailed metadata.
func (*LoadbalancersServiceOp) MetadataList ¶
func (s *LoadbalancersServiceOp) MetadataList(ctx context.Context, loadbalancerID string) ([]MetadataDetailed, *Response, error)
MetadataList load balancer detailed metadata items.
func (*LoadbalancersServiceOp) MetadataUpdate ¶
func (s *LoadbalancersServiceOp) MetadataUpdate(ctx context.Context, loadbalancerID string, reqBody *Metadata) (*Response, error)
MetadataUpdate load balancer metadata.
func (*LoadbalancersServiceOp) MetricsList ¶
func (s *LoadbalancersServiceOp) MetricsList(ctx context.Context, loadbalancerID string, reqBody *LoadbalancerMetricsListRequest) ([]LoadbalancerMetrics, *Response, error)
MetricsList get load balancer metrics.
func (*LoadbalancersServiceOp) PoolCreate ¶
func (s *LoadbalancersServiceOp) PoolCreate(ctx context.Context, reqBody *PoolCreateRequest) (*TaskResponse, *Response, error)
PoolCreate a Loadbalancer Pool.
func (*LoadbalancersServiceOp) PoolDelete ¶
func (s *LoadbalancersServiceOp) PoolDelete(ctx context.Context, poolID string) (*TaskResponse, *Response, error)
PoolDelete the Loadbalancer Pool.
func (*LoadbalancersServiceOp) PoolGet ¶
func (s *LoadbalancersServiceOp) PoolGet(ctx context.Context, poolID string) (*Pool, *Response, error)
PoolGet a Loadbalancer Pool.
func (*LoadbalancersServiceOp) PoolList ¶
func (s *LoadbalancersServiceOp) PoolList(ctx context.Context, opts *PoolListOptions) ([]Pool, *Response, error)
PoolList get Loadbalancer Pools.
func (*LoadbalancersServiceOp) PoolMemberCreate ¶
func (s *LoadbalancersServiceOp) PoolMemberCreate(ctx context.Context, poolID string, reqBody *PoolMemberCreateRequest) (*TaskResponse, *Response, error)
PoolMemberCreate a Loadbalancer Pool Member.
func (*LoadbalancersServiceOp) PoolMemberDelete ¶
func (s *LoadbalancersServiceOp) PoolMemberDelete(ctx context.Context, poolID, memberID string) (*TaskResponse, *Response, error)
PoolMemberDelete the Loadbalancer Pool Member.
func (*LoadbalancersServiceOp) PoolUpdate ¶
func (s *LoadbalancersServiceOp) PoolUpdate(ctx context.Context, poolID string, reqBody *PoolUpdateRequest) (*TaskResponse, *Response, error)
PoolUpdate a Loadbalancer Pool.
func (*LoadbalancersServiceOp) Rename ¶
func (s *LoadbalancersServiceOp) Rename(ctx context.Context, loadbalancerID string, reqBody *Name) (*Loadbalancer, *Response, error)
Rename a load balancer.
type MetadataCreateRequest ¶
type MetadataCreateRequest struct {
Metadata
}
MetadataCreateRequest represent a metadata create struct.
type MetadataDetailed ¶
type MetadataItemOptions ¶
type MetadataItemOptions struct {
Key string `url:"key,omitempty" validate:"omitempty"`
}
type MetadataRoot ¶
type MetadataRoot struct { Count int Metadata []MetadataDetailed `json:"results"` }
MetadataRoot represents a Metadata root.
type MetricsDatabase ¶
type MetricsDatabase struct {
ID int `json:"id"`
}
type Network ¶
type Network struct { ID string `json:"id"` Name string `json:"name"` CreatedAt string `json:"created_at"` CreatorTaskID string `json:"creator_task_id"` Default bool `json:"default"` External bool `json:"external"` MTU int `json:"mtu"` Metadata []MetadataDetailed `json:"metadata,omitempty"` ProjectID int `json:"project_id"` Region string `json:"region"` RegionID int `json:"region_id"` SegmentationID int `json:"segmentation_id"` Subnets []string `json:"subnets"` TaskID string `json:"task_id"` Type string `json:"type"` UpdatedAt string `json:"updated_at"` }
Network represents an EdgecenterCloud Network.
type NetworkCreateRequest ¶
type NetworkCreateRequest struct { Name string `json:"name" required:"true" validate:"required"` CreateRouter bool `json:"create_router"` Type NetworkType `json:"type,omitempty" validate:"omitempty"` Metadata Metadata `json:"metadata,omitempty" validate:"omitempty,dive"` }
NetworkCreateRequest represents a request to create a Network.
type NetworkListOptions ¶
type NetworkListOptions struct { OrderBy string `url:"order_by,omitempty" validate:"omitempty"` MetadataKV string `url:"metadata_kv,omitempty" validate:"omitempty"` MetadataK string `url:"metadata_k,omitempty" validate:"omitempty"` }
NetworkListOptions specifies the optional query parameters to List method.
type NetworkSubnetwork ¶
type NetworkSubnetwork struct { Metadata []MetadataDetailed `json:"metadata,omitempty"` UpdatedAt string `json:"updated_at"` Name string `json:"name"` CreatedAt string `json:"created_at"` Type string `json:"type"` External bool `json:"external"` TaskID string `json:"task_id"` Default bool `json:"default"` RegionID int `json:"region_id"` Region string `json:"region"` MTU int `json:"mtu"` SegmentationID int `json:"segmentation_id"` CreatorTaskID string `json:"creator_task_id"` ID string `json:"id"` ProjectID int `json:"project_id"` Subnets []Subnetwork `json:"subnets"` }
NetworkSubnetwork represents an EdgecenterCloud Network with info about Subnets.
type NetworkType ¶
type NetworkType string
const ( VLAN NetworkType = "vlan" VXLAN NetworkType = "vxlan" )
type NetworksMetadata ¶
type NetworksMetadata interface { MetadataList(context.Context, string) ([]MetadataDetailed, *Response, error) MetadataCreate(context.Context, string, *Metadata) (*Response, error) MetadataUpdate(context.Context, string, *Metadata) (*Response, error) MetadataDeleteItem(context.Context, string, *MetadataItemOptions) (*Response, error) MetadataGetItem(context.Context, string, *MetadataItemOptions) (*MetadataDetailed, *Response, error) }
type NetworksService ¶
type NetworksService interface { List(context.Context, *NetworkListOptions) ([]Network, *Response, error) Get(context.Context, string) (*Network, *Response, error) Create(context.Context, *NetworkCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) UpdateName(context.Context, string, *Name) (*Network, *Response, error) ListNetworksWithSubnets(context.Context, *NetworksWithSubnetsOptions) ([]NetworkSubnetwork, *Response, error) PortList(context.Context, string) ([]PortsInstance, *Response, error) NetworksMetadata }
NetworksService is an interface for creating and managing Networks with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/networks
type NetworksServiceOp ¶
type NetworksServiceOp struct {
// contains filtered or unexported fields
}
NetworksServiceOp handles communication with Networks methods of the EdgecenterCloud API.
func (*NetworksServiceOp) Create ¶
func (s *NetworksServiceOp) Create(ctx context.Context, reqBody *NetworkCreateRequest) (*TaskResponse, *Response, error)
Create a Network.
func (*NetworksServiceOp) Delete ¶
func (s *NetworksServiceOp) Delete(ctx context.Context, networkID string) (*TaskResponse, *Response, error)
Delete the Network.
func (*NetworksServiceOp) List ¶
func (s *NetworksServiceOp) List(ctx context.Context, opts *NetworkListOptions) ([]Network, *Response, error)
List get networks.
func (*NetworksServiceOp) ListNetworksWithSubnets ¶
func (s *NetworksServiceOp) ListNetworksWithSubnets(ctx context.Context, opts *NetworksWithSubnetsOptions) ([]NetworkSubnetwork, *Response, error)
ListNetworksWithSubnets get networks with details of subnets.
func (*NetworksServiceOp) MetadataCreate ¶
func (s *NetworksServiceOp) MetadataCreate(ctx context.Context, networkID string, reqBody *Metadata) (*Response, error)
MetadataCreate or update network metadata.
func (*NetworksServiceOp) MetadataDeleteItem ¶
func (s *NetworksServiceOp) MetadataDeleteItem(ctx context.Context, networkID string, opts *MetadataItemOptions) (*Response, error)
MetadataDeleteItem a network metadata item by key.
func (*NetworksServiceOp) MetadataGetItem ¶
func (s *NetworksServiceOp) MetadataGetItem(ctx context.Context, networkID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
MetadataGetItem network detailed metadata.
func (*NetworksServiceOp) MetadataList ¶
func (s *NetworksServiceOp) MetadataList(ctx context.Context, networkID string) ([]MetadataDetailed, *Response, error)
MetadataList network detailed metadata items.
func (*NetworksServiceOp) MetadataUpdate ¶
func (s *NetworksServiceOp) MetadataUpdate(ctx context.Context, networkID string, reqBody *Metadata) (*Response, error)
MetadataUpdate network metadata.
func (*NetworksServiceOp) PortList ¶
func (s *NetworksServiceOp) PortList(ctx context.Context, networkID string) ([]PortsInstance, *Response, error)
PortList get instance ports by network_id.
func (*NetworksServiceOp) UpdateName ¶
func (s *NetworksServiceOp) UpdateName(ctx context.Context, networkID string, reqBody *Name) (*Network, *Response, error)
UpdateName of the network.
type NetworksWithSubnetsOptions ¶
type NetworksWithSubnetsOptions struct { NetworkID string `url:"network_id,omitempty" validate:"omitempty"` NetworkType string `url:"network_type,omitempty" validate:"omitempty"` OrderBy string `url:"order_by,omitempty" validate:"omitempty"` MetadataKV string `url:"metadata_kv,omitempty" validate:"omitempty"` MetadataK string `url:"metadata_k,omitempty" validate:"omitempty"` }
NetworksWithSubnetsOptions specifies the optional query parameters to ListNetworksWithSubnets method.
type NotificationThresholdUpdateRequest ¶
type NotificationThresholdUpdateRequest struct { LastMessage CombinedQuota `json:"last_message,omitempty" validate:"omitempty"` LastSending string `json:"last_sending,omitempty" validate:"omitempty"` Threshold int `json:"threshold" validate:"required"` }
type OperatingStatus ¶
type OperatingStatus string
const ( OperatingStatusOnline OperatingStatus = "ONLINE" OperatingStatusDraining OperatingStatus = "DRAINING" OperatingStatusOffline OperatingStatus = "OFFLINE" OperatingStatusDegraded OperatingStatus = "DEGRADED" OperatingStatusError OperatingStatus = "ERROR" OperatingStatusNoMonitor OperatingStatus = "NO_MONITOR" )
type Pool ¶
type Pool struct { ID string `json:"id"` Name string `json:"name"` LoadbalancerAlgorithm LoadbalancerAlgorithm `json:"lb_algorithm"` Protocol LoadbalancerPoolProtocol `json:"protocol"` Loadbalancers []ID `json:"loadbalancers"` Listeners []ID `json:"listeners"` Members []PoolMember `json:"members"` HealthMonitor *HealthMonitor `json:"healthmonitor,omitempty"` SessionPersistence *LoadbalancerSessionPersistence `json:"session_persistence,omitempty"` ProvisioningStatus ProvisioningStatus `json:"provisioning_status"` OperatingStatus OperatingStatus `json:"operating_status"` CreatorTaskID string `json:"creator_task_id"` TaskID string `json:"task_id"` TimeoutClientData int `json:"timeout_client_data"` TimeoutMemberData int `json:"timeout_member_data"` TimeoutMemberConnect int `json:"timeout_member_connect"` }
Pool represents an EdgecenterCloud Loadbalancer Pool.
type PoolCreateRequest ¶
type PoolCreateRequest struct {
LoadbalancerPoolCreateRequest
}
PoolCreateRequest represents a request to create a Loadbalancer Listener Pool. Used as a separate request to create Pool.
type PoolListOptions ¶
type PoolMember ¶
type PoolMember struct { ID string `json:"id"` OperatingStatus OperatingStatus `json:"operating_status,omitempty"` PoolMemberCreateRequest }
PoolMember represents an EdgecenterCloud Loadbalancer Pool PoolMember.
type PoolMemberCreateRequest ¶
type PoolMemberCreateRequest struct { ID string `json:"id,omitempty"` Address net.IP `json:"address" required:"true"` ProtocolPort int `json:"protocol_port" required:"true"` SubnetID string `json:"subnet_id,omitempty"` InstanceID string `json:"instance_id,omitempty"` Weight int `json:"weight,omitempty"` AdminStateUP bool `json:"admin_state_up,omitempty"` }
PoolMemberCreateRequest represents a request to create a Loadbalancer Pool PoolMember.
type PoolUpdateRequest ¶
type PoolUpdateRequest struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` LoadbalancerAlgorithm LoadbalancerAlgorithm `json:"lb_algorithm,omitempty"` SessionPersistence *LoadbalancerSessionPersistence `json:"session_persistence,omitempty"` Members []PoolMemberCreateRequest `json:"members,omitempty"` HealthMonitor *HealthMonitorCreateRequest `json:"healthmonitor,omitempty"` TimeoutClientData int `json:"timeout_client_data,omitempty"` TimeoutMemberData int `json:"timeout_member_data,omitempty"` TimeoutMemberConnect int `json:"timeout_member_connect,omitempty"` }
PoolUpdateRequest represents a request to update a Loadbalancer Listener Pool.
type Port ¶
type Port struct { NetworkID string `json:"network_id"` AllowedAddressPairs []PortsAllowedAddressPairs `json:"allowed_address_pairs"` InstanceID string `json:"instance_id"` PortID string `json:"port_id"` }
Port represents an EdgecenterCloud Port.
type PortsAllowedAddressPairs ¶ added in v2.0.28
type PortsAllowedAddressPairs struct { IPAddress string `json:"ip_address"` MacAddress string `json:"mac_address"` }
PortsAllowedAddressPairs represents allowed port address pair and/or subnet masks.
type PortsAllowedAddressPairsRequest ¶ added in v2.0.28
type PortsAllowedAddressPairsRequest struct {
AllowedAddressPairs []PortsAllowedAddressPairs `json:"allowed_address_pairs"`
}
PortsAllowedAddressPairsRequest represents a request to assign allowed address pairs for an instance port.
type PortsInstance ¶
type PortsInstance struct { InstanceID string `json:"instance_id"` InstanceName string `json:"instance_name"` ID string `json:"id"` }
PortsInstance represent instances ports.
type PortsSecurityGroupNames ¶
type PortsService ¶
type PortsService interface { Assign(context.Context, string, *PortsAllowedAddressPairsRequest) (*Port, *Response, error) EnablePortSecurity(context.Context, string) (*InstancePortInterface, *Response, error) DisablePortSecurity(context.Context, string) (*InstancePortInterface, *Response, error) }
PortsService is an interface for creating and managing Ports with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/ports
type PortsServiceOp ¶
type PortsServiceOp struct {
// contains filtered or unexported fields
}
PortsServiceOp handles communication with Ports methods of the EdgecenterCloud API.
func (*PortsServiceOp) Assign ¶
func (s *PortsServiceOp) Assign(ctx context.Context, portID string, reqBody *PortsAllowedAddressPairsRequest) (*Port, *Response, error)
Assign allowed address pairs for an instance port.
func (*PortsServiceOp) DisablePortSecurity ¶
func (s *PortsServiceOp) DisablePortSecurity(ctx context.Context, portID string) (*InstancePortInterface, *Response, error)
DisablePortSecurity for an instance interface.
func (*PortsServiceOp) EnablePortSecurity ¶
func (s *PortsServiceOp) EnablePortSecurity(ctx context.Context, portID string) (*InstancePortInterface, *Response, error)
EnablePortSecurity for an instance interface.
type Project ¶
type Project struct { ID int `json:"id"` ClientID int `json:"client_id"` CreatedAt string `json:"created_at"` Description string `json:"description"` IsDefault bool `json:"is_default"` Name string `json:"name"` State ProjectState `json:"state"` TaskID *string `json:"task_id"` }
Project represents a EdgecenterCloud Project configuration.
type ProjectCreateRequest ¶
type ProjectCreateRequest struct { Name string `json:"name" required:"true"` ClientID string `json:"client_id"` State string `json:"state"` Description string `json:"description"` }
ProjectCreateRequest represents a request to create a Project.
type ProjectListOptions ¶
type ProjectState ¶
type ProjectState string
ProjectState the model 'ProjectState'.
const ( ProjectStateActive ProjectState = "ACTIVE" ProjectStateDeleted ProjectState = "DELETED" ProjectStateDeleting ProjectState = "DELETING" )
List of ProjectState.
type ProjectUpdateRequest ¶
type ProjectUpdateRequest struct { Description string `json:"description" required:"true"` Name string `json:"name" required:"true"` }
ProjectUpdateRequest represents a request to update a Project.
type ProjectsService ¶
type ProjectsService interface { Get(context.Context, string) (*Project, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) Update(context.Context, string, *ProjectUpdateRequest) (*Project, *Response, error) List(context.Context, *ProjectListOptions) ([]Project, *Response, error) Create(context.Context, *ProjectCreateRequest) (*Project, *Response, error) }
ProjectsService is an interface for creating and managing Projects with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/projects
type ProjectsServiceOp ¶
type ProjectsServiceOp struct {
// contains filtered or unexported fields
}
ProjectsServiceOp handles communication with Projects methods of the EdgecenterCloud API.
func (*ProjectsServiceOp) Create ¶
func (s *ProjectsServiceOp) Create(ctx context.Context, reqBody *ProjectCreateRequest) (*Project, *Response, error)
Create a project.
func (*ProjectsServiceOp) Delete ¶
func (s *ProjectsServiceOp) Delete(ctx context.Context, projectID string) (*TaskResponse, *Response, error)
Delete a project.
func (*ProjectsServiceOp) List ¶
func (s *ProjectsServiceOp) List(ctx context.Context, opts *ProjectListOptions) ([]Project, *Response, error)
List gets projects.
func (*ProjectsServiceOp) Update ¶
func (s *ProjectsServiceOp) Update(ctx context.Context, projectID string, reqBody *ProjectUpdateRequest) (*Project, *Response, error)
Update a project.
type ProvisioningStatus ¶
type ProvisioningStatus string
const ( ProvisioningStatusActive ProvisioningStatus = "ACTIVE" ProvisioningStatusDeleted ProvisioningStatus = "DELETED" ProvisioningStatusError ProvisioningStatus = "ERROR" ProvisioningStatusPendingCreate ProvisioningStatus = "PENDING_CREATE" ProvisioningStatusPendingUpdate ProvisioningStatus = "PENDING_UPDATE" ProvisioningStatusPendingDelete ProvisioningStatus = "PENDING_DELETE" )
type QuotaNotificationThreshold ¶
type QuotaNotificationThreshold struct { LastMessage CombinedQuota `json:"last_message"` LastSending string `json:"last_sending"` Threshold int `json:"threshold"` ClientID int `json:"client_id"` }
type QuotasService ¶
type QuotasService interface { ListCombined(context.Context, *ListCombinedOptions) (*CombinedQuota, *Response, error) ListGlobal(context.Context, int) (*Quota, *Response, error) ListRegional(context.Context, int, int) (*Quota, *Response, error) DeleteNotificationThreshold(context.Context, int) (*Response, error) GetNotificationThreshold(context.Context, int) (*QuotaNotificationThreshold, *Response, error) UpdateNotificationThreshold(context.Context, int, *NotificationThresholdUpdateRequest) (*QuotaNotificationThreshold, *Response, error) }
QuotasService is an interface for creating and managing Quotas with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/quotas
type QuotasServiceOp ¶
type QuotasServiceOp struct {
// contains filtered or unexported fields
}
QuotasServiceOp handles communication with Quotas methods of the EdgecenterCloud API.
func (*QuotasServiceOp) DeleteNotificationThreshold ¶
func (s *QuotasServiceOp) DeleteNotificationThreshold(ctx context.Context, clientID int) (*Response, error)
DeleteNotificationThreshold delete a client's quota notification threshold.
func (*QuotasServiceOp) GetNotificationThreshold ¶
func (s *QuotasServiceOp) GetNotificationThreshold(ctx context.Context, clientID int) (*QuotaNotificationThreshold, *Response, error)
GetNotificationThreshold get a client's quota notification threshold.
func (*QuotasServiceOp) ListCombined ¶
func (s *QuotasServiceOp) ListCombined(ctx context.Context, opts *ListCombinedOptions) (*CombinedQuota, *Response, error)
ListCombined get combined client quotas, regional and global.
func (*QuotasServiceOp) ListGlobal ¶
ListGlobal get a global quota.
func (*QuotasServiceOp) ListRegional ¶
func (s *QuotasServiceOp) ListRegional(ctx context.Context, clientID, regionID int) (*Quota, *Response, error)
ListRegional get a quota by region.
func (*QuotasServiceOp) UpdateNotificationThreshold ¶
func (s *QuotasServiceOp) UpdateNotificationThreshold(ctx context.Context, clientID int, reqBody *NotificationThresholdUpdateRequest) (*QuotaNotificationThreshold, *Response, error)
UpdateNotificationThreshold update or create a client's quota notification threshold.
type Region ¶
type Region struct { HasKVM bool `json:"has_kvm"` HasK8S bool `json:"has_k8s"` DisplayName string `json:"display_name"` HasBaremetal bool `json:"has_baremetal"` VLANPhysicalNetwork string `json:"vlan_physical_network"` EndpointType RegionEndpointType `json:"endpoint_type"` Zone Zone `json:"zone"` SpiceProxyURL string `json:"spice_proxy_url"` KeystoneID int `json:"keystone_id"` KeystoneName string `json:"keystone_name"` Keystone Keystone `json:"keystone"` MetricsDatabaseID int `json:"metrics_database_id"` SerialProxyURL string `json:"serial_proxy_url"` ID int `json:"id"` TaskID *string `json:"task_id"` ExternalNetworkID string `json:"external_network_id"` AccessLevel string `json:"access_level"` CreatedOn string `json:"created_on"` AvailableVolumeTypes []string `json:"available_volume_types"` Country string `json:"country"` NoVNSProxyURL string `json:"novnc_proxy_url"` K8SMasterFlavorID string `json:"k8s_master_flavor_id"` State RegionState `json:"state"` MetricsDatabase MetricsDatabase `json:"metrics_database"` }
Region represents a EdgecenterCloud Region configuration.
type RegionEndpointType ¶
type RegionEndpointType string
const ( RegionEndpointTypePublic RegionEndpointType = "public" RegionEndpointTypeInternal RegionEndpointType = "internal" RegionEndpointTypeAdmin RegionEndpointType = "admin" )
type RegionGetOptions ¶
type RegionGetOptions struct {
ShowVolumeTypes bool `url:"show_volume_types,omitempty" validate:"omitempty"`
}
RegionGetOptions specifies the optional query parameters to Get method.
type RegionListOptions ¶
type RegionListOptions struct {
ShowVolumeTypes bool `url:"show_volume_types,omitempty" validate:"omitempty"`
}
RegionListOptions specifies the optional query parameters to List method.
type RegionState ¶
type RegionState string
const ( RegionStateNew RegionState = "NEW" RegionStateInactive RegionState = "INACTIVE" RegionStateActive RegionState = "ACTIVE" RegionStateMaintenance RegionState = "MAINTENANCE" RegionStateDeleting RegionState = "DELETING" RegionStateDeletionFailed RegionState = "DELETION_FAILED" RegionStateDeleted RegionState = "DELETED" )
type RegionsService ¶
type RegionsService interface { List(context.Context, *RegionListOptions) ([]Region, *Response, error) Get(context.Context, string, *RegionGetOptions) (*Region, *Response, error) }
RegionsService is an interface for creating and managing Regions with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/regions
type RegionsServiceOp ¶
type RegionsServiceOp struct {
// contains filtered or unexported fields
}
RegionsServiceOp handles communication with Regions methods of the EdgecenterCloud API.
func (*RegionsServiceOp) Get ¶
func (s *RegionsServiceOp) Get(ctx context.Context, regionID string, opts *RegionGetOptions) (*Region, *Response, error)
Get retrieves a single region by its ID.
func (*RegionsServiceOp) List ¶
func (s *RegionsServiceOp) List(ctx context.Context, opts *RegionListOptions) ([]Region, *Response, error)
List get regions.
type RemoteConsole ¶
type RequestCompletionCallback ¶
RequestCompletionCallback defines the type of the request callback function.
type Reservation ¶
type ReservedFixedIP ¶
type ReservedFixedIP struct { Region string `json:"region"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Name string `json:"name"` RegionID int `json:"region_id"` PortID string `json:"port_id,omitempty"` FixedIPAddress net.IP `json:"fixed_ip_address,omitempty"` TaskID string `json:"task_id"` IsVIP bool `json:"is_vip"` IsExternal bool `json:"is_external"` ProjectID int `json:"project_id"` NetworkID string `json:"network_id"` CreatorTaskID string `json:"creator_task_id"` Status string `json:"status"` SubnetID string `json:"subnet_id"` AllowedAddressPairs []PortsAllowedAddressPairs `json:"allowed_address_pairs"` Network Network `json:"network"` Reservation Reservation `json:"reservation"` }
ReservedFixedIP represents an EdgecenterCloud ReservedFixedIP.
type ReservedFixedIPCreateRequest ¶
type ReservedFixedIPCreateRequest struct { IsVIP bool `json:"is_vip"` Type ReservedFixedIPType `json:"type" required:"true" validate:"required,enum"` NetworkID string `json:"network_id,omitempty" validate:"rfe=Type:ip_address;any_subnet,omitempty,uuid4"` SubnetID string `json:"subnet_id,omitempty" validate:"rfe=Type:subnet,omitempty,uuid4"` IPAddress string `json:"ip_address,omitempty" validate:"rfe=Type:ip_address,omitempty"` }
type ReservedFixedIPListOptions ¶
type ReservedFixedIPListOptions struct { ExternalOnly bool `url:"external_only,omitempty" validate:"omitempty"` InternalOnly bool `url:"internal_only,omitempty" validate:"omitempty"` AvailableOnly bool `url:"available_only,omitempty" validate:"omitempty"` VIPOnly bool `url:"vip_only,omitempty" validate:"omitempty"` SearchPrefixIP string `url:"search_prefix_ip,omitempty" validate:"omitempty"` DeviceID string `url:"device_id,omitempty" validate:"omitempty"` Limit int `url:"limit,omitempty" validate:"omitempty"` Offset int `url:"offset,omitempty" validate:"omitempty"` }
ReservedFixedIPListOptions specifies the optional query parameters to get ReservedFixedIP List method.
type ReservedFixedIPType ¶
type ReservedFixedIPType string
type ReservedFixedIPsService ¶
type ReservedFixedIPsService interface { List(context.Context, *ReservedFixedIPListOptions) ([]ReservedFixedIP, *Response, error) Create(context.Context, *ReservedFixedIPCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) Get(context.Context, string) (*ReservedFixedIP, *Response, error) SwitchVIPStatus(context.Context, string, *SwitchVIPStatusRequest) (*ReservedFixedIP, *Response, error) ListInstancePorts(context.Context, string) ([]ReservedFixedIPInstancePort, *Response, error) AddInstancePorts(context.Context, string, *AddInstancePortsRequest) ([]ReservedFixedIPInstancePort, *Response, error) ReplaceInstancePorts(context.Context, string, *AddInstancePortsRequest) ([]ReservedFixedIPInstancePort, *Response, error) ListInstancePortsAvailable(context.Context, string) ([]ReservedFixedIPInstancePort, *Response, error) }
ReservedFixedIPsService is an interface for creating and managing Reserved Fixed IPs with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/reserved_fixed_ips
type ReservedFixedIPsServiceOp ¶
type ReservedFixedIPsServiceOp struct {
// contains filtered or unexported fields
}
ReservedFixedIPsServiceOp handles communication with Reserved Fixed IPs methods of the EdgecenterCloud API.
func (*ReservedFixedIPsServiceOp) AddInstancePorts ¶
func (s *ReservedFixedIPsServiceOp) AddInstancePorts(ctx context.Context, reservedFixedIPID string, reqBody *AddInstancePortsRequest) ([]ReservedFixedIPInstancePort, *Response, error)
AddInstancePorts that share a VIP.
func (*ReservedFixedIPsServiceOp) Create ¶
func (s *ReservedFixedIPsServiceOp) Create(ctx context.Context, reqBody *ReservedFixedIPCreateRequest) (*TaskResponse, *Response, error)
Create a Reserved Fixed IP.
func (*ReservedFixedIPsServiceOp) Delete ¶
func (s *ReservedFixedIPsServiceOp) Delete(ctx context.Context, reservedFixedIPID string) (*TaskResponse, *Response, error)
Delete a Reserved Fixed IP.
func (*ReservedFixedIPsServiceOp) Get ¶
func (s *ReservedFixedIPsServiceOp) Get(ctx context.Context, reservedFixedIPID string) (*ReservedFixedIP, *Response, error)
Get a Reserved Fixed IP.
func (*ReservedFixedIPsServiceOp) List ¶
func (s *ReservedFixedIPsServiceOp) List(ctx context.Context, opts *ReservedFixedIPListOptions) ([]ReservedFixedIP, *Response, error)
List get Reserved Fixed IPs.
func (*ReservedFixedIPsServiceOp) ListInstancePorts ¶
func (s *ReservedFixedIPsServiceOp) ListInstancePorts(ctx context.Context, reservedFixedIPID string) ([]ReservedFixedIPInstancePort, *Response, error)
ListInstancePorts that share a VIP.
func (*ReservedFixedIPsServiceOp) ListInstancePortsAvailable ¶
func (s *ReservedFixedIPsServiceOp) ListInstancePortsAvailable(ctx context.Context, reservedFixedIPID string) ([]ReservedFixedIPInstancePort, *Response, error)
ListInstancePortsAvailable for connecting to a VIP.
func (*ReservedFixedIPsServiceOp) ReplaceInstancePorts ¶
func (s *ReservedFixedIPsServiceOp) ReplaceInstancePorts(ctx context.Context, reservedFixedIPID string, reqBody *AddInstancePortsRequest) ([]ReservedFixedIPInstancePort, *Response, error)
ReplaceInstancePorts that share a VIP.
func (*ReservedFixedIPsServiceOp) SwitchVIPStatus ¶
func (s *ReservedFixedIPsServiceOp) SwitchVIPStatus(ctx context.Context, reservedFixedIPID string, reqBody *SwitchVIPStatusRequest) (*ReservedFixedIP, *Response, error)
SwitchVIPStatus of a Reserved Fixed IP.
type Response ¶
Response is a EdgecenterCloud response. This wraps the standard http.Response returned from EdgecenterCloud.
type ResponseError ¶
type ResponseError struct { // HTTP response that caused this error Response *http.Response // Error message Message string `json:"message"` // Attempts is the number of times the request was attempted when retries are enabled. Attempts int }
An ResponseError reports the error caused by an API request.
func (*ResponseError) Error ¶
func (r *ResponseError) Error() string
type RetryConfig ¶
type RetryConfig struct { RetryMax int RetryWaitMin *float64 // Minimum time to wait RetryWaitMax *float64 // Maximum time to wait Logger interface{} // Customer logger instance. Must implement either go-retryablehttp.Logger or go-retryablehttp.LeveledLogger }
RetryConfig sets the values used for enabling retries and backoffs for requests that fail with 429 or 500-level response codes using the go-retryablehttp client. RetryConfig.RetryMax must be configured to enable this behavior. RetryConfig.RetryWaitMin and RetryConfig.RetryWaitMax are optional, with the default values being 1.0 and 30.0, respectively.
Note: Opting to use the go-retryablehttp client will overwrite any custom HTTP client passed into New().
type RoleAssignment ¶
type RoleAssignment struct { ID int `json:"id"` ProjectID int `json:"project_id,omitempty"` ClientID int `json:"client_id,omitempty"` Role string `json:"role"` UserID int `json:"user_id"` }
RoleAssignment represents a EdgecenterCloud User Role Assignment configuration.
type Router ¶
type Router struct { Region string `json:"region"` UpdatedAt string `json:"updated_at"` CreatedAt string `json:"created_at"` Name string `json:"name"` ID string `json:"id"` RegionID int `json:"region_id"` ProjectID int `json:"project_id"` TaskID string `json:"task_id"` Status string `json:"status"` CreatorTaskID string `json:"creator_task_id"` ExternalGatewayInfo ExternalGatewayInfo `json:"external_gateway_info"` Interfaces []RouterInterface `json:"interfaces"` Routes []HostRoute `json:"routes"` }
Router represents an EdgecenterCloud Router.
type RouterAttachRequest ¶
type RouterAttachRequest struct {
SubnetID string `json:"subnet_id" required:"true" validate:"required"`
}
type RouterCreateRequest ¶
type RouterCreateRequest struct { Interfaces []RouterInterfaceCreate `json:"interfaces"` ExternalGatewayInfo ExternalGatewayInfoCreate `json:"external_gateway_info"` Name string `json:"name" required:"true" validate:"required"` Routes []HostRoute `json:"routes"` }
type RouterDetachRequest ¶
type RouterDetachRequest struct {
SubnetID string `json:"subnet_id" required:"true" validate:"required"`
}
type RouterInterface ¶
type RouterInterface struct { PortID string `json:"port_id"` IPAssignments []PortIP `json:"ip_assignments"` MacAddress string `json:"mac_address"` NetworkID string `json:"network_id"` }
RouterInterface represents a router instance interface.
type RouterInterfaceCreate ¶
type RouterUpdateRequest ¶
type RouterUpdateRequest struct { ExternalGatewayInfo ExternalGatewayInfoCreate `json:"external_gateway_info"` Name string `json:"name" required:"true" validate:"required"` Routes []HostRoute `json:"routes"` }
type RoutersService ¶
type RoutersService interface { List(context.Context) ([]Router, *Response, error) Create(context.Context, *RouterCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) Get(context.Context, string) (*Router, *Response, error) Update(context.Context, string, *RouterUpdateRequest) (*Router, *Response, error) Attach(context.Context, string, *RouterAttachRequest) (*Router, *Response, error) Detach(context.Context, string, *RouterDetachRequest) (*Router, *Response, error) }
RoutersService is an interface for creating and managing Routers with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/routers
type RoutersServiceOp ¶
type RoutersServiceOp struct {
// contains filtered or unexported fields
}
RoutersServiceOp handles communication with Routers methods of the EdgecenterCloud API.
func (*RoutersServiceOp) Attach ¶
func (s *RoutersServiceOp) Attach(ctx context.Context, routerID string, reqBody *RouterAttachRequest) (*Router, *Response, error)
Attach a subnet to a Router.
func (*RoutersServiceOp) Create ¶
func (s *RoutersServiceOp) Create(ctx context.Context, reqBody *RouterCreateRequest) (*TaskResponse, *Response, error)
Create a Router.
func (*RoutersServiceOp) Delete ¶
func (s *RoutersServiceOp) Delete(ctx context.Context, routerID string) (*TaskResponse, *Response, error)
Delete a Router.
func (*RoutersServiceOp) Detach ¶
func (s *RoutersServiceOp) Detach(ctx context.Context, routerID string, reqBody *RouterDetachRequest) (*Router, *Response, error)
Detach a subnet from a Router.
func (*RoutersServiceOp) Update ¶
func (s *RoutersServiceOp) Update(ctx context.Context, routerID string, reqBody *RouterUpdateRequest) (*Router, *Response, error)
Update a Router.
type RuleCreateRequest ¶
type RuleCreateRequest struct { Description *string `json:"description"` RemoteIPPrefix *string `json:"remote_ip_prefix,omitempty"` SecurityGroupID *string `json:"security_group_id,omitempty"` PortRangeMax *int `json:"port_range_max,omitempty"` Protocol SecurityGroupRuleProtocol `json:"protocol,omitempty"` PortRangeMin *int `json:"port_range_min,omitempty"` EtherType EtherType `json:"ethertype,omitempty" required:"true"` RemoteGroupID *string `json:"remote_group_id,omitempty"` Direction SecurityGroupRuleDirection `json:"direction"` }
type RuleUpdateRequest ¶
type RuleUpdateRequest struct { ID string `json:"id"` Description string `json:"description"` RemoteIPPrefix string `json:"remote_ip_prefix,omitempty"` SecurityGroupID string `json:"security_group_id,omitempty"` PortRangeMax int `json:"port_range_max,omitempty"` Protocol SecurityGroupRuleProtocol `json:"protocol,omitempty"` PortRangeMin int `json:"port_range_min,omitempty"` EtherType EtherType `json:"ethertype,omitempty" required:"true"` RemoteGroupID string `json:"remote_group_id,omitempty"` Direction SecurityGroupRuleDirection `json:"direction"` }
type Secret ¶
type Secret struct { Expiration string `json:"expiration"` Algorithm string `json:"algorithm"` Name string `json:"name"` Mode string `json:"mode"` ID string `json:"id"` BitLength int `json:"bit_length"` Created string `json:"created"` Status string `json:"status"` SecretType string `json:"secret_type"` ContentTypes map[string]string `json:"content_types"` }
Secret represents an EdgecenterCloud Secret.
type SecretCreateRequest ¶
type SecretCreateRequest struct { Expiration string `json:"expiration,omitempty"` PayloadContentType string `json:"payload_content_type" required:"true" validate:"required"` Algorithm string `json:"algorithm,omitempty"` Name string `json:"name" required:"true" validate:"required"` Mode string `json:"mode,omitempty"` BitLength int `json:"bit_length,omitempty"` PayloadContentEncoding string `json:"payload_content_encoding" required:"true" validate:"required"` Payload string `json:"payload" required:"true" validate:"required"` SecretType SecretType `json:"secret_type" required:"true" validate:"required"` }
type SecretCreateRequestV2 ¶
type SecretType ¶
type SecretType string
const ( SecretTypeSymmetric SecretType = "symmetric" SecretTypePublic SecretType = "public" SecretTypePrivate SecretType = "private" SecretTypePassphrase SecretType = "passphrase" SecretTypeCertificate SecretType = "certificate" SecretTypeOpaque SecretType = "opaque" )
type SecretsService ¶
type SecretsService interface { List(context.Context) ([]Secret, *Response, error) Create(context.Context, *SecretCreateRequest) (*TaskResponse, *Response, error) CreateV2(context.Context, *SecretCreateRequestV2) (*TaskResponse, *Response, error) Get(context.Context, string) (*Secret, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) }
SecretsService is an interface for creating and managing Secrets with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/secrets
type SecretsServiceOp ¶
type SecretsServiceOp struct {
// contains filtered or unexported fields
}
SecretsServiceOp handles communication with Secrets methods of the EdgecenterCloud API.
func (*SecretsServiceOp) Create ¶
func (s *SecretsServiceOp) Create(ctx context.Context, reqBody *SecretCreateRequest) (*TaskResponse, *Response, error)
Create a Secret.
func (*SecretsServiceOp) CreateV2 ¶
func (s *SecretsServiceOp) CreateV2(ctx context.Context, reqBody *SecretCreateRequestV2) (*TaskResponse, *Response, error)
CreateV2 a Secret V2.
func (*SecretsServiceOp) Delete ¶
func (s *SecretsServiceOp) Delete(ctx context.Context, secretID string) (*TaskResponse, *Response, error)
Delete a Secret.
type SecurityGroup ¶
type SecurityGroup struct { ID string `json:"id"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` RevisionNumber int `json:"revision_number"` Name string `json:"name"` Description string `json:"description"` SecurityGroupRules []SecurityGroupRule `json:"security_group_rules"` Metadata []MetadataDetailed `json:"metadata"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` Tags []string `json:"tags"` }
SecurityGroup represents a EdgecenterCloud Security Group.
type SecurityGroupCreateRequest ¶
type SecurityGroupCreateRequest struct { SecurityGroup SecurityGroupCreateRequestInner `json:"security_group" required:"true"` Instances []ID `json:"instances,omitempty"` }
SecurityGroupCreateRequest represents a request to create a Security Group.
type SecurityGroupCreateRequestInner ¶
type SecurityGroupCreateRequestInner struct { Name string `json:"name" required:"true"` Description *string `json:"description,omitempty"` Metadata Metadata `json:"metadata,omitempty"` Tags []string `json:"tags,omitempty"` SecurityGroupRules []RuleCreateRequest `json:"security_group_rules,omitempty"` }
type SecurityGroupListOptions ¶
type SecurityGroupListOptions struct { MetadataKV string `url:"metadata_kv,omitempty" validate:"omitempty"` MetadataK string `url:"metadata_k,omitempty" validate:"omitempty"` }
SecurityGroupListOptions specifies the optional query parameters to List method.
type SecurityGroupRule ¶
type SecurityGroupRule struct { ID string `json:"id"` SecurityGroupID string `json:"security_group_id"` RemoteGroupID string `json:"remote_group_id"` Direction SecurityGroupRuleDirection `json:"direction"` EtherType *EtherType `json:"ethertype"` Protocol *SecurityGroupRuleProtocol `json:"protocol"` PortRangeMax *int `json:"port_range_max"` PortRangeMin *int `json:"port_range_min"` Description *string `json:"description"` RemoteIPPrefix *string `json:"remote_ip_prefix"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` RevisionNumber int `json:"revision_number"` }
SecurityGroupRule represents a EdgecenterCloud Security Group Rule.
type SecurityGroupRuleDirection ¶
type SecurityGroupRuleDirection string
const ( SGRuleDirectionEgress SecurityGroupRuleDirection = "egress" SGRuleDirectionIngress SecurityGroupRuleDirection = "ingress" )
func (SecurityGroupRuleDirection) IsValid ¶ added in v2.0.11
func (rd SecurityGroupRuleDirection) IsValid() error
func (SecurityGroupRuleDirection) List ¶ added in v2.0.11
func (rd SecurityGroupRuleDirection) List() []SecurityGroupRuleDirection
func (*SecurityGroupRuleDirection) MarshalJSON ¶ added in v2.0.11
func (rd *SecurityGroupRuleDirection) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface.
func (SecurityGroupRuleDirection) String ¶ added in v2.0.11
func (rd SecurityGroupRuleDirection) String() string
func (SecurityGroupRuleDirection) StringList ¶ added in v2.0.11
func (rd SecurityGroupRuleDirection) StringList() []string
func (*SecurityGroupRuleDirection) UnmarshalJSON ¶ added in v2.0.11
func (rd *SecurityGroupRuleDirection) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface.
func (SecurityGroupRuleDirection) ValidOrNil ¶ added in v2.0.11
func (rd SecurityGroupRuleDirection) ValidOrNil() (*SecurityGroupRuleDirection, error)
type SecurityGroupRuleProtocol ¶
type SecurityGroupRuleProtocol string
const ( SGRuleProtocolANY SecurityGroupRuleProtocol = "any" SGRuleProtocolAH SecurityGroupRuleProtocol = "ah" SGRuleProtocolDCCP SecurityGroupRuleProtocol = "dccp" SGRuleProtocolEGP SecurityGroupRuleProtocol = "egp" SGRuleProtocolESP SecurityGroupRuleProtocol = "esp" SGRuleProtocolGRE SecurityGroupRuleProtocol = "gre" SGRuleProtocolICMP SecurityGroupRuleProtocol = "icmp" SGRuleProtocolIGMP SecurityGroupRuleProtocol = "igmp" SGRuleProtocolIPIP SecurityGroupRuleProtocol = "ipip" SGRuleProtocolOSPF SecurityGroupRuleProtocol = "ospf" SGRuleProtocolPGM SecurityGroupRuleProtocol = "pgm" SGRuleProtocolRSVP SecurityGroupRuleProtocol = "rsvp" SGRuleProtocolSCTP SecurityGroupRuleProtocol = "sctp" SGRuleProtocolTCP SecurityGroupRuleProtocol = "tcp" SGRuleProtocolUDP SecurityGroupRuleProtocol = "udp" SGRuleProtocolUDPLITE SecurityGroupRuleProtocol = "udplite" SGRuleProtocolVRRP SecurityGroupRuleProtocol = "vrrp" SGRuleProtocolIPEncap SecurityGroupRuleProtocol = "ipencap" )
func (SecurityGroupRuleProtocol) IsValid ¶ added in v2.0.11
func (p SecurityGroupRuleProtocol) IsValid() error
func (SecurityGroupRuleProtocol) List ¶ added in v2.0.11
func (p SecurityGroupRuleProtocol) List() []SecurityGroupRuleProtocol
func (*SecurityGroupRuleProtocol) MarshalJSON ¶ added in v2.0.11
func (p *SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error)
MarshalJSON - implements Marshaler interface.
func (SecurityGroupRuleProtocol) String ¶ added in v2.0.11
func (p SecurityGroupRuleProtocol) String() string
func (SecurityGroupRuleProtocol) StringList ¶ added in v2.0.11
func (p SecurityGroupRuleProtocol) StringList() []string
func (*SecurityGroupRuleProtocol) UnmarshalJSON ¶ added in v2.0.11
func (p *SecurityGroupRuleProtocol) UnmarshalJSON(data []byte) error
UnmarshalJSON - implements Unmarshaler interface.
func (SecurityGroupRuleProtocol) ValidOrNil ¶ added in v2.0.11
func (p SecurityGroupRuleProtocol) ValidOrNil() (*SecurityGroupRuleProtocol, error)
type SecurityGroupUpdateRequest ¶
type SecurityGroupUpdateRequest struct { Name string `json:"name"` ChangedRules []ChangedRules `json:"changed_rules"` }
type SecurityGroupsMetadata ¶
type SecurityGroupsMetadata interface { MetadataList(context.Context, string) ([]MetadataDetailed, *Response, error) MetadataCreate(context.Context, string, *Metadata) (*Response, error) MetadataUpdate(context.Context, string, *Metadata) (*Response, error) MetadataDeleteItem(context.Context, string, *MetadataItemOptions) (*Response, error) MetadataGetItem(context.Context, string, *MetadataItemOptions) (*MetadataDetailed, *Response, error) }
type SecurityGroupsRules ¶
type SecurityGroupsRules interface { RuleCreate(context.Context, string, *RuleCreateRequest) (*SecurityGroupRule, *Response, error) RuleDelete(context.Context, string) (*TaskResponse, *Response, error) RuleUpdate(context.Context, string, *RuleUpdateRequest) (*SecurityGroupRule, *Response, error) }
type SecurityGroupsService ¶
type SecurityGroupsService interface { List(context.Context, *SecurityGroupListOptions) ([]SecurityGroup, *Response, error) Get(context.Context, string) (*SecurityGroup, *Response, error) Create(context.Context, *SecurityGroupCreateRequest) (*SecurityGroup, *Response, error) Delete(context.Context, string) (*Response, error) Update(context.Context, string, *SecurityGroupUpdateRequest) (*SecurityGroup, *Response, error) DeepCopy(context.Context, string, *Name) (*Response, error) SecurityGroupsRules SecurityGroupsMetadata }
SecurityGroupsService is an interface for creating and managing Security Groups (Firewalls) with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/securitygroups
type SecurityGroupsServiceOp ¶
type SecurityGroupsServiceOp struct {
// contains filtered or unexported fields
}
SecurityGroupsServiceOp handles communication with Security Groups (Firewalls) methods of the EdgecenterCloud API.
func (*SecurityGroupsServiceOp) Create ¶
func (s *SecurityGroupsServiceOp) Create(ctx context.Context, reqBody *SecurityGroupCreateRequest) (*SecurityGroup, *Response, error)
Create a Security Group.
func (*SecurityGroupsServiceOp) DeepCopy ¶
func (s *SecurityGroupsServiceOp) DeepCopy(ctx context.Context, securityGroupID string, reqBody *Name) (*Response, error)
DeepCopy creates a deep copy of a security group.
func (*SecurityGroupsServiceOp) Delete ¶
func (s *SecurityGroupsServiceOp) Delete(ctx context.Context, securityGroupID string) (*Response, error)
Delete the Security Group.
func (*SecurityGroupsServiceOp) Get ¶
func (s *SecurityGroupsServiceOp) Get(ctx context.Context, securityGroupID string) (*SecurityGroup, *Response, error)
Get individual Security Group.
func (*SecurityGroupsServiceOp) List ¶
func (s *SecurityGroupsServiceOp) List(ctx context.Context, opts *SecurityGroupListOptions) ([]SecurityGroup, *Response, error)
List get security groups.
func (*SecurityGroupsServiceOp) MetadataCreate ¶
func (s *SecurityGroupsServiceOp) MetadataCreate(ctx context.Context, securityGroupID string, reqBody *Metadata) (*Response, error)
MetadataCreate or update security group metadata.
func (*SecurityGroupsServiceOp) MetadataDeleteItem ¶
func (s *SecurityGroupsServiceOp) MetadataDeleteItem(ctx context.Context, securityGroupID string, opts *MetadataItemOptions) (*Response, error)
MetadataDeleteItem a security group metadata item by key.
func (*SecurityGroupsServiceOp) MetadataGetItem ¶
func (s *SecurityGroupsServiceOp) MetadataGetItem(ctx context.Context, securityGroupID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
MetadataGetItem security group detailed metadata.
func (*SecurityGroupsServiceOp) MetadataList ¶
func (s *SecurityGroupsServiceOp) MetadataList(ctx context.Context, securityGroupID string) ([]MetadataDetailed, *Response, error)
MetadataList security group detailed metadata items.
func (*SecurityGroupsServiceOp) MetadataUpdate ¶
func (s *SecurityGroupsServiceOp) MetadataUpdate(ctx context.Context, securityGroupID string, reqBody *Metadata) (*Response, error)
MetadataUpdate security group metadata.
func (*SecurityGroupsServiceOp) RuleCreate ¶
func (s *SecurityGroupsServiceOp) RuleCreate(ctx context.Context, securityGroupID string, reqBody *RuleCreateRequest) (*SecurityGroupRule, *Response, error)
RuleCreate to a security group.
func (*SecurityGroupsServiceOp) RuleDelete ¶
func (s *SecurityGroupsServiceOp) RuleDelete(ctx context.Context, securityGroupID string) (*TaskResponse, *Response, error)
RuleDelete a security group rule. todo cloud-api deletes rule without tash.
func (*SecurityGroupsServiceOp) RuleUpdate ¶
func (s *SecurityGroupsServiceOp) RuleUpdate(ctx context.Context, securityGroupID string, reqBody *RuleUpdateRequest) (*SecurityGroupRule, *Response, error)
RuleUpdate a security group rule.
func (*SecurityGroupsServiceOp) Update ¶
func (s *SecurityGroupsServiceOp) Update(ctx context.Context, securityGroupID string, reqBody *SecurityGroupUpdateRequest) (*SecurityGroup, *Response, error)
Update a Security Group.
type ServerGroup ¶
type ServerGroup struct { ID string `json:"servergroup_id"` Policy ServerGroupPolicy `json:"policy"` Name string `json:"name"` Instances []ServerGroupInstance `json:"instances"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` Region string `json:"region"` }
ServerGroup represents an EdgecenterCloud Server Group.
type ServerGroupCreateRequest ¶
type ServerGroupCreateRequest struct { Name string `json:"name" required:"true"` Policy ServerGroupPolicy `json:"policy" required:"true" validate:"enum"` }
ServerGroupCreateRequest represents a request to create a Server Group.
type ServerGroupInstance ¶
type ServerGroupInstance struct { InstanceID string `json:"instance_id"` InstanceName string `json:"instance_name"` }
ServerGroupInstance represent an instances in server group.
type ServerGroupPolicy ¶
type ServerGroupPolicy string
const ( ServerGroupPolicyAffinity ServerGroupPolicy = "affinity" ServerGroupPolicyAntiAffinity ServerGroupPolicy = "anti-affinity" )
type ServerGroupsService ¶
type ServerGroupsService interface { List(context.Context) ([]ServerGroup, *Response, error) Get(context.Context, string) (*ServerGroup, *Response, error) Create(context.Context, *ServerGroupCreateRequest) (*ServerGroup, *Response, error) Delete(context.Context, string) (*Response, error) }
ServerGroupsService is an interface for creating and managing Server Groups with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/servergroups
type ServerGroupsServiceOp ¶
type ServerGroupsServiceOp struct {
// contains filtered or unexported fields
}
ServerGroupsServiceOp handles communication with Server Groups methods of the EdgecenterCloud API.
func (*ServerGroupsServiceOp) Create ¶
func (s *ServerGroupsServiceOp) Create(ctx context.Context, reqBody *ServerGroupCreateRequest) (*ServerGroup, *Response, error)
Create a Server Group.
func (*ServerGroupsServiceOp) Delete ¶
func (s *ServerGroupsServiceOp) Delete(ctx context.Context, serverGroupID string) (*Response, error)
Delete the Server Group.
func (*ServerGroupsServiceOp) Get ¶
func (s *ServerGroupsServiceOp) Get(ctx context.Context, serverGroupID string) (*ServerGroup, *Response, error)
Get individual Server Group.
func (*ServerGroupsServiceOp) List ¶
func (s *ServerGroupsServiceOp) List(ctx context.Context) ([]ServerGroup, *Response, error)
List get Server Groups.
type SessionPersistence ¶
type SessionPersistence string
const ( SessionPersistenceAppCookie SessionPersistence = "APP_COOKIE" SessionPersistenceHTTPCookie SessionPersistence = "HTTP_COOKIE" SessionPersistenceSourceIP SessionPersistence = "SOURCE_IP" )
type Snapshot ¶
type Snapshot struct { Region string `json:"region"` UpdatedAt *string `json:"updated_at"` CreatedAt string `json:"created_at"` Name string `json:"name"` ID string `json:"id"` RegionID int `json:"region_id"` ProjectID int `json:"project_id"` TaskID *string `json:"task_id"` Status string `json:"status"` CreatorTaskID *string `json:"creator_task_id"` Size int `json:"size"` VolumeID string `json:"volume_id"` Description string `json:"description"` Metadata Metadata `json:"metadata"` }
Snapshot represents an EdgecenterCloud Snapshot.
type SnapshotCreateRequest ¶
type SnapshotListOptions ¶
type SnapshotListOptions struct { VolumeID string `url:"volume_id,omitempty" validate:"omitempty"` InstanceID string `url:"instance_id,omitempty" validate:"omitempty"` ScheduleID string `url:"schedule_id,omitempty" validate:"omitempty"` LifecyclePolicyID int `url:"lifecycle_policy_id,omitempty" validate:"omitempty"` Limit int `url:"limit,omitempty" validate:"omitempty"` Offset int `url:"offset,omitempty" validate:"omitempty"` }
SnapshotListOptions specifies the optional query parameters to List method.
type SnapshotsService ¶
type SnapshotsService interface { List(context.Context, *SnapshotListOptions) ([]Snapshot, *Response, error) Create(context.Context, *SnapshotCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) Get(context.Context, string) (*Snapshot, *Response, error) MetadataUpdate(context.Context, string, *MetadataCreateRequest) (*Snapshot, *Response, error) }
SnapshotsService is an interface for creating and managing Snapshots with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/snapshots
type SnapshotsServiceOp ¶
type SnapshotsServiceOp struct {
// contains filtered or unexported fields
}
SnapshotsServiceOp handles communication with Snapshots methods of the EdgecenterCloud API.
func (*SnapshotsServiceOp) Create ¶
func (s *SnapshotsServiceOp) Create(ctx context.Context, reqBody *SnapshotCreateRequest) (*TaskResponse, *Response, error)
Create a Snapshot.
func (*SnapshotsServiceOp) Delete ¶
func (s *SnapshotsServiceOp) Delete(ctx context.Context, snapshotID string) (*TaskResponse, *Response, error)
Delete a Snapshot.
func (*SnapshotsServiceOp) Get ¶
func (s *SnapshotsServiceOp) Get(ctx context.Context, snapshotID string) (*Snapshot, *Response, error)
Get a Snapshot.
func (*SnapshotsServiceOp) List ¶
func (s *SnapshotsServiceOp) List(ctx context.Context, opts *SnapshotListOptions) ([]Snapshot, *Response, error)
List get Snapshots.
func (*SnapshotsServiceOp) MetadataUpdate ¶
func (s *SnapshotsServiceOp) MetadataUpdate(ctx context.Context, snapshotID string, reqBody *MetadataCreateRequest) (*Snapshot, *Response, error)
MetadataUpdate updates snapshot metadata.
type Subnetwork ¶
type Subnetwork struct { ID string `json:"id"` Name string `json:"name"` NetworkID string `json:"network_id"` IPVersion int `json:"ip_version"` EnableDHCP bool `json:"enable_dhcp"` ConnectToNetworkRouter bool `json:"connect_to_network_router"` CIDR string `json:"cidr"` // TODO add cidr parsing. CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` CreatorTaskID string `json:"creator_task_id"` TaskID string `json:"task_id"` AvailableIps int `json:"available_ips"` TotalIps int `json:"total_ips"` HasRouter bool `json:"has_router"` DNSNameservers []net.IP `json:"dns_nameservers"` HostRoutes []HostRoute `json:"host_routes"` GatewayIP net.IP `json:"gateway_ip"` Metadata []MetadataDetailed `json:"metadata,omitempty"` Region string `json:"region"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` }
Subnetwork represents an EdgecenterCloud Subnetwork.
type SubnetworkCreateRequest ¶
type SubnetworkCreateRequest struct { Name string `json:"name" required:"true"` NetworkID string `json:"network_id" required:"true"` EnableDHCP bool `json:"enable_dhcp,omitempty"` CIDR string `json:"cidr" required:"true"` ConnectToNetworkRouter bool `json:"connect_to_network_router"` DNSNameservers []net.IP `json:"dns_nameservers,omitempty"` GatewayIP *net.IP `json:"gateway_ip,omitempty"` Metadata Metadata `json:"metadata,omitempty"` HostRoutes []HostRoute `json:"host_routes,omitempty"` }
SubnetworkCreateRequest represents a request to create a Subnetwork.
type SubnetworkListOptions ¶
type SubnetworkListOptions struct { NetworkID string `url:"network_id,omitempty" validate:"omitempty"` MetadataKV string `url:"metadata_kv,omitempty" validate:"omitempty"` MetadataK string `url:"metadata_k,omitempty" validate:"omitempty"` }
SubnetworkListOptions specifies the optional query parameters to List method.
type SubnetworkUpdateRequest ¶
type SubnetworkUpdateRequest struct { Name string `json:"name,omitempty"` DNSNameservers []net.IP `json:"dns_nameservers"` EnableDHCP bool `json:"enable_dhcp"` HostRoutes []HostRoute `json:"host_routes"` GatewayIP *net.IP `json:"gateway_ip"` }
SubnetworkUpdateRequest represents a request to update a Subnetwork properties.
type SubnetworksMetadata ¶
type SubnetworksMetadata interface { MetadataList(context.Context, string) ([]MetadataDetailed, *Response, error) MetadataCreate(context.Context, string, *Metadata) (*Response, error) MetadataUpdate(context.Context, string, *Metadata) (*Response, error) MetadataDeleteItem(context.Context, string, *MetadataItemOptions) (*Response, error) MetadataGetItem(context.Context, string, *MetadataItemOptions) (*MetadataDetailed, *Response, error) }
type SubnetworksService ¶
type SubnetworksService interface { List(context.Context, *SubnetworkListOptions) ([]Subnetwork, *Response, error) Get(context.Context, string) (*Subnetwork, *Response, error) Create(context.Context, *SubnetworkCreateRequest) (*TaskResponse, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) Update(context.Context, string, *SubnetworkUpdateRequest) (*Subnetwork, *Response, error) SubnetworksMetadata }
SubnetworksService is an interface for creating and managing Subnetworks with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/subnets
type SubnetworksServiceOp ¶
type SubnetworksServiceOp struct {
// contains filtered or unexported fields
}
SubnetworksServiceOp handles communication with Subnetworks methods of the EdgecenterCloud API.
func (*SubnetworksServiceOp) Create ¶
func (s *SubnetworksServiceOp) Create(ctx context.Context, reqBody *SubnetworkCreateRequest) (*TaskResponse, *Response, error)
Create a Subnetwork.
func (*SubnetworksServiceOp) Delete ¶
func (s *SubnetworksServiceOp) Delete(ctx context.Context, subnetworkID string) (*TaskResponse, *Response, error)
Delete the Subnetwork.
func (*SubnetworksServiceOp) Get ¶
func (s *SubnetworksServiceOp) Get(ctx context.Context, subnetworkID string) (*Subnetwork, *Response, error)
Get individual Subnetwork.
func (*SubnetworksServiceOp) List ¶
func (s *SubnetworksServiceOp) List(ctx context.Context, opts *SubnetworkListOptions) ([]Subnetwork, *Response, error)
List get subnetworks.
func (*SubnetworksServiceOp) MetadataCreate ¶
func (s *SubnetworksServiceOp) MetadataCreate(ctx context.Context, subnetworkID string, reqBody *Metadata) (*Response, error)
MetadataCreate or update subnetwork metadata.
func (*SubnetworksServiceOp) MetadataDeleteItem ¶
func (s *SubnetworksServiceOp) MetadataDeleteItem(ctx context.Context, subnetworkID string, opts *MetadataItemOptions) (*Response, error)
MetadataDeleteItem a subnetwork metadata item by key.
func (*SubnetworksServiceOp) MetadataGetItem ¶
func (s *SubnetworksServiceOp) MetadataGetItem(ctx context.Context, subnetworkID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
MetadataGetItem subnetwork detailed metadata.
func (*SubnetworksServiceOp) MetadataList ¶
func (s *SubnetworksServiceOp) MetadataList(ctx context.Context, subnetworkID string) ([]MetadataDetailed, *Response, error)
MetadataList subnetwork detailed metadata items.
func (*SubnetworksServiceOp) MetadataUpdate ¶
func (s *SubnetworksServiceOp) MetadataUpdate(ctx context.Context, subnetworkID string, reqBody *Metadata) (*Response, error)
MetadataUpdate subnetwork metadata.
func (*SubnetworksServiceOp) Update ¶
func (s *SubnetworksServiceOp) Update(ctx context.Context, subnetworkID string, reqBody *SubnetworkUpdateRequest) (*Subnetwork, *Response, error)
Update the Subnetwork properties.
type SwitchVIPStatusRequest ¶
type SwitchVIPStatusRequest struct {
IsVIP bool `json:"is_vip"`
}
type Task ¶
type Task struct { ID string `json:"id"` TaskType string `json:"task_type"` ProjectID int `json:"project_id"` RegionID int `json:"region_id"` ClientID int `json:"client_id"` UserID int `json:"user_id"` UserClientID int `json:"user_client_id"` State TaskState `json:"state"` Data *map[string]interface{} `json:"data"` CreatedResources map[string]interface{} `json:"created_resources"` RequestID string `json:"request_id"` Error *string `json:"error"` CreatedOn string `json:"created_on"` UpdatedOn *string `json:"updated_on,omitempty"` FinishedOn *string `json:"finished_on,omitempty"` AcknowledgedAt string `json:"acknowledged_at,omitempty"` AcknowledgedBy int `json:"acknowledged_by,omitempty"` JobID string `json:"job_id"` ScheduleID string `json:"schedule_id"` LifecyclePolicyID int `json:"lifecycle_policy_id"` }
Task represents an EdgecenterCloud Task.
type TaskListOptions ¶
type TaskListOptions struct { ClientID int `url:"client_id,omitempty" validate:"omitempty"` ProjectID int `url:"project_id,omitempty" validate:"omitempty"` RegionID int `url:"region_id,omitempty" validate:"omitempty"` ScheduleID string `url:"schedule_id,omitempty" validate:"omitempty"` LifecyclePolicyID int `url:"lifecycle_policy_id,omitempty" validate:"omitempty"` IsAcknowledged bool `url:"is_acknowledged,omitempty" validate:"omitempty"` FromTimestamp string `url:"from_timestamp,omitempty" validate:"omitempty"` ToTimestamp string `url:"to_timestamp,omitempty" validate:"omitempty"` Limit int `url:"limit,omitempty" validate:"omitempty"` Offset int `url:"offset,omitempty" validate:"omitempty"` TaskType string `url:"task_type,omitempty" validate:"omitempty"` State TaskState `url:"state,omitempty" validate:"omitempty"` Sorting TaskSorting `url:"sorting,omitempty" validate:"omitempty"` }
type TaskResponse ¶
type TaskResponse struct {
Tasks []string `json:"tasks"`
}
TaskResponse is an EdgecenterCloud response with list of created tasks.
type TaskSorting ¶
type TaskSorting string
const ( TaskSortingAsc TaskSorting = "asc" TaskSortingDesc TaskSorting = "desc" )
type TasksService ¶
type TasksService interface { ListActive(context.Context) ([]Task, *Response, error) Acknowledge(context.Context, string) (*Task, *Response, error) AcknowledgeAll(context.Context, *TaskAcknowledgeAllOptions) (*Response, error) Get(context.Context, string) (*Task, *Response, error) List(context.Context, *TaskListOptions) ([]Task, *Response, error) }
TasksService is an interface for managing Tasks with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/tasks
type TasksServiceOp ¶
type TasksServiceOp struct {
// contains filtered or unexported fields
}
TasksServiceOp handles communication with Tasks methods of the EdgecenterCloud API.
func (*TasksServiceOp) Acknowledge ¶
Acknowledge one task on project scope.
func (*TasksServiceOp) AcknowledgeAll ¶
func (s *TasksServiceOp) AcknowledgeAll(ctx context.Context, opts *TaskAcknowledgeAllOptions) (*Response, error)
AcknowledgeAll client tasks in project or region.
func (*TasksServiceOp) List ¶
func (s *TasksServiceOp) List(ctx context.Context, opts *TaskListOptions) ([]Task, *Response, error)
List gets tasks.
func (*TasksServiceOp) ListActive ¶
ListActive get active tasks.
type UpdateAssignmentRequest ¶
type User ¶
type User struct { Activated bool `json:"activated"` IsAdmin bool `json:"is_admin"` ID int `json:"id"` Email string `json:"email"` Name string `json:"name"` }
User represents a EdgecenterCloud User configuration.
type UserListOptions ¶
type UserListOptions struct {
ClientID int `url:"client_id,omitempty" validate:"omitempty"`
}
UserListOptions specifies the optional query parameters to List method.
type UserRoleListOptions ¶
type UserRoleListOptions struct { ClientID int `url:"client_id,omitempty" validate:"omitempty"` ProjectID int `url:"project_id,omitempty" validate:"omitempty"` }
UserRoleListOptions specifies the optional query parameters to ListRoles method.
type UsersService ¶
type UsersService interface { List(context.Context, *UserListOptions) ([]User, *Response, error) ListRoles(context.Context, *UserRoleListOptions) ([]UserRole, *Response, error) ListAssignment(context.Context, *UserRoleListOptions) ([]RoleAssignment, *Response, error) DeleteAssignment(context.Context, int) (*Response, error) UpdateAssignment(context.Context, int, *UpdateAssignmentRequest) (*Response, error) AssignRole(context.Context, *UpdateAssignmentRequest) (*UserRole, *Response, error) }
UsersService is an interface for creating and managing UsersService with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/users
type UsersServiceOp ¶
type UsersServiceOp struct {
// contains filtered or unexported fields
}
UsersServiceOp handles communication with Users methods of the EdgecenterCloud API.
func (*UsersServiceOp) AssignRole ¶
func (s *UsersServiceOp) AssignRole(ctx context.Context, reqBody *UpdateAssignmentRequest) (*UserRole, *Response, error)
AssignRole to an existing user.
func (*UsersServiceOp) DeleteAssignment ¶
DeleteAssignment deletes a role assignment.
func (*UsersServiceOp) List ¶
func (s *UsersServiceOp) List(ctx context.Context, opts *UserListOptions) ([]User, *Response, error)
List get client’s users.
func (*UsersServiceOp) ListAssignment ¶
func (s *UsersServiceOp) ListAssignment(ctx context.Context, opts *UserRoleListOptions) ([]RoleAssignment, *Response, error)
ListAssignment get available assignment roles.
func (*UsersServiceOp) ListRoles ¶
func (s *UsersServiceOp) ListRoles(ctx context.Context, opts *UserRoleListOptions) ([]UserRole, *Response, error)
ListRoles get available roles.
func (*UsersServiceOp) UpdateAssignment ¶
func (s *UsersServiceOp) UpdateAssignment(ctx context.Context, assignmentID int, reqBody *UpdateAssignmentRequest) (*Response, error)
UpdateAssignment updates a role assignment.
type Volume ¶
type Volume struct { ID string `json:"id"` Name string `json:"name"` Status string `json:"status"` // todo: need to implement volume status type Size int `json:"size"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` VolumeType VolumeType `json:"volume_type"` Device string `json:"device"` InstanceID string `json:"instance_id"` Bootable bool `json:"bootable"` CreatorTaskID string `json:"creator_task_id"` TaskID string `json:"task_id"` Metadata Metadata `json:"metadata"` MetadataDetailed []MetadataDetailed `json:"metadata_detailed,omitempty"` SnapshotIDs []string `json:"snapshot_ids"` Region string `json:"region"` RegionID int `json:"region_id"` ProjectID int `json:"project_id"` Attachments []Attachment `json:"attachments"` VolumeImageMetadata VolumeImageMetadata `json:"volume_image_metadata"` LimiterStats LimiterStats `json:"limiter_stats"` AvailabilityZone string `json:"availability_zone"` }
Volume represents an EdgecenterCloud Volume.
type VolumeAttachRequest ¶
type VolumeAttachRequest struct { InstanceID string `json:"instance_id" required:"true" validate:"required"` AttachmentTag string `json:"attachment_tag,omitempty" validate:"omitempty"` }
VolumeAttachRequest represents a request to attach a Volume to Instance.
type VolumeChangeTypeRequest ¶
type VolumeChangeTypeRequest struct {
VolumeType VolumeType `json:"volume_type" required:"true" validate:"required,enum"`
}
VolumeChangeTypeRequest represents a request to change a Volume type.
type VolumeCreateRequest ¶
type VolumeCreateRequest struct { AttachmentTag string `json:"attachment_tag,omitempty" validate:"omitempty,required_with=InstanceIDToAttachTo"` ImageID string `json:"image_id,omitempty" validate:"rfe=Source:image,allowed_without=SnapshotID,omitempty,uuid4"` InstanceIDToAttachTo string `json:"instance_id_to_attach_to,omitempty" validate:"omitempty,uuid4"` LifeCyclePolicyIDs []int `json:"lifecycle_policy_ids,omitempty"` Metadata Metadata `json:"metadata,omitempty" validate:"omitempty,dive"` Name string `json:"name" required:"true" validate:"required"` Size int `json:"size,omitempty"` SnapshotID string `json:"snapshot_id,omitempty" validate:"rfe=Source:snapshot,allowed_without=ImageID,omitempty,uuid4"` Source VolumeSource `json:"source" required:"true" validate:"required,enum"` TypeName VolumeType `json:"type_name" required:"true" validate:"required,enum"` }
VolumeCreateRequest represents a request to create a Volume.
type VolumeDetachRequest ¶
type VolumeDetachRequest struct {
InstanceID string `json:"instance_id" required:"true" validate:"required"`
}
VolumeDetachRequest represents a request to detach a Volume from an Instance.
type VolumeExtendSizeRequest ¶
type VolumeExtendSizeRequest struct {
Size int `json:"size" required:"true" validate:"required"`
}
VolumeExtendSizeRequest represents a request to extend a Volume size.
type VolumeImageMetadata ¶ added in v2.0.17
type VolumeImageMetadata struct { ContainerFormat string `json:"container_format"` MinRAM string `json:"min_ram"` OwnerSpecifiedOpenstackSHA256 string `json:"owner_specified.openstack.sha256"` DiskFormat string `json:"disk_format"` ImageName string `json:"image_name"` ImageID string `json:"image_id"` OwnerSpecifiedOpenstackObject string `json:"owner_specified.openstack.object"` OwnerSpecifiedOpenstackMD5 string `json:"owner_specified.openstack.md5"` MinDisk string `json:"min_disk"` Checksum string `json:"checksum"` Size string `json:"size"` }
type VolumeListOptions ¶
type VolumeListOptions struct { InstanceID string `url:"instance_id,omitempty" validate:"omitempty"` ClusterID string `url:"cluster_id,omitempty" validate:"omitempty"` Limit int `url:"limit,omitempty" validate:"omitempty"` Offset int `url:"offset,omitempty" validate:"omitempty"` Bootable bool `url:"bootable,omitempty" validate:"omitempty"` HasAttachments bool `url:"has_attachments,omitempty" validate:"omitempty"` IDPart string `url:"id_part,omitempty" validate:"omitempty"` NamePart string `url:"name_part,omitempty" validate:"omitempty"` MetadataKV string `url:"metadata_kv,omitempty" validate:"omitempty"` MetadataK string `url:"metadata_k,omitempty" validate:"omitempty"` }
VolumeListOptions specifies the optional query parameters to List method.
type VolumeMetadata ¶
type VolumeMetadata interface { MetadataList(context.Context, string) ([]MetadataDetailed, *Response, error) MetadataCreate(context.Context, string, *Metadata) (*Response, error) MetadataUpdate(context.Context, string, *Metadata) (*Response, error) MetadataDeleteItem(context.Context, string, *MetadataItemOptions) (*Response, error) MetadataGetItem(context.Context, string, *MetadataItemOptions) (*MetadataDetailed, *Response, error) }
type VolumeSource ¶
type VolumeSource string
const ( VolumeSourceNewVolume VolumeSource = "new-volume" VolumeSourceImage VolumeSource = "image" VolumeSourceSnapshot VolumeSource = "snapshot" VolumeSourceExistingVolume VolumeSource = "existing-volume" VolumeSourceAppTemplate VolumeSource = "apptemplate" )
type VolumeType ¶
type VolumeType string
const ( VolumeTypeStandard VolumeType = "standard" VolumeTypeSsdHiIops VolumeType = "ssd_hiiops" VolumeTypeSsdLocal VolumeType = "ssd_local" VolumeTypeCold VolumeType = "cold" VolumeTypeUltra VolumeType = "ultra" )
func (VolumeType) IsValid ¶ added in v2.0.18
func (vt VolumeType) IsValid() error
func (VolumeType) String ¶ added in v2.0.18
func (vt VolumeType) String() string
func (VolumeType) ValidOrNil ¶ added in v2.0.18
func (vt VolumeType) ValidOrNil() (*VolumeType, error)
type VolumesService ¶
type VolumesService interface { List(context.Context, *VolumeListOptions) ([]Volume, *Response, error) Create(context.Context, *VolumeCreateRequest) (*TaskResponse, *Response, error) Get(context.Context, string) (*Volume, *Response, error) Delete(context.Context, string) (*TaskResponse, *Response, error) ChangeType(context.Context, string, *VolumeChangeTypeRequest) (*Volume, *Response, error) Extend(context.Context, string, *VolumeExtendSizeRequest) (*TaskResponse, *Response, error) Rename(context.Context, string, *Name) (*Volume, *Response, error) Attach(context.Context, string, *VolumeAttachRequest) (*Volume, *Response, error) Detach(context.Context, string, *VolumeDetachRequest) (*Volume, *Response, error) Revert(context.Context, string) (*TaskResponse, *Response, error) VolumeMetadata }
VolumesService is an interface for creating and managing Volumes with the EdgecenterCloud API. See: https://apidocs.edgecenter.ru/cloud#tag/volumes
type VolumesServiceOp ¶
type VolumesServiceOp struct {
// contains filtered or unexported fields
}
VolumesServiceOp handles communication with Volumes methods of the EdgecenterCloud API.
func (*VolumesServiceOp) Attach ¶
func (s *VolumesServiceOp) Attach(ctx context.Context, volumeID string, reqBody *VolumeAttachRequest) (*Volume, *Response, error)
Attach the volume.
func (*VolumesServiceOp) ChangeType ¶
func (s *VolumesServiceOp) ChangeType(ctx context.Context, volumeID string, reqBody *VolumeChangeTypeRequest) (*Volume, *Response, error)
ChangeType of the volume.
func (*VolumesServiceOp) Create ¶
func (s *VolumesServiceOp) Create(ctx context.Context, reqBody *VolumeCreateRequest) (*TaskResponse, *Response, error)
Create a Volume.
func (*VolumesServiceOp) Delete ¶
func (s *VolumesServiceOp) Delete(ctx context.Context, volumeID string) (*TaskResponse, *Response, error)
Delete the Volume.
func (*VolumesServiceOp) Detach ¶
func (s *VolumesServiceOp) Detach(ctx context.Context, volumeID string, reqBody *VolumeDetachRequest) (*Volume, *Response, error)
Detach the volume.
func (*VolumesServiceOp) Extend ¶
func (s *VolumesServiceOp) Extend(ctx context.Context, volumeID string, reqBody *VolumeExtendSizeRequest) (*TaskResponse, *Response, error)
Extend the volume size.
func (*VolumesServiceOp) List ¶
func (s *VolumesServiceOp) List(ctx context.Context, opts *VolumeListOptions) ([]Volume, *Response, error)
List get volumes.
func (*VolumesServiceOp) MetadataCreate ¶
func (s *VolumesServiceOp) MetadataCreate(ctx context.Context, volumeID string, reqBody *Metadata) (*Response, error)
MetadataCreate or update volume metadata.
func (*VolumesServiceOp) MetadataDeleteItem ¶
func (s *VolumesServiceOp) MetadataDeleteItem(ctx context.Context, volumeID string, opts *MetadataItemOptions) (*Response, error)
MetadataDeleteItem a volume metadata item by key.
func (*VolumesServiceOp) MetadataGetItem ¶
func (s *VolumesServiceOp) MetadataGetItem(ctx context.Context, volumeID string, opts *MetadataItemOptions) (*MetadataDetailed, *Response, error)
MetadataGetItem volume detailed metadata.
func (*VolumesServiceOp) MetadataList ¶
func (s *VolumesServiceOp) MetadataList(ctx context.Context, volumeID string) ([]MetadataDetailed, *Response, error)
MetadataList volume detailed metadata items.
func (*VolumesServiceOp) MetadataUpdate ¶
func (s *VolumesServiceOp) MetadataUpdate(ctx context.Context, volumeID string, reqBody *Metadata) (*Response, error)
MetadataUpdate volume metadata.
func (*VolumesServiceOp) Rename ¶
func (s *VolumesServiceOp) Rename(ctx context.Context, volumeID string, reqBody *Name) (*Volume, *Response, error)
Rename the volume.
func (*VolumesServiceOp) Revert ¶
func (s *VolumesServiceOp) Revert(ctx context.Context, volumeID string) (*TaskResponse, *Response, error)
Revert a volume to its last snapshot.
Source Files ¶
- baremetal.go
- common.go
- edgecloud.go
- errors.go
- flavors.go
- floatingips.go
- images.go
- instances.go
- keypairs.go
- l7policies.go
- l7rules.go
- lifecyclepolicies.go
- loadbalancers.go
- metadata.go
- networks.go
- ports.go
- projects.go
- quotas.go
- regions.go
- reserved_fixed_ips.go
- routers.go
- secrets.go
- securitygroups.go
- servergroups.go
- snapshots.go
- subnets.go
- tasks.go
- users.go
- uuid.go
- volumes.go