Documentation ¶
Overview ¶
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func GetVMIDFromData(client *ONeClient, inst *pb.Instance) (vmid int, err error)
- func GetVarValue(in *proto.Var, key string) (r *structpb.Value, err error)
- func MonitorDatastoresPool(log *zap.Logger, c *ONeClient) (res *structpb.Value, err error)
- func MonitorHostsPool(log *zap.Logger, c *ONeClient) (res *structpb.Value, err error)
- func MonitorNetworks(log *zap.Logger, c *ONeClient) (res *structpb.Value, err error)
- func MonitorTemplates(log *zap.Logger, c *ONeClient) (res *structpb.Value, err error)
- type CheckInstancesGroupResponse
- type LocationPublicData
- type LocationState
- type ONeClient
- func (c *ONeClient) CheckInstancesGroup(IG *pb.InstancesGroup) (*CheckInstancesGroupResponse, error)
- func (c *ONeClient) CheckInstancesGroupResponseProcess(resp *CheckInstancesGroupResponse, data map[string]*structpb.Value, group int)
- func (c *ONeClient) Chmod(class string, oid int, perm *shared.Permissions) error
- func (c *ONeClient) Chown(class string, oid, uid, gid int) error
- func (c *ONeClient) CreateUser(name, pass string, groups []int) (id int, err error)
- func (c *ONeClient) DeleteUser(id int) error
- func (c *ONeClient) DeleteUserAndVNets(id int) error
- func (c *ONeClient) DeleteVNet(id int) error
- func (c *ONeClient) FindFreeVlan(sp *sppb.ServicesProvider) (vnMad string, freeVlan int, err error)
- func (c *ONeClient) FindVMByInstance(inst *pb.Instance) (*vm.VM, error)
- func (c *ONeClient) GetGroup(id int) (*group.Group, error)
- func (c *ONeClient) GetImage(id int) (*img.Image, error)
- func (c *ONeClient) GetInstSnapshots(inst *pb.Instance) (map[string]interface{}, error)
- func (c *ONeClient) GetSecrets() map[string]*structpb.Value
- func (c *ONeClient) GetTemplate(id int) (*tmpl.Template, error)
- func (c *ONeClient) GetUser(id int) (*user.User, error)
- func (c *ONeClient) GetUserPrivateVNet(user int) (id int, err error)
- func (c *ONeClient) GetUserPublicVNet(user int) (id int, err error)
- func (c *ONeClient) GetUserVMsInstancesGroup(userId int) (*pb.InstancesGroup, error)
- func (c *ONeClient) GetVM(vmid int) (*vm.VM, error)
- func (c *ONeClient) GetVMByName(name string) (id int, err error)
- func (c *ONeClient) GetVNet(id int) (*vnet.VirtualNetwork, error)
- func (c *ONeClient) InstantiateTemplate(id int, vmname, tmpl string, pending bool) (vmid int, err error)
- func (c *ONeClient) InstantiateTemplateHelper(instance *instpb.Instance, group_data map[string]*structpb.Value, token string) (vmid int, err error)
- func (c *ONeClient) ListImages() ([]img.Image, error)
- func (c *ONeClient) ListTemplates() ([]tmpl.Template, error)
- func (c *ONeClient) Logger(n string) *zap.Logger
- func (c *ONeClient) MonitorLocation(sp *sppb.ServicesProvider) (st *LocationState, pd *LocationPublicData, err error)
- func (c *ONeClient) NetworkingVM(id int) (map[string]interface{}, error)
- func (c *ONeClient) PoweroffVM(id int, hard bool) error
- func (c *ONeClient) RebootVM(id int, hard bool) error
- func (c *ONeClient) ReservePrivateIP(u int, vnMad string, vlanID int) (pool_id int, err error)
- func (c *ONeClient) ReservePublicIP(u, n int) (pool_id int, err error)
- func (c *ONeClient) ReserveVNet(id, size, to int, name string) (int, error)
- func (c *ONeClient) ResumeVM(id int) error
- func (c *ONeClient) SetSecrets(secrets map[string]*structpb.Value)
- func (c *ONeClient) SetVars(vars map[string]*sppb.Var)
- func (c *ONeClient) SnapCreate(name string, vmid int) error
- func (c *ONeClient) SnapDelete(snapId, vmid int) error
- func (c *ONeClient) SnapRevert(snapId, vmid int) error
- func (c *ONeClient) StateVM(id int) (state int, state_str string, lcm_state int, lcm_state_str string, err error)
- func (c *ONeClient) SuspendVM(id int) error
- func (c *ONeClient) TerminateVM(id int, hard bool) error
- func (c *ONeClient) UpdateVNet(id int, tmpl string, uType parameters.UpdateType) error
- func (c *ONeClient) UserAddAttribute(id int, data map[string]interface{}) error
- func (c *ONeClient) VMToInstance(id int) (*pb.Instance, error)
- type Record
Constants ¶
This section is empty.
Variables ¶
var ( // OpenNebula Scheduler Requirements (nodes provisioning rules for VMs deploy) SCHED = "sched" // OpenNebula DataStore Scheduler Requirements (datastores provisioning rules for VMs deploy) SCHED_DS = "sched_ds" // OpenNebula Super VNet public IP addresses to be reserved from PUBLIC_IP_POOL = "public_ip_pool" // OpenNebula Super VNet private IP addresses to be reserved from PRIVATE_VN_TEMPLATE = "private_vnet_tmpl" // OpenNebula VM Name Data Key DATA_VM_NAME = "vm_name" // OpenNebula VM ID Data Key DATA_VM_ID = "vmid" )
var ( USER_PUBLIC_VNET_NAME_PATTERN = "user-%d-pub-vnet" USER_PRIVATE_VNET_NAME_PATTERN = "user-%d-private-vnet" )
Functions ¶
func GetVMIDFromData ¶
func MonitorDatastoresPool ¶
func MonitorHostsPool ¶
func MonitorNetworks ¶
Types ¶
type LocationPublicData ¶
type LocationState ¶
type ONeClient ¶
func NewClientFromSP ¶
func (*ONeClient) CheckInstancesGroup ¶
func (c *ONeClient) CheckInstancesGroup(IG *pb.InstancesGroup) (*CheckInstancesGroupResponse, error)
func (*ONeClient) CheckInstancesGroupResponseProcess ¶
func (*ONeClient) Chmod ¶
Chmod common method
class - shorthand for entity type, possible values: vm - VirtualMachine, vn - VirtualNetwork, template - VM Template, image - Image, datastore - DataStore
func (*ONeClient) Chown ¶
Chown common method
class - shorthand for entity type, possible values: vm - VirtualMachine, vn - VirtualNetwork, template - VM Template, image - Image, datastore - DataStore
func (*ONeClient) CreateUser ¶
func (*ONeClient) DeleteUser ¶
func (*ONeClient) DeleteUserAndVNets ¶
func (*ONeClient) DeleteVNet ¶
func (*ONeClient) FindFreeVlan ¶
func (*ONeClient) FindVMByInstance ¶
func (*ONeClient) GetInstSnapshots ¶
func (*ONeClient) GetUserPrivateVNet ¶
func (*ONeClient) GetUserPublicVNet ¶
func (*ONeClient) GetUserVMsInstancesGroup ¶
func (c *ONeClient) GetUserVMsInstancesGroup(userId int) (*pb.InstancesGroup, error)
returns instances of all VMs belonged to User
func (*ONeClient) InstantiateTemplate ¶
func (*ONeClient) InstantiateTemplateHelper ¶
func (*ONeClient) MonitorLocation ¶
func (c *ONeClient) MonitorLocation(sp *sppb.ServicesProvider) (st *LocationState, pd *LocationPublicData, err error)
func (*ONeClient) NetworkingVM ¶
func (*ONeClient) ReservePrivateIP ¶
func (*ONeClient) ReservePublicIP ¶
func (*ONeClient) ReserveVNet ¶
Reserve Addresses to the other VNet
id - VNet ID to reserve from size - amount of addresses to reserve to - VNet ID to reserve to, if set to -1 new will be created name - name of the new VNet, if set to "", either existing will be used or new - generated
func (*ONeClient) SnapDelete ¶
func (*ONeClient) SnapRevert ¶
func (*ONeClient) UpdateVNet ¶
func (c *ONeClient) UpdateVNet(id int, tmpl string, uType parameters.UpdateType) error
func (*ONeClient) UserAddAttribute ¶
type Record ¶
type Record struct { Start int64 End int64 State stpb.NoCloudState }
func FilterTimeline ¶
func MakeRecord ¶
func MakeRecord(from, to int, state stpb.NoCloudState) (res Record)
func MakeTimeline ¶
func MakeTimelineRecords ¶
func MakeTimelineRecords(r vm.HistoryRecord) (res []Record)